Grammalecte  Check-in [284ea35ba0]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:[build] remove print()
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk | build
Files: files | file ages | folders
SHA3-256:284ea35ba0f7718d3ebfc71e2de486e741883362c41ef10de6e2498db3c2a35b
User & Date: olr 2019-07-19 13:47:46
Context
2019-07-19
16:47
[build][misc][fr] antipatterns for token rules, +syntax for SublimeText, +ajustements check-in: 6d63ab4c87 user: olr tags: build, fr, misc, new_feature, trunk
13:47
[build] remove print() check-in: 284ea35ba0 user: olr tags: build, trunk
11:34
[build][fr] declensions for tokens check-in: 340b41b40a user: olr tags: build, fr, new_feature, trunk
Changes

Changes to compile_rules_graph.py.

137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160


def createTokenList (sTokBlock, dDeclensions):
    "return a list of tokens from a block of tokens"
    lToken = []
    for sToken in sTokBlock[1:-1].split("|"):
        if "+" in sToken and not sToken.startswith("+"):
            print("\n", sToken)
            for sCode in dDeclensions:
                if sToken.endswith(sCode):
                    sToken = sToken[:-len(sCode)]
                    lToken.append(sToken)
                    print(dDeclensions[sCode])
                    for sSuffix in dDeclensions[sCode]:
                        lToken.append(sToken+sSuffix)
                    break
            print(lToken)
        else:
            lToken.append(sToken)
    return lToken


def createRule (iLine, sRuleName, sTokenLine, iActionBlock, sActions, nPriority, dOptPriority, dDef, dDecl):
    "generator: create rule as list"







<




<



<







137
138
139
140
141
142
143

144
145
146
147

148
149
150

151
152
153
154
155
156
157


def createTokenList (sTokBlock, dDeclensions):
    "return a list of tokens from a block of tokens"
    lToken = []
    for sToken in sTokBlock[1:-1].split("|"):
        if "+" in sToken and not sToken.startswith("+"):

            for sCode in dDeclensions:
                if sToken.endswith(sCode):
                    sToken = sToken[:-len(sCode)]
                    lToken.append(sToken)

                    for sSuffix in dDeclensions[sCode]:
                        lToken.append(sToken+sSuffix)
                    break

        else:
            lToken.append(sToken)
    return lToken


def createRule (iLine, sRuleName, sTokenLine, iActionBlock, sActions, nPriority, dOptPriority, dDef, dDecl):
    "generator: create rule as list"