Commit deb9c81c authored by Eckhart Arnold's avatar Eckhart Arnold
Browse files

- DHParser/ebnf.py EBNFCompiler.on_syntax(): static analysis right after...

- DHParser/ebnf.py EBNFCompiler.on_syntax(): static analysis right after compilation  of EBNF already.
parent 59047804
......@@ -178,6 +178,7 @@ class EBNFGrammar(Grammar):
"""
expression = Forward()
source_hash__ = "82a7c668f86b83f86515078e6c9093ed"
static_analysis_pending__ = False
parser_initialization__ = ["upon instantiation"]
COMMENT__ = r'#.*(?:\n|$)'
WHITESPACE__ = r'\s*'
......@@ -926,8 +927,11 @@ class EBNFCompiler(Compiler):
grammar_python_src = self.assemble_parser(definitions, node)
if get_config_value('static_analysis') == 'early':
try:
grammar_class = compile_python_object(DHPARSER_IMPORTS + grammar_python_src, self.grammar_name)
grammar_class = compile_python_object(DHPARSER_IMPORTS + grammar_python_src,
self.grammar_name)
_ = grammar_class()
grammar_python_src = grammar_python_src.replace(
'static_analysis_pending__ = True', 'static_analysis_pending__ = False', 1)
except NameError:
pass # undefined name in the grammar are already cuaght and reported
except GrammarError as error:
......
......@@ -60,7 +60,7 @@ class ArithmeticGrammar(Grammar):
expression = Forward()
variable = Forward()
source_hash__ = "cf537b22b7a1a2a58c426f99f784285d"
static_analysis_pending__ = True
static_analysis_pending__ = False
parser_initialization__ = ["upon instantiation"]
resume_rules__ = {}
COMMENT__ = r''
......
......@@ -58,7 +58,7 @@ class EBNFGrammar(Grammar):
"""
expression = Forward()
source_hash__ = "7ca2bbabfc9bc19ec54e2318bbc4c9c2"
static_analysis_pending__ = True
static_analysis_pending__ = False
parser_initialization__ = ["upon instantiation"]
resume_rules__ = {}
COMMENT__ = r'#.*(?:\n|$)'
......
......@@ -58,7 +58,7 @@ class LaTeXGrammar(Grammar):
tabular_config = Forward()
text_element = Forward()
source_hash__ = "dacb1f9ad5b1c18cdc29c7ddb7878959"
static_analysis_pending__ = True
static_analysis_pending__ = False
parser_initialization__ = ["upon instantiation"]
resume_rules__ = {}
COMMENT__ = r'%.*'
......
......@@ -59,7 +59,7 @@ class Lyrik_explicit_whitespaceGrammar(Grammar):
r"""Parser for a Lyrik_explicit_whitespace source file.
"""
source_hash__ = "bcb3cee425961a2148941b492e614bd2"
static_analysis_pending__ = True
static_analysis_pending__ = False
parser_initialization__ = ["upon instantiation"]
resume_rules__ = {}
COMMENT__ = r''
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment