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
Branches
Tags
No related merge requests found
...@@ -588,8 +588,9 @@ class CompiledMatcher(object): ...@@ -588,8 +588,9 @@ class CompiledMatcher(object):
result_dict[k_converted] = v_converted result_dict[k_converted] = v_converted
if self.matcher.fixedStartValues: if self.matcher.fixedStartValues:
for k,v in sorted(self.matcher.fixedStartValues.items()): for k,v in sorted(self.matcher.fixedStartValues.items()):
k_converted, v_converted = self.addStrValue(parser.backend, k, v) if k not in result_dict:
result_dict[k_converted] = v_converted v_converted = self.addValue(parser.backend, k, v)
result_dict[k] = v_converted
if self.matcher.forwardMatch: if self.matcher.forwardMatch:
logger.debug("handleStartMatch of %s on (%s) pushing back line", self.matcher.desc(),line) logger.debug("handleStartMatch of %s on (%s) pushing back line", self.matcher.desc(),line)
parser.fIn.pushbackLine(line) parser.fIn.pushbackLine(line)
...@@ -608,8 +609,9 @@ class CompiledMatcher(object): ...@@ -608,8 +609,9 @@ class CompiledMatcher(object):
result_dict[k_converted] = v_converted result_dict[k_converted] = v_converted
if self.matcher.fixedEndValues: if self.matcher.fixedEndValues:
for k,v in sorted(self.matcher.fixedEndValues.items()): for k,v in sorted(self.matcher.fixedEndValues.items()):
k_converted, v_converted = self.addStrValue(parser.backend, k, v) if k not in result_dict:
result_dict[k_converted] = v_converted v_converted = self.addValue(parser.backend, k, v)
result_dict[k] = v_converted
return result_dict return result_dict
def annotate(self,match,line,parser,matcher,targetStartEnd): 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