commit e8edbc22bf9dffe9547d03b86582a4e30e5ff0ed
parent 1fceaa3dc4dcdc5c6c5e92154e1d2b4def23d874
Author: Eyal Sawady <ecs@d2evs.net>
Date: Wed, 30 Dec 2020 15:22:56 -0500
parse: implement unbounded arrays
Diffstat:
1 file changed, 6 insertions(+), 0 deletions(-)
diff --git a/src/parse.c b/src/parse.c
@@ -563,6 +563,12 @@ parse_type(struct lexer *lexer)
type->storage = TYPE_STORAGE_SLICE;
type->slice.members = parse_type(lexer);
break;
+ case T_TIMES:
+ type->storage = TYPE_STORAGE_ARRAY;
+ type->array.length = NULL;
+ want(lexer, T_RBRACKET, NULL);
+ type->array.members = parse_type(lexer);
+ break;
default:
type->storage = TYPE_STORAGE_ARRAY;
unlex(lexer, &tok);