diff --git a/vyper/ast/grammar.lark b/vyper/ast/grammar.lark index 649db33471..dbcf80719b 100644 --- a/vyper/ast/grammar.lark +++ b/vyper/ast/grammar.lark @@ -80,8 +80,8 @@ enum_body: _NEWLINE _INDENT (enum_member _NEWLINE)+ _DEDENT enum_def: _ENUM_DECL NAME ":" enum_body // Types -array_def: (NAME | array_def | dyn_array_def) "[" (DEC_NUMBER | NAME) "]" -dyn_array_def: "DynArray" "[" (NAME | array_def | dyn_array_def) "," (DEC_NUMBER | NAME) "]" +array_def: (NAME | array_def | dyn_array_def) "[" _expr "]" +dyn_array_def: "DynArray" "[" (NAME | array_def | dyn_array_def) "," _expr "]" tuple_def: "(" ( NAME | array_def | dyn_array_def | tuple_def ) ( "," ( NAME | array_def | dyn_array_def | tuple_def ) )* [","] ")" // NOTE: Map takes a basic type and maps to another type (can be non-basic, including maps) _MAP: "HashMap"