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.

Support underscores in identifier without escaping

See original GitHub issue

I’ve come across the following issue when using Writer:

import kastree.ast.Writer
import kastree.ast.psi.Parser


fun main(args: Array<String>) {
    val source = """
        const val c = FOO_BAR
    """

    val file = Parser.parseFile(source)
    println(Writer.write(file))
}

This program will output the following:

const val c = `FOO_BAR`

For c I’d expect (without the back-ticks):

const val c = FOO_BAR

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
TAGCcommented, Jan 4, 2019

Nice one man, thanks.

1reaction
cretzcommented, Dec 21, 2018

Released

Read more comments on GitHub >

github_iconTop Results From Across the Web

Make a command accept underscores without having to ...
I am trying to make my own command to display Python code, but Python identifiers frequently have underscores, so I would like to...
Read more >
Identifiers starting with underscores don't immediately tab- ...
One way to alleviate the whole issue is to have some fixed (non-underscore) prefix to avoid generating an initial underscore that would be...
Read more >
Escaping underscore for Java interoperability in Scala
No problem, right? Just escape it: scala> StupidUnderscore.`_` res0: String = Please give me a real name! And this has always ...
Read more >
C Identifiers
By convention, Microsoft uses an underscore and an uppercase letter to begin macro names and double underscores for Microsoft-specific keyword ...
Read more >
and quotes within SQL LIKE queries
For an example using underscores, this query wants to display all values that contain the string "_to_" (e.g. hard_to_get within a query). Here,...
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