Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
parser-fplo
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This project is archived. Its data is
read-only
.
Show more breadcrumbs
nomad-lab
parser-fplo
Commits
88ebbf47
Commit
88ebbf47
authored
Oct 28, 2016
by
Henning Glawe
Browse files
Options
Downloads
Patches
Plain Diff
try to match literals first
parent
5cefed72
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
parser/parser-fplo/FploInputParser.py
+5
-5
5 additions, 5 deletions
parser/parser-fplo/FploInputParser.py
with
5 additions
and
5 deletions
parser/parser-fplo/FploInputParser.py
+
5
−
5
View file @
88ebbf47
...
@@ -95,6 +95,11 @@ class FploInputParser(object):
...
@@ -95,6 +95,11 @@ class FploInputParser(object):
def
state_root
(
self
,
line
,
pos_in_line
):
def
state_root
(
self
,
line
,
pos_in_line
):
"""
state: no open section, i.e. at the root of the namelist
"""
"""
state: no open section, i.e. at the root of the namelist
"""
# match literals
m
=
cRE_literal
.
match
(
line
,
pos_in_line
)
if
m
is
not
None
:
self
.
annotate
(
m
.
group
(),
ANSI
.
FG_MAGENTA
)
return
m
.
end
()
# match identifier or keyword
# match identifier or keyword
m
=
cRE_kw_ident
.
match
(
line
,
pos_in_line
)
m
=
cRE_kw_ident
.
match
(
line
,
pos_in_line
)
if
m
is
not
None
:
if
m
is
not
None
:
...
@@ -106,11 +111,6 @@ class FploInputParser(object):
...
@@ -106,11 +111,6 @@ class FploInputParser(object):
if
m
is
not
None
:
if
m
is
not
None
:
self
.
annotate
(
m
.
group
(),
ANSI
.
FG_GREEN
)
self
.
annotate
(
m
.
group
(),
ANSI
.
FG_GREEN
)
return
m
.
end
()
return
m
.
end
()
# match literals
m
=
cRE_literal
.
match
(
line
,
pos_in_line
)
if
m
is
not
None
:
self
.
annotate
(
m
.
group
(),
ANSI
.
FG_MAGENTA
)
return
m
.
end
()
# match operators
# match operators
m
=
cRE_operator
.
match
(
line
,
pos_in_line
)
m
=
cRE_operator
.
match
(
line
,
pos_in_line
)
if
m
is
not
None
:
if
m
is
not
None
:
...
...
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
sign in
to comment