|
|
@ -113,11 +113,11 @@ DEF_RULE(import_stmt, nc, or(2), rule(import_name), rule(import_from)) |
|
|
|
DEF_RULE(import_name, c(import_name), and(2), tok(KW_IMPORT), rule(dotted_as_names)) |
|
|
|
DEF_RULE(import_from, c(import_from), and(4), tok(KW_FROM), rule(import_from_2), tok(KW_IMPORT), rule(import_from_3)) |
|
|
|
DEF_RULE(import_from_2, nc, or(2), rule(dotted_name), rule(import_from_2b)) |
|
|
|
DEF_RULE(import_from_2b, nc, and(2), rule(one_or_more_period_or_ellipses), opt_rule(dotted_name)) |
|
|
|
DEF_RULE(import_from_2b, nc, and(2), rule(one_or_more_period_or_ellipsis), opt_rule(dotted_name)) |
|
|
|
DEF_RULE(import_from_3, nc, or(3), tok(OP_STAR), rule(import_as_names_paren), rule(import_as_names)) |
|
|
|
DEF_RULE(import_as_names_paren, nc, and(3), tok(DEL_PAREN_OPEN), rule(import_as_names), tok(DEL_PAREN_CLOSE)) |
|
|
|
DEF_RULE(one_or_more_period_or_ellipses, nc, one_or_more, rule(period_or_ellipses)) |
|
|
|
DEF_RULE(period_or_ellipses, nc, or(2), tok(DEL_PERIOD), tok(ELLIPSES)) |
|
|
|
DEF_RULE(one_or_more_period_or_ellipsis, nc, one_or_more, rule(period_or_ellipsis)) |
|
|
|
DEF_RULE(period_or_ellipsis, nc, or(2), tok(DEL_PERIOD), tok(ELLIPSIS)) |
|
|
|
DEF_RULE(import_as_name, nc, and(2), tok(NAME), opt_rule(as_name)) |
|
|
|
DEF_RULE(dotted_as_name, nc, and(2), rule(dotted_name), opt_rule(as_name)) |
|
|
|
DEF_RULE(as_name, nc, and(2), tok(KW_AS), tok(NAME)) |
|
|
@ -220,7 +220,7 @@ DEF_RULE(power_dbl_star, c(power_dbl_star), and(2), tok(OP_DBL_STAR), rule(facto |
|
|
|
// testlist_comp: (test|star_expr) ( comp_for | (',' (test|star_expr))* [','] )
|
|
|
|
// trailer: '(' [arglist] ')' | '[' subscriptlist ']' | '.' NAME
|
|
|
|
|
|
|
|
DEF_RULE(atom, nc, or(10), tok(NAME), tok(NUMBER), rule(atom_string), tok(ELLIPSES), tok(KW_NONE), tok(KW_TRUE), tok(KW_FALSE), rule(atom_paren), rule(atom_bracket), rule(atom_brace)) |
|
|
|
DEF_RULE(atom, nc, or(10), tok(NAME), tok(NUMBER), rule(atom_string), tok(ELLIPSIS), tok(KW_NONE), tok(KW_TRUE), tok(KW_FALSE), rule(atom_paren), rule(atom_bracket), rule(atom_brace)) |
|
|
|
DEF_RULE(atom_string, c(atom_string), one_or_more, rule(string_or_bytes)) |
|
|
|
DEF_RULE(string_or_bytes, nc, or(2), tok(STRING), tok(BYTES)) |
|
|
|
DEF_RULE(atom_paren, c(atom_paren), and(3), tok(DEL_PAREN_OPEN), opt_rule(atom_2b), tok(DEL_PAREN_CLOSE)) |
|
|
|