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

re-interpret 'fixed' start/end dicts as fallbacks

further assumption: fixedStartValues and fixedEndValues values
adhere to target type, as well as target units.

in present parsers, fixedStartValues and fixedEndValues is only used for
strings, so this change should be backwards-compatible
parent 3e2499f4
No related branches found
No related tags found
No related merge requests found
......@@ -588,8 +588,9 @@ class CompiledMatcher(object):
result_dict[k_converted] = v_converted
if self.matcher.fixedStartValues:
for k,v in sorted(self.matcher.fixedStartValues.items()):
k_converted, v_converted = self.addStrValue(parser.backend, k, v)
result_dict[k_converted] = v_converted
if k not in result_dict:
v_converted = self.addValue(parser.backend, k, v)
result_dict[k] = v_converted
if self.matcher.forwardMatch:
logger.debug("handleStartMatch of %s on (%s) pushing back line", self.matcher.desc(),line)
parser.fIn.pushbackLine(line)
......@@ -608,8 +609,9 @@ class CompiledMatcher(object):
result_dict[k_converted] = v_converted
if self.matcher.fixedEndValues:
for k,v in sorted(self.matcher.fixedEndValues.items()):
k_converted, v_converted = self.addStrValue(parser.backend, k, v)
result_dict[k_converted] = v_converted
if k not in result_dict:
v_converted = self.addValue(parser.backend, k, v)
result_dict[k] = v_converted
return result_dict
def annotate(self,match,line,parser,matcher,targetStartEnd):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment