hwdb/ids_parser: make text_eol a proper function

This commit is contained in:
Jörg Behrmann
2026-05-18 09:41:22 +09:00
committed by Yu Watanabe
parent c884b1410d
commit f4fcd5cfad
+4 -1
View File
@@ -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')