dimitriv / Ziria

A domain-specific-language and compiler for low-level bitstream processing.
92 stars 18 forks source link

Cryptic parser error messages. #62

Closed valderman closed 9 years ago

valderman commented 9 years ago

The parse errors are a bit more low-level than ideal. For instance, this code:

fun comp test() {
  x <- take;
  emit (x+1)
}

read[int] >>> standalone (repeat test()) >>> write[int]

produces a rather cryptic error message:

"test.zir" (line 6, column 1):
unexpected 'r'
expecting "#", ";", "var", "struct", "let", "fun" or end of input
ExitFailure 1

Instead of unexpected 'r', it would be nice to have the compiler complain about unexpected 'read' or something.

edsko commented 9 years ago

The parser now returns

"./issue062.zir" (line 6, column 1):
unexpected keyword "read"

(in branch feature/separate-lexer for now.)