Przeglądaj źródła

fixed lark.lark requiring newline at the end of grammars

lark.lark didn't parse grammars that didn't have a trailing newline in the file, but lark itself has no problem parsing those grammars
this change makes lark.lark more accurate in reflecting what grammars are parsed by lark.
tags/gm/2021-09-23T00Z/github.com--lark-parser-lark/0.10.0
starwarswii 4 lat temu
committed by starwarswii
rodzic
commit
082e0f3de7
1 zmienionych plików z 6 dodań i 6 usunięć
  1. +6
    -6
      examples/lark.lark

+ 6
- 6
examples/lark.lark Wyświetl plik

@@ -1,20 +1,20 @@
start: (_item | _NL)*
start: (_item? _NL)* _item?

_item: rule
| token
| statement

rule: RULE rule_params priority? ":" expansions _NL
token: TOKEN token_params priority? ":" expansions _NL
rule: RULE rule_params priority? ":" expansions
token: TOKEN token_params priority? ":" expansions

rule_params: ["{" RULE ("," RULE)* "}"]
token_params: ["{" TOKEN ("," TOKEN)* "}"]

priority: "." NUMBER

statement: "%ignore" expansions _NL -> ignore
| "%import" import_path ["->" name] _NL -> import
| "%import" import_path name_list _NL -> multi_import
statement: "%ignore" expansions -> ignore
| "%import" import_path ["->" name] -> import
| "%import" import_path name_list -> multi_import
| "%declare" name+ -> declare

!import_path: "."? name ("." name)*


Ładowanie…
Anuluj
Zapisz