Grammalecte  Check-in [ffacab70c5]

Overview
Comment:[build] check regexes: memorize checked regexes
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | build | rg
Files: files | file ages | folders
SHA3-256: ffacab70c520b32f1eb98ade47405f5ab90684fb20b9319ac011d8cd03a51b7a
User & Date: olr on 2018-06-27 23:30:57
Other Links: branch diff | manifest | tags
Context
2018-06-27
23:36
[build] check regexes: memorize checked regexes check-in: 6f12ea6825 user: olr tags: build, rg
23:30
[build] check regexes: memorize checked regexes check-in: ffacab70c5 user: olr tags: build, rg
23:26
[build] check regexes of DARGs check-in: cf5fbaf4dc user: olr tags: build, rg
Changes

Modified compile_rules_graph.py from [ffaec91e64] to [9a2e2f9a01].

   263    263           print("# Unknown action at line " + sActionId)
   264    264           return None
   265    265   
   266    266   
   267    267   def checkRegexes (dAllGraph):
   268    268       "check validity of regexes"
   269    269       print("  checking regexes...")
          270  +    aRegex = set()
   270    271       for sGraphName, dGraph in dAllGraph.items():
   271    272           for nKey, dVal in dGraph.items():
   272    273               if "<re_value>" in dVal:
   273    274                   for sRegex in dVal["<re_value>"]:
   274         -                    _checkRegex(sRegex)
          275  +                    if sRegex not in aRegex:
          276  +                        _checkRegex(sRegex)
          277  +                        aRegex.add(sRegex)
   275    278               if "<re_morph>" in dVal:
   276    279                   for sRegex in dVal["<re_morph>"]:
   277         -                    _checkRegex(sRegex)
          280  +                    if sRegex not in aRegex:
          281  +                        _checkRegex(sRegex)
          282  +                        aRegex.add(sRegex)
          283  +    aRegex.clear()
   278    284   
   279    285   def _checkRegex (sRegex):
   280    286       #print(sRegex)
   281    287       if "¬" in sRegex:
   282    288           sPattern, sNegPattern = sRegex.split("¬")
   283    289           try:
   284    290               if not sNegPattern: