You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Expressions are evaluated parsed values from the file and used to manage conditionals, loops, asserts, and more. Expressions are evaluated as they are seen within the definition file. Expressions are evaluated dynamically during file parsing and have access to already parsed fields and variables.
Expressions will be similar to C++ and will follow their operator precedence (though many will not be applicable). Values will have a dynamic type; values must be of a compatible type, coercion will not be performed.
Numbers are considered compatible with each other and evaluated by value. This means that signed and unsigned numbers interact according to their value and not their native types. Numbers are expanded to larger types if needed, but cannot be larger than native types (i.e. long double, int64_t, or uint64_t).
This only covers numeric expressions; this doesn't cover strings, object, or array access.
type Example {
int32 a;
int32 b;
assert a + b == 0;
assert a > 0;
}
The text was updated successfully, but these errors were encountered:
Although coercion doesn't happen within an expression, there is still a concept of "truthiness" that is used for conditionals and boolean operators. The following values are considered false, all other values are true:
null (usually from a field that was on another if branch)
Expressions are evaluated parsed values from the file and used to manage conditionals, loops, asserts, and more. Expressions are evaluated as they are seen within the definition file. Expressions are evaluated dynamically during file parsing and have access to already parsed fields and variables.
Expressions will be similar to C++ and will follow their operator precedence (though many will not be applicable). Values will have a dynamic type; values must be of a compatible type, coercion will not be performed.
Numbers are considered compatible with each other and evaluated by value. This means that signed and unsigned numbers interact according to their value and not their native types. Numbers are expanded to larger types if needed, but cannot be larger than native types (i.e.
long double
,int64_t
, oruint64_t
).This only covers numeric expressions; this doesn't cover strings, object, or array access.
The text was updated successfully, but these errors were encountered: