Index: compile_rules_graph.py ================================================================== --- compile_rules_graph.py +++ compile_rules_graph.py @@ -218,10 +218,14 @@ 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 @@ -310,15 +314,18 @@ dAllGraph[sGraphName].append((j, sRuleName, sTokenLine, sActions, nPriority)) lTokenLine.clear() sActions = "" sRuleName = "" nPriority = 4 - elif sLine.startswith((" ")): + elif sLine.startswith((" <<-", " <<-")): # actions sActions += " " + sLine.strip() - else: + elif sLine.startswith((" ")): lTokenLine.append([i, sLine.strip()]) + else: + print("Unknown line:") + print(sLine) # tests print(" list tests...") sGCTests = "\n".join(lTest) sGCTestsJS = '{ "aData2": ' + json.dumps(lTest, ensure_ascii=False) + " }\n"