hwdb/ids_parser: make text_eol a proper function
This commit is contained in:
committed by
Yu Watanabe
parent
c884b1410d
commit
f4fcd5cfad
@@ -31,11 +31,14 @@ NUM6 = Word('0123456789abcdefABCDEF', exact=6)
|
||||
TAB = White('\t', exact=1).suppress()
|
||||
COMMENTLINE = pythonStyleComment + EOL
|
||||
EMPTYLINE = LineEnd()
|
||||
text_eol = lambda name: Regex(r'[^\n]+')(name) + EOL
|
||||
|
||||
ParserElement.setDefaultWhitespaceChars(' \n')
|
||||
|
||||
|
||||
def text_eol(name):
|
||||
return Regex(r'[^\n]+')(name) + EOL
|
||||
|
||||
|
||||
def klass_grammar():
|
||||
# fmt: off
|
||||
klass_line = Literal('C ').suppress() + NUM2('klass') + text_eol('text')
|
||||
|
||||
Reference in New Issue
Block a user