Overview
Comment: | [build] handles groups of actions within rules |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | build | rg |
Files: | files | file ages | folders |
SHA3-256: |
4452713abf61641d57fc2ef3aaf0425e |
User & Date: | olr on 2018-06-16 09:52:40 |
Other Links: | branch diff | manifest | tags |
Context
2018-06-17
| ||
11:14 | [fr] conversion: regex rules -> graph rules check-in: 04c936fc10 user: olr tags: fr, rg | |
2018-06-16
| ||
09:52 | [build] handles groups of actions within rules check-in: 4452713abf user: olr tags: build, rg | |
2018-06-14
| ||
12:35 | [core][bug] boolean storing condition result wrongly reset check-in: 30e9ffd98a user: olr tags: core, rg | |
Changes
Modified compile_rules_graph.py from [1ffdcd91bb] to [6a40538d43].
︙ | |||
70 71 72 73 74 75 76 | 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 | - + - + - + | else: for aRule in lTokenLines: aRule.append(sToken) for aRule in lTokenLines: yield aRule |
︙ | |||
232 233 234 235 236 237 238 239 240 241 242 243 244 245 | 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 | + | # removing comments, zeroing empty lines, creating definitions, storing tests, merging rule lines print(" parsing rules...") lTokenLine = [] sActions = "" nPriority = 4 dAllGraph = {} sGraphName = "" iActionBlock = 0 for i, sLine in lRule: sLine = sLine.rstrip() if "\t" in sLine: # tabulation not allowed print("Error. Tabulation at line: ", i) exit() |
︙ | |||
256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 | 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 | + - + + - - + + | print("Error. Graph name not found at line", i) exit() elif sLine.startswith("__") and sLine.endswith("__"): # new rule group m = re.match("__(\\w+)(!\\d|)__", sLine) if m: sRuleName = m.group(1) iActionBlock = 1 nPriority = int(m.group(2)[1:]) if m.group(2) else 4 else: print("Error at rule group: ", sLine, " -- line:", i) break elif re.match("[ ]*$", sLine): # empty line to end merging if not lTokenLine: continue if not sActions: print("Error. No action found at line:", i) exit() if not sGraphName: print("Error. All rules must belong to a named graph. Line: ", i) exit() for j, sTokenLine in lTokenLine: |
︙ |