Better token formatting available?
See original GitHub issueWhat is your question?
I have a Lark grammar that has the following production:
!inneroperator : "has" | "=" | "<" | ">" | "<=" | ">=" | "!="
(The whole grammar should parse statements like foo < 3
, pretty simple stuff actually)
When I give parse
something invalid, such as foo 3
, the error message reads:
No terminal defined for '3' at line 1 col 8
foo 3
Expecting: {'EQUAL', 'HAS', 'MORETHAN', '__ANON_1', '__ANON_0', '__ANON_2', 'LESSTHAN'}
This is already quite readable, and I’m impressed. However, I don’t know what these ANON
things are, and also I would ideally output =
instead of EQUAL
. Is that possible?
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Design Tokens Format Module
This document describes the technical specification for a file format to exchange design tokens between different tools.
Read more >The Pyramid Design Token Structure: The Best Way to Format ...
The Pyramid Design Token Structure layers and abstracts variables and design tokens so that you can keep foundational items (think, more variables) separately ......
Read more >Behind GitHub's new authentication token formats
Additionally, we want to make these prefixes clearly distinguishable within the token to improve readability. Thus, we are adding a ...
Read more >Custom Token Formula Reference - AWS
Specifier. Represents ; 0. Digit placeholder. If the value being formatted has a digit in the position where '0' appears in the format...
Read more >Format a Token - Cherwell Help - Ivanti
Some Tokens can be reformatted using Modifiers and Formats that change the visual format or calculated value of the Token in a One-Step...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
There has already been some talk about improving the error messages by providing the expected values, so I will keep that in mind as a possible task.
Another easier fix we could do, is include default names for
>=
and<=
and!=
, as they are common enough to the landscape.When a terminal doesn’t have a name (i.e. defined as
"foo"
), and Lark can’t guess the name, it calls it ANON.