Overview
| Comment: | [build][bug] fix rules conversion to JS |
|---|---|
| Downloads: | Tarball | ZIP archive | SQL archive |
| Timelines: | family | ancestors | descendants | both | trunk | build |
| Files: | files | file ages | folders |
| SHA3-256: |
e4195c83c26e3e0d5e244b343d4b7929 |
| User & Date: | olr on 2018-03-31 15:00:28 |
| Other Links: | manifest | tags |
Context
|
2018-03-31
| ||
| 19:38 | [fr] faux positif: quelles en sont les conséquences check-in: ae9f7dcbe8 user: olr tags: trunk, fr | |
| 15:00 | [build][bug] fix rules conversion to JS check-in: e4195c83c2 user: olr tags: trunk, build | |
|
2018-03-26
| ||
| 21:44 | [build] helpers: fileFile to *.py files check-in: 5782076e99 user: olr tags: trunk, build | |
Changes
Modified compile_rules_js_convert.py from [2637ee1377] to [da0ad4e711].
1 2 3 4 5 6 7 8 9 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | - - - + + + + + + + |
# Convert Python code to JavaScript code
import copy
import re
import json
def py2js (sCode):
"convert Python code to JavaScript code"
|
| ︙ | |||
30 31 32 33 34 35 36 | 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | - - - + + + - + |
sCode = sCode.replace(".isupper", ".gl_isUpperCase")
sCode = sCode.replace(".islower", ".gl_isLowerCase")
sCode = sCode.replace(".istitle", ".gl_isTitle")
sCode = sCode.replace(".capitalize", ".gl_toCapitalize")
sCode = sCode.replace(".strip", ".gl_trim")
sCode = sCode.replace(".lstrip", ".gl_trimLeft")
sCode = sCode.replace(".rstrip", ".gl_trimRight")
|
| ︙ | |||
56 57 58 59 60 61 62 | 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 | - + - + |
# regex matches
sCode = sCode.replace(".end()", ".end[0]")
sCode = sCode.replace(".start()", ".index")
sCode = sCode.replace("m.group()", "m[0]")
sCode = re.sub("\\.start\\((\\d+)\\)", ".start[\\1]", sCode)
sCode = re.sub("m\\.group\\((\\d+)\\)", "m[\\1]", sCode)
# tuples -> lists
|
| ︙ |