From 836735211fffa7e45015781aad2349f81dfe622c Mon Sep 17 00:00:00 2001 From: Rob Rose Date: Wed, 25 Apr 2018 14:28:12 -0400 Subject: [PATCH] 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. --- docs/json_tutorial.md | 2 +- examples/README.md | 2 +- examples/{lark.g => lark.lark} | 0 examples/lark_grammar.py | 10 +++++----- 4 files changed, 7 insertions(+), 7 deletions(-) rename examples/{lark.g => lark.lark} (100%) diff --git a/docs/json_tutorial.md b/docs/json_tutorial.md index 9f3fbf1..96e76fb 100644 --- a/docs/json_tutorial.md +++ b/docs/json_tutorial.md @@ -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. diff --git a/examples/README.md b/examples/README.md index 0951c86..ef150ad 100644 --- a/examples/README.md +++ b/examples/README.md @@ -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 diff --git a/examples/lark.g b/examples/lark.lark similarity index 100% rename from examples/lark.g rename to examples/lark.lark diff --git a/examples/lark_grammar.py b/examples/lark_grammar.py index 88fc4cf..30ccc8b 100644 --- a/examples/lark_grammar.py +++ b/examples/lark_grammar.py @@ -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():