Support underscores in identifier without escaping
See original GitHub issueI’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:
- Created 5 years ago
- Comments:8 (6 by maintainers)
Top 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 >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
Nice one man, thanks.
Released