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
59b7de7c
Commit
59b7de7c
authored
Jul 26, 2021
by
Eckhart Arnold
Browse files
Merge branch 'development' of
https://gitlab.lrz.de/badw-it/DHParser
into development
parents
43efd6a5
bd7f33b3
Changes
3
Hide whitespace changes
Inline
Side-by-side
DHParser/compile.py
View file @
59b7de7c
...
...
@@ -338,7 +338,7 @@ def compile_source(source: str,
1. The result as returned by the compiler or ``None`` in case of failure
2. A list of error or warning messages
3. The root-node of the abstract syntax tree if `preserve_ast` is True
or `None` otherwise.
or `None` otherwise.
"""
ast
=
None
# type: Optional[Node]
original_text
=
load_if_file
(
source
)
# type: str
...
...
examples/ts2dataclass/ts2dataclass.ebnf
View file @
59b7de7c
...
...
@@ -114,7 +114,6 @@ object = "{" [ association { "," association } ] "}"
basic_type = (`object` | `array` | `string` | `number` | `boolean` | `null`
| `integer` | `uinteger` | `decimal` ) ~
#######################################################################
#
#: Entities
...
...
examples/ts2dataclass/ts2dataclassParser.py
View file @
59b7de7c
...
...
@@ -303,7 +303,7 @@ class ts2dataclassCompiler(Compiler):
val
=
int
(
literal
)
return
f
'IntEnum("
{
val
}
",
{
val
}
)'
except
ValueError
:
return
f
'Enum(
{
v
al
}
,
{
v
al
}
)'
return
f
'Enum(
{
liter
al
}
,
{
liter
al
}
)'
else
:
assert
literal_typ
==
'string'
literal
=
self
.
compile
(
typ
)
...
...
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