aboutsummaryrefslogtreecommitdiff
path: root/src/parse
diff options
context:
space:
mode:
Diffstat (limited to 'src/parse')
-rw-r--r--src/parse/numbers.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/parse/numbers.c b/src/parse/numbers.c
index 5aa5c287..b992b133 100644
--- a/src/parse/numbers.c
+++ b/src/parse/numbers.c
@@ -100,5 +100,9 @@ ast_t *parse_num(parse_ctx_t *ctx, const char *pos) {
if (!Real$is_zero(real)) real = Real$times(Real$divided_by(real, Real$from_float64(360.)), Real$tau);
}
+ if (Real$tag(real) == REAL_TAG_SYMBOLIC && REAL_SYMBOLIC(real)->op == SYM_INVALID) {
+ parser_err(ctx, start, pos, "Failed to convert this to a real number");
+ }
+
return NewAST(ctx->file, start, pos, Number, .n = real);
}