Schlag ist der ast.ml, alle ast.mli in gleicheFehler in OCaml Datenstrukturtyp
type ident = string
type beantype =
| Bool
| Int
| { fields : field list }
| TId of ident
and field =
(ident * beantype)
in parser.mly, verwende ich die Felder als Liste
typespec :
| BOOL { Bool }
| INT { Int }
| LBRAK fields RBRAK { { fields = List.rev $2 } }
| IDENT { TId $1 }
fields :
| fields COMMA field { $3 :: $1 }
field :
| IDENT COLON typespec { ($1, $3) }
es jedoch ist ein Fehler wie folgt:
ocamlc -c bean_ast.mli
File "bean_ast.mli", line 6, characters 3-4:
Error: Syntax error
make: *** [bean_ast.cmi] Error 2
Warum gibt es einen Fehler?