dumptruckman
02/07/2019, 4:48 PM=
in kotlindiesieben07
02/07/2019, 4:48 PMdumptruckman
02/07/2019, 4:48 PMdiesieben07
02/07/2019, 4:49 PM@set:JvmSynthetic
hides the generated setter from java.dumptruckman
02/07/2019, 4:49 PMdumptruckman
02/07/2019, 4:53 PM=
syntax, basicallyRuckus
02/07/2019, 4:55 PMdumptruckman
02/07/2019, 4:55 PMdiesieben07
02/07/2019, 4:55 PMfoo
is an error, unused getter"dumptruckman
02/07/2019, 4:59 PMclass EmailBuilder {
val recipients: MutableList<String> = mutableListOf()
@set:JvmName("to")
var to: String
@JvmSynthetic
@Deprecated(message = "unused getter", level = DeprecationLevel.HIDDEN)
get() = throw RuntimeException()
set(value) {
recipients.clear();
recipients.addAll(value.split(";"))
}
}
dumptruckman
02/07/2019, 5:00 PMthis
for chaining loldiesieben07
02/07/2019, 5:01 PMthis
.dumptruckman
02/07/2019, 5:02 PMdumptruckman
02/07/2019, 5:02 PMdumptruckman
02/07/2019, 5:02 PMdumptruckman
02/07/2019, 5:03 PMdumptruckman
02/07/2019, 5:04 PM<http://email.to|email.to>()
just seems like a weird thing to write in javaSmallville7123
03/30/2019, 1:22 AMval lex = lexer(fileToByteBuffer(File(src)), tokens)
println("cloning")
val la = lexer(lex.f.duplicate(), lex.delimiters)
println("clone made")
var line = lex.lex()
var laline = la.lex()
println("line is '$line'")
println("laline is '$laline'")
cloning
clone made
line is '
'
laline is '
'
Smallville7123
03/30/2019, 4:16 AMclass a {
fun b() : Int {
return 9
}
inner class c {
fun b() : Int {
return b()+4
}
}
}
a().c().b() will return a().b() + 4streetsofboston
03/30/2019, 4:29 AMfun b(): Int {
return this@a.b() + 4
}
Smallville7123
03/30/2019, 11:28 PMLine 12: val tokens = tokenizeKotlinCode("val x = foo() + 10;")
^ Unresolved reference: tokenizeKotlinCode
repositories {
flatDir {
dirs "../kpp/libs"
}
}
dependencies {
implementation name: 'kotlin-grammar-tools-0.1'
}
as i am trying to obtain an AST of kotlin code for analysis rather than trying to make my own kotlin lexer/parser that probably does not detect all code casesSmallville7123
03/31/2019, 2:35 AMSmallville7123
03/31/2019, 2:45 AMval space = TS.isSequenceOneOrMany(" ")
val newline = TS.isSequenceOnce("\n")
val directive = TS.isSequenceOnce("#")
val define = TS.isSequenceOnce("define")
val comment = TS.isSequenceOnce("//")
val emptyparens = TS.isSequenceOnce("()")
val TSA = TS.clone()
// space, newline, directive, define, comment, emptyparens become available in TSA
Smallville7123
03/31/2019, 3:11 AMSmallville7123
03/31/2019, 3:12 AMSmallville7123
03/31/2019, 3:44 AMclass invokers() {
inner class information {
var name : String = ""
var paramater : String = ""
}
val info : MutableList<information> = mutableListOf()
val function : (String) -> Unit = { v : String -> println("invoked with paramater 'v' with value '$v'") }
fun add(name : String, paramater : String) {
this.info.add(information())
<http://this.info[this.info.size-1].name|this.info[this.info.size-1].name> = name
<http://this.info[this.info.size-1].paramater|this.info[this.info.size-1].paramater> = paramater
}
fun print() {
this.info.forEach({println("it.name = ${it.name}")})
this.info.forEach({println("it.paramater = ${it.paramater}")})
}
fun call(name : String) {
for (information in info) {
if (information.name.equals(name)) {
println("name exists: $name")
function(information.paramater)
}
}
}
}
fun t(){
val functionList = invokers()
functionList.add("h", "HAI")
functionList.print()
functionList.call("h")
}
it.name = h
it.paramater = HAI
name exists: h
invoked with paramater 'v' with value 'HAI'
Smallville7123
03/31/2019, 3:46 AMSmallville7123
03/31/2019, 3:50 AMSmallville7123
03/31/2019, 3:50 AMSmallville7123
03/31/2019, 3:52 AM