Grammalecte  Check-in [b5fe051926]

Overview
Comment:[core][bug] parsing nodes
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | core | rg
Files: files | file ages | folders
SHA3-256: b5fe051926a934c7418e9713e2598ca1e04a53435e705ca5bb1bb243436d392e
User & Date: olr on 2018-06-08 15:06:17
Other Links: branch diff | manifest | tags
Context
2018-06-08
15:32
[build][core] disambigation check-in: 9e87c7d854 user: olr tags: build, core, rg
15:06
[core][bug] parsing nodes check-in: b5fe051926 user: olr tags: core, rg
11:29
[core] gc engine: code clarification check-in: a1630c9df7 user: olr tags: core, rg
Changes

Modified gc_core/py/lang_core/gc_engine.py from [1a58d9e056] to [1f7865990e].

   630    630           dErr = {}
   631    631           dPriority = {}  # Key = position; value = priority
   632    632           dOpt = _dOptions  if not dOptions  else dOptions
   633    633           lPointer = []
   634    634           bChange = False
   635    635           for dToken in self.lToken:
   636    636               # check arcs for each existing pointer
   637         -            lNewPointer = []
   638         -            for i, dPointer in enumerate(lPointer):
   639         -                bValid = False
   640         -                bFirst = True
          637  +            lNextPointer = []
          638  +            for dPointer in lPointer:
   641    639                   for dNode in self._getNextMatchingNodes(dToken, dPointer["dNode"]):
   642         -                    if bFirst:
   643         -                        dPointer["dNode"] = dNode
   644         -                    else:
   645         -                        lNewPointer.append({"nOffset": dPointer["nOffset"], "dNode": dNode})
   646         -                    bFirst = False
   647         -                    bValid = True
   648         -                if not bValid:
   649         -                    del lPointer[i]
   650         -            lPointer.extend(lNewPointer)
          640  +                    lNextPointer.append({"iToken": dPointer["iToken"], "dNode": dNode})
          641  +            lPointer = lNextPointer
   651    642               # check arcs of first nodes
   652    643               for dNode in self._getNextMatchingNodes(dToken, dGraph[0]):
   653         -                lPointer.append({"nOffset": dToken["i"], "dNode": dNode})
          644  +                lPointer.append({"iToken": dToken["i"], "dNode": dNode})
   654    645               # check if there is rules to check for each pointer
   655    646               for dPointer in lPointer:
   656    647                   if "<rules>" in dPointer["dNode"]:
   657         -                    bHasChanged, errs = self._executeActions(dPointer["dNode"]["<rules>"], dPointer["nOffset"]-1, dPriority, dOpt, sCountry, bShowRuleId, bContext)
          648  +                    bHasChanged, errs = self._executeActions(dPointer["dNode"]["<rules>"], dPointer["iToken"]-1, dPriority, dOpt, sCountry, bShowRuleId, bContext)
   658    649                       dErr.update(errs)
   659    650                       if bHasChanged:
   660    651                           bChange = True
   661    652           if dErr:
   662    653               print(dErr)
   663    654           return (bChange, dErr)
   664    655