Browse Source

BUGFIX: Undefined symbols (Issue #87)

tags/gm/2021-09-23T00Z/github.com--lark-parser-lark/0.5.4
Erez Shinan 6 years ago
parent
commit
6578742c06
2 changed files with 2 additions and 1 deletions
  1. +1
    -1
      lark/parser_frontends.py
  2. +1
    -0
      tests/test_trees.py

+ 1
- 1
lark/parser_frontends.py View File

@@ -81,7 +81,7 @@ class Earley_NoLex:
regexp = t.pattern.to_regexp()
width = get_regexp_width(regexp)
if width != (1,1):
raise GrammarError('Scanless parsing (lexer=None) requires all tokens to have a width of 1 (terminal %s: %s is %s)' % (sym, regexp, width))
raise GrammarError('Scanless parsing (lexer=None) requires all tokens to have a width of 1 (terminal %s: %s is %s)' % (t.name, regexp, width))
self.regexps[t.name] = re.compile(regexp)

def parse(self, text):


+ 1
- 0
tests/test_trees.py View File

@@ -1,5 +1,6 @@
from __future__ import absolute_import

import unittest
from unittest import TestCase
import logging
import copy


Loading…
Cancel
Save