[Genie] Dedent should not be highlighted as a keyword in error messages
@astavale
Submitted by Al Thomas Link to original bug (#748468)
Description
Created attachment 302349 Patch to change error text for indent and dedent tokens
These are two simple patches to clean up some small details of error messages given by the Genie parser. The aim is to make Genie give more meaningful error messages and appear more polished.
With the following Genie code:
[indent=2] init print "test" print "missing indent"
the error message "syntax error, expected declaration but got print' with previous
dedent'" is produced.
It is the convention that keywords and operators are quoted. Dedent is not a keyword or operator so should not be quoted. Other whitespace tokens such as end of file and end of line are not surrounded by quote marks.
The first patch changes "dedent'" to read "end of block (dedent)". Also indent is changed from "
tab indent'" to "block (indent)". Indentation is strictly speaking not just tabs. The patch also re-words the syntax error to remove the word "previous". For the error above it reads "syntax error, expected a declaration after end of block (dedent), but got `print'"
The second patch changes the back tick and single quote for keywords and operators to a single quote at the beginning and end. This is purely cosmetic, but see http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html for a rationale.
Patch 302349, "Patch to change error text for indent and dedent tokens":
0001-Genie-Amend-text-of-indent-and-dedent-for-error-mess.patch
Version: 0.28.x