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
f2995a5e
Commit
f2995a5e
authored
May 05, 2017
by
Eckhart Arnold
Browse files
- made ptype parameter implicit (again)
parent
93ed340e
Changes
3
Hide whitespace changes
Inline
Side-by-side
DHParser/syntaxtree.py
View file @
f2995a5e
...
...
@@ -573,11 +573,11 @@ def reduce_single_child(node):
node
.
result
=
node
.
result
[
0
].
result
def
replace_parser
(
node
,
parser_
name
,
p
arser_
type
=
''
):
def
replace_parser
(
node
,
name
,
ptype
=
''
):
"""Replaces the parser of a Node to a mock parser with the given
name and pseudo-type.
"""
node
.
parser
=
MockParser
(
parser_
name
,
p
arser_
type
)
node
.
parser
=
MockParser
(
name
,
ptype
)
# ------------------------------------------------
...
...
examples/MLW/MLW_compiler.py
View file @
f2995a5e
...
...
@@ -283,7 +283,7 @@ MLW_AST_transformation_table = {
[
partial
(
remove_tokens
,
tokens
=
{
'AUTORIN'
,
'AUTOR'
})],
"WORT, WORT_KLEIN, WORT_GROSS, GROSSSCHRIFT"
:
[
remove_expendables
,
reduce_single_child
],
"LEER, TRENNER, ZSPRUNG"
:
partial
(
replace_parser
,
parser_nam
e
=
WHITESPACE_
KEYWORD
),
"LEER, TRENNER, ZSPRUNG"
:
partial
(
replace_parser
,
name
=
''
,
ptyp
e
=
WHITESPACE_
PTYPE
),
"DATEI_ENDE"
:
no_operation
,
"NIEMALS"
:
no_operation
,
(
TOKEN_PTYPE
,
WHITESPACE_PTYPE
):
...
...
examples/MLW/samples/fascitergula.xml
View file @
f2995a5e
...
...
@@ -22,12 +22,12 @@
fa-rcu-tergula
</LVariante>
<LVZusatz>
<
TOKEN__
>
<
:Token
>
ZUSATZ
</
TOKEN__
>
<
TOKEN__
>
</
:Token
>
<
:Token
>
sim.
</
TOKEN__
>
</
:Token
>
</LVZusatz>
</LemmaVarianten>
<GrammatikPosition>
...
...
@@ -78,9 +78,9 @@
</LemmaPosition>
<SchreibweisenPosition>
<SWTyp>
<
TOKEN__
>
<
:Token
>
script.
</
TOKEN__
>
</
:Token
>
</SWTyp>
<SWVariante>
<Schreibweise>
...
...
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