Grammalecte  Check-in [0c1e2728dd]

Overview
Comment:[build] update code conversion to JS
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | build | rg
Files: files | file ages | folders
SHA3-256: 0c1e2728dd919e4aec0c089190913f7ac4f48a4b4eed6a1876e163b914e2e215
User & Date: olr on 2018-09-12 08:05:05
Other Links: branch diff | manifest | tags
Context
2018-09-12
09:44
[core][py] gc engine: better debugging information check-in: ba6939effa user: olr tags: core, rg
08:05
[build] update code conversion to JS check-in: 0c1e2728dd user: olr tags: build, rg
07:58
[core][js] gc engine: fix several issues check-in: b4074ae3b3 user: olr tags: core, rg
Changes

Modified compile_rules_js_convert.py from [2f44eb628a] to [9c357794f2].

20
21
22
23
24
25
26

27
28
29
30
31
32
33
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34







+







    sCode = sCode.replace(" and ", " && ")
    sCode = sCode.replace(" or ", " || ")
    sCode = re.sub("\\bnot\\b", "!", sCode)
    sCode = re.sub("(.+) if (.+) else (.+)", "(\\2) ? \\1 : \\3", sCode)
    # boolean
    sCode = sCode.replace("False", "false")
    sCode = sCode.replace("True", "true")
    sCode = sCode.replace("None", "null")
    sCode = sCode.replace("bool", "Boolean")
    # methods
    sCode = sCode.replace(".__len__()", ".length")
    sCode = sCode.replace(".endswith", ".endsWith")
    sCode = sCode.replace(".find", ".indexOf")
    sCode = sCode.replace(".startswith", ".startsWith")
    sCode = sCode.replace(".lower", ".toLowerCase")