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:
Benjamin Loison 2022-12-10 00:05:07 +01:00
parent 3c811c6128
commit a17b3c6fdd
2 changed files with 2 additions and 0 deletions

View File

@ -14,6 +14,7 @@
("returns", RETURNS);
("var", VAR);
("int", TYP(Ast.TInt));
("real", TYP(Ast.TReal));
("bool", TYP(Ast.TBool));
("<=", CMP_le);
(">=", CMP_ge);

View File

@ -118,6 +118,7 @@
%token COLON
%token BOOL
%token INT
%token REAL
%token LET
%token TEL
%token NODE