Index: compile_rules_graph.py ================================================================== --- compile_rules_graph.py +++ compile_rules_graph.py @@ -232,11 +232,11 @@ lToken[i] = sToken[1:-1] iGroup += 1 dPos[iGroup] = i + 1 # we add 1, for we count tokens from 1 to n (not from 0) # Parse actions - for iAction, (iActionLine, sAction) in enumerate(lActions): + for iAction, (iActionLine, sAction) in enumerate(lActions, 1): sAction = sAction.strip() if sAction: sActionId = self.sGraphCode + "__" + sRuleName + "__b" + str(iActionBlock) + "_a" + str(iAction) aAction = self.createAction(sActionId, sAction, nPriority, len(lToken), dPos, iActionLine) if aAction: @@ -384,11 +384,11 @@ print("\n# Unknown action.", sActionId) return None def storeAction (self, sActionId, aAction): "store in avoiding duplicates and return action name" - nVar = 0 + nVar = 1 while True: sActionName = sActionId + "_" + str(nVar) if sActionName not in self.dActions: self.dActions[sActionName] = aAction return sActionName