Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
badw-it
DHParser
Commits
e257281d
Commit
e257281d
authored
Jul 07, 2021
by
Eckhart Arnold
Browse files
parser.py, ebnf.py: Allow Parsers for resume-skipping (refactorings pending)
parent
16a25786
Changes
1
Hide whitespace changes
Inline
Side-by-side
experimental/JSON/serialization_demo.py
deleted
100644 → 0
View file @
16a25786
import
sys
,
os
try
:
scriptpath
=
os
.
path
.
dirname
(
__file__
)
except
NameError
:
scriptpath
=
''
dhparser_parentdir
=
os
.
path
.
abspath
(
os
.
path
.
join
(
scriptpath
,
r
'../..'
))
if
scriptpath
not
in
sys
.
path
:
sys
.
path
.
append
(
scriptpath
)
if
dhparser_parentdir
not
in
sys
.
path
:
sys
.
path
.
append
(
dhparser_parentdir
)
import
JSONParser
if
__name__
==
"__main__"
:
syntax_tree
=
JSONParser
.
parse_JSON
(
'{ "one": 1, "two": 2 }'
)
JSONParser
.
transform_JSON
(
syntax_tree
)
print
(
syntax_tree
.
as_sxpr
())
print
(
syntax_tree
.
as_json
(
indent
=
None
))
print
(
syntax_tree
.
as_xml
())
print
(
syntax_tree
.
as_tree
())
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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