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.

Comments between statement don't parser

See original GitHub issue

Input:

if (true) {
    $a = 1;
}

// Don't parsed :(
if (false) {
    $a = 2;
}

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:10 (7 by maintainers)

github_iconTop GitHub Comments

3reactions
ichiriaccommented, Mar 2, 2018

@nevadascout, @rasmusbe, can you please give me your point of view on this major change on the next release ?

In the next release, I can provide a structure more close to babylon parser with an leadingComments array :

image

2reactions
alexander-akaitcommented, Mar 2, 2018

@ichiriac we implement logic as js prettier based on babylon. He have also comments (https://astexplorer.net/#/gist/3202ee068c3e3f3645588357d931216f/14a080841262821fa733893886d8fc99ac711795) and it is good 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to ignore single line comments in a parser-combinator
I am extending RegexParsers for my parser and ignoring whitespace (the default way), so I am losing the new line characters anyway. I...
Read more >
mypy cannot parse type comment of "with" and "for" statement ...
https://www.python.org/dev/peps/pep-0484/#type-comments I tried to check type comments, but it cannot parse "with" and "for" statement as below.
Read more >
How are comments usually parsed?
Python comes to mind and it has a very simple answer: no block comments. You start a comment with # and then the...
Read more >
Parsing XML while ignoring comments/mixed context/PI
Let's say I have three boolean variables representing whether or not to ignore comments, mixed context and PIs in an XML document
Read more >
Parse Predictable Patterns Using an Anchor | Sumo Logic Docs
This topic describes how to use the parse anchor UI tool to add parsing to a query and provides details on the structure...
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