Grammalecte  Check-in [d5decbf54f]

Overview
Comment:[core] small debugging modification
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | core | rg
Files: files | file ages | folders
SHA3-256: d5decbf54f8d310f53474b03335ba8309611026a86a4e04ee8a8cae5a8d1af03
User & Date: olr on 2018-06-18 18:28:37
Other Links: branch diff | manifest | tags
Context
2018-06-18
19:15
[build] small code clarification check-in: 4bd95a4517 user: olr tags: build, rg
18:28
[core] small debugging modification check-in: d5decbf54f user: olr tags: core, rg
18:13
merge trunk check-in: 10458c45e6 user: olr tags: rg
Changes

Modified gc_core/py/lang_core/gc_engine.py from [7520fb92f1] to [bea60fba77].

   854    854           lNewToken = []
   855    855           for i, dToken in enumerate(self.lToken):
   856    856               if "bToRemove" in dToken:
   857    857                   # remove useless token
   858    858                   self.sSentence = self.sSentence[:dToken["nStart"]] + " " * (dToken["nEnd"] - dToken["nStart"]) + self.sSentence[dToken["nEnd"]:]
   859    859                   if bDebug:
   860    860                       print("removed:", dToken["sValue"])
   861         -                    print(self.sSentence)
   862    861               else:
   863    862                   lNewToken.append(dToken)
   864    863                   if "sNewValue" in dToken:
   865    864                       # rewrite token and sentence
   866    865                       if bDebug:
   867    866                           print(dToken["sValue"], "->", dToken["sNewValue"])
   868    867                       dToken["sRealValue"] = dToken["sValue"]
   869    868                       dToken["sValue"] = dToken["sNewValue"]
   870    869                       nDiffLen = len(dToken["sRealValue"]) - len(dToken["sNewValue"])
   871    870                       sNewRepl = (dToken["sNewValue"] + " " * nDiffLen)  if nDiffLen >= 0  else dToken["sNewValue"][:len(dToken["sRealValue"])]
   872    871                       self.sSentence = self.sSentence[:dToken["nStart"]] + sNewRepl + self.sSentence[dToken["nEnd"]:]
   873    872                       del dToken["sNewValue"]
          873  +        if bDebug:
          874  +            print(self.sSentence)
   874    875           self.lToken.clear()
   875    876           self.lToken = lNewToken
   876    877           return self.sSentence
   877    878   
   878    879   
   879    880   
   880    881   #### Analyse tokens