Overview
Comment: | [build][core] graph calls within regex rules |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | core | build | rg |
Files: | files | file ages | folders |
SHA3-256: |
eeef098bd9f125077bc432ade4b12eed |
User & Date: | olr on 2018-06-11 13:21:42 |
Other Links: | branch diff | manifest | tags |
Context
2018-06-11
| ||
18:20 | [misc] SublimeText syntax rules update check-in: cac524f6db user: olr tags: misc, rg | |
13:21 | [build][core] graph calls within regex rules check-in: eeef098bd9 user: olr tags: core, build, rg | |
09:26 | [build][core] named graphs check-in: 7e92a17d42 user: olr tags: core, build, rg | |
Changes
Modified compile_rules.py from [394c512707] to [8c11a24e22].
︙ | |||
108 109 110 111 112 113 114 | 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 | - + + + + + + + + + | 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 | 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 | + - - + + | print("# Unknown action at line " + sIdAction) return None def _calcRulesStats (lRules): d = {'=':0, '~': 0, '-': 0, '>': 0} for aRule in lRules: if aRule[0] != "@@@@": |
︙ | |||
434 435 436 437 438 439 440 | 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 | - - + + + - + - + + + + + + + - + + + - + + | # removing comments, zeroing empty lines, creating definitions, storing tests, merging rule lines print(" parsing rules...") global dDEF lLine = [] lRuleLine = [] lTest = [] lOpt = [] |
︙ |
Modified compile_rules_js_convert.py from [5ad87f3f46] to [f2cc9f3e39].
︙ | |||
115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 | 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 | + + + + - - - - - - - - - - - + + + + + + + + + + + + + + + + | if not lNegLookBeforeRegex: lNegLookBeforeRegex = None return (sRegex, lNegLookBeforeRegex) def pyRuleToJS (lRule, dJSREGEXES, sWORDLIMITLEFT): lRuleJS = copy.deepcopy(lRule) # graph rules if lRuleJS[0] == "@@@@": return lRuleJS del lRule[-1] # tGroups positioning codes are useless for Python # error messages for aAction in lRuleJS[6]: if aAction[1] == "-": aAction[2] = aAction[2].replace(" ", " ") # nbsp --> nnbsp aAction[4] = aAction[4].replace("« ", "« ").replace(" »", " »").replace(" :", " :").replace(" :", " :") # js regexes lRuleJS[1], lNegLookBehindRegex = regex2js(dJSREGEXES.get(lRuleJS[3], lRuleJS[1]), sWORDLIMITLEFT) lRuleJS.append(lNegLookBehindRegex) return lRuleJS def writeRulesToJSArray (lRules): sArray = "[\n" for sOption, aRuleGroup in lRules: if sOption != "@@@@": |
Modified gc_core/py/lang_core/gc_engine.py from [12b89317cd] to [0da090b219].
︙ | |||
87 88 89 90 91 92 93 | 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 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 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 | - - - - - - - + + + + + + + + - + - - - - - + - - - - - + + + + + + + + + + + + - + + | def _loadRules (): from . import gc_rules global _rules _rules = gc_rules # compile rules regex |
︙ | |||
323 324 325 326 327 328 329 | 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 | + - - - + + + | if sFilter: try: zFilter = re.compile(sFilter) except: echo("# Error. List rules: wrong regex.") sFilter = None for sOption, lRuleGroup in chain(_getRules(True), _getRules(False)): if sOption != "@@@@": |
︙ |
Modified gc_lang/fr/rules.grx from [bf0a5c739e] to [5101ac8a06].
︙ | |||
12441 12442 12443 12444 12445 12446 12447 12448 12449 12450 12451 12452 12453 12454 | 12441 12442 12443 12444 12445 12446 12447 12448 12449 12450 12451 12452 12453 12454 12455 12456 12457 12458 | + + + + | -2>> =suggVerbMode(@, ":I", \1) # Après « quand » ou « lorsque », le verbe ne s’emploie pas au subjonctif mais à l’indicatif. TEST: quand elle {{rencontrât}} son créateur TEST: lorsqu’il y {{eût}} du grabuge, nous montâmes tous sur le pont. @@@@GRAPH: test_graph@@@@ !! !! !! !! !! !! |
︙ | |||
16512 16513 16514 16515 16516 16517 16518 | 16516 16517 16518 16519 16520 16521 16522 16523 16524 16525 16526 16527 16528 16529 16530 | - - | TEST: Éliante, cousine de Célimène, TEST: Arsinoé, amie de Célimène, TEST: Acaste, TEST: Clitandre, marquis TEST: Basque, valet de Célimène, TEST: Un garde de la maréchaussée de France, TEST: Dubois, valet d’Alceste. |
︙ |