예제 #1
0
def value(rule):
    rule | (ID, star('-', _or(INT, ID)))
    rule.dont_ignore = True
예제 #2
0
def four_sub(rule):
    rule | (ID, _or('+','=','-'), ID, _or(NEWLINE, EOF))
예제 #3
0
def start(rule):
    rule | star(_or(section, NEWLINE))
    rule.astAttrs = {'sections':[section]}
예제 #4
0
def section(rule):
    rule | (head, star(_or(define, NEWLINE)))
    rule.astAttrs = {'head':head, 'body':[define]}
예제 #5
0
def name(rule):
    rule | plus(_or(ID, NUMBER, WHITE))
    rule.astAttrs = {'words':[ID, NUMBER, WHITE]}
예제 #6
0
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
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
def at(rule):
    rule | (no_ignore('@', ID), _or(STRING, SSTRING, star(_not(_or(';','}')))), ';')
    rule | star(_not(_or(';','}')))
예제 #10
0
def start(rule):
    rule | plus(_or(STRING, ID, NUMBER))
    rule.astAttrs = {'values':[STRING, ID, NUMBER]}
예제 #11
0
def at(rule):
    rule | (no_ignore('@', ID), _or(STRING, SSTRING))