diff options
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 } |