Grammalecte  Check-in [bf346cdb9b]

Overview
Comment:[build] graph builder update (syntax + bookmarks)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | build | rg
Files: files | file ages | folders
SHA3-256: bf346cdb9b6c6d192264e43854df6bf46f2629c6d71e1e6396345acd0844e3a2
User & Date: olr on 2018-06-12 16:37:19
Other Links: branch diff | manifest | tags
Context
2018-06-12
16:38
[fr] conversion: regex -> graph rules check-in: 8230a349b4 user: olr tags: fr, rg
16:37
[build] graph builder update (syntax + bookmarks) check-in: bf346cdb9b user: olr tags: build, rg
12:24
[fr] ne pas réécrire <-t-> si non nécessaire check-in: 39e274565b user: olr tags: fr, rg
Changes

Modified compile_rules_graph.py from [2fdedc6cde] to [917ee86abf].

216
217
218
219
220
221
222




223
224
225
226
227
228
229
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233







+
+
+
+







    elif cAction == ">":
        ## no action, break loop if condition is False
        return [sOption, sCondition, cAction, ""]
    else:
        print("# Unknown action at line " + sIdAction)
        return None


def printBookmark (nLevel, sComment, nLine):
    print("  {:>6}:  {}".format(nLine, "  " * nLevel + sComment))


def make (spLang, sLang, bJavaScript):
    "compile rules, returns a dictionary of values"
    # for clarity purpose, don’t create any file here

    print("> read graph rules file...")
    try:
308
309
310
311
312
313
314
315

316
317


318

319

320
321
322
323
324
325
326
312
313
314
315
316
317
318

319
320
321
322
323
324
325

326
327
328
329
330
331
332
333







-
+


+
+

+
-
+







                exit()
            for j, sTokenLine in lTokenLine:
                dAllGraph[sGraphName].append((j, sRuleName, sTokenLine, sActions, nPriority))
            lTokenLine.clear()
            sActions = ""
            sRuleName = ""
            nPriority = 4
        elif sLine.startswith(("        ")):
        elif sLine.startswith(("        <<-", "    <<-")):
            # actions
            sActions += " " + sLine.strip()
        elif sLine.startswith(("    ")):
            lTokenLine.append([i, sLine.strip()])
        else:
            print("Unknown line:")
            lTokenLine.append([i, sLine.strip()])
            print(sLine)

    # tests
    print("  list tests...")
    sGCTests = "\n".join(lTest)
    sGCTestsJS = '{ "aData2": ' + json.dumps(lTest, ensure_ascii=False) + " }\n"

    # processing rules