fix #72 comments are allowed in class constructor; some configuration bigs fixed

This commit is contained in:
sergeych committed 2025-12-04 16:09:27 +01:00
1 parent b8f27c7a18
commit 5cfc15cf17
4 files changed
+62 -2

No files matched your search

@@ -832,6 +832,7 @@ class Compiler(
}
Token.Type.NEWLINE -> {}
Token.Type.MULTILINE_COMMENT, Token.Type.SINLGE_LINE_COMMENT -> {}
Token.Type.ID -> {
// visibility
@@ -15,6 +15,7 @@
*
*/
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.delay
import kotlinx.coroutines.flow.map
@@ -30,6 +31,22 @@ import net.sergeych.tools.bm
import kotlin.test.*
import kotlin.time.Duration.Companion.seconds
/*
* Copyright 2025 Sergey S. Chernov real.sergeych@gmail.com
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
class ScriptTest {
@Test
fun testVersion() {
@@ -3766,4 +3783,22 @@ class ScriptTest {
""".trimIndent())
}
@Test
fun testCommentsInClassConstructor() = runTest {
eval("""
class T(
// comment 1
val x: Int,
// comment 2
val y: String
)
println( T(1, "2") )
"""
)
}
}