@@ -36,7 +36,7 @@ def __init__(self, text, /, config: ParserConfig | None = None, **settings):
3636 namechars = '' ,
3737 parseinfo = True ,
3838 comments = '(?sm)[(][*](?:.|\\ n)*?[*][)]' ,
39- eol_comments = '(?sm)* #[^\\ n]*$' ,
39+ eol_comments = '(?m) #[^\\ n]*$' ,
4040 keywords = KEYWORDS ,
4141 start = 'start' ,
4242 )
@@ -50,7 +50,7 @@ def __init__(self, /, config: ParserConfig | None = None, **settings):
5050 config = ParserConfig .new (
5151 config ,
5252 owner = self ,
53- whitespace = '\\ s+' ,
53+ whitespace = '(?m) \\ s+' ,
5454 nameguard = None ,
5555 ignorecase = False ,
5656 namechars = '' ,
@@ -172,10 +172,12 @@ def _directive_(self):
172172 self ._token ('left_recursion' )
173173 with self ._option ():
174174 self ._token ('parseinfo' )
175+ with self ._option ():
176+ self ._token ('memoization' )
175177 self ._error (
176178 'expecting one of: '
177179 "'ignorecase' 'left_recursion'"
178- "'nameguard' 'parseinfo'"
180+ "'memoization' ' nameguard' 'parseinfo'"
179181 )
180182 self .name_last_node ('name' )
181183 self ._cut ()
@@ -219,8 +221,8 @@ def _directive_(self):
219221 'expecting one of: '
220222 "'comments' 'eol_comments' 'grammar'"
221223 "'ignorecase' 'left_recursion'"
222- "'namechars ' 'nameguard ' 'parseinfo '"
223- "'whitespace'"
224+ "'memoization ' 'namechars ' 'nameguard '"
225+ "'parseinfo' ' whitespace'"
224226 )
225227 self ._cut ()
226228 self ._define (['name' , 'value' ], [])
0 commit comments