mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
- @is_const is deprecated in favour of directly using $defined.
- `@is_lvalue(#value)` is deprecated in favour of directly using `$defined`.
This commit is contained in:
@@ -69,7 +69,7 @@ alias VoidFn = fn void();
|
||||
macro scope.
|
||||
|
||||
@param #variable : `the variable to store and restore`
|
||||
@require values::@is_lvalue(#variable)
|
||||
@require $defined(#variable = #variable) : `Expected an actual variable`
|
||||
*>
|
||||
macro void @scope(#variable; @body) @builtin
|
||||
{
|
||||
|
||||
@@ -16,12 +16,11 @@ macro bool @is_promotable_to_floatlike(#value) @const => types::is_promotable_to
|
||||
macro bool @is_promotable_to_float(#value) @const => types::is_promotable_to_float($typeof(#value));
|
||||
macro bool @is_vector(#value) @const => types::is_vector($typeof(#value));
|
||||
macro bool @is_same_vector_type(#value1, #value2) @const => types::is_same_vector_type($typeof(#value1), $typeof(#value2));
|
||||
macro bool @assign_to(#value1, #value2) @const @deprecated("use '$define(#value1 = #value2)'") => @assignable_to(#value1, $typeof(#value2));
|
||||
macro bool @is_lvalue(#value) => $defined(#value = #value);
|
||||
macro bool @is_const(#foo) @const @builtin
|
||||
macro bool @assign_to(#value1, #value2) @const @deprecated("use '$defined(#value1 = #value2)'") => @assignable_to(#value1, $typeof(#value2));
|
||||
macro bool @is_lvalue(#value) @deprecated("use '$defined(#value = #value)'")=> $defined(#value = #value);
|
||||
macro bool @is_const(#foo) @const @builtin @deprecated("use '$defined(var $v = expr)'")
|
||||
{
|
||||
var $v;
|
||||
return $defined($v = #foo);
|
||||
return $defined(var $v = #foo);
|
||||
}
|
||||
|
||||
macro promote_int(x)
|
||||
|
||||
@@ -28,6 +28,8 @@
|
||||
- If the `os-arch` linked library doesn't exist, try with `os` for c3l libs.
|
||||
- A file with an inferred module may not contain additional other modules.
|
||||
- Update error message for missing body after if/for/etc #2289.
|
||||
- `@is_const` is deprecated in favour of directly using `$defined`.
|
||||
- `@is_lvalue(#value)` is deprecated in favour of directly using `$defined`.
|
||||
|
||||
### Fixes
|
||||
- List.remove_at would incorrectly trigger ASAN.
|
||||
@@ -193,7 +195,7 @@
|
||||
- Added Ed25519.
|
||||
- Added string::bformat.
|
||||
- Virtual memory library.
|
||||
- New virtual emory arena allocator.
|
||||
- New virtual memory arena allocator.
|
||||
- Added `WString.len`.
|
||||
- Added `@addr` macro.
|
||||
- Add `ConditionVariable.wait_until` and `ConditionVariable.wait_for`
|
||||
|
||||
@@ -1210,7 +1210,6 @@ static Expr *parse_ct_is_const(ParseContext *c, Expr *left, SourceSpan lhs_start
|
||||
ASSIGN_EXPR_OR_RET(checks->inner_expr, parse_expr(c), poisoned_expr);
|
||||
CONSUME_OR_RET(TOKEN_RPAREN, poisoned_expr);
|
||||
RANGE_EXTEND_PREV(checks);
|
||||
SEMA_DEPRECATED(checks, "The $is_const macro is deprecated. Use @is_const(...) instead.");
|
||||
return checks;
|
||||
}
|
||||
|
||||
|
||||
@@ -10268,6 +10268,7 @@ ERROR:
|
||||
|
||||
static inline bool sema_expr_analyse_ct_is_const(SemaContext *context, Expr *expr)
|
||||
{
|
||||
SEMA_DEPRECATED(expr, "$is_const is deprecated, use '$defined(var $e = expr)' instead.");
|
||||
ASSERT_SPAN(expr, expr->resolve_status == RESOLVE_RUNNING);
|
||||
Expr *inner = expr->inner_expr;
|
||||
if (!sema_analyse_expr(context, inner)) return false;
|
||||
|
||||
@@ -18,7 +18,7 @@ fn void main()
|
||||
}
|
||||
|
||||
<*
|
||||
@require values::@is_lvalue(#s)
|
||||
@require $defined(#s = #s)
|
||||
*>
|
||||
macro int @read_int(String #s)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user