Commit 99e401cc authored by eckhart's avatar eckhart

- test_dhparser.py: bugfix

parent c4a9089a
......@@ -59,7 +59,7 @@ class ArithmeticGrammar(Grammar):
r"""Parser for an Arithmetic source file.
"""
expression = Forward()
source_hash__ = "20c6ec451784ce19bed29a4f141c4363"
source_hash__ = "b75119067b29e37cd0bfe66facbcad22"
static_analysis_pending__ = [True]
parser_initialization__ = ["upon instantiation"]
resume_rules__ = {}
......
......@@ -63,7 +63,7 @@ class ArithmeticRightRecursiveGrammar(Grammar):
sign = Forward()
tail = Forward()
term = Forward()
source_hash__ = "f1bf4bfc9852f779d0ffe210c1ccf0db"
source_hash__ = "0c78c1f796133256eba3d3784356105a"
static_analysis_pending__ = [True]
parser_initialization__ = ["upon instantiation"]
resume_rules__ = {}
......
......@@ -60,7 +60,7 @@ class ArithmeticRightRecursiveGrammar(Grammar):
"""
expression = Forward()
term = Forward()
source_hash__ = "efea40aaf7475d6c8cbddd969e2d6b5b"
source_hash__ = "d98f130442f0561e9217728aceb8eec3"
static_analysis_pending__ = [True]
parser_initialization__ = ["upon instantiation"]
resume_rules__ = {}
......
......@@ -59,7 +59,7 @@ class ArithmeticSimpleGrammar(Grammar):
r"""Parser for an ArithmeticSimple source file.
"""
expression = Forward()
source_hash__ = "8f63d4fd3488afa0551c18f5d7d8fc19"
source_hash__ = "e255247d005cd6cb213068881d76ffb4"
static_analysis_pending__ = [True]
parser_initialization__ = ["upon instantiation"]
resume_rules__ = {}
......
......@@ -57,7 +57,7 @@ class BibTeXGrammar(Grammar):
r"""Parser for a BibTeX source file.
"""
text = Forward()
source_hash__ = "090e7cf86e9f66967d5f94a9d1c1d99e"
source_hash__ = "8839d079e31b568a31f0ea4cbb175aa8"
static_analysis_pending__ = [True]
parser_initialization__ = ["upon instantiation"]
resume_rules__ = {}
......
......@@ -11,13 +11,7 @@ Match-test "simple"
{Edward N. Zalta}
### AST
<content>
<:Token>{</:Token>
<text>
<CONTENT_STRING>Edward N. Zalta</CONTENT_STRING>
</text>
<:Token>}</:Token>
</content>
(content (:Token "{") (text (CONTENT_STRING "Edward N. Zalta")) (:Token "}"))
Match-test "nested_braces"
--------------------------
......@@ -26,18 +20,21 @@ Match-test "nested_braces"
{\url{https://plato.stanford.edu/archives/fall2013/entries/thomas-kuhn/}}
### AST
<content>
<:Token>{</:Token>
<text>
<CONTENT_STRING>\url</CONTENT_STRING>
<:Token>{</:Token>
<text>
<CONTENT_STRING>https://plato.stanford.edu/archives/fall2013/entries/thomas-kuhn/</CONTENT_STRING>
</text>
<:Token>}</:Token>
</text>
<:Token>}</:Token>
</content>
content
:Token
"{"
text
CONTENT_STRING
"\url"
:Token
"{"
text
CONTENT_STRING
"https://plato.stanford.edu/archives/fall2013/entries/thomas-kuhn/"
:Token
"}"
:Token
"}"
Test of parser: "entry"
......@@ -77,121 +74,135 @@ Match test "entry" for parser "entry" failed:
### AST
<ZOMBIE__>
<entry>
<:RegExp>@</:RegExp>
<type>
<WORD>Online</WORD>
</type>
<:Token>{</:Token>
<key>
<NO_BLANK_STRING>wikipedia-duhem-quine</NO_BLANK_STRING>
</key>
<:Token>,</:Token>
<:Whitespace>
</:Whitespace>
<field>
<WORD>
<:RegExp>editor</:RegExp>
<:Whitespace> </:Whitespace>
</WORD>
</field>
<:Token>=</:Token>
<:Whitespace> </:Whitespace>
<content>
<:Token>{</:Token>
<text>
<CONTENT_STRING>Wikipedia</CONTENT_STRING>
</text>
<:Token>}</:Token>
</content>
<:Token>,</:Token>
<:Whitespace>
</:Whitespace>
<field>
<WORD>
<:RegExp>title</:RegExp>
<:Whitespace> </:Whitespace>
</WORD>
</field>
<:Token>=</:Token>
<:Whitespace> </:Whitespace>
<content>
<:Token>{</:Token>
<text>
<CONTENT_STRING>Duhem-Quine thesis</CONTENT_STRING>
</text>
<:Token>}</:Token>
</content>
<:Token>,</:Token>
<:Whitespace>
</:Whitespace>
<field>
<WORD>
<:RegExp>year</:RegExp>
<:Whitespace> </:Whitespace>
</WORD>
</field>
<:Token>=</:Token>
<:Whitespace> </:Whitespace>
<content>
<:Token>{</:Token>
<text>
<CONTENT_STRING>2017</CONTENT_STRING>
</text>
<:Token>}</:Token>
</content>
<:Token>,</:Token>
<:Whitespace>
</:Whitespace>
<field>
<WORD>
<:RegExp>date</:RegExp>
<:Whitespace> </:Whitespace>
</WORD>
</field>
<:Token>=</:Token>
<:Whitespace> </:Whitespace>
<content>
<:Token>{</:Token>
<text>
<CONTENT_STRING>2017-08-19</CONTENT_STRING>
</text>
<:Token>}</:Token>
</content>
<:Token>,</:Token>
<:Whitespace>
</:Whitespace>
<field>
<WORD>
<:RegExp>url</:RegExp>
<:Whitespace> </:Whitespace>
</WORD>
</field>
<:Token>=</:Token>
<:Whitespace> </:Whitespace>
<plain_content>
<COMMA_TERMINATED_STRING>{https://en.wikipedia.org/w/index.php?title=Duhem\</COMMA_TERMINATED_STRING>
</plain_content>
<ZOMBIE__>%</ZOMBIE__>
</entry>
<ZOMBIE__>
E2\%80\%93Quine\_thesis\&amp;oldid=772834991},
</ZOMBIE__>
<ZOMBIE__>
organization = {Wikipedia}
</ZOMBIE__>
<ZOMBIE__>}</ZOMBIE__>
</ZOMBIE__>
\ No newline at end of file
ZOMBIE__
entry
:RegExp
"@"
type
WORD
"Online"
:Token
"{"
key
NO_BLANK_STRING
"wikipedia-duhem-quine"
:Token
","
:Whitespace
""
" "
field
WORD
:RegExp
"editor"
:Whitespace
" "
:Token
"="
:Whitespace
" "
content
:Token
"{"
text
CONTENT_STRING
"Wikipedia"
:Token
"}"
:Token
","
:Whitespace
""
" "
field
WORD
:RegExp
"title"
:Whitespace
" "
:Token
"="
:Whitespace
" "
content
:Token
"{"
text
CONTENT_STRING
"Duhem-Quine thesis"
:Token
"}"
:Token
","
:Whitespace
""
" "
field
WORD
:RegExp
"year"
:Whitespace
" "
:Token
"="
:Whitespace
" "
content
:Token
"{"
text
CONTENT_STRING
"2017"
:Token
"}"
:Token
","
:Whitespace
""
" "
field
WORD
:RegExp
"date"
:Whitespace
" "
:Token
"="
:Whitespace
" "
content
:Token
"{"
text
CONTENT_STRING
"2017-08-19"
:Token
"}"
:Token
","
:Whitespace
""
" "
field
WORD
:RegExp
"url"
:Whitespace
" "
:Token
"="
:Whitespace
" "
plain_content
COMMA_TERMINATED_STRING
"{https://en.wikipedia.org/w/index.php?title=Duhem\"
ZOMBIE__ `(err "'}' ~ expected, »%E2\%80\%9...« found!"
"%"
ZOMBIE__
"E2\%80\%93Quine\_thesis\&oldid=772834991},"
""
ZOMBIE__
" organization = {Wikipedia}"
""
ZOMBIE__
"}"
\ No newline at end of file
......@@ -59,7 +59,7 @@ class EBNFGrammar(Grammar):
r"""Parser for an EBNF source file.
"""
expression = Forward()
source_hash__ = "9a341fad79f7e8eb46f1a657b553bec7"
source_hash__ = "be91994c910201cdf0bd2da656c7cc01"
static_analysis_pending__ = [True]
parser_initialization__ = ["upon instantiation"]
resume_rules__ = {}
......
......@@ -57,7 +57,7 @@ class LaTeXGrammar(Grammar):
paragraph = Forward()
tabular_config = Forward()
text_element = Forward()
source_hash__ = "8ec9110209a992e0cf91b283b220fa83"
source_hash__ = "4e6ab6dede977be94d488bcc9990a5bb"
static_analysis_pending__ = [True]
parser_initialization__ = ["upon instantiation"]
resume_rules__ = {}
......
......@@ -58,7 +58,7 @@ def get_preprocessor() -> PreprocessorFunc:
class LyrikGrammar(Grammar):
r"""Parser for a Lyrik source file.
"""
source_hash__ = "482df1ca1ff6088c06029775578eceed"
source_hash__ = "06c4d5d864de1ee662251e1e50dbafa0"
static_analysis_pending__ = [True]
parser_initialization__ = ["upon instantiation"]
resume_rules__ = {}
......
......@@ -58,7 +58,7 @@ def get_preprocessor() -> PreprocessorFunc:
class Lyrik_explicit_whitespaceGrammar(Grammar):
r"""Parser for a Lyrik_explicit_whitespace source file.
"""
source_hash__ = "5c2c8a19e31d7d731fac4a0187b44b32"
source_hash__ = "10fbc58b65d0fd5a178572b3776456f0"
static_analysis_pending__ = [True]
parser_initialization__ = ["upon instantiation"]
resume_rules__ = {}
......
......@@ -66,7 +66,7 @@ class XMLGrammar(Grammar):
extSubsetDecl = Forward()
ignoreSectContents = Forward()
markupdecl = Forward()
source_hash__ = "6e104ce4a07a419fcafcfdf04f27a042"
source_hash__ = "fabca55375f62d0a2f009cdfd76f0f77"
static_analysis_pending__ = [True]
parser_initialization__ = ["upon instantiation"]
resume_rules__ = {}
......
......@@ -60,7 +60,7 @@ class XMLSnippetGrammar(Grammar):
"""
Name = Forward()
element = Forward()
source_hash__ = "3cc68a13c706e7c74498f5ef6d49a715"
source_hash__ = "54cd2aa8a44307a7c802ab2014a483eb"
static_analysis_pending__ = [True]
parser_initialization__ = ["upon instantiation"]
resume_rules__ = {}
......
......@@ -62,7 +62,7 @@ class jsonGrammar(Grammar):
"""
element = Forward()
value = Forward()
source_hash__ = "abc885159d84633d94e82c75709c9684"
source_hash__ = "ef3108350d5f28b0f32716ad3952316d"
static_analysis_pending__ = [True]
parser_initialization__ = ["upon instantiation"]
resume_rules__ = {}
......
......@@ -31,7 +31,8 @@ sys.path.extend(['../', './'])
scriptdir = os.path.dirname(os.path.realpath(__file__))
def system(s: str) -> int:
return subprocess.call(s.split(' '), shell=True)
# return os.system(s)
return subprocess.call(s, shell=True)
class TestDHParserCommandLineTool:
def setup(self):
......
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