コード例 #1
0
ファイル: ignore.py プロジェクト: bwhmather/codetalker
def value(rule):
    rule | (ID, star('-', _or(INT, ID)))
    rule.dont_ignore = True
コード例 #2
0
ファイル: small.py プロジェクト: bwhmather/codetalker
def four_sub(rule):
    rule | (ID, _or('+','=','-'), ID, _or(NEWLINE, EOF))
コード例 #3
0
ファイル: configparser.py プロジェクト: bwhmather/codetalker
def start(rule):
    rule | star(_or(section, NEWLINE))
    rule.astAttrs = {'sections':[section]}
コード例 #4
0
ファイル: configparser.py プロジェクト: bwhmather/codetalker
def section(rule):
    rule | (head, star(_or(define, NEWLINE)))
    rule.astAttrs = {'head':head, 'body':[define]}
コード例 #5
0
ファイル: configparser.py プロジェクト: bwhmather/codetalker
def name(rule):
    rule | plus(_or(ID, NUMBER, WHITE))
    rule.astAttrs = {'words':[ID, NUMBER, WHITE]}
コード例 #6
0
ファイル: configparser.py プロジェクト: bwhmather/codetalker
def value(rule):
    rule | (star(_or(*not_newline)), _or(EOF, (NEWLINE, [INDENT, star(star(_or(*not_newline)), _or(NEWLINE, EOF)), _or(DEDENT, EOF)])))
    rule.astAttrs = {'text':list(not_newline)+[NEWLINE]}
コード例 #7
0
ファイル: configparser.py プロジェクト: bwhmather/codetalker
def define(rule):
    rule | (name, _or(':', '='), value)
    rule.astAttrs = {'name':name, 'value':value}
コード例 #8
0
ファイル: not.py プロジェクト: bwhmather/codetalker
def at(rule):
    rule | (no_ignore("@", ID), _or(STRING, SSTRING, star(_not(_or(";", "}")))), ";")
    rule | star(_not(_or(";", "}")))
コード例 #9
0
ファイル: segfixes.py プロジェクト: bwhmather/codetalker
def at(rule):
    rule | (no_ignore('@', ID), _or(STRING, SSTRING, star(_not(_or(';','}')))), ';')
    rule | star(_not(_or(';','}')))
コード例 #10
0
ファイル: multi_ast.py プロジェクト: bwhmather/codetalker
def start(rule):
    rule | plus(_or(STRING, ID, NUMBER))
    rule.astAttrs = {'values':[STRING, ID, NUMBER]}
コード例 #11
0
ファイル: noignore.py プロジェクト: bwhmather/codetalker
def at(rule):
    rule | (no_ignore('@', ID), _or(STRING, SSTRING))