-
Notifications
You must be signed in to change notification settings - Fork 614
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
28 changed files
with
975 additions
and
286 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,3 +13,9 @@ var c = 3 | |
*/ | ||
|
||
/* comment */ var f = 6 /* another comment */ | ||
|
||
/* | ||
comment | ||
/* nested comment */ | ||
var g = 7 | ||
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,10 @@ | ||
Bar input.kt /^class Bar<T, U>(val a: T, val b: U): Foo<T>$/;" c | ||
Baz input.kt /^class Baz <T, U: Pair<String,Pair<T, Double>>>(val c: T, val d: U): Foo<T>$/;" c | ||
Foo input.kt /^interface Foo<T> {$/;" i | ||
a input.kt /^class Bar<T, U>(val a: T, val b: U): Foo<T>$/;" C | ||
b input.kt /^class Bar<T, U>(val a: T, val b: U): Foo<T>$/;" C | ||
genericFunction input.kt /^ fun<T: Any> genericFunction() = 42$/;" m | ||
a input.kt /^class Bar<T, U>(val a: T, val b: U): Foo<T>$/;" C class:Bar | ||
b input.kt /^class Bar<T, U>(val a: T, val b: U): Foo<T>$/;" C class:Bar | ||
c input.kt /^class Baz <T, U: Pair<String,Pair<T, Double>>>(val c: T, val d: U): Foo<T>$/;" C class:Baz | ||
d input.kt /^class Baz <T, U: Pair<String,Pair<T, Double>>>(val c: T, val d: U): Foo<T>$/;" C class:Baz | ||
genericFunction1 input.kt /^ fun<T: Any> genericFunction1() = 41$/;" m interface:Foo | ||
genericFunction2 input.kt /^ fun<T: Pair<String,Pair<Int, T>>> genericFunction2() = 42$/;" m interface:Foo | ||
genericFunction3 input.kt /^ fun <T> genericFunction3() = 43$/;" m interface:Foo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
interface Foo<T> { | ||
fun<T: Any> genericFunction() = 42 | ||
fun<T: Any> genericFunction1() = 41 | ||
fun<T: Pair<String,Pair<Int, T>>> genericFunction2() = 42 | ||
fun <T> genericFunction3() = 43 | ||
} | ||
|
||
class Bar<T, U>(val a: T, val b: U): Foo<T> | ||
class Baz <T, U: Pair<String,Pair<T, Double>>>(val c: T, val d: U): Foo<T> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
A input.kt /^val A=1$/;" C | ||
B input.kt /^val B=2$/;" C | ||
C input.kt /^val C=3$/;" C |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// this is not valid Kotlin code, but the parser should recover and continue parsing | ||
val A=1 | ||
... | ||
... | ||
val B=2 | ||
... | ||
val C=3 |
3 changes: 0 additions & 3 deletions
3
Units/parser-kotlin.r/kotlin-multilinestrings.d/expected.tags
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
used1 input.kt /^var used1 = """var unused1 = 1"""$/;" v | ||
used2 input.kt /^var used2 = """$/;" v | ||
used3 input.kt /^var used3 = """var unused3a = 3""" + """var unused3b = 3"""$/;" v | ||
used4 input.kt /^var used4 = """..."val unused4"..."""$/;" v | ||
used5 input.kt /^var used5 = """${process("""var unused5 = 5""")}"""$/;" v | ||
used6 input.kt /^var used6 = """"val unused6=6""""$/;" v | ||
used7 input.kt /^var used7 = """""var unused6=6"""""$/;" v |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
var used1 = """var unused1 = 1""" | ||
var used2 = """ | ||
var unused2 = 2 | ||
""" | ||
var used3 = """var unused3a = 3""" + """var unused3b = 3""" | ||
var used4 = """..."val unused4"...""" | ||
var used5 = """${process("""var unused5 = 5""")}""" | ||
var used6 = """"val unused6=6"""" | ||
var used7 = """""var unused6=6""""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
--sort=no |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
com.example.test input.kt /^package com.example.test$/;" p | ||
TestObject input.kt /^object TestObject {$/;" o package:com.example.test | ||
a input.kt /^ val a = 1$/;" C object:com.example.test.TestObject | ||
f1 input.kt /^ fun f1(): String {$/;" m object:com.example.test.TestObject | ||
b input.kt /^ val b = "hi"$/;" C method:com.example.test.TestObject.f1 | ||
TestClass input.kt /^class TestClass(val c: String, var d: Int) {$/;" c package:com.example.test | ||
c input.kt /^class TestClass(val c: String, var d: Int) {$/;" C class:com.example.test.TestClass | ||
d input.kt /^class TestClass(val c: String, var d: Int) {$/;" v class:com.example.test.TestClass | ||
e input.kt /^ val e = 2$/;" C class:com.example.test.TestClass | ||
f2 input.kt /^ fun f2(): String {$/;" m class:com.example.test.TestClass | ||
f input.kt /^ var f = 42 * 12$/;" v method:com.example.test.TestClass.f2 | ||
TestInterface input.kt /^interface TestInterface {$/;" i package:com.example.test | ||
g input.kt /^ abstract val g: Int$/;" C interface:com.example.test.TestInterface | ||
f3 input.kt /^ fun f3(): String {$/;" m interface:com.example.test.TestInterface | ||
lmbd input.kt /^ val lmbd: () -> String = {$/;" C method:com.example.test.TestInterface.f3 | ||
<lambda> input.kt /^ val lmbd: () -> String = {$/;" m method:com.example.test.TestInterface.f3 | ||
h input.kt /^ val h = "B".toLowerCase()$/;" C method:com.example.test.TestInterface.f3.<lambda> | ||
anonymousFunction input.kt /^val anonymousFunction = fun(x: Int, y: Int): Int {$/;" C package:com.example.test | ||
<anonymous> input.kt /^val anonymousFunction = fun(x: Int, y: Int): Int {$/;" m package:com.example.test | ||
sum input.kt /^ val sum = x + y$/;" C method:com.example.test.<anonymous> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package com.example.test | ||
|
||
object TestObject { | ||
val a = 1 | ||
fun f1(): String { | ||
val b = "hi" | ||
return b | ||
} | ||
} | ||
|
||
class TestClass(val c: String, var d: Int) { | ||
val e = 2 | ||
fun f2(): String { | ||
var f = 42 * 12 | ||
return f.toString() | ||
} | ||
} | ||
|
||
interface TestInterface { | ||
abstract val g: Int | ||
fun f3(): String { | ||
val lmbd: () -> String = { | ||
val h = "B".toLowerCase() | ||
h | ||
} | ||
return lmbd() | ||
} | ||
} | ||
|
||
val anonymousFunction = fun(x: Int, y: Int): Int { | ||
val sum = x + y | ||
return sum | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
used1 input.kt /^var used1 = "var unused1 = 1"$/;" v | ||
used2 input.kt /^var used2 = "\\"var\\" unused2 = 2"$/;" v | ||
used3 input.kt /^var used3 = ""$/;" v | ||
used4 input.kt /^var used4 = "${process("var unused4 = 4")}"$/;" v | ||
used5 input.kt /^var used5 = '\\"'$/;" v |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,6 @@ | ||
var used1 = "var unused1 = 1" | ||
var used2 = "\"var\" unused2 = 2" | ||
var used3 = "" | ||
var used4 = "${process("var unused4 = 4")}" | ||
// quote in character literal must not break parser | ||
var used5 = '\"' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
com.example.helloworld input.kt /^package com.example.helloworld$/;" p | ||
AbstractWorker input.kt /^interface AbstractWorker {$/;" i | ||
process input.kt /^ abstract fun process(): String$/;" m | ||
Worker input.kt /^class Worker<T>(val name: T): AbstractWorker {$/;" c | ||
name input.kt /^class Worker<T>(val name: T): AbstractWorker {$/;" C | ||
process input.kt /^ override fun process(): String = name.toString()$/;" m | ||
Global input.kt /^object Global {$/;" o | ||
greeting input.kt /^ const val greeting = "Hello"$/;" C | ||
StringWorker input.kt /^typealias StringWorker = Worker<String>$/;" T | ||
main input.kt /^fun main() {$/;" m | ||
result input.kt /^ var result: String = Global.greeting$/;" v | ||
AbstractWorker input.kt /^interface AbstractWorker {$/;" i package:com.example.helloworld | ||
process input.kt /^ abstract fun process(): String$/;" m interface:com.example.helloworld.AbstractWorker | ||
Worker input.kt /^class Worker<T>(val name: T): AbstractWorker {$/;" c package:com.example.helloworld | ||
name input.kt /^class Worker<T>(val name: T): AbstractWorker {$/;" C class:com.example.helloworld.Worker | ||
process input.kt /^ override fun process(): String = name.toString()$/;" m class:com.example.helloworld.Worker | ||
Global input.kt /^object Global {$/;" o package:com.example.helloworld | ||
greeting input.kt /^ const val greeting = "Hello"$/;" C object:com.example.helloworld.Global | ||
StringWorker input.kt /^typealias StringWorker = Worker<String>$/;" T package:com.example.helloworld | ||
main input.kt /^fun main() {$/;" m package:com.example.helloworld | ||
result input.kt /^ var result: String = Global.greeting$/;" v method:com.example.helloworld.main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
# -*- makefile -*- | ||
PEG_INPUT = \ | ||
peg/varlink.peg \ | ||
peg/kotlin.peg \ | ||
\ | ||
$(NULL) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.