Grammalecte  Check-in [c722bee9fd]

Overview
Comment:[build][js] replace nbsp by nnbsp in suggestion action
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk | build | major_change
Files: files | file ages | folders
SHA3-256: c722bee9fd1b969445121aa667edcb197072d4e33a7f519a2b8b09558cb553b2
User & Date: olr on 2017-06-18 05:26:51
Other Links: manifest | tags
Context
2017-06-18
05:27
[fr] màj: accro à +l’argent check-in: 8fc4cdd6f8 user: olr tags: trunk, fr
05:26
[build][js] replace nbsp by nnbsp in suggestion action check-in: c722bee9fd user: olr tags: trunk, build, major_change
2017-06-17
06:28
[fr] tests pour la règle x_fois_par_période check-in: fd86898b60 user: olr tags: trunk, fr
Changes

Modified compile_rules.py from [20229cb495] to [b76ec26418].

446
447
448
449
450
451
452

453
454
455
456
457
458
459

def pyRuleToJS (lRule):
    lRuleJS = copy.deepcopy(lRule)
    del lRule[-1] # tGroups positioning codes are useless for Python
    # error messages
    for aAction in lRuleJS[6]:
        if aAction[1] == "-":

            aAction[4] = aAction[4].replace("« ", "« ").replace(" »", " »")
    # js regexes
    lRuleJS[1], lNegLookBehindRegex = regex2js( dJSREGEXES.get(lRuleJS[3], lRuleJS[1]) )
    lRuleJS.append(lNegLookBehindRegex)
    return lRuleJS









>







446
447
448
449
450
451
452
453
454
455
456
457
458
459
460

def pyRuleToJS (lRule):
    lRuleJS = copy.deepcopy(lRule)
    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(" »", " »")
    # js regexes
    lRuleJS[1], lNegLookBehindRegex = regex2js( dJSREGEXES.get(lRuleJS[3], lRuleJS[1]) )
    lRuleJS.append(lNegLookBehindRegex)
    return lRuleJS