question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Line number with comments and propagate_positions, lalr

See original GitHub issue

When 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:closed
  • Created 5 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
erezshcommented, Aug 22, 2018

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#L31

The 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.

0reactions
erezshcommented, Sep 20, 2018
Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found