Browse Source

Fix undetected newlines on ignored tokens

tags/gm/2021-09-23T00Z/github.com--lark-parser-lark/0.7.3
Fábio Macêdo Mendes 5 years ago
parent
commit
1e4dbac58c
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      lark/lexer.py

+ 2
- 1
lark/lexer.py View File

@@ -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


Loading…
Cancel
Save