diff options
author | Sébastien Dailly <sebastien@chimrod.com> | 2017-11-07 15:44:40 +0100 |
---|---|---|
committer | Sébastien Dailly <sebastien@chimrod.com> | 2017-11-08 14:05:56 +0100 |
commit | 6f6ff0e39eb6d771ef5336394079646ccdc18bd5 (patch) | |
tree | f06907f88972e8e87c5924de8eb225362a4a775b /odf/odf_ExpressionParser.mly | |
parent | 50c16c8fc79d349f9db9d7975d1ae4e57050b648 (diff) |
Use Zarith instead of Num for computing numbers
Diffstat (limited to 'odf/odf_ExpressionParser.mly')
-rwxr-xr-x | odf/odf_ExpressionParser.mly | 16 |
1 files changed, 7 insertions, 9 deletions
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 <string * Num.num> REAL -%token <string * Num.num> NUM +%token <string> REAL +%token <string> NUM %token <string> STR %token <string> 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 } |