Index: compile_rules_graph.py ================================================================== --- compile_rules_graph.py +++ compile_rules_graph.py @@ -131,11 +131,11 @@ cAction = m.group("action") sAction = sAction[m.end():].strip() sAction = changeReferenceToken(sAction, dPos) if not m.group("start"): iStartAction = 1 - iEndAction = nToken + iEndAction = 0 else: iStartAction = int(m.group("start")) iEndAction = int(m.group("end")[1:]) if m.group("end") else iStartAction if dPos: try: Index: gc_core/py/lang_core/gc_engine.py ================================================================== --- gc_core/py/lang_core/gc_engine.py +++ gc_core/py/lang_core/gc_engine.py @@ -673,17 +673,17 @@ # check if there is rules to check for each pointer for dPointer in lPointer: #if bDebug: # print("+", dPointer) if "" in dPointer["dNode"]: - bHasChanged, errs = self._executeActions(dGraph, dPointer["dNode"][""], dPointer["iToken"]-1, dPriority, dOpt, sCountry, bShowRuleId, bDebug, bContext) + bHasChanged, errs = self._executeActions(dGraph, dPointer["dNode"][""], dPointer["iToken"]-1, dToken["i"], dPriority, dOpt, sCountry, bShowRuleId, bDebug, bContext) dErr.update(errs) if bHasChanged: bChange = True return (bChange, dErr) - def _executeActions (self, dGraph, dNode, nTokenOffset, dPriority, dOptions, sCountry, bShowRuleId, bDebug, bContext): + def _executeActions (self, dGraph, dNode, nTokenOffset, nLastToken, dPriority, dOptions, sCountry, bShowRuleId, bDebug, bContext): "execute actions found in the DARG" dErrs = {} bChange = False for sLineId, nextNodeKey in dNode.items(): bCondMemo = None @@ -698,21 +698,22 @@ bCondMemo = not sFuncCond or globals()[sFuncCond](self.lToken, nTokenOffset, sCountry, bCondMemo) if bCondMemo: if cActionType == "-": # grammar error nTokenErrorStart = nTokenOffset + eAct[0] - nTokenErrorEnd = nTokenOffset + eAct[1] + nTokenErrorEnd = (nTokenOffset + eAct[1]) if eAct[1] else nLastToken nErrorStart = self.nOffset + self.lToken[nTokenErrorStart]["nStart"] nErrorEnd = self.nOffset + self.lToken[nTokenErrorEnd]["nEnd"] if nErrorStart not in dErrs or eAct[2] > dPriority[nErrorStart]: dErrs[nErrorStart] = self.createError(sWhat, nTokenOffset, nTokenErrorStart, nErrorStart, nErrorEnd, sLineId, sRuleId, True, eAct[3], eAct[4], bShowRuleId, "notype", bContext) dPriority[nErrorStart] = eAct[2] if bDebug: print("-", sRuleId, dErrs[nErrorStart]) elif cActionType == "~": # text processor - self._tagAndPrepareTokenForRewriting(sWhat, nTokenOffset + eAct[0], nTokenOffset + eAct[1], bDebug) + nEndToken = (nTokenOffset + eAct[1]) if eAct[1] else nLastToken + self._tagAndPrepareTokenForRewriting(sWhat, nTokenOffset + eAct[0], nEndToken, bDebug) if bDebug: print("~", sRuleId) bChange = True elif cActionType == "=": # disambiguation