-
-
Notifications
You must be signed in to change notification settings - Fork 13
Open
Description
Cant figure out how to parse a line by line file (CSV, or other list...)
from pyleri import Choice, Grammar, Keyword, List, Optional, Ref, Regex, Sequence, Token
import os
class MyGrammar(Grammar):
element = Regex(r"\w+")
START = List(element, "\n", opt=True)
grammar = MyGrammar()
result = grammar.parse("word\nword\n").as_str()
print(result)error at position 5, expecting:
Tried with combination of \n, \n, os.linesep...
No luck
Any idea?
Metadata
Metadata
Assignees
Labels
No labels