From a1693c01847f9018ba4c4d9ec455157e34ebd6b3 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Tue, 23 Feb 2021 14:45:15 +0000 Subject: Deprecate `inline for` in favour of `#unroll for` --- src/parser.cpp | 26 +++----------------------- 1 file changed, 3 insertions(+), 23 deletions(-) (limited to 'src/parser.cpp') diff --git a/src/parser.cpp b/src/parser.cpp index c1160f8b1..7277f6128 100644 --- a/src/parser.cpp +++ b/src/parser.cpp @@ -2066,29 +2066,6 @@ Ast *parse_operand(AstFile *f, bool lhs) { syntax_error(token, "Expected a least 1 argument in a procedure group"); } - return ast_proc_group(f, token, open, close, args); - } else if (f->curr_token.kind == Token_OpenBracket) { // ProcGroup - Token open = expect_token(f, Token_OpenBracket); - warning(open, "Procedure groups using [] are now deprecated, please use {} instead"); - - auto args = array_make(heap_allocator()); - - while (f->curr_token.kind != Token_CloseBracket && - f->curr_token.kind != Token_EOF) { - Ast *elem = parse_expr(f, false); - array_add(&args, elem); - - if (!allow_token(f, Token_Comma)) { - break; - } - } - - Token close = expect_token(f, Token_CloseBracket); - - if (args.count == 0) { - syntax_error(token, "Expected a least 1 argument in a procedure group"); - } - return ast_proc_group(f, token, open, close, args); } @@ -4297,6 +4274,9 @@ Ast *parse_attribute(AstFile *f, Token token, TokenKind open_kind, TokenKind clo Ast *parse_unrolled_for_loop(AstFile *f, Token inline_token) { + if (inline_token.kind == Token_inline) { + syntax_warning(inline_token, "'inline for' is deprecated in favour of `#unroll for'"); + } Token for_token = expect_token(f, Token_for); Ast *val0 = nullptr; Ast *val1 = nullptr; -- cgit v1.2.3