better elvis + throw
+added run {}
This commit is contained in:
1 parent
835333dfad
commit
95c1da60ed
4 files changed
+42
No files matched your search
@@ -376,6 +376,11 @@ class Compiler(
|
||||
|
||||
}
|
||||
|
||||
"throw" -> {
|
||||
val s = parseThrowStatement()
|
||||
operand = Accessor { s.execute(it).asReadonly }
|
||||
}
|
||||
|
||||
else -> operand?.let { left ->
|
||||
// selector: <lvalue>, '.' , <id>
|
||||
// we replace operand with selector code, that
|
||||
|
||||
@@ -315,6 +315,9 @@ open class Obj {
|
||||
args.firstAndOnly().callOn(copy(Arguments(thisObj)))
|
||||
thisObj
|
||||
}
|
||||
addFn("run") {
|
||||
args.firstAndOnly().callOn(this)
|
||||
}
|
||||
addFn("getAt") {
|
||||
requireExactCount(1)
|
||||
thisObj.getAt(this, requiredArg<Obj>(0))
|
||||
|
||||
Reference in new issue
Block a user