TokenKind.Error and toString


in the parseType method in line 432 assigns TokenKind.ERROR to kind and then in line 437 calls createBaseType with kind as parameter. What is the intended behavior of toString here? Do we print Type_<error>?


Just print <error> for any kind of parsing error (type, statement, expression).

What about a pointer to such an error type? Does it then output <error> or Pointer[<error>]? This generalizes to all the other nodes of the AST.

Yes, in that case, you would have a pointer type to an error type.