libSyntax: use node choice for dictionary expression.

This allows us to support empty dictionary literal.
This commit is contained in:
Xi Ge
2017-12-20 17:35:41 -08:00
parent 21fc2fb92b
commit b4da5a3c31
5 changed files with 15 additions and 1 deletions

View File

@@ -152,7 +152,11 @@ EXPR_NODES = [
Node('DictionaryExpr', kind='Expr',
children=[
Child('LeftSquare', kind='LeftSquareToken'),
Child('Elements', kind='DictionaryElementList'),
Child('Content', kind='Syntax',
node_choices=[
Child('Colon', kind='ColonToken'),
Child('Elements', kind='DictionaryElementList'),
]),
Child('RightSquare', kind='RightSquareToken'),
]),