Fixed mysterious error message if start defined as a function
This commit is contained in:
parent
5bf4d9707d
commit
d9c763d2f7
4
CHANGES
4
CHANGES
@ -1,5 +1,9 @@
|
||||
Version 0.4
|
||||
-----------
|
||||
04/09/2019 Fixed very mysterious error message that resulted if you
|
||||
defined a grammar rule called "start". start can now
|
||||
be a string or a function.
|
||||
|
||||
04/09/2019 Minor refinement to the reporting of reduce/reduce conflicts.
|
||||
If a top grammar rule wasn't specified, SLY could fail with
|
||||
a mysterious "unknown conflict" exception. This should be
|
||||
|
@ -486,6 +486,9 @@ class Grammar(object):
|
||||
# -----------------------------------------------------------------------------
|
||||
|
||||
def set_start(self, start=None):
|
||||
if callable(start):
|
||||
start = start.__name__
|
||||
|
||||
if not start:
|
||||
start = self.Productions[1].name
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user