Commit bd90a88f authored by di68kap's avatar di68kap
Browse files

transform.py: bugfix: remove_brackets

parent 9995ad7f
......@@ -282,12 +282,13 @@ CONFIG_PRESET['static_analysis'] = "none"
# Default value: False
CONFIG_PRESET['add_grammar_source_to_parser_docstring'] = False
# Default value vor the regular expression by which identifiers for
# Default value for the regular expression by which identifiers for
# parsers that yield anonymous nodes are distinguished from identifiers
# for parsers that yield named nodes. The default value is a regular
# expression that catches names with a leading underscore.
# Default value : '_'
CONFIG_PRESET['default_anonymous_regexp'] = r'_'
# for parsers that yield named nodes. For example, the regular expression
# r'_' catches names with a leading underscore. The default value is a
# regular expression that matches no string whatsoever.
# Default value: r'..(?<=^)' # never match.
CONFIG_PRESET['default_anonymous_regexp'] = r'..(?<=^)'
########################################################################
......
......@@ -94,7 +94,7 @@ from DHParser import start_logging, suspend_logging, resume_logging, is_filename
replace_by_children, remove_empty, remove_tokens, flatten, is_insignificant_whitespace, \\
merge_adjacent, collapse, collapse_children_if, replace_content, WHITESPACE_PTYPE, TOKEN_PTYPE, \\
remove_nodes, remove_content, remove_brackets, change_tag_name, remove_anonymous_tokens, \\
keep_children, is_one_of, not_one_of, has_content, apply_if, \\
keep_children, is_one_of, not_one_of, has_content, apply_if, peek, \\
remove_anonymous_empty, keep_nodes, traverse_locally, strip, lstrip, rstrip, \\
replace_content, replace_content_by, forbid, assert_content, remove_infix_operator, \\
error_on, recompile_grammar, left_associative, lean_left, set_config_value, \\
......@@ -1106,6 +1106,22 @@ class EBNFCompiler(Compiler):
"match the empty string, /%s/ does not." % value)
self.directives[key] = value
elif key == 'anonymous':
if node.children[1].tag_name == "regexp":
check_argnum()
re_pattern = node.children[1].content
if re.match(re_pattern, ''):
self.tree.new_error(
node, "The regular expression r'%s' matches any symbol, "
"which is not allowed!" % re_pattern)
else:
self.anonymous_regexp = re.compile(node.children[1].content)
else:
args = node.children[1:]
assert all(child.tag_name == "symbol" for child in args)
alist = [child.content for child in args]
self.anonymous_regexp = re.compile('$|'.join(alist) + '$')
elif key == 'drop':
if len(node.children) <= 1:
self.tree.new_error(node, 'Directive "@ drop" requires as least one argument!')
......
......@@ -888,7 +888,7 @@ class Grammar:
# root__ must be overwritten with the root-parser by grammar subclass
parser_initialization__ = ["pending"] # type: List[str]
resume_rules__ = dict() # type: Dict[str, ResumeList]
anonymous__ = re.compile(r'_') # type: RxPatternType
anonymous__ = RX_NEVER_MATCH # type: RxPatternType
# some default values
COMMENT__ = r'' # type: str # r'#.*(?:\n|$)'
WSP_RE__ = mixin_comment(whitespace=r'[\t ]*', comment=COMMENT__) # type: str
......
......@@ -62,7 +62,7 @@ class ArithmeticGrammar(Grammar):
"""
expression = Forward()
source_hash__ = "4197ddd06ba30244927f160c6f46e30f"
anonymous__ = re.compile('_')
anonymous__ = re.compile('..(?<=^)')
static_analysis_pending__ = [True]
parser_initialization__ = ["upon instantiation"]
resume_rules__ = {}
......
......@@ -66,7 +66,7 @@ class ArithmeticRightRecursiveGrammar(Grammar):
tail = Forward()
term = Forward()
source_hash__ = "3d81c718b586fbd4490776d2cd4e3e53"
anonymous__ = re.compile('_')
anonymous__ = re.compile('..(?<=^)')
static_analysis_pending__ = [True]
parser_initialization__ = ["upon instantiation"]
resume_rules__ = {}
......
......@@ -63,7 +63,7 @@ class ArithmeticRightRecursiveGrammar(Grammar):
expression = Forward()
term = Forward()
source_hash__ = "9f9acd23245ae0a07680aa9cfda7952f"
anonymous__ = re.compile('_')
anonymous__ = re.compile('..(?<=^)')
static_analysis_pending__ = [True]
parser_initialization__ = ["upon instantiation"]
resume_rules__ = {}
......
......@@ -62,7 +62,7 @@ class ArithmeticSimpleGrammar(Grammar):
"""
expression = Forward()
source_hash__ = "057a467fa65d6c91e5658319e2c9469f"
anonymous__ = re.compile('_')
anonymous__ = re.compile('..(?<=^)')
static_analysis_pending__ = [True]
parser_initialization__ = ["upon instantiation"]
resume_rules__ = {}
......
......@@ -64,7 +64,7 @@ class EBNFGrammar(Grammar):
"""
expression = Forward()
source_hash__ = "a7929c507e1b8319071d18dc9eaccdf7"
anonymous__ = re.compile('_')
anonymous__ = re.compile('..(?<=^)')
static_analysis_pending__ = [True]
parser_initialization__ = ["upon instantiation"]
resume_rules__ = {}
......
......@@ -3,7 +3,11 @@
# preamble
@ whitespace = /[ \t]*(?:\n(?![ \t]*\n)[ \t]*)?/ # optional whitespace, including at most one linefeed
@ comment = /%.*/
@ drop = token, whitespace, regexp, _WSPC, _GAP, _PARSEP
@ anonymous = _WSPC, _GAP, _PARSEP, _LB,
block_environment, known_environment, text_element,
inline_element, inline_environment, known_inline_env,
begin_inline_env, end_inline_env, command, known_command
@ drop = token, whitespace, regexp, _WSPC, _GAP, _PARSEP, _LB
########################################################################
#
......@@ -12,7 +16,7 @@
########################################################################
latexdoc = preamble document
preamble = { [_WSPC] _command }+
preamble = { [_WSPC]command }+
document = [_WSPC] "\begin{document}"
frontpages
......@@ -60,12 +64,12 @@ heading = block
#### block environments ####
_block_environment = _known_environment | generic_block
_known_environment = itemize | enumerate | figure | tabular | quotation
block_environment = known_environment | generic_block
known_environment = itemize | enumerate | figure | tabular | quotation
| verbatim
generic_block = begin_generic_block sequence §end_generic_block
begin_generic_block = -&LB begin_environment LFF
end_generic_block = -&LB end_environment LFF
begin_generic_block = -&_LB begin_environment LFF
end_generic_block = -&_LB end_environment LFF
itemize = "\begin{itemize}" [_WSPC] { item } §"\end{itemize}"
enumerate = "\begin{enumerate}" [_WSPC] {item } §"\end{enumerate}"
......@@ -78,37 +82,37 @@ verbatim = "\begin{verbatim}" sequence §"\end{verbatim}"
tabular = "\begin{tabular}" tabular_config { tabular_row } §"\end{tabular}"
tabular_row = (multicolumn | tabular_cell) { "&" (multicolumn | tabular_cell) }
"\\" ( hline | { cline } )
tabular_cell = { _line_element [S] }
tabular_cell = {line_element [S] }
tabular_config = "{" TBCFG_VALUE §"}"
TBCFG_VALUE = /[lcr|]+/~
#### paragraphs and sequences of paragraphs ####
block_of_paragraphs = "{" [sequence] §"}"
sequence = [_WSPC] { (paragraph | _block_environment ) [_PARSEP] }+
paragraph = { !blockcmd _text_element [S] }+
_text_element = _line_element | LINEFEED
_line_element = text | block | _inline_environment | _command
sequence = [_WSPC] { (paragraph | block_environment ) [_PARSEP] }+
paragraph = { !blockcmd text_element [S] }+
text_element = line_element | LINEFEED
line_element = text | block |inline_environment |command
#### inline enivronments ####
_inline_environment = _known_inline_env | generic_inline_env
_known_inline_env = inline_math
generic_inline_env = _begin_inline_env ~ paragraph §_end_inline_env
_begin_inline_env = (-!LB begin_environment) | (begin_environment !LFF)
_end_inline_env = end_environment
## (-!LB end_environment) | (end_environment !LFF) # ambiguity with generic_block when EOF
inline_environment = known_inline_env | generic_inline_env
known_inline_env = inline_math
generic_inline_env = begin_inline_env ~ paragraph §end_inline_env
begin_inline_env = (-!_LB begin_environment) | (begin_environment !LFF)
end_inline_env = end_environment
## (-!_LB end_environment) | (end_environment !LFF) # ambiguity with generic_block when EOF
begin_environment = /\\begin{/ §NAME /}/
end_environment = /\\end{/ §::NAME /}/
inline_math = /\$/ /[^$]*/ §/\$/
#### _commands ####
#### commands ####
_command = _known_command | text_command | generic_command
_known_command = citet | citep | footnote | includegraphics | caption
command = known_command | text_command | generic_command
known_command = citet | citep | footnote | includegraphics | caption
| multicolumn | hline | cline | documentclass | pdfinfo
text_command = TXTCOMMAND | ESCAPED | BRACKETS
generic_command = !no_command CMDNAME [[ ~ config ] ~ block ]
......@@ -134,7 +138,7 @@ pdfinfo = "\pdfinfo" block
config = "[" cfg_text §"]"
cfg_text = { (~ text) | CMDNAME | SPECIAL }
block = /{/ ~ { !blockcmd _text_element [S] } §/}/
block = /{/ ~ { !blockcmd text_element [S] } §/}/
text = TEXTCHUNK { S TEXTCHUNK }
no_command = "\begin{" | "\end" | BACKSLASH structural
......@@ -174,7 +178,7 @@ _WSPC = { COMMENT__ | /\s+/ }+ # arbitrary horizontal or vertical w
_GAP = /[ \t]*(?:\n[ \t]*)+\n/~ # at least one empty line, i.e.
# [whitespace] linefeed [whitespace] linefeed
NEW_LINE = /[ \t]*/ [COMMENT__] /\n/
LB = /\s*?\n|$/ # backwards line break for Lookbehind-Operator
_LB = /\s*?\n|$/ # backwards line break for Lookbehind-Operator
# beginning of text marker '$' added for test code
BACKSLASH = /[\\]/
......
......@@ -27,8 +27,8 @@ from DHParser import is_filename, Grammar, Compiler, Lookbehind, Alternative, Po
PreprocessorFunc, Node, TransformationFunc, traverse, remove_children_if, \
reduce_single_child, replace_by_single_child, remove_whitespace, remove_empty, \
flatten, is_empty, collapse, replace_content, remove_brackets, strip, \
is_one_of, traverse_locally, remove_tokens, remove_nodes, TOKEN_PTYPE, Error, \
access_thread_locals, recompile_grammar
is_one_of, replace_content_by, remove_tokens, remove_nodes, TOKEN_PTYPE, Error, \
access_thread_locals, recompile_grammar, peek
from DHParser.log import start_logging
......@@ -54,15 +54,15 @@ def get_preprocessor() -> PreprocessorFunc:
class LaTeXGrammar(Grammar):
r"""Parser for a LaTeX source file.
"""
_block_environment = Forward()
_text_element = Forward()
begin_generic_block = Forward()
block_environment = Forward()
block_of_paragraphs = Forward()
end_generic_block = Forward()
paragraph = Forward()
tabular_config = Forward()
source_hash__ = "eb4d89532f94890e2488876d7ccfcc53"
anonymous__ = re.compile('_')
text_element = Forward()
source_hash__ = "31de40dc10efd720f8578d0ab7073e63"
anonymous__ = re.compile('_WSPC$|_GAP$|_PARSEP$|_LB$|block_environment$|known_environment$|text_element$|inline_element$|inline_environment$|known_inline_env$|begin_inline_env$|end_inline_env$|command$|known_command$')
static_analysis_pending__ = [True]
parser_initialization__ = ["upon instantiation"]
resume_rules__ = {}
......@@ -76,7 +76,7 @@ class LaTeXGrammar(Grammar):
dwsp__ = Drop(RegExp(WSP_RE__))
EOF = RegExp('(?!.)')
BACKSLASH = RegExp('[\\\\]')
LB = RegExp('\\s*?\\n|$')
_LB = RegExp('\\s*?\\n|$')
NEW_LINE = Series(Drop(RegExp('[ \\t]*')), Option(comment__), Drop(RegExp('\\n')))
_GAP = Drop(Series(RegExp('[ \\t]*(?:\\n[ \\t]*)+\\n'), dwsp__))
_WSPC = Drop(OneOrMore(Drop(Alternative(comment__, Drop(RegExp('\\s+'))))))
......@@ -97,7 +97,7 @@ class LaTeXGrammar(Grammar):
blockcmd = Series(BACKSLASH, Alternative(Series(Alternative(Series(Drop(Token("begin{")), dwsp__), Series(Drop(Token("end{")), dwsp__)), Alternative(Series(Drop(Token("enumerate")), dwsp__), Series(Drop(Token("itemize")), dwsp__), Series(Drop(Token("figure")), dwsp__), Series(Drop(Token("quote")), dwsp__), Series(Drop(Token("quotation")), dwsp__), Series(Drop(Token("tabular")), dwsp__)), Series(Drop(Token("}")), dwsp__)), structural, begin_generic_block, end_generic_block))
no_command = Alternative(Series(Drop(Token("\\begin{")), dwsp__), Series(Drop(Token("\\end")), dwsp__), Series(BACKSLASH, structural))
text = Series(TEXTCHUNK, ZeroOrMore(Series(S, TEXTCHUNK)))
block = Series(Drop(RegExp('{')), dwsp__, ZeroOrMore(Series(NegativeLookahead(blockcmd), _text_element, Option(S))), Drop(RegExp('}')), mandatory=3)
block = Series(Drop(RegExp('{')), dwsp__, ZeroOrMore(Series(NegativeLookahead(blockcmd), text_element, Option(S))), Drop(RegExp('}')), mandatory=3)
cfg_text = ZeroOrMore(Alternative(Series(dwsp__, text), CMDNAME, SPECIAL))
config = Series(Series(Drop(Token("[")), dwsp__), cfg_text, Series(Drop(Token("]")), dwsp__), mandatory=2)
pdfinfo = Series(Series(Drop(Token("\\pdfinfo")), dwsp__), block)
......@@ -112,24 +112,24 @@ class LaTeXGrammar(Grammar):
citet = Series(Series(Drop(Token("\\citet")), dwsp__), Option(config), block)
generic_command = Series(NegativeLookahead(no_command), CMDNAME, Option(Series(Option(Series(dwsp__, config)), dwsp__, block)))
text_command = Alternative(TXTCOMMAND, ESCAPED, BRACKETS)
_known_command = Alternative(citet, citep, footnote, includegraphics, caption, multicolumn, hline, cline, documentclass, pdfinfo)
_command = Alternative(_known_command, text_command, generic_command)
known_command = Alternative(citet, citep, footnote, includegraphics, caption, multicolumn, hline, cline, documentclass, pdfinfo)
command = Alternative(known_command, text_command, generic_command)
inline_math = Series(Drop(RegExp('\\$')), Drop(RegExp('[^$]*')), Drop(RegExp('\\$')), mandatory=2)
end_environment = Series(Drop(RegExp('\\\\end{')), Pop(NAME), Drop(RegExp('}')), mandatory=1)
begin_environment = Series(Drop(RegExp('\\\\begin{')), NAME, Drop(RegExp('}')), mandatory=1)
_end_inline_env = Synonym(end_environment)
_begin_inline_env = Alternative(Series(NegativeLookbehind(LB), begin_environment), Series(begin_environment, NegativeLookahead(LFF)))
generic_inline_env = Series(_begin_inline_env, dwsp__, paragraph, _end_inline_env, mandatory=3)
_known_inline_env = Synonym(inline_math)
_inline_environment = Alternative(_known_inline_env, generic_inline_env)
_line_element = Alternative(text, block, _inline_environment, _command)
_text_element.set(Alternative(_line_element, LINEFEED))
paragraph.set(OneOrMore(Series(NegativeLookahead(blockcmd), _text_element, Option(S))))
sequence = Series(Option(_WSPC), OneOrMore(Series(Alternative(paragraph, _block_environment), Option(_PARSEP))))
end_inline_env = Synonym(end_environment)
begin_inline_env = Alternative(Series(NegativeLookbehind(_LB), begin_environment), Series(begin_environment, NegativeLookahead(LFF)))
generic_inline_env = Series(begin_inline_env, dwsp__, paragraph, end_inline_env, mandatory=3)
known_inline_env = Synonym(inline_math)
inline_environment = Alternative(known_inline_env, generic_inline_env)
line_element = Alternative(text, block, inline_environment, command)
text_element.set(Alternative(line_element, LINEFEED))
paragraph.set(OneOrMore(Series(NegativeLookahead(blockcmd), text_element, Option(S))))
sequence = Series(Option(_WSPC), OneOrMore(Series(Alternative(paragraph, block_environment), Option(_PARSEP))))
block_of_paragraphs.set(Series(Series(Drop(Token("{")), dwsp__), Option(sequence), Series(Drop(Token("}")), dwsp__), mandatory=2))
TBCFG_VALUE = Series(RegExp('[lcr|]+'), dwsp__)
tabular_config.set(Series(Series(Drop(Token("{")), dwsp__), TBCFG_VALUE, Series(Drop(Token("}")), dwsp__), mandatory=2))
tabular_cell = ZeroOrMore(Series(_line_element, Option(S)))
tabular_cell = ZeroOrMore(Series(line_element, Option(S)))
tabular_row = Series(Alternative(multicolumn, tabular_cell), ZeroOrMore(Series(Series(Drop(Token("&")), dwsp__), Alternative(multicolumn, tabular_cell))), Series(Drop(Token("\\\\")), dwsp__), Alternative(hline, ZeroOrMore(cline)))
tabular = Series(Series(Drop(Token("\\begin{tabular}")), dwsp__), tabular_config, ZeroOrMore(tabular_row), Series(Drop(Token("\\end{tabular}")), dwsp__), mandatory=3)
verbatim = Series(Series(Drop(Token("\\begin{verbatim}")), dwsp__), sequence, Series(Drop(Token("\\end{verbatim}")), dwsp__), mandatory=2)
......@@ -138,11 +138,11 @@ class LaTeXGrammar(Grammar):
item = Series(Series(Drop(Token("\\item")), dwsp__), sequence)
enumerate = Series(Series(Drop(Token("\\begin{enumerate}")), dwsp__), Option(_WSPC), ZeroOrMore(item), Series(Drop(Token("\\end{enumerate}")), dwsp__), mandatory=3)
itemize = Series(Series(Drop(Token("\\begin{itemize}")), dwsp__), Option(_WSPC), ZeroOrMore(item), Series(Drop(Token("\\end{itemize}")), dwsp__), mandatory=3)
end_generic_block.set(Series(Lookbehind(LB), end_environment, LFF))
begin_generic_block.set(Series(Lookbehind(LB), begin_environment, LFF))
end_generic_block.set(Series(Lookbehind(_LB), end_environment, LFF))
begin_generic_block.set(Series(Lookbehind(_LB), begin_environment, LFF))
generic_block = Series(begin_generic_block, sequence, end_generic_block, mandatory=2)
_known_environment = Alternative(itemize, enumerate, figure, tabular, quotation, verbatim)
_block_environment.set(Alternative(_known_environment, generic_block))
known_environment = Alternative(itemize, enumerate, figure, tabular, quotation, verbatim)
block_environment.set(Alternative(known_environment, generic_block))
heading = Synonym(block)
Index = Series(Option(_WSPC), Series(Drop(Token("\\printindex")), dwsp__))
Bibliography = Series(Option(_WSPC), Series(Drop(Token("\\bibliography")), dwsp__), heading)
......@@ -160,7 +160,7 @@ class LaTeXGrammar(Grammar):
Chapters = OneOrMore(Series(Option(_WSPC), Chapter))
frontpages = Synonym(sequence)
document = Series(Option(_WSPC), Series(Drop(Token("\\begin{document}")), dwsp__), frontpages, Alternative(Chapters, Sections), Option(Bibliography), Option(Index), Option(_WSPC), Series(Drop(Token("\\end{document}")), dwsp__), Option(_WSPC), EOF, mandatory=9)
preamble = OneOrMore(Series(Option(_WSPC), _command))
preamble = OneOrMore(Series(Option(_WSPC), command))
latexdoc = Series(preamble, document)
root__ = latexdoc
......@@ -234,7 +234,6 @@ LaTeX_AST_transformation_table = {
# AST Transformations for the LaTeX-grammar
"<": [flatten, flatten_structure, remove_empty],
"latexdoc": [],
"preamble": [traverse_locally({'<': remove_whitespace, 'block': replace_by_single_child})],
"document": [flatten_structure],
"pdfinfo": [],
"frontpages": reduce_single_child,
......@@ -277,7 +276,7 @@ LaTeX_AST_transformation_table = {
"includegraphics": [],
"caption": [],
"config": [remove_brackets, reduce_single_child],
"block": [remove_brackets, flatten, replace_by_single_child],
"block": [remove_brackets, flatten],
"text": collapse,
"no_command, blockcmd": [],
"structural": [],
......@@ -288,13 +287,11 @@ LaTeX_AST_transformation_table = {
"BRACKETS": [],
"TEXTCHUNK": [],
"LF": [],
"PARSEP": replace_content(lambda node: '\n\n'),
"GAP": [],
"LB": [],
"BACKSLASH": [],
"EOF": [],
# "PARSEP": [replace_content_by('\n\n')],
# "WSPC": [replace_content_by(' ')],
"PARSEP": [replace_content_by('\n\n')],
":Whitespace, WSPC, S": streamline_whitespace,
"*": replace_by_single_child
}
......@@ -526,8 +523,8 @@ class LaTeXCompiler(Compiler):
self.tree.new_error(node, 'Only one document language supported. '
'Using %s, ignoring %s.'
% (self.metadata['language'], it), Error.WARNING)
if node['text'] in self.KNOWN_DOCUMENT_CLASSES:
self.metadata['documentclass'] = node['text']
if node['block'].content in self.KNOWN_DOCUMENT_CLASSES:
self.metadata['documentclass'] = node['block'].content
return node
def on_pdfinfo(self, node):
......
[match:LB]
[match:_LB]
1: """
"""
[fail:LB]
[fail:_LB]
10: """ """
......
......@@ -12,7 +12,7 @@
13: Low-level text must not contain any \commands.
[match:_text_element]
[match:text_element]
1 : \command
2 : \textbackslash
......
[match:_block_environment]
[match:block_environment]
1 : """\begin{generic}
A generic block element is a block element
that is unknown to DHParser.
......@@ -20,7 +20,7 @@
\end{quote}
[fail:_block_environment]
[fail:block_environment]
10: """\begin{generic}inline environment\end{generic}
"""
......@@ -33,7 +33,7 @@
"""
[match:_inline_environment]
[match:inline_environment]
1 : """\begin{generic}inline environment\end{generic}"""
2 : """\begin{generic}inline environment
......@@ -42,7 +42,7 @@
3 : "$ inline math $"
[fail:_inline_environment]
[fail:inline_environment]
10: """\begin{generic}
invalid enivronment \end{generic}
"""
......
[match:_command]
[match:command]
1 : \includegraphics[width=\textwidth]{Graph.eps}
2 : \multicolumn{1}{c}{ }
......@@ -8,3 +8,5 @@
4 : \multicolumn{2}{c}{$\underbrace{\hspace{7cm}}_{Simulations}$}
5*: "\usepackage [english, czech] {babel}"
6*: "\usepackage{microtype}"
......@@ -65,7 +65,7 @@ class LyrikGrammar(Grammar):
r"""Parser for a Lyrik source file.
"""
source_hash__ = "67a576722c8248e8f2a88094256d5db2"
anonymous__ = re.compile('_')
anonymous__ = re.compile('..(?<=^)')
static_analysis_pending__ = [True]
parser_initialization__ = ["upon instantiation"]
resume_rules__ = {}
......
......@@ -63,7 +63,7 @@ class Lyrik_explicit_whitespaceGrammar(Grammar):
r"""Parser for a Lyrik_explicit_whitespace source file.
"""
source_hash__ = "082c362ff149f702e7b1b76032b5febb"
anonymous__ = re.compile('_')
anonymous__ = re.compile('..(?<=^)')
static_analysis_pending__ = [True]
parser_initialization__ = ["upon instantiation"]
resume_rules__ = {}
......
......@@ -69,7 +69,7 @@ class XMLGrammar(Grammar):
ignoreSectContents = Forward()
markupdecl = Forward()
source_hash__ = "4cd0cef2b3f3559b014e4d34e5d8b1f6"
anonymous__ = re.compile('_')
anonymous__ = re.compile('..(?<=^)')
static_analysis_pending__ = [True]
parser_initialization__ = ["upon instantiation"]
resume_rules__ = {}
......
......@@ -63,7 +63,7 @@ class XMLSnippetGrammar(Grammar):
Name = Forward()
element = Forward()
source_hash__ = "251e31d28ec63ce674dc7a67686acaf1"
anonymous__ = re.compile('_')
anonymous__ = re.compile('..(?<=^)')
static_analysis_pending__ = [True]
parser_initialization__ = ["upon instantiation"]
resume_rules__ = {}
......
......@@ -64,7 +64,7 @@ class jsonGrammar(Grammar):
"""
_element = Forward()
source_hash__ = "31833295329c0325d087229c3d932092"
anonymous__ = re.compile('_')
anonymous__ = re.compile('..(?<=^)')
static_analysis_pending__ = [True]
parser_initialization__ = ["upon instantiation"]
resume_rules__ = {}
......
......@@ -64,7 +64,7 @@ class json_fail_tolerantGrammar(Grammar):
"""
_element = Forward()
source_hash__ = "6410f8962393b80b827883f8593d859c"
anonymous__ = re.compile('_')
anonymous__ = re.compile('..(?<=^)')
static_analysis_pending__ = [True]
parser_initialization__ = ["upon instantiation"]
string_skip__ = [re.compile(r'(?=")')]
......
Supports Markdown
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