diff options
author | 2022-01-28 19:26:03 -0800 | |
---|---|---|
committer | 2022-01-28 19:26:03 -0800 | |
commit | 97d17904d3f6b850e8973b84d6b4ad5e22afb941 (patch) | |
tree | 36324992d636cf889b878e99ecd21747753eca8e /src/json_parser.zig | |
parent | 98af486b89122654f5112926139ab3da464260f4 (diff) | |
download | bun-97d17904d3f6b850e8973b84d6b4ad5e22afb941.tar.gz bun-97d17904d3f6b850e8973b84d6b4ad5e22afb941.tar.zst bun-97d17904d3f6b850e8973b84d6b4ad5e22afb941.zip |
Update AST layout to store capacity for items
We want to be able to push to the list
Diffstat (limited to 'src/json_parser.zig')
-rw-r--r-- | src/json_parser.zig | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/json_parser.zig b/src/json_parser.zig index ed5e42d85..e8fbde12c 100644 --- a/src/json_parser.zig +++ b/src/json_parser.zig @@ -178,7 +178,7 @@ fn JSONLikeParser(opts: js_lexer.JSONOptions) type { is_single_line = false; } try p.lexer.expect(.t_close_bracket); - return p.e(E.Array{ .items = exprs.items }, loc); + return p.e(E.Array{ .items = ExprNodeList.fromList(exprs), .is_single_line = is_single_line }, loc); }, .t_open_brace => { try p.lexer.next(); @@ -245,7 +245,7 @@ fn JSONLikeParser(opts: js_lexer.JSONOptions) type { } try p.lexer.expect(.t_close_brace); return p.e(E.Object{ - .properties = properties.items, + .properties = G.Property.List.fromList(properties), .is_single_line = is_single_line, }, loc); }, @@ -484,7 +484,7 @@ const DotEnvJSONParser = JSONLikeParser(js_lexer.JSONOptions{ var empty_string = E.String{ .utf8 = "" }; const TSConfigParser = JSONLikeParser(js_lexer.JSONOptions{ .allow_comments = true, .is_json = true, .allow_trailing_commas = true }); var empty_object = E.Object{}; -var empty_array = E.Array{ .items = &[_]ExprNodeIndex{} }; +var empty_array = E.Array{}; var empty_string_data = Expr.Data{ .e_string = &empty_string }; var empty_object_data = Expr.Data{ .e_object = &empty_object }; var empty_array_data = Expr.Data{ .e_array = &empty_array }; |