Line number with comments and propagate_positions, lalr
See original GitHub issueWhen propagate_positions=True
, the result tree contains line and column number. However, they count only ‘actual statements’, ignoring things like comments and blank lines specified via %ignore
.
I would like to pinpoint the location to the end user, for this to happen I need the line number to include those ignored statements, not just the actual ones.
With ‘lalr’ parser, is this possible in the current implementation?
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Bison 3.8.1 - GNU.org
Bison is a general-purpose parser generator that converts an annotated context-free grammar into a deterministic LR or generalized LR (GLR) parser employing ...
Read more >HCA Healthcare Careers
Unlock possibilities. We eagerly embrace the challenges of our profession and welcome new opportunities to grow and make a positive impact.
Read more >Build a Lake House Architecture on AWS | AWS Big Data Blog
The Lake House Architecture enables you to ingest and analyze data from a variety of sources. Many of these sources such as line...
Read more >SAT Practice Test #6 Answer Explanations
In the context of not doing a job well, this means Nawab was ... The main purpose of Nawab's comments in lines 43-52...
Read more >Compass Group Careers: Home
View our current positions ... Jobs Filled Last Year ... Your career path could be a straight line with each successive position leading...
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
If I understand you correctly, you want a way to access the ignored tokens?
That is possible using
lexer_callbacks
. Here’s an example of it in use: https://github.com/geographika/mappyfile/blob/master/mappyfile/parser.py#L31The ignored tokens will have the correct line and column. Matching these tokens to the correct spot in the tree is possible, but isn’t a trivial effort.
Add docs under https://lark-parser.readthedocs.io/en/latest/recipes/