working CLI tool, versioning support, etc
This commit is contained in:
1 parent
7b76b7d80f
commit
953e0e696b
17 files changed
+234
-46
No files matched your search
@@ -21,7 +21,6 @@ class Script(
|
||||
companion object {
|
||||
val defaultContext: Context = Context().apply {
|
||||
addFn("println") {
|
||||
print("yn: ")
|
||||
for ((i, a) in args.withIndex()) {
|
||||
if (i > 0) print(' ' + a.asStr.value)
|
||||
else print(a.asStr.value)
|
||||
|
||||
@@ -5,6 +5,7 @@ package net.sergeych.lyng
|
||||
open class ScriptError(val pos: Pos, val errorMessage: String,cause: Throwable?=null) : Exception(
|
||||
"""
|
||||
$pos: Error: $errorMessage
|
||||
|
||||
${pos.currentLine}
|
||||
${"-".repeat(pos.column)}^
|
||||
""".trimIndent(),
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
package net.sergeych.lyng
|
||||
|
||||
import net.sergeych.lyng.buildconfig.BuildConfig
|
||||
|
||||
val LyngVersion = BuildConfig.VERSION
|
||||
@@ -6,6 +6,12 @@ import kotlin.test.*
|
||||
|
||||
class ScriptTest {
|
||||
|
||||
@Test
|
||||
fun testVersion() {
|
||||
println("--------------------------------------------")
|
||||
println("version = ${LyngVersion}")
|
||||
}
|
||||
|
||||
@Test
|
||||
fun parseNewlines() {
|
||||
fun check(expected: String, type: Token.Type, row: Int, col: Int, src: String, offset: Int = 0) {
|
||||
|
||||
Reference in new issue
Block a user