Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
badw-it
DHParser
Commits
72799c38
Commit
72799c38
authored
Jun 18, 2017
by
Eckhart Arnold
Browse files
more bugs detected: see TODOs, write tests, fix!
parent
ab1f1788
Changes
2
Hide whitespace changes
Inline
Side-by-side
DHParser/ebnf.py
View file @
72799c38
...
...
@@ -66,7 +66,8 @@ def get_ebnf_scanner() -> ScannerFunc:
#
########################################################################
# TODO: Introduce dummy/rename-parser, for simple assignments (e.g. jahr = JAHRESZAHL) or substition!
# TODO: Raise Error for unconnected parsers!
class
EBNFGrammar
(
Grammar
):
r
"""Parser for an EBNF source file, with this grammar:
...
...
DHParser/parsers.py
View file @
72799c38
...
...
@@ -295,7 +295,10 @@ class Grammar:
constructor will not be overwritten. Parser names starting or
ending with a double underscore like ``root__`` will be
ignored. See ``toolkit.sane_parser_name()``
This is done only once, upon the first instantiation of the
grammar class!
Attention: If there exists more than one reference to the same
parser, only the first one will be chosen for python versions
greater or equal 3.6. For python version <= 3.5 an arbitrarily
...
...
@@ -324,7 +327,7 @@ class Grammar:
self
.
dirty_flag
=
False
self
.
history_tracking
=
False
self
.
_reset
()
self
.
_assign_parser_names
()
self
.
_assign_parser_names
()
# prepare class first
self
.
root__
=
root
if
root
else
copy
.
deepcopy
(
self
.
__class__
.
root__
)
if
self
.
wspL__
:
self
.
wsp_left_parser__
=
Whitespace
(
self
.
wspL__
)
# type: ParserBase
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment