Renamed to lyng/3
This commit is contained in:
1 parent
dae09f0dc9
commit
2344e19857
33 files changed
+42
-42
No files matched your search
@@ -81,7 +81,7 @@ mavenPublishing {
|
||||
coordinates(group.toString(), "library", version.toString())
|
||||
|
||||
pom {
|
||||
name = "Ling language"
|
||||
name = "Lyng language"
|
||||
description = "Kotlin-bound scripting loanguage"
|
||||
inceptionYear = "2025"
|
||||
// url = "https://sergeych.net"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package net.sergeych.ling
|
||||
package net.sergeych.lyng
|
||||
|
||||
data class ParsedArgument(val value: Statement, val pos: Pos, val isSplat: Boolean = false)
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package net.sergeych.ling
|
||||
package net.sergeych.lyng
|
||||
|
||||
//fun buildDoubleFromParts(
|
||||
// integerPart: Long,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package net.sergeych.ling
|
||||
package net.sergeych.lyng
|
||||
|
||||
/**
|
||||
* The LING compiler.
|
||||
* The LYNG compiler.
|
||||
*/
|
||||
class Compiler(
|
||||
@Suppress("UNUSED_PARAMETER")
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package net.sergeych.ling
|
||||
package net.sergeych.lyng
|
||||
|
||||
internal class CompilerContext(val tokens: List<Token>) : ListIterator<Token> by tokens.listIterator() {
|
||||
val labels = mutableSetOf<String>()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package net.sergeych.ling
|
||||
package net.sergeych.lyng
|
||||
|
||||
class Context(
|
||||
val parent: Context?,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package net.sergeych.ling
|
||||
package net.sergeych.lyng
|
||||
|
||||
sealed class ListEntry {
|
||||
data class Element(val accessor: Accessor) : ListEntry()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package net.sergeych.ling
|
||||
package net.sergeych.lyng
|
||||
|
||||
class LoopBreakContinueException(
|
||||
val doContinue: Boolean,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package net.sergeych.ling
|
||||
package net.sergeych.lyng
|
||||
|
||||
import kotlinx.coroutines.sync.Mutex
|
||||
import kotlinx.coroutines.sync.withLock
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package net.sergeych.ling
|
||||
package net.sergeych.lyng
|
||||
|
||||
data class ObjBool(val value: Boolean) : Obj() {
|
||||
override val asStr by lazy { ObjString(value.toString()) }
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package net.sergeych.ling
|
||||
package net.sergeych.lyng
|
||||
|
||||
class ObjChar(val value: Char): Obj() {
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package net.sergeych.ling
|
||||
package net.sergeych.lyng
|
||||
|
||||
val ObjClassType by lazy { ObjClass("Class") }
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package net.sergeych.ling
|
||||
package net.sergeych.lyng
|
||||
|
||||
data class ObjInt(var value: Long) : Obj(), Numeric {
|
||||
override val asStr get() = ObjString(value.toString())
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package net.sergeych.ling
|
||||
package net.sergeych.lyng
|
||||
|
||||
class ObjList(val list: MutableList<Obj>) : Obj() {
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package net.sergeych.ling
|
||||
package net.sergeych.lyng
|
||||
|
||||
class ObjRange(val start: Obj?, val end: Obj?, val isEndInclusive: Boolean) : Obj() {
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package net.sergeych.ling
|
||||
package net.sergeych.lyng
|
||||
|
||||
class ObjRangeIterator(val self: ObjRange) : Obj() {
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package net.sergeych.ling
|
||||
package net.sergeych.lyng
|
||||
|
||||
import kotlin.math.floor
|
||||
import kotlin.math.roundToLong
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package net.sergeych.ling
|
||||
package net.sergeych.lyng
|
||||
|
||||
import kotlinx.serialization.SerialName
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package net.sergeych.ling
|
||||
package net.sergeych.lyng
|
||||
|
||||
val digitsSet = ('0'..'9').toSet()
|
||||
val digits = { d: Char -> d in digitsSet }
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package net.sergeych.ling
|
||||
package net.sergeych.lyng
|
||||
|
||||
data class Pos(val source: Source, val line: Int, val column: Int) {
|
||||
override fun toString(): String {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package net.sergeych.ling
|
||||
package net.sergeych.lyng
|
||||
|
||||
import kotlin.math.*
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
@file:Suppress("CanBeParameter")
|
||||
|
||||
package net.sergeych.ling
|
||||
package net.sergeych.lyng
|
||||
|
||||
open class ScriptError(val pos: Pos, val errorMessage: String,cause: Throwable?=null) : Exception(
|
||||
"""
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package net.sergeych.ling
|
||||
package net.sergeych.lyng
|
||||
|
||||
class Source(val fileName: String, text: String) {
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package net.sergeych.ling
|
||||
package net.sergeych.lyng
|
||||
|
||||
/**
|
||||
* Whatever [Obj] stored somewhere
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package net.sergeych.ling
|
||||
package net.sergeych.lyng
|
||||
|
||||
data class Token(val value: String, val pos: Pos, val type: Type) {
|
||||
val isComment: Boolean by lazy { type == Type.SINLGE_LINE_COMMENT || type == Type.MULTILINE_COMMENT }
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package net.sergeych.ling
|
||||
package net.sergeych.lyng
|
||||
|
||||
fun String.toSource(name: String = "eval"): Source = Source(name, this)
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package io.github.kotlin.fibonacci
|
||||
|
||||
import kotlinx.coroutines.test.runTest
|
||||
import net.sergeych.ling.*
|
||||
import net.sergeych.lyng.*
|
||||
import kotlin.test.*
|
||||
|
||||
class ScriptTest {
|
||||
|
||||
@@ -3,8 +3,8 @@ import kotlinx.coroutines.flow.Flow
|
||||
import kotlinx.coroutines.flow.flow
|
||||
import kotlinx.coroutines.flow.flowOn
|
||||
import kotlinx.coroutines.test.runTest
|
||||
import net.sergeych.ling.Context
|
||||
import net.sergeych.ling.ObjVoid
|
||||
import net.sergeych.lyng.Context
|
||||
import net.sergeych.lyng.ObjVoid
|
||||
import java.nio.file.Files.readAllLines
|
||||
import java.nio.file.Paths
|
||||
import kotlin.test.Test
|
||||
|
||||
Reference in new issue
Block a user