Skip to content

Commit 72a4611

Browse files
Recognize dictionary unpacking operation
1 parent 4900bd9 commit 72a4611

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

src/lpython/parser/parser.yy

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -782,6 +782,7 @@ expr_list
782782
dict
783783
: expr ":" expr { $$ = DICT_EXPR_01($1, $3, @$); }
784784
| expr ":" type_comment expr { $$ = DICT_EXPR_02($1, $3, $4, @$); }
785+
| "**" expr { $$ = DICT_EXPR_01(NONE(@$), $2, @$); }
785786
;
786787

787788
dict_list

src/runtime/lpython_parser.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ def generic_visit(self, node):
7878
else:
7979
if type(item) == str:
8080
new_list.append(item)
81+
elif item is None:
82+
new_list.append(self.visit(python_ast.ConstantNone()))
8183
d[field] = new_list
8284
elif field in ["vararg", "kwarg"]:
8385
if value is None:

0 commit comments

Comments
 (0)