예제 #1
0
def origin_for_statement(ast, context):
    expression_no_in(ast[3], context)
    while expression_no_in(ast[5], context):
        statement(ast[9], context)
        if context.return_value is not None:
            break
        expression_no_in(ast[7], context)
예제 #2
0
def origin_for_statement(ast, context):
    expression_no_in(ast[3], context)
    while expression_no_in(ast[5], context):
        statement(ast[9], context)
        if context.return_value is not None:
            break
        expression_no_in(ast[7], context)
예제 #3
0
def return_statement(ast, context):
    if ast[len(ast) - 1] == ";":
        ast.pop()
    if len(ast) == 2:
        context.return_value = UNDEFINED
    elif len(ast) == 3:
        context.return_value = expression_no_in(ast[2], context)
예제 #4
0
def do_statement(ast, context):
    while True:
        statement(ast[2], context)
        if context.return_value is not None:
            break
        if not expression_no_in(ast[5], context):
            break
예제 #5
0
def return_statement(ast, context):
    if ast[len(ast) - 1] == ";":
        ast.pop()
    if len(ast) == 2:
        context.return_value = UNDEFINED
    elif len(ast) == 3:
        context.return_value = expression_no_in(ast[2], context)
예제 #6
0
def do_statement(ast, context):
    while True:
        statement(ast[2], context)
        if context.return_value is not None:
            break
        if not expression_no_in(ast[5], context):
            break
예제 #7
0
def print_statement(ast, context):
    print(expression_no_in(ast[2], context))
예제 #8
0
def for_each_statement(ast, context):
    for context[ast[4][1]] in expression_no_in(ast[6], context):
        statement(ast[8], context)
        if context.return_value is not None:
            break
예제 #9
0
def while_statement(ast, context):
    while expression_no_in(ast[3], context):
        statement(ast[5], context)
        if context.return_value is not None:
            break
예제 #10
0
def if_statement(ast, context):
    if expression_no_in(ast[3], context):
        statement(ast[5], context)
    else:
        if len(ast) == 8:
            statement(ast[7], context)
예제 #11
0
def expression_no_in_statement(ast, context):
    return expression_no_in(ast[1], context)
예제 #12
0
def print_statement(ast, context):
    print(expression_no_in(ast[2], context))
예제 #13
0
def for_each_statement(ast, context):
    for context[ast[4][1]] in expression_no_in(ast[6], context):
        statement(ast[8], context)
        if context.return_value is not None:
            break
예제 #14
0
def while_statement(ast, context):
    while expression_no_in(ast[3], context):
        statement(ast[5], context)
        if context.return_value is not None:
            break
예제 #15
0
def if_statement(ast, context):
    if expression_no_in(ast[3], context):
        statement(ast[5], context)
    else:
        if len(ast) == 8:
            statement(ast[7], context)
예제 #16
0
def expression_no_in_statement(ast, context):
    return expression_no_in(ast[1], context)