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
a3db829f
Commit
a3db829f
authored
Feb 26, 2019
by
di68kap
Browse files
- Fehler in Grammatik-Tests korrigiert
parent
658fe908
Changes
2
Hide whitespace changes
Inline
Side-by-side
examples/Arithmetic/grammar_tests/02_test_components.ini
View file @
a3db829f
[match:group]
M1:
"(2
+
x)"
M2:
"(3)"
M3:
"(-4x
/
2)"
[fail:group]
F1:
"22"
...
...
@@ -17,6 +18,7 @@ M6: "-(a * b)"
M7:
"2x"
M8:
"-2x"
M9:
"-(2
+
4)x(3
+
4)"
M10:
"2(-x)"
[fail:factor]
F1:
"x4"
...
...
@@ -46,6 +48,7 @@ M4: "a - 5 + b"
M5:
"-5
-
+4x"
M6:
"5
-
4
+
3"
M7:
"5
-
(4
+
3)"
M8:
"5
-
4
/
2
+
3x
-
2"
[fail:expression]
F1:
"-5
-
-
4x"
...
...
examples/Arithmetic/tst_Arithmetic_grammar.py
View file @
a3db829f
...
...
@@ -8,7 +8,7 @@ import sys
LOGGING
=
False
sys
.
path
.
extend
([
'../../'
,
'..
/
'
,
'.
/
'
])
sys
.
path
.
extend
([
'../../'
,
'..'
,
'.'
])
scriptpath
=
os
.
path
.
dirname
(
__file__
)
...
...
@@ -24,7 +24,7 @@ except ModuleNotFoundError:
CONFIG_PRESET
[
'ast_serialization'
]
=
"S-expression"
CONFIG_PRESET
[
'test_parallelization'
]
=
Tru
e
CONFIG_PRESET
[
'test_parallelization'
]
=
Fals
e
def
recompile_grammar
(
grammar_src
,
force
):
grammar_tests_dir
=
os
.
path
.
join
(
scriptpath
,
'grammar_tests'
)
...
...
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