Grammalecte  Check-in [570dda15fe]

Overview
Comment:cherrypick from trunk: [build] enumerate actions from 1 not from 0
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | gcerw
Files: files | file ages | folders
SHA3-256: 570dda15fe5b23597dd6b387df453b42a7e1a42f7fb275a17f1a4449f4cff50e
User & Date: olr on 2020-04-17 18:07:55
Other Links: branch diff | manifest | tags
Context
2020-04-17
18:09
[core][js] gc engine: bug fix > last index array check-in: 9a4522a381 user: olr tags: core, gcerw
18:07
cherrypick from trunk: [build] enumerate actions from 1 not from 0 check-in: 570dda15fe user: olr tags: gcerw
18:02
cherrypick from trunk: [fr] ajustements check-in: 91457464b6 user: olr tags: gcerw
17:31
[build] enumerate actions from 1 not from 0 check-in: 873f3e7060 user: olr tags: build, trunk
Changes

Modified compile_rules_graph.py from [d5b25a4036] to [b7d9668574].

   230    230                   for i, sToken in enumerate(lToken):
   231    231                       if sToken.startswith("(") and sToken.endswith(")"):
   232    232                           lToken[i] = sToken[1:-1]
   233    233                           iGroup += 1
   234    234                           dPos[iGroup] = i + 1    # we add 1, for we count tokens from 1 to n (not from 0)
   235    235   
   236    236                   # Parse actions
   237         -                for iAction, (iActionLine, sAction) in enumerate(lActions):
          237  +                for iAction, (iActionLine, sAction) in enumerate(lActions, 1):
   238    238                       sAction = sAction.strip()
   239    239                       if sAction:
   240    240                           sActionId = self.sGraphCode + "__" + sRuleName + "__b" + str(iActionBlock) + "_a" + str(iAction)
   241    241                           aAction = self.createAction(sActionId, sAction, nPriority, len(lToken), dPos, iActionLine)
   242    242                           if aAction:
   243    243                               sActionName = self.storeAction(sActionId, aAction)
   244    244                               lResult = list(lToken)
................................................................................
   382    382               sAction = self.createFunction("da", sAction)
   383    383               return [sLineId, sOption, sCondition, cAction, sAction]
   384    384           print("\n# Unknown action.", sActionId)
   385    385           return None
   386    386   
   387    387       def storeAction (self, sActionId, aAction):
   388    388           "store <aAction> in <self.dActions> avoiding duplicates and return action name"
   389         -        nVar = 0
          389  +        nVar = 1
   390    390           while True:
   391    391               sActionName = sActionId + "_" + str(nVar)
   392    392               if sActionName not in self.dActions:
   393    393                   self.dActions[sActionName] = aAction
   394    394                   return sActionName
   395    395               if aAction == self.dActions[sActionName]:
   396    396                   return sActionName