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
d0e0a4d9
Commit
d0e0a4d9
authored
Nov 04, 2018
by
eckhart
Browse files
- xml-Bereinigungen
parent
02e79bfb
Changes
2
Hide whitespace changes
Inline
Side-by-side
DHParser/testing.py
View file @
d0e0a4d9
...
...
@@ -258,10 +258,10 @@ def get_report(test_unit):
cst
=
tests
.
get
(
'__cst__'
,
{}).
get
(
test_name
,
None
)
if
cst
and
(
not
ast
or
str
(
test_name
).
endswith
(
'*'
)):
report
.
append
(
'
\n
### CST'
)
report
.
append
(
indent
(
cst
.
as_sxpr
()))
report
.
append
(
indent
(
cst
.
as_sxpr
(
compact
=
True
)))
if
ast
:
report
.
append
(
'
\n
### AST'
)
report
.
append
(
indent
(
ast
.
as_
sxpr
()))
report
.
append
(
indent
(
ast
.
as_
xml
()))
for
test_name
,
test_code
in
tests
.
get
(
'fail'
,
dict
()).
items
():
heading
=
'Fail-test "%s"'
%
test_name
report
.
append
(
'
\n
%s
\n
%s
\n
'
%
(
heading
,
'-'
*
len
(
heading
)))
...
...
DHParser/transform.py
View file @
d0e0a4d9
...
...
@@ -605,7 +605,7 @@ def replace_parser(context: List[Node], name: str):
@
transformation_factory
(
collections
.
abc
.
Callable
)
def
flatten
(
context
:
List
[
Node
],
condition
:
Callable
=
is_anonymous
,
recursive
:
bool
=
True
):
"""
Flattens all children, that fulfil the given ``condition``
Flattens all children, that fulfil
l
the given ``condition``
(default: all unnamed children). Flattening means that wherever a
node has child nodes, the child nodes are inserted in place of the
node.
...
...
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