mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 20:11:17 +00:00
Allow var in lambdas in macros. Allow ad hoc generic declaration in lambdas and type definitions. Fix deprecation flag.
This commit is contained in:
@@ -466,7 +466,7 @@ Expr *parse_vasplat(ParseContext *c)
|
||||
RANGE_EXTEND_PREV(expr);
|
||||
END:
|
||||
// TODO remove in 0.7
|
||||
if (lparen && !compiler.context.silence_deprecation)
|
||||
if (lparen && !compiler.build.silence_deprecation)
|
||||
{
|
||||
if (expr->vasplat_expr.end || expr->vasplat_expr.start)
|
||||
{
|
||||
@@ -517,7 +517,7 @@ bool parse_arg_list(ParseContext *c, Expr ***result, TokenType param_end, bool v
|
||||
CONSUME_OR_RET(TOKEN_EQ, false);
|
||||
ASSIGN_EXPR_OR_RET(expr->named_argument_expr.value, parse_expr(c), false);
|
||||
RANGE_EXTEND_PREV(expr);
|
||||
if (!compiler.context.silence_deprecation)
|
||||
if (!compiler.build.silence_deprecation)
|
||||
{
|
||||
SEMA_NOTE(expr, "Named arguments using the '.foo = expr' style are deprecated, please use 'foo: expr' instead.");
|
||||
}
|
||||
@@ -1297,7 +1297,7 @@ static Expr *parse_ct_arg(ParseContext *c, Expr *left)
|
||||
ASSIGN_EXPRID_OR_RET(expr->ct_arg_expr.arg, parse_expr(c), poisoned_expr);
|
||||
CONSUME_OR_RET(is_lparen ? TOKEN_RPAREN : TOKEN_RBRACKET, poisoned_expr);
|
||||
// TODO remove in 0.7
|
||||
if (is_lparen && !compiler.context.silence_deprecation)
|
||||
if (is_lparen && !compiler.build.silence_deprecation)
|
||||
{
|
||||
SEMA_NOTE(expr, "'%s(...)' is deprecated, use '%s[...]' instead.",
|
||||
token_type_to_string(type), token_type_to_string(type));
|
||||
|
||||
Reference in New Issue
Block a user