Skip to content

Commit

Permalink
Merge branch 'Fix_multi_import' of https://github.com/qpfiffer/mochi
Browse files Browse the repository at this point in the history
…into qpfiffer-Fix_multi_import
  • Loading branch information
i2y committed Dec 21, 2014
2 parents 72117a7 + 6e2174e commit aa4d5d3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion mochi/mochi.py
Original file line number Diff line number Diff line change
Expand Up @@ -2673,7 +2673,8 @@ def translate_from(self, exp):
names = [ast.alias(name=import_sym.name,
asname=None,
lineno=import_sym.lineno,
col_offset=import_sym.col_offset) for import_sym in exp[2:]]
col_offset=import_sym.col_offset) for import_sym_names in exp[2:]
for import_sym in import_sym_names]
return (ast.ImportFrom(module=exp[1].name,
names=names,
level=0,
Expand Down
4 changes: 2 additions & 2 deletions mochi/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,9 +294,9 @@ def tuple_elt(p):
return p[0]


@pg.production('from_expr : FROM names IMPORT NAME')
@pg.production('from_expr : FROM names IMPORT namelist')
def from_expr(p):
return [Symbol('from-import'), p[1], token_to_symbol(p[3])]
return [Symbol('from-import'), p[1], p[3]]


@pg.production('suite : binop_expr') # TODO multi
Expand Down

0 comments on commit aa4d5d3

Please sign in to comment.