From 6f6ff0e39eb6d771ef5336394079646ccdc18bd5 Mon Sep 17 00:00:00 2001 From: Sébastien Dailly Date: Tue, 7 Nov 2017 15:44:40 +0100 Subject: Use Zarith instead of Num for computing numbers --- odf/odf_ExpressionParser.mly | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'odf/odf_ExpressionParser.mly') diff --git a/odf/odf_ExpressionParser.mly b/odf/odf_ExpressionParser.mly index 190e6f1..6b571a9 100755 --- a/odf/odf_ExpressionParser.mly +++ b/odf/odf_ExpressionParser.mly @@ -4,12 +4,12 @@ let u = UTF8.from_utf8string - let extractColumnNameFromNum (fixed, (str, value)) = (fixed, value) + let extractColumnNameFromNum (fixed, str) = (fixed, int_of_string str) %} -%token REAL -%token NUM +%token REAL +%token NUM %token STR %token LETTERS @@ -43,9 +43,7 @@ value: | LETTERS COLON EQ expr EOF {$4} expr: - | num {Value (number ( - DataType.Num.of_num @@ snd $1 - ))} + | num {Value (number ($1))} | MINUS expr {Call (F.sub, [$2])} | PLUS expr {Call (F.add, [$2])} @@ -85,8 +83,8 @@ fixed(X): | X {false, $1} num: - | REAL {$1} - | NUM {$1} + | REAL {DataType.Num.of_float @@ float_of_string $1} + | NUM {DataType.Num.of_int @@ int_of_string $1} ident: | IDENT { $1 } @@ -94,4 +92,4 @@ ident: text: | LETTERS { $1 } - | NUM { fst $1 } + | NUM { $1 } -- cgit v1.2.3