Grammalecte  Check-in [c7091dec9e]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:[build] check duplicate names in rules file
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk | build
Files: files | file ages | folders
SHA3-256:c7091dec9ee0289b19f24f803b2ef6be8a2e9aad3c0be0f517f9a4d1e74390d1
User & Date: olr 2019-07-29 22:38:43
Context
2019-07-30
18:37
[fr] tests et ajustements check-in: b1bd4a9b9c user: olr tags: fr, trunk
2019-07-29
22:38
[build] check duplicate names in rules file check-in: c7091dec9e user: olr tags: build, trunk
22:36
[fr] tests et ajustements check-in: f6ce09d6cb user: olr tags: fr, trunk
Changes

Changes to compile_rules_graph.py.

   381    381                   exit()
   382    382           elif sLine.startswith("__") and sLine.endswith("__"):
   383    383               # new rule group
   384    384               m = re.match("__(\\w+)(!\\d|)__", sLine)
   385    385               if m:
   386    386                   sRuleName = m.group(1)
   387    387                   if sRuleName in aRuleName:
   388         -                    print("Error at line " + i + ". Rule name <" + sRuleName + "> already exists.")
          388  +                    print("Error at line " + str(i) + ". Rule name <" + sRuleName + "> already exists.")
   389    389                       exit()
          390  +                aRuleName.add(sRuleName)
   390    391                   iActionBlock = 1
   391    392                   nPriority = int(m.group(2)[1:]) if m.group(2)  else -1
   392    393               else:
   393    394                   print("Syntax error in rule group: ", sLine, " -- line:", i)
   394    395                   exit()
   395    396           elif re.search("^    +<<- ", sLine) or (sLine.startswith("        ") and not sLine.startswith("        ||")) \
   396    397                   or re.search("^    +#", sLine) or re.search(r"[-=~/!>](?:-?\d\.?(?::\.?-?\d+|)|)>> ", sLine) :