Grammalecte  Check-in [52c97f487a]

Overview
Comment:[build] DARG: don’t check regex when equal to * (shortcut for nothing except required pattern)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | build | rg
Files: files | file ages | folders
SHA3-256: 52c97f487a66cafc57bc56dd837c4034a0d3cd48f0accb4087512b03f2a89c66
User & Date: olr on 2018-07-01 07:50:12
Other Links: branch diff | manifest | tags
Context
2018-07-01
08:33
[core][bug] in Python all() sends True if the tested list is empty check-in: 29cdebf3f5 user: olr tags: core, rg
07:50
[build] DARG: don’t check regex when equal to * (shortcut for nothing except required pattern) check-in: 52c97f487a user: olr tags: build, rg
2018-06-30
20:04
[fr] conversion: regex rules -> graph rules check-in: e55e78a0d1 user: olr tags: fr, rg
Changes

Modified darg.py from [02fc45c534] to [ad8b8ac55e].

165
166
167
168
169
170
171

172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
        #print(sRegex)
        if "¬" in sRegex:
            sPattern, sNegPattern = sRegex.split("¬")
            try:
                if not sNegPattern:
                    print("# Warning! Empty negpattern:", sRegex)
                re.compile(sPattern)

                re.compile(sNegPattern)
            except:
                print("# Error. Wrong regex:", sRegex)
                traceback.print_exc()
                exit()
        else:
            try:
                if not sRegex:
                    print("# Warning! Empty pattern:", sRegex)
                re.compile(sRegex)
            except:
                print("# Error. Wrong regex:", sRegex)
                traceback.print_exc()
                exit()


class Node:
    """Node of the rule graph"""

    NextId = 0







>
|


<








<







165
166
167
168
169
170
171
172
173
174
175

176
177
178
179
180
181
182
183

184
185
186
187
188
189
190
        #print(sRegex)
        if "¬" in sRegex:
            sPattern, sNegPattern = sRegex.split("¬")
            try:
                if not sNegPattern:
                    print("# Warning! Empty negpattern:", sRegex)
                re.compile(sPattern)
                if sNegPattern != "*":
                    re.compile(sNegPattern)
            except:
                print("# Error. Wrong regex:", sRegex)

                exit()
        else:
            try:
                if not sRegex:
                    print("# Warning! Empty pattern:", sRegex)
                re.compile(sRegex)
            except:
                print("# Error. Wrong regex:", sRegex)

                exit()


class Node:
    """Node of the rule graph"""

    NextId = 0