Skip to content

Instantly share code, notes, and snippets.

@cprieto
Last active September 15, 2018 09:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cprieto/8dc97c2eea65b30964a5c1bf06e4064c to your computer and use it in GitHub Desktop.
Save cprieto/8dc97c2eea65b30964a5c1bf06e4064c to your computer and use it in GitHub Desktop.
It works in Kotlin
package com.cprieto.samples
class ShortToStringConverterListener: ArrayInitBaseListener() {
private val builder = StringBuilder()
override fun enterInit(ctx: ArrayInitParser.InitContext?) {
builder.append("{")
}
override fun toString(): String {
return builder.toString()
}
}
package com.cprieto.samples
class ShortToStringConverterListener: ArrayInitBaseListener() {
private val builder = StringBuilder()
override fun enterInit(ctx: ArrayInitParser.InitContext?) {
builder.append("{")
}
override fun toString() = builder.toString()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment