Пример #1
0
def p_expr_primary6(p):
    '''primary : '[' arg_exprs ']' '''
    p[0] = ast.LitExp(ast.LitExp.ARRAY, p[2], p.lineno(1))
Пример #2
0
def p_expr_primary3(p):
    'primary : FCONST'
    p[0] = ast.LitExp(ast.LitExp.FLOAT, float(p[1]), p.lineno(1))
Пример #3
0
def p_expr_primary4(p):
    'primary : SCONST'
    p[0] = ast.LitExp(ast.LitExp.STRING, p[1], p.lineno(1))
Пример #4
0
def p_expr_primary2(p):
    'primary : ICONST'
    p[0] = ast.LitExp(ast.LitExp.INT, int(p[1]), p.lineno(1))