Sfoglia il codice sorgente

Examples: Tiny fix

tags/gm/2021-09-23T00Z/github.com--lark-parser-lark/0.12.0
Erez Sh 3 anni fa
parent
commit
155f4a8c0f
2 ha cambiato i file con 5 aggiunte e 4 eliminazioni
  1. +1
    -1
      examples/composition/main.py
  2. +4
    -3
      examples/composition/storage.lark

+ 1
- 1
examples/composition/main.py Vedi File

@@ -15,7 +15,7 @@ file format that allows both CSV and JSON to co-exist.
The resulting transformer can evaluate both JSON and CSV in the parse tree.

The methods of each transformer are renamed into their appropriate namespace, using the given prefix.
This appraoch allows full re-use: the transformers don't need to care if their grammar is used directly,
This approach allows full re-use: the transformers don't need to care if their grammar is used directly,
or being imported, or who is doing the importing.

"""


+ 4
- 3
examples/composition/storage.lark Vedi File

@@ -1,8 +1,9 @@
start: (csv__start | json__start _NL?)+

// Renaming of the import variables is required, as they
// receive the namespace of this file.
// Renaming of the import variables is required, as they receive the namespace of this file.
// See: https://github.com/lark-parser/lark/pull/973#issuecomment-907287565
%import .csv.start -> csv__start
%import .csv._NL -> _NL
%import .json.start -> json__start

%import .csv._NL -> _NL


Caricamento…
Annulla
Salva