Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
source
OBSW MOD GENERATOR CORE
Commits
d9beb68b
Unverified
Commit
d9beb68b
authored
May 18, 2021
by
Robin Mueller
Browse files
increaed robustness of retval parser
parent
e21e5b53
Changes
1
Hide whitespace changes
Inline
Side-by-side
returnvalues/returnvalues_parser.py
View file @
d9beb68b
...
...
@@ -58,7 +58,7 @@ class InterfaceParser(FileParser):
target_end_name
=
match
.
group
(
2
)
start_matched
=
True
else
:
match
=
re
.
search
(
r
'[\s]*([
A-Z_0-9
]*),?[\s]*//([^\n]*)?'
,
line
)
match
=
re
.
search
(
r
'[\s]*([
\w
]*),?
(?:
[\s]*//
)?
([^\n]*)?'
,
line
)
if
match
:
count
+=
1
if
re
.
search
(
r
"\[EXPORT\][\s]*:[\s]*\[END\]"
,
match
.
group
(
2
)):
...
...
@@ -66,7 +66,10 @@ class InterfaceParser(FileParser):
end_matched
=
True
self
.
end_name_list
.
append
([
last_entry_name
,
None
])
else
:
current_file_table
.
update
({
count
:
[
match
.
group
(
1
),
match
.
group
(
2
)]})
short_name
=
match
.
group
(
2
)
if
short_name
==
""
:
short_name
=
match
.
group
(
1
)[
0
:
3
]
current_file_table
.
update
({
count
:
[
match
.
group
(
1
),
short_name
]})
if
not
start_matched
:
print
(
"No start match detected when parsing interface files.."
)
sys
.
exit
(
1
)
...
...
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