Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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
Ejemplo n.º 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)
Ejemplo n.º 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
Ejemplo n.º 7
0
def print_statement(ast, context):
    print(expression_no_in(ast[2], context))
Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 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)
Ejemplo n.º 11
0
def expression_no_in_statement(ast, context):
    return expression_no_in(ast[1], context)
Ejemplo n.º 12
0
def print_statement(ast, context):
    print(expression_no_in(ast[2], context))
Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 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)
Ejemplo n.º 16
0
def expression_no_in_statement(ast, context):
    return expression_no_in(ast[1], context)