Changes In Branch rg Through [30e9ffd98a] Excluding Merge-Ins
This is equivalent to a diff from 86f910ec5e to 30e9ffd98a
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 | |
12:31 | [core] better debugging mode check-in: 51affbc3d4 user: olr tags: core, rg | |
2018-06-13
| ||
08:19 | [fr] faire/vouloir +Vinfi check-in: 80b12e1e04 user: olr tags: trunk, fr | |
05:46 | merge trunk check-in: 168628b7ae user: olr tags: rg | |
2018-06-11
| ||
18:27 | [fr] faux positifs: en x secondes check-in: 86f910ec5e user: olr tags: trunk, fr | |
2018-06-10
| ||
11:04 | [fx] gc panel ui, tooltip: go to the db in debug mode check-in: 5033db6633 user: olr tags: trunk, fx | |
Modified compile_rules.py from [1ea2b6d97a] to [a5c1ea137d].
1 2 3 4 5 6 7 8 9 10 11 12 13 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 | + | import re import traceback import json import compile_rules_js_convert as jsconv import compile_rules_graph as crg dDEF = {} lFUNCTIONS = [] aRULESET = set() # set of rule-ids to check if there is several rules with the same id nRULEWITHOUTNAME = 0 |
︙ | |||
25 26 27 28 29 30 31 | 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 | - - + + - + - - - + + + - - - - - - + + + + + + | s = re.sub(r"isRealStart *\(\)", 'before("^ *$")', s) s = re.sub(r"isStart0 *\(\)", 'before0("^ *$|, *$")', s) s = re.sub(r"isRealStart0 *\(\)", 'before0("^ *$")', s) s = re.sub(r"isEnd *\(\)", 'after("^ *$|^,")', s) s = re.sub(r"isRealEnd *\(\)", 'after("^ *$")', s) s = re.sub(r"isEnd0 *\(\)", 'after0("^ *$|^,")', s) s = re.sub(r"isRealEnd0 *\(\)", 'after0("^ *$")', s) |
︙ | |||
108 109 110 111 112 113 114 | 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 | - + + + + + + + + + | def createRule (s, nIdLine, sLang, bParagraph, dOptPriority): "returns rule as list [option name, regex, bCaseInsensitive, identifier, list of actions]" global dJSREGEXES global nRULEWITHOUTNAME |
︙ | |||
341 342 343 344 345 346 347 | 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 | + - - + + | print("# Unknown action at line " + sIdAction) return None def _calcRulesStats (lRules): d = {'=':0, '~': 0, '-': 0, '>': 0} for aRule in lRules: if aRule[0] != "@@@@": |
︙ | |||
430 431 432 433 434 435 436 | 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 | - - - + + + + - + - - + - - - + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + - + + | except: print("Error. Rules file in project [" + sLang + "] not found.") exit() # removing comments, zeroing empty lines, creating definitions, storing tests, merging rule lines print(" parsing rules...") global dDEF |
︙ | |||
515 516 517 518 519 520 521 | 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 | - + - + | # creating file with all functions callable by rules print(" creating callables...") sPyCallables = "# generated code, do not edit\n" sJSCallables = "// generated code, do not edit\nconst oEvalFunc = {\n" for sFuncName, sReturn in lFUNCTIONS: cType = sFuncName[0:1] if cType == "c": # condition |
︙ | |||
547 548 549 550 551 552 553 554 555 | 579 580 581 582 583 584 585 586 587 588 589 590 591 | + + + + | "gctests": sGCTests, "gctestsJS": sGCTestsJS, "paragraph_rules": mergeRulesByOption(lParagraphRules), "sentence_rules": mergeRulesByOption(lSentenceRules), "paragraph_rules_JS": jsconv.writeRulesToJSArray(mergeRulesByOption(lParagraphRulesJS)), "sentence_rules_JS": jsconv.writeRulesToJSArray(mergeRulesByOption(lSentenceRulesJS)) } d.update(dOptions) # compile graph rules d2 = crg.make(lGraphRule, sLang, bJavaScript) d.update(d2) return d |
Added compile_rules_graph.py version [1ffdcd91bb].