Browse Source

Resolved upstream changes to use new file-extension

- @erezsh added the new Lark reference and some other things using the
  current .g extension, so I wanted to resolve them for PR #117
- Renamed lark.g to lark.lark.
- Changed lark_grammar.py to use .lark file extensions.
- Changed urls that used .g to use .lark.
tags/gm/2021-09-23T00Z/github.com--lark-parser-lark/0.6.0
Rob Rose 7 years ago
parent
commit
836735211f
4 changed files with 7 additions and 7 deletions
  1. +1
    -1
      docs/json_tutorial.md
  2. +1
    -1
      examples/README.md
  3. +0
    -0
      examples/lark.lark
  4. +5
    -5
      examples/lark_grammar.py

+ 1
- 1
docs/json_tutorial.md View File

@@ -79,7 +79,7 @@ By the way, if you're curious what these terminals signify, they are roughly equ

Lark will accept this, if you really want to complicate your life :)

(You can find the original definitions in [common.g](/lark/grammars/common.g).)
(You can find the original definitions in [common.lark](/lark/grammars/common.lark).)

Notice that terminals are written in UPPER-CASE, while rules are written in lower-case.
I'll touch more on the differences between rules and terminals later.


+ 1
- 1
examples/README.md View File

@@ -7,7 +7,7 @@
- [indented\_tree.py](indented\_tree.py) - A demonstration of parsing indentation ("whitespace significant" language)
- [fruitflies.py](fruitflies.py) - A demonstration of ambiguity
- [turtle\_dsl.py](turtle_dsl.py) - Implements a LOGO-like toy language for Python's turtle, with interpreter.
- [lark\_grammar.py](lark_grammar.py) + [lark.g](lark.g) - A reference implementation of the Lark grammar (using LALR(1) + standard lexer)
- [lark\_grammar.py](lark_grammar.py) + [lark.lark](lark.lark) - A reference implementation of the Lark grammar (using LALR(1) + standard lexer)

### Advanced



examples/lark.g → examples/lark.lark View File


+ 5
- 5
examples/lark_grammar.py View File

@@ -1,12 +1,12 @@
from lark import Lark

parser = Lark(open('examples/lark.g'), parser="lalr")
parser = Lark(open('examples/lark.lark'), parser="lalr")

grammar_files = [
'examples/python2.g',
'examples/python3.g',
'examples/lark.g',
'lark/grammars/common.g',
'examples/python2.lark',
'examples/python3.lark',
'examples/lark.lark',
'lark/grammars/common.lark',
]

def test():


Loading…
Cancel
Save