Skip to content
Snippets Groups Projects
Commit 88ebbf47 authored by Henning Glawe's avatar Henning Glawe
Browse files

try to match literals first

parent 5cefed72
Branches
Tags
No related merge requests found
...@@ -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:
... ...
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment