From 1e4dbac58cbec032fd0271b5f1dac26ea2461068 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A1bio=20Mac=C3=AAdo=20Mendes?= Date: Fri, 9 Aug 2019 18:54:44 -0300 Subject: [PATCH] Fix undetected newlines on ignored tokens --- lark/lexer.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lark/lexer.py b/lark/lexer.py index d3e4af6..377fab6 100644 --- a/lark/lexer.py +++ b/lark/lexer.py @@ -270,8 +270,9 @@ def _regexp_has_newline(r): - escaped newline (\\n) - anything but ([^...]) - any-char (.) when the flag (?s) exists + - spaces (\s) """ - return '\n' in r or '\\n' in r or '[^' in r or ('(?s' in r and '.' in r) + return '\n' in r or '\\n' in r or '\\s' in r or '[^' in r or ('(?s' in r and '.' in r) class Lexer(object): """Lexer interface