differential-datalog
differential-datalog copied to clipboard
Bad parser error message
The following code:
relation X(a: Option<string>, b: Set<string>, c: string)
relation Y(d: string)
for (X(a, b, c)) {
Some{var d} = match (a) {
Some{_} -> set_nth(b, 0),
None -> Some{c},
} in
Y(d)
}
provokes the following error, citing the { in Some{var d}:
ddlog: Failed to parse input file: "playpen3.dl" (line 5, column 9):
unexpected "{"
expecting letter or digit, "_", ".", "[", "(", ";" or "}"
But the actual problem is the trailing , in Some{c}, two lines later, and it's very difficult to figure out that's the real problem when it's much farther along than the cited line. I guess the parser must use arbitrary lookahead....
Related to issue #554