Make real type works
Otherwise for the following code:
```
node test (i: real) returns (o: real);
let
o = 0.0;
tel
```
was experiencing:
```
Fatal error: exception Stdlib.Parsing.Parse_error
Raised at Stdlib__Parsing.yyparse.loop in file "parsing.ml", line 139, characters 8-25
Called from Stdlib__Parsing.yyparse in file "parsing.ml", line 165, characters 4-28
Re-raised at Stdlib__Parsing.yyparse in file "parsing.ml", line 184, characters 8-17
Called from Parser.main in file "parser.ml" (inlined), line 1110, characters 4-44
Called from Main in file "main.ml", line 70, characters 16-68
```
Note that `%token REAL` doesn't help to solve this error, but it doesn't seem to be any reason for not having it.
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
("returns", RETURNS);
|
||||
("var", VAR);
|
||||
("int", TYP(Ast.TInt));
|
||||
("real", TYP(Ast.TReal));
|
||||
("bool", TYP(Ast.TBool));
|
||||
("<=", CMP_le);
|
||||
(">=", CMP_ge);
|
||||
|
||||
@@ -118,6 +118,7 @@
|
||||
%token COLON
|
||||
%token BOOL
|
||||
%token INT
|
||||
%token REAL
|
||||
%token LET
|
||||
%token TEL
|
||||
%token NODE
|
||||
|
||||
Reference in New Issue
Block a user