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:
parent
3c811c6128
commit
a17b3c6fdd
@ -14,6 +14,7 @@
|
|||||||
("returns", RETURNS);
|
("returns", RETURNS);
|
||||||
("var", VAR);
|
("var", VAR);
|
||||||
("int", TYP(Ast.TInt));
|
("int", TYP(Ast.TInt));
|
||||||
|
("real", TYP(Ast.TReal));
|
||||||
("bool", TYP(Ast.TBool));
|
("bool", TYP(Ast.TBool));
|
||||||
("<=", CMP_le);
|
("<=", CMP_le);
|
||||||
(">=", CMP_ge);
|
(">=", CMP_ge);
|
||||||
|
@ -118,6 +118,7 @@
|
|||||||
%token COLON
|
%token COLON
|
||||||
%token BOOL
|
%token BOOL
|
||||||
%token INT
|
%token INT
|
||||||
|
%token REAL
|
||||||
%token LET
|
%token LET
|
||||||
%token TEL
|
%token TEL
|
||||||
%token NODE
|
%token NODE
|
||||||
|
Loading…
Reference in New Issue
Block a user