summaryrefslogtreecommitdiffstats
path: root/dimension/common.rules
diff options
context:
space:
mode:
Diffstat (limited to 'dimension/common.rules')
-rw-r--r--dimension/common.rules8
1 files changed, 8 insertions, 0 deletions
diff --git a/dimension/common.rules b/dimension/common.rules
index d77ab1a..157edca 100644
--- a/dimension/common.rules
+++ b/dimension/common.rules
@@ -477,6 +477,14 @@ FLOAT: ARITH_EXPR {
}
;
+INT: FLOAT {
+ $$ = $1;
+ if ($$.type == DMNSN_AST_FLOAT) {
+ dmnsn_diagnostic(@$, "WARNING: float rounded to integer");
+ }
+ }
+;
+
FLOAT_LITERAL: "integer" {
$$ = dmnsn_new_astnode(DMNSN_AST_INTEGER, @$);
$$.ptr = dmnsn_malloc(sizeof(long));