plum
git clone https://git.pyrossh.dev/plum
A statically typed, imperative programming language inspired by rust, python
30158b0
— Peter John
2023-04-19T22:57:37+05:30
new grammar
Generated files not shown: src/parser.c
- examples/Logger.kt +0 -182
- examples/MenuScene.kt +0 -25
- examples/all.kt +0 -115
- grammar.js +278 -302
- package.json +1 -1
- src/grammar.json +373 -1249
- src/node-types.json +83 -559
- test/corpus/class_definitions.txt +0 -128
- test/corpus/enum_definitions.txt +0 -117
- test/corpus/functions.txt +2 -2
- test/corpus/import.txt +40 -0
- test/corpus/import_statements.txt +0 -16
- test/corpus/record.txt +65 -0
- test/corpus/traits.txt +0 -65
- test/corpus/type.txt +77 -0
examples/Logger.kt
DELETED
|
@@ -1,182 +0,0 @@
|
|
|
1
|
-
package logger
|
|
2
|
-
|
|
3
|
-
import github/pine/io
|
|
4
|
-
import github/pine/util
|
|
5
|
-
import github/pine/time
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
val log = Logger()
|
|
9
|
-
|
|
10
|
-
@cache
|
|
11
|
-
fun log() => Logger {
|
|
12
|
-
return Logger()
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
@Handler
|
|
16
|
-
class JULRedirector(
|
|
17
|
-
val downstream: Logger
|
|
18
|
-
)
|
|
19
|
-
|
|
20
|
-
fun JULRedirector.publish(record: LogRecord) => {
|
|
21
|
-
when (record.level) {
|
|
22
|
-
Level.SEVERE -> downstream.error(record.message)
|
|
23
|
-
Level.WARNING -> downstream.warn(record.message)
|
|
24
|
-
Level.INFO -> downstream.info(record.message)
|
|
25
|
-
Level.CONFIG -> downstream.debug(record.message)
|
|
26
|
-
Level.FINE -> downstream.trace(record.message)
|
|
27
|
-
else -> downstream.deepTrace(record.message)
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
fun JULRedirector.flush() => {}
|
|
32
|
-
|
|
33
|
-
fun JULRedirector.close() => {}
|
|
34
|
-
|
|
35
|
-
enum class LogLevel(val value: Int) {
|
|
36
|
-
NONE(100),
|
|
37
|
-
ERROR(2),
|
|
38
|
-
WARN(1),
|
|
39
|
-
INFO(0),
|
|
40
|
-
DEBUG(-1),
|
|
41
|
-
TRACE(-2),
|
|
42
|
-
DEEP_TRACE(-3),
|
|
43
|
-
ALL(-100)
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
class LogMessage(
|
|
47
|
-
val level: LogLevel,
|
|
48
|
-
val message: String
|
|
49
|
-
)
|
|
50
|
-
|
|
51
|
-
fun LogMessage.formatted() => String {
|
|
52
|
-
return "[$level] $message"
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
class Logger(
|
|
56
|
-
var outBackend: ((LogMessage) -> Unit)? = null,
|
|
57
|
-
var errBackend: ((LogMessage) -> Unit)? = null,
|
|
58
|
-
val outQueue: Queue<LogMessage> = ArrayDeque(),
|
|
59
|
-
val errQueue: Queue<LogMessage> = ArrayDeque(),
|
|
60
|
-
val newline: String = System.lineSeparator(),
|
|
61
|
-
val logTime: Bool = false,
|
|
62
|
-
var level: LogLevel = LogLevel.INFO,
|
|
63
|
-
)
|
|
64
|
-
|
|
65
|
-
fun Logger.outputError(msg: LogMessage) => {
|
|
66
|
-
if (errBackend == null) {
|
|
67
|
-
errQueue.offer(msg)
|
|
68
|
-
} else {
|
|
69
|
-
errBackend?.invoke(msg)
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
fun Logger.output(msg: LogMessage) => {
|
|
74
|
-
if (outBackend == null) {
|
|
75
|
-
outQueue.offer(msg)
|
|
76
|
-
} else {
|
|
77
|
-
outBackend?.invoke(msg)
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
fun Logger.log(msgLevel: LogLevel, msg: String, placeholders: Array<out Any?>) => {
|
|
82
|
-
if (level.value <= msgLevel.value) {
|
|
83
|
-
output(LogMessage(msgLevel, format(insertPlaceholders(msg, placeholders))))
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
fun Logger.error(msg: String, vararg placeholders: Any?) => {
|
|
88
|
-
log(LogLevel.ERROR, msg, placeholders)
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
fun Logger.warn(msg: String, vararg placeholders: Any?) => {
|
|
92
|
-
log(LogLevel.WARN, msg, placeholders)
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
fun Logger.info(msg: String, vararg placeholders: Any?) => {
|
|
96
|
-
log(LogLevel.INFO, msg, placeholders)
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
fun Logger.debug(msg: String, vararg placeholders: Any?) => {
|
|
100
|
-
log(LogLevel.DEBUG, msg, placeholders)
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
fun Logger.trace(msg: String, vararg placeholders: Any?) => {
|
|
104
|
-
log(LogLevel.TRACE, msg, placeholders)
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
fun Logger.deepTrace(msg: String, vararg placeholders: Any?) => {
|
|
108
|
-
log(LogLevel.DEEP_TRACE, msg, placeholders)
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
fun Logger.connectJULFrontend() => {
|
|
112
|
-
val rootLogger = java.util.logging.Logger.getLogger("")
|
|
113
|
-
rootLogger.addHandler(JULRedirector(this))
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
fun Logger.connectOutputBackend(outBackend: (LogMessage) -> Unit) => {
|
|
117
|
-
this.outBackend = outBackend
|
|
118
|
-
flushOutQueue()
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
fun Logger.connectErrorBackend(errBackend: (LogMessage) -> Unit) => {
|
|
122
|
-
this.errBackend = errBackend
|
|
123
|
-
flushErrQueue()
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
fun Logger.connectStdioBackend() => {
|
|
127
|
-
connectOutputBackend { println(it.formatted) }
|
|
128
|
-
connectOutputBackend { System.err.println(it.formatted) }
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
fun Logger.insertPlaceholders(msg: String, placeholders: Array<out Any?>) => String {
|
|
132
|
-
val msgLength = msg.length
|
|
133
|
-
val lastIndex = msgLength - 1
|
|
134
|
-
var charIndex = 0
|
|
135
|
-
var placeholderIndex = 0
|
|
136
|
-
var result = StringBuilder()
|
|
137
|
-
|
|
138
|
-
while (charIndex < msgLength) {
|
|
139
|
-
val currentChar = msg.get(charIndex)
|
|
140
|
-
val nextChar = if (charIndex != lastIndex) msg.get(charIndex + 1) else '?'
|
|
141
|
-
if ((currentChar == '{') && (nextChar == '}')) {
|
|
142
|
-
if (placeholderIndex >= placeholders.size) {
|
|
143
|
-
return "ERROR: Tried to log more '{}' placeholders than there are values"
|
|
144
|
-
}
|
|
145
|
-
result.append(placeholders[placeholderIndex] ?: "null")
|
|
146
|
-
placeholderIndex += 1
|
|
147
|
-
charIndex += 2
|
|
148
|
-
} else {
|
|
149
|
-
result.append(currentChar)
|
|
150
|
-
charIndex += 1
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
return result.toString()
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
fun Logger.flushOutQueue() => {
|
|
158
|
-
while (outQueue.isNotEmpty()) {
|
|
159
|
-
outBackend?.invoke(outQueue.poll())
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
fun Logger.flushErrQueue() => {
|
|
164
|
-
while (errQueue.isNotEmpty()) {
|
|
165
|
-
errBackend?.invoke(errQueue.poll())
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
fun Logger.format(msg: String) => String {
|
|
170
|
-
val time = if (logTime) "${Instant.now()} " else ""
|
|
171
|
-
var thread = Thread.currentThread().name
|
|
172
|
-
|
|
173
|
-
return time + shortenOrPad(thread, 10) + msg
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
fun Logger.shortenOrPad(str: String, length: Int) => String {
|
|
177
|
-
if (str.length <= length) {
|
|
178
|
-
return str.padEnd(length, ' ')
|
|
179
|
-
} else {
|
|
180
|
-
return ".." + str.substring(str.length - length + 2)
|
|
181
|
-
}
|
|
182
|
-
}
|
examples/MenuScene.kt
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
@Scene
|
|
2
|
-
class MenuScene(
|
|
3
|
-
name: string
|
|
4
|
-
)
|
|
5
|
-
|
|
6
|
-
fun MenuScene.init() {
|
|
7
|
-
log("Hello world")
|
|
8
|
-
log("new data")
|
|
9
|
-
showToast("Toasting", 2)
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
fun MenuScene.onClick(scene: Scene, actor: Actor) {
|
|
13
|
-
val nextScene = when (actor.name) {
|
|
14
|
-
"Play" -> GameScene,
|
|
15
|
-
"Play3d" -> Game3dScene,
|
|
16
|
-
"Options" -> OptionsScene,
|
|
17
|
-
"Exit" -> {
|
|
18
|
-
showMessageDialog(title = "Exit", message = "Are you sure you want \n to quit?")
|
|
19
|
-
exit(0)
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
nextScene?.run {
|
|
23
|
-
scene.setScene(it)
|
|
24
|
-
}
|
|
25
|
-
}
|
examples/all.kt
DELETED
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
import github.com/std/http
|
|
2
|
-
|
|
3
|
-
enum Color(val rgb: Int) {
|
|
4
|
-
RED(0xFF0000),
|
|
5
|
-
GREEN(0x00FF00),
|
|
6
|
-
BLUE(0x0000FF)
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
fun Color.isReddish() => Bool {
|
|
10
|
-
return this == Color.Red
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
trait List(
|
|
14
|
-
val name: String
|
|
15
|
-
fun area(): Float
|
|
16
|
-
)
|
|
17
|
-
|
|
18
|
-
class Email(value: String)
|
|
19
|
-
|
|
20
|
-
fun Email.init() => {
|
|
21
|
-
if !value.match("/s\@/s") {
|
|
22
|
-
throw error("Email not value ${value}")
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
class Array<T>(
|
|
27
|
-
var items: []T,
|
|
28
|
-
var size: Int
|
|
29
|
-
)
|
|
30
|
-
|
|
31
|
-
fun Array<T>.get(index: Int): T => {
|
|
32
|
-
return items[int]
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
fun Array<T>.set(index: Int, value: T) => {
|
|
36
|
-
items[i] = value
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
fun listOf<T>(elements: ...T): List<T> => {
|
|
40
|
-
return Array(elements)
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
class User(
|
|
44
|
-
val name: String,
|
|
45
|
-
val age: Int,
|
|
46
|
-
val email: Email,
|
|
47
|
-
)
|
|
48
|
-
|
|
49
|
-
fun User.init() => {
|
|
50
|
-
assert(name.size > 5, "name is not valid")
|
|
51
|
-
assert(age > 0 && age < 130, "age is not valid")
|
|
52
|
-
assert(email.test("regex"), "email is not valid")
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
fun User.invoke() => {
|
|
56
|
-
println("Hello")
|
|
57
|
-
listOf(0, 1, 2, 3).map { "Number ${it}" }
|
|
58
|
-
range(0, 10, 1).each { i, v ->
|
|
59
|
-
echo i, v
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
fun User.getFullName() => String {
|
|
64
|
-
return "${name} 123"
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
@Get("/about")
|
|
68
|
-
fun about() => HtmlNode {
|
|
69
|
-
val sir = "John"
|
|
70
|
-
html {
|
|
71
|
-
head {
|
|
72
|
-
title {
|
|
73
|
-
"Tesla"
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
body {
|
|
77
|
-
div {
|
|
78
|
-
"Welcome ${sir}"
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
fun main(args: List<String>) => {
|
|
85
|
-
println(hello)
|
|
86
|
-
val items = args?
|
|
87
|
-
.map { it.name }
|
|
88
|
-
.filter { it.isVerified }
|
|
89
|
-
.each { it -> it.name } ?: listOf()
|
|
90
|
-
val john = User("John", 2)
|
|
91
|
-
val jill = User(name = "Jill", age = 3)
|
|
92
|
-
val jack = john.copy(age = 5)
|
|
93
|
-
val (name, age) = jack
|
|
94
|
-
// Pair, Triple
|
|
95
|
-
|
|
96
|
-
val name2 = jill?.let {
|
|
97
|
-
it.name + "123"
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
jill?.run {
|
|
101
|
-
println(it)
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
names.each { name, i ->
|
|
106
|
-
println(name, i)
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
TODO()
|
|
110
|
-
|
|
111
|
-
when message {
|
|
112
|
-
New -> println("new $id: $quantity")
|
|
113
|
-
Cancel -> println("cancel $id")
|
|
114
|
-
}
|
|
115
|
-
}
|
grammar.js
CHANGED
|
@@ -2,388 +2,356 @@ const DEC_DIGITS = token(sep1(/[0-9]+/, /_+/));
|
|
|
2
2
|
const HEX_DIGITS = token(sep1(/[0-9a-fA-F]+/, /_+/));
|
|
3
3
|
const BIN_DIGITS = token(sep1(/[01]/, /_+/));
|
|
4
4
|
|
|
5
|
-
const PREC = {
|
|
6
|
-
POSTFIX: 16,
|
|
7
|
-
PREFIX: 15,
|
|
8
|
-
TYPE_RHS: 14,
|
|
9
|
-
AS: 13,
|
|
10
|
-
MULTIPLICATIVE: 12,
|
|
11
|
-
ADDITIVE: 11,
|
|
12
|
-
RANGE: 10,
|
|
13
|
-
INFIX: 9,
|
|
14
|
-
ELVIS: 8,
|
|
15
|
-
CHECK: 7,
|
|
16
|
-
COMPARISON: 6,
|
|
17
|
-
EQUALITY: 5,
|
|
18
|
-
CONJUNCTION: 4,
|
|
19
|
-
DISJUNCTION: 3,
|
|
20
|
-
SPREAD: 2,
|
|
21
|
-
SIMPLE_USER_TYPE: 2,
|
|
22
|
-
VAR_DECL: 1,
|
|
23
|
-
ASSIGNMENT: 1,
|
|
24
|
-
BLOCK: 1,
|
|
25
|
-
LAMBDA_LITERAL: 0,
|
|
26
|
-
RETURN_OR_THROW: 0,
|
|
27
|
-
COMMENT: 0
|
|
28
|
-
};
|
|
29
|
-
|
|
30
5
|
module.exports = grammar({
|
|
31
|
-
name: '
|
|
6
|
+
name: 'palm',
|
|
32
|
-
conflicts: $ => [
|
|
33
|
-
[$.fun_field],
|
|
34
|
-
[$.decorator_name],
|
|
35
|
-
],
|
|
36
|
-
extras: $ => [
|
|
7
|
+
// extras: $ => [
|
|
37
|
-
|
|
8
|
+
// $.comment,
|
|
38
|
-
|
|
9
|
+
// /\s+/ // Whitespace
|
|
39
|
-
],
|
|
10
|
+
// ],
|
|
40
11
|
rules: {
|
|
41
12
|
source_file: $ => seq(
|
|
42
|
-
|
|
13
|
+
$.module,
|
|
43
|
-
repeat($.
|
|
14
|
+
repeat($.import),
|
|
44
|
-
repeat(
|
|
15
|
+
repeat(choice(
|
|
16
|
+
$.record,
|
|
17
|
+
$.type,
|
|
18
|
+
// $.proc,
|
|
19
|
+
)),
|
|
45
20
|
),
|
|
46
21
|
|
|
47
|
-
|
|
22
|
+
module: $ => seq('module', field("module", $.module_name)),
|
|
48
23
|
|
|
49
|
-
/
|
|
24
|
+
/* Import statements */
|
|
25
|
+
import: ($) =>
|
|
26
|
+
seq(
|
|
27
|
+
"import",
|
|
28
|
+
field("module", $.module_name),
|
|
29
|
+
optional(seq(".", field("imports", $.unqualified_imports))),
|
|
30
|
+
optional(seq("as", field("alias", $.identifier)))
|
|
31
|
+
),
|
|
32
|
+
module_name: ($) => seq($._name, repeat(seq("/", $._name))),
|
|
33
|
+
unqualified_imports: ($) =>
|
|
34
|
+
seq("{", optional(series_of($.unqualified_import, ",")), "}"),
|
|
35
|
+
unqualified_import: ($) =>
|
|
36
|
+
choice(
|
|
37
|
+
seq(
|
|
38
|
+
field("name", $.identifier),
|
|
39
|
+
optional(seq("as", field("alias", $.identifier)))
|
|
40
|
+
),
|
|
41
|
+
seq(
|
|
42
|
+
field("name", $.type_identifier),
|
|
43
|
+
optional(seq("as", field("alias", $.type_identifier)))
|
|
44
|
+
)
|
|
45
|
+
),
|
|
50
46
|
|
|
51
|
-
|
|
47
|
+
/* Declarations */
|
|
52
|
-
$.class_definition,
|
|
53
|
-
$.trait_definition,
|
|
54
|
-
$.enum_definition,
|
|
55
|
-
$.fun_definition,
|
|
56
|
-
),
|
|
57
48
|
|
|
58
|
-
|
|
49
|
+
record: $ => seq(
|
|
59
|
-
field('decorators', optional(repeat($.decorator_name))),
|
|
60
|
-
'
|
|
50
|
+
'record',
|
|
61
|
-
field('name', $.
|
|
51
|
+
field('name', $.type_identifier),
|
|
62
52
|
field('generics', optional($.generic_list)),
|
|
63
|
-
field('
|
|
53
|
+
field('fields', repeat($.type_field)),
|
|
64
|
-
field('fields', seq('(', commaSep1($.type_field), ')')),
|
|
65
54
|
),
|
|
66
55
|
|
|
67
|
-
|
|
56
|
+
type: $ => seq(
|
|
68
|
-
'
|
|
57
|
+
'type',
|
|
69
|
-
field('name', $.
|
|
58
|
+
field('name', $.type_identifier),
|
|
70
59
|
field('generics', optional($.generic_list)),
|
|
71
|
-
field('fields', seq('(', commaSep1($.trait_field), ')')),
|
|
72
|
-
),
|
|
73
|
-
|
|
74
|
-
enum_definition: $ => seq(
|
|
75
|
-
|
|
60
|
+
"=",
|
|
76
|
-
field('
|
|
61
|
+
field('types', pipeSep1($.type_name)),
|
|
77
|
-
field('types', seq('(', commaSep1($.type_field), ')')),
|
|
78
|
-
field('fields', seq('{', commaSep1($.enum_field), '}')),
|
|
79
62
|
),
|
|
80
63
|
|
|
81
|
-
|
|
64
|
+
// proc: $ => seq(
|
|
82
|
-
field('decorators', optional(repeat($.decorator_name))),
|
|
83
|
-
'fun',
|
|
84
|
-
|
|
65
|
+
// field('name', $.identifier),
|
|
85
|
-
field('generics', optional($.generic_list)),
|
|
86
|
-
|
|
66
|
+
// field('params', seq('(', optional(commaSep1($.type_field)), ')')),
|
|
67
|
+
// optional(
|
|
68
|
+
// seq(
|
|
87
|
-
|
|
69
|
+
// '->',
|
|
88
|
-
|
|
70
|
+
// field('return', optional($.return_type)),
|
|
71
|
+
// ),
|
|
72
|
+
// ),
|
|
73
|
+
// '=',
|
|
89
|
-
|
|
74
|
+
// // field('body', $._block)
|
|
90
|
-
),
|
|
91
|
-
|
|
92
|
-
decorator_name: $ => seq("@", $.identifier, '(', optional(commaSep1($._primary_expression)), ')'),
|
|
93
|
-
|
|
94
|
-
trait_list: $ => seq(
|
|
95
|
-
|
|
75
|
+
// ),
|
|
96
|
-
commaSep1($.definition_name),
|
|
97
|
-
),
|
|
98
76
|
|
|
77
|
+
/* Shared AST nodes */
|
|
78
|
+
|
|
99
|
-
|
|
79
|
+
return_type: $ => seq(
|
|
80
|
+
field('name', $.type_identifier),
|
|
81
|
+
field("generics", optional(seq(
|
|
100
|
-
|
|
82
|
+
"(",
|
|
101
|
-
|
|
83
|
+
commaSep1($.identifier),
|
|
102
|
-
|
|
84
|
+
")",
|
|
85
|
+
)))
|
|
103
86
|
),
|
|
104
87
|
|
|
105
|
-
type: $ => seq($.definition_name, optional('?')),
|
|
106
88
|
|
|
107
|
-
|
|
89
|
+
type_name: $ => seq(
|
|
108
|
-
field('name', $.
|
|
90
|
+
field('name', $.type_identifier),
|
|
91
|
+
optional(seq(
|
|
109
|
-
|
|
92
|
+
"(",
|
|
93
|
+
choice(
|
|
94
|
+
$.identifier,
|
|
110
|
-
|
|
95
|
+
commaSep1($.type_field),
|
|
96
|
+
),
|
|
97
|
+
")",
|
|
98
|
+
))
|
|
111
99
|
),
|
|
112
100
|
|
|
113
101
|
type_field: $ => seq(
|
|
114
|
-
'val',
|
|
115
|
-
field('name', $.variable_name),
|
|
116
|
-
':',
|
|
117
|
-
field('type', $.type)
|
|
118
|
-
),
|
|
119
|
-
|
|
120
|
-
fun_field: $ => seq(
|
|
121
|
-
'fun',
|
|
122
102
|
field('name', $.identifier),
|
|
123
|
-
field('params', seq('(', optional(commaSep1($.param)), ')')),
|
|
124
|
-
'
|
|
103
|
+
':',
|
|
125
|
-
field('
|
|
104
|
+
field('type', $.identifier)
|
|
126
105
|
),
|
|
127
|
-
|
|
128
|
-
|
|
106
|
+
identifier: ($) => $._name,
|
|
107
|
+
type_identifier: ($) => $._upname,
|
|
108
|
+
generic_list: $ => seq(
|
|
129
|
-
|
|
109
|
+
'(',
|
|
130
|
-
$.
|
|
110
|
+
commaSep1($.identifier),
|
|
111
|
+
')'
|
|
131
112
|
),
|
|
132
113
|
|
|
114
|
+
_discard_name: ($) => /_[_0-9a-z]*/,
|
|
133
|
-
|
|
115
|
+
_name: ($) => /[_a-z][_0-9a-z]*/,
|
|
116
|
+
_upname: ($) => /[A-Z][0-9a-zA-Z]*/,
|
|
134
117
|
|
|
118
|
+
// param: $ => seq(
|
|
119
|
+
// field('name', $.variable_name),
|
|
120
|
+
// ':',
|
|
121
|
+
// field('type', $.type)
|
|
135
|
-
//
|
|
122
|
+
// ),
|
|
136
123
|
|
|
137
|
-
_block: $ => prec(PREC.BLOCK, seq(
|
|
138
|
-
"{",
|
|
139
|
-
// optional($.statements),
|
|
140
|
-
"}"
|
|
141
|
-
)),
|
|
142
124
|
|
|
143
|
-
// statements: $ => seq(
|
|
144
|
-
// $._statement,
|
|
145
|
-
// ),
|
|
146
125
|
|
|
147
|
-
//
|
|
126
|
+
// fun_field: $ => seq(
|
|
148
|
-
// choice(
|
|
149
|
-
//
|
|
127
|
+
// 'fun',
|
|
128
|
+
// field('name', $.identifier),
|
|
129
|
+
// field('params', seq('(', optional(commaSep1($.param)), ')')),
|
|
150
|
-
//
|
|
130
|
+
// '=>',
|
|
151
|
-
//
|
|
131
|
+
// field('returns', optional(commaSep1($.type))),
|
|
152
|
-
// )
|
|
153
132
|
// ),
|
|
154
133
|
|
|
155
|
-
//
|
|
134
|
+
// trait_field: $ => choice(
|
|
135
|
+
// $.type_field,
|
|
156
|
-
// $.
|
|
136
|
+
// $.fun_field,
|
|
157
|
-
// $.while_statement,
|
|
158
137
|
// ),
|
|
159
138
|
|
|
160
|
-
// for_statement: $ => prec.right(seq(
|
|
161
|
-
// "for",
|
|
162
|
-
// "(",
|
|
163
|
-
// repeat($.annotation),
|
|
164
|
-
//
|
|
139
|
+
// enum_field: $ => seq($.enum_field_name, '(', commaSep1($._primary_expression), ')'),
|
|
165
|
-
// "in",
|
|
166
|
-
// $._expression,
|
|
167
|
-
// ")",
|
|
168
|
-
// optional($.control_structure_body)
|
|
169
|
-
// )),
|
|
170
140
|
|
|
171
|
-
// while_statement: $ => seq(
|
|
172
|
-
// "while",
|
|
173
|
-
// "(",
|
|
174
|
-
//
|
|
141
|
+
// // Expressions
|
|
175
|
-
// ")",
|
|
176
|
-
// choice(";", $.control_structure_body)
|
|
177
|
-
// ),
|
|
178
142
|
|
|
179
|
-
//
|
|
143
|
+
// _block: $ => prec(PREC.BLOCK, seq(
|
|
180
|
-
// prec.left(PREC.ASSIGNMENT, seq($.directly_assignable_expression, $._assignment_and_operator, $._expression)),
|
|
181
|
-
// prec.left(PREC.ASSIGNMENT, seq($.directly_assignable_expression, "=", $._expression)),
|
|
182
|
-
//
|
|
144
|
+
// "{",
|
|
145
|
+
// // optional($.statements),
|
|
146
|
+
// "}"
|
|
183
|
-
// ),
|
|
147
|
+
// )),
|
|
184
148
|
|
|
149
|
+
// // assignment: $ => choice(
|
|
150
|
+
// // prec.left(PREC.ASSIGNMENT, seq($.directly_assignable_expression, $._assignment_and_operator, $._expression)),
|
|
151
|
+
// // prec.left(PREC.ASSIGNMENT, seq($.directly_assignable_expression, "=", $._expression)),
|
|
152
|
+
// // // TODO
|
|
185
|
-
// //
|
|
153
|
+
// // ),
|
|
186
|
-
// // Expressions
|
|
187
|
-
// // ==========
|
|
188
154
|
|
|
189
|
-
//
|
|
155
|
+
// // // ==========
|
|
190
|
-
// $._unary_expression,
|
|
191
|
-
//
|
|
156
|
+
// // // Expressions
|
|
192
|
-
//
|
|
157
|
+
// // // ==========
|
|
193
|
-
// ),
|
|
194
158
|
|
|
159
|
+
// // _expression: $ => choice(
|
|
195
|
-
// //
|
|
160
|
+
// // $._unary_expression,
|
|
161
|
+
// // $._binary_expression,
|
|
162
|
+
// // $._primary_expression
|
|
163
|
+
// // ),
|
|
196
164
|
|
|
197
|
-
// _unary_expression: $ => choice(
|
|
198
|
-
// $.postfix_expression,
|
|
199
|
-
// $.call_expression,
|
|
200
|
-
//
|
|
165
|
+
// // // Unary expressions
|
|
201
|
-
// $.navigation_expression,
|
|
202
|
-
// $.prefix_expression,
|
|
203
|
-
// $.as_expression,
|
|
204
|
-
// $.spread_expression
|
|
205
|
-
// ),
|
|
206
166
|
|
|
207
|
-
//
|
|
167
|
+
// // _unary_expression: $ => choice(
|
|
168
|
+
// // $.postfix_expression,
|
|
169
|
+
// // $.call_expression,
|
|
170
|
+
// // $.indexing_expression,
|
|
171
|
+
// // $.navigation_expression,
|
|
172
|
+
// // $.prefix_expression,
|
|
173
|
+
// // $.as_expression,
|
|
174
|
+
// // $.spread_expression
|
|
175
|
+
// // ),
|
|
208
176
|
|
|
209
|
-
//
|
|
177
|
+
// // postfix_expression: $ => prec.left(PREC.POSTFIX, seq($._expression, $._postfix_unary_operator)),
|
|
210
178
|
|
|
211
|
-
//
|
|
179
|
+
// // call_expression: $ => prec.left(PREC.POSTFIX, seq($._expression, $.call_suffix)),
|
|
212
180
|
|
|
213
|
-
//
|
|
181
|
+
// // indexing_expression: $ => prec.left(PREC.POSTFIX, seq($._expression, $.indexing_suffix)),
|
|
214
182
|
|
|
215
|
-
//
|
|
183
|
+
// // navigation_expression: $ => prec.left(PREC.POSTFIX, seq($._expression, $.navigation_suffix)),
|
|
216
184
|
|
|
217
|
-
//
|
|
185
|
+
// // prefix_expression: $ => prec.right(seq(choice($.annotation, $.label, $._prefix_unary_operator), $._expression)),
|
|
218
186
|
|
|
219
|
-
//
|
|
187
|
+
// // as_expression: $ => prec.left(PREC.AS, seq($._expression, $._as_operator, $._type)),
|
|
220
188
|
|
|
221
|
-
//
|
|
189
|
+
// // spread_expression: $ => prec.left(PREC.SPREAD, seq("*", $._expression)),
|
|
222
|
-
// $.multiplicative_expression,
|
|
223
|
-
// $.additive_expression,
|
|
224
|
-
// $.range_expression,
|
|
225
|
-
// $.infix_expression,
|
|
226
|
-
// $.elvis_expression,
|
|
227
|
-
// $.check_expression,
|
|
228
|
-
// $.comparison_expression,
|
|
229
|
-
// $.equality_expression,
|
|
230
|
-
// $.comparison_expression,
|
|
231
|
-
// $.equality_expression,
|
|
232
|
-
// $.conjunction_expression,
|
|
233
|
-
// $.disjunction_expression
|
|
234
|
-
// ),
|
|
235
190
|
|
|
191
|
+
// // _binary_expression: $ => choice(
|
|
236
|
-
//
|
|
192
|
+
// // $.multiplicative_expression,
|
|
193
|
+
// // $.additive_expression,
|
|
194
|
+
// // $.range_expression,
|
|
195
|
+
// // $.infix_expression,
|
|
196
|
+
// // $.elvis_expression,
|
|
197
|
+
// // $.check_expression,
|
|
198
|
+
// // $.comparison_expression,
|
|
199
|
+
// // $.equality_expression,
|
|
200
|
+
// // $.comparison_expression,
|
|
201
|
+
// // $.equality_expression,
|
|
202
|
+
// // $.conjunction_expression,
|
|
203
|
+
// // $.disjunction_expression
|
|
204
|
+
// // ),
|
|
237
205
|
|
|
238
|
-
//
|
|
206
|
+
// // multiplicative_expression: $ => prec.left(PREC.MULTIPLICATIVE, seq($._expression, $._multiplicative_operator, $._expression)),
|
|
239
207
|
|
|
240
|
-
//
|
|
208
|
+
// // additive_expression: $ => prec.left(PREC.ADDITIVE, seq($._expression, $._additive_operator, $._expression)),
|
|
241
209
|
|
|
242
|
-
//
|
|
210
|
+
// // range_expression: $ => prec.left(PREC.RANGE, seq($._expression, "..", $._expression)),
|
|
243
211
|
|
|
244
|
-
//
|
|
212
|
+
// // infix_expression: $ => prec.left(PREC.INFIX, seq($._expression, $.simple_identifier, $._expression)),
|
|
245
213
|
|
|
246
|
-
//
|
|
214
|
+
// // elvis_expression: $ => prec.left(PREC.ELVIS, seq($._expression, "?:", $._expression)),
|
|
247
|
-
// seq($._in_operator, $._expression),
|
|
248
|
-
// seq($._is_operator, $._type)))),
|
|
249
215
|
|
|
250
|
-
//
|
|
216
|
+
// // check_expression: $ => prec.left(PREC.CHECK, seq($._expression, choice(
|
|
217
|
+
// // seq($._in_operator, $._expression),
|
|
218
|
+
// // seq($._is_operator, $._type)))),
|
|
251
219
|
|
|
252
|
-
//
|
|
220
|
+
// // comparison_expression: $ => prec.left(PREC.COMPARISON, seq($._expression, $._comparison_operator, $._expression)),
|
|
253
221
|
|
|
254
|
-
//
|
|
222
|
+
// // equality_expression: $ => prec.left(PREC.EQUALITY, seq($._expression, $._equality_operator, $._expression)),
|
|
255
223
|
|
|
256
|
-
//
|
|
224
|
+
// // conjunction_expression: $ => prec.left(PREC.CONJUNCTION, seq($._expression, "&&", $._expression)),
|
|
257
225
|
|
|
258
|
-
//
|
|
226
|
+
// // disjunction_expression: $ => prec.left(PREC.DISJUNCTION, seq($._expression, "||", $._expression)),
|
|
259
227
|
|
|
260
|
-
//
|
|
228
|
+
// // // Suffixes
|
|
261
229
|
|
|
262
|
-
//
|
|
230
|
+
// // indexing_suffix: $ => seq("[", sep1($._expression, ","), "]"),
|
|
263
|
-
// $._member_access_operator,
|
|
264
|
-
// choice(
|
|
265
|
-
// $.simple_identifier,
|
|
266
|
-
// $.parenthesized_expression,
|
|
267
|
-
// "class"
|
|
268
|
-
// )
|
|
269
|
-
// ),
|
|
270
231
|
|
|
271
|
-
//
|
|
232
|
+
// // navigation_suffix: $ => seq(
|
|
272
|
-
// // this introduces ambiguities with 'less than' for comparisons
|
|
273
|
-
//
|
|
233
|
+
// // $._member_access_operator,
|
|
274
|
-
// choice(
|
|
234
|
+
// // choice(
|
|
275
|
-
// seq(optional($.value_arguments), $.annotated_lambda),
|
|
276
|
-
// $.
|
|
235
|
+
// // $.simple_identifier,
|
|
236
|
+
// // $.parenthesized_expression,
|
|
237
|
+
// // "class"
|
|
277
|
-
// )
|
|
238
|
+
// // )
|
|
278
|
-
// )
|
|
239
|
+
// // ),
|
|
279
240
|
|
|
280
|
-
//
|
|
241
|
+
// // call_suffix: $ => prec.left(seq(
|
|
242
|
+
// // // this introduces ambiguities with 'less than' for comparisons
|
|
243
|
+
// // optional($.type_arguments),
|
|
244
|
+
// // choice(
|
|
245
|
+
// // seq(optional($.value_arguments), $.annotated_lambda),
|
|
281
|
-
//
|
|
246
|
+
// // $.value_arguments
|
|
282
|
-
//
|
|
247
|
+
// // )
|
|
283
|
-
// optional(seq(":", $._type))
|
|
284
|
-
// )),
|
|
248
|
+
// // )),
|
|
285
249
|
|
|
286
|
-
//
|
|
250
|
+
// // variable_declaration: $ => prec.left(PREC.VAR_DECL, seq(
|
|
287
|
-
//
|
|
251
|
+
// // // repeat($.annotation), TODO
|
|
288
|
-
// $.
|
|
252
|
+
// // $.simple_identifier,
|
|
253
|
+
// // optional(seq(":", $._type))
|
|
289
|
-
//
|
|
254
|
+
// // )),
|
|
290
|
-
// $._type
|
|
291
|
-
// ),
|
|
292
255
|
|
|
293
|
-
//
|
|
256
|
+
// // function_type: $ => seq(
|
|
257
|
+
// // optional(seq($._simple_user_type, ".")), // TODO: Support "real" types
|
|
258
|
+
// // $.function_type_parameters,
|
|
259
|
+
// // "->",
|
|
260
|
+
// // $._type
|
|
294
|
-
//
|
|
261
|
+
// // ),
|
|
295
|
-
// optional(sep1(choice($.parameter, $._type), ",")),
|
|
296
|
-
// ")"
|
|
297
|
-
// )),
|
|
298
262
|
|
|
263
|
+
// // function_type_parameters: $ => prec.left(1, seq(
|
|
264
|
+
// // "(",
|
|
299
|
-
//
|
|
265
|
+
// // optional(sep1(choice($.parameter, $._type), ",")),
|
|
266
|
+
// // ")"
|
|
267
|
+
// // )),
|
|
300
268
|
|
|
301
|
-
|
|
269
|
+
// // parenthesized_type: $ => seq("(", $._type, ")"),
|
|
302
|
-
$._literal_constant,
|
|
303
|
-
$._string_literal,
|
|
304
|
-
),
|
|
305
270
|
|
|
306
|
-
|
|
271
|
+
// _primary_expression: $ => choice(
|
|
272
|
+
// $._literal_constant,
|
|
273
|
+
// $._string_literal,
|
|
274
|
+
// ),
|
|
307
275
|
|
|
308
276
|
url: $ => sep1(/[a-zA-Z_][a-zA-Z_0-9]*/, '/'),
|
|
309
|
-
|
|
277
|
+
// module: $ => $.identifier,
|
|
310
278
|
identifier: $ => /[a-zA-Z_][a-zA-Z_0-9]*/,
|
|
311
|
-
definition_name: $ => /[A-Z](([a-z]+[A-Z]?)*)/, // Pascal Case - no digits allowed
|
|
279
|
+
// definition_name: $ => /[A-Z](([a-z]+[A-Z]?)*)/, // Pascal Case - no digits allowed
|
|
312
|
-
variable_name: $ => /[a-z][a-z]*(([A-Z][a-z]+)*[A-Z]?|([a-z]+[A-Z])*|[A-Z])/, // Lower Camel Case - no digits allowed
|
|
280
|
+
// variable_name: $ => /[a-z][a-z]*(([A-Z][a-z]+)*[A-Z]?|([a-z]+[A-Z])*|[A-Z])/, // Lower Camel Case - no digits allowed
|
|
313
|
-
enum_field_name: $ => /[A-Z_][A-Z_0-9]*/,
|
|
281
|
+
// enum_field_name: $ => /[A-Z_][A-Z_0-9]*/,
|
|
314
|
-
|
|
282
|
+
|
|
315
|
-
// Literals
|
|
283
|
+
// // Literals
|
|
316
|
-
boolean_literal: $ => choice("true", "false"),
|
|
284
|
+
// boolean_literal: $ => choice("true", "false"),
|
|
317
|
-
integer_literal: $ => token(seq(optional(/[1-9]/), DEC_DIGITS)),
|
|
285
|
+
// integer_literal: $ => token(seq(optional(/[1-9]/), DEC_DIGITS)),
|
|
318
|
-
hex_literal: $ => token(seq("0", /[xX]/, HEX_DIGITS)),
|
|
286
|
+
// hex_literal: $ => token(seq("0", /[xX]/, HEX_DIGITS)),
|
|
319
|
-
bin_literal: $ => token(seq("0", /[bB]/, BIN_DIGITS)),
|
|
287
|
+
// bin_literal: $ => token(seq("0", /[bB]/, BIN_DIGITS)),
|
|
320
|
-
float_literal: $ => token(choice(
|
|
288
|
+
// float_literal: $ => token(choice(
|
|
321
|
-
|
|
289
|
+
// seq(
|
|
322
|
-
|
|
290
|
+
// seq(optional(DEC_DIGITS), ".", DEC_DIGITS),
|
|
323
|
-
|
|
291
|
+
// optional(/[fF]/)
|
|
324
|
-
|
|
292
|
+
// ),
|
|
325
|
-
|
|
293
|
+
// seq(DEC_DIGITS, /[fF]/)
|
|
326
|
-
)),
|
|
294
|
+
// )),
|
|
327
|
-
character_literal: $ => seq(
|
|
295
|
+
// character_literal: $ => seq(
|
|
328
|
-
|
|
296
|
+
// "'",
|
|
329
|
-
|
|
297
|
+
// choice($.character_escape_seq, /[^\n\r'\\]/),
|
|
330
|
-
|
|
298
|
+
// "'"
|
|
331
|
-
),
|
|
299
|
+
// ),
|
|
332
|
-
character_escape_seq: $ => choice(
|
|
300
|
+
// character_escape_seq: $ => choice(
|
|
333
|
-
|
|
301
|
+
// $._uni_character_literal,
|
|
334
|
-
|
|
302
|
+
// $._escaped_identifier
|
|
335
|
-
),
|
|
303
|
+
// ),
|
|
336
|
-
_uni_character_literal: $ => seq(
|
|
304
|
+
// _uni_character_literal: $ => seq(
|
|
337
|
-
|
|
305
|
+
// "\\u",
|
|
338
|
-
|
|
306
|
+
// /[0-9a-fA-F]{4}/
|
|
339
|
-
),
|
|
307
|
+
// ),
|
|
340
|
-
_escaped_identifier: $ => /\\[tbrn'"\\$]/,
|
|
308
|
+
// _escaped_identifier: $ => /\\[tbrn'"\\$]/,
|
|
341
309
|
|
|
342
|
-
_string_literal: $ => choice(
|
|
310
|
+
// _string_literal: $ => choice(
|
|
343
|
-
|
|
311
|
+
// $.line_string_literal,
|
|
344
|
-
|
|
312
|
+
// $.multi_line_string_literal
|
|
345
|
-
),
|
|
313
|
+
// ),
|
|
346
314
|
|
|
347
|
-
line_string_literal: $ => seq('"', repeat(choice($._line_string_content, $._interpolation)), '"'),
|
|
315
|
+
// line_string_literal: $ => seq('"', repeat(choice($._line_string_content, $._interpolation)), '"'),
|
|
348
316
|
|
|
349
|
-
multi_line_string_literal: $ => seq(
|
|
317
|
+
// multi_line_string_literal: $ => seq(
|
|
318
|
+
// '`',
|
|
319
|
+
// repeat(choice(
|
|
320
|
+
// $._multi_line_string_content,
|
|
321
|
+
// $._interpolation
|
|
322
|
+
// )),
|
|
323
|
+
// '`'
|
|
350
|
-
|
|
324
|
+
// ),
|
|
351
|
-
repeat(choice(
|
|
352
|
-
$._multi_line_string_content,
|
|
353
|
-
$._interpolation
|
|
354
|
-
)),
|
|
355
|
-
'`'
|
|
356
|
-
),
|
|
357
325
|
|
|
358
|
-
_line_string_content: $ => choice(
|
|
326
|
+
// _line_string_content: $ => choice(
|
|
359
|
-
|
|
327
|
+
// $._line_str_text,
|
|
360
|
-
|
|
328
|
+
// $.character_escape_seq
|
|
361
|
-
),
|
|
329
|
+
// ),
|
|
362
330
|
|
|
363
|
-
_multi_line_string_content: $ => choice($._multi_line_str_text, '"'),
|
|
331
|
+
// _multi_line_string_content: $ => choice($._multi_line_str_text, '"'),
|
|
364
332
|
|
|
365
|
-
_line_str_text: $ => /[^\\"$]+/,
|
|
333
|
+
// _line_str_text: $ => /[^\\"$]+/,
|
|
366
334
|
|
|
367
|
-
_multi_line_str_text: $ => /[^"$]+/,
|
|
335
|
+
// _multi_line_str_text: $ => /[^"$]+/,
|
|
368
336
|
|
|
369
|
-
_interpolation: $ => choice(
|
|
337
|
+
// _interpolation: $ => choice(
|
|
370
|
-
|
|
338
|
+
// // seq("${", alias($._expression, $.interpolated_expression), "}"),
|
|
371
|
-
|
|
339
|
+
// seq("$", alias($.identifier, $.interpolated_identifier))
|
|
372
|
-
),
|
|
340
|
+
// ),
|
|
373
341
|
|
|
374
|
-
_literal_constant: $ => choice(
|
|
342
|
+
// _literal_constant: $ => choice(
|
|
375
|
-
|
|
343
|
+
// $.boolean_literal,
|
|
376
|
-
|
|
344
|
+
// $.integer_literal,
|
|
377
|
-
|
|
345
|
+
// $.hex_literal,
|
|
378
|
-
|
|
346
|
+
// $.bin_literal,
|
|
379
|
-
|
|
347
|
+
// $.character_literal,
|
|
380
|
-
|
|
348
|
+
// $.float_literal,
|
|
381
|
-
|
|
349
|
+
// "null",
|
|
382
|
-
),
|
|
350
|
+
// ),
|
|
383
351
|
|
|
384
|
-
comment: $ => token(prec(PREC.COMMENT, choice(
|
|
352
|
+
// comment: $ => token(prec(PREC.COMMENT, choice(
|
|
385
|
-
|
|
353
|
+
// seq("#", /.*/),
|
|
386
|
-
))),
|
|
354
|
+
// ))),
|
|
387
355
|
}
|
|
388
356
|
});
|
|
389
357
|
|
|
@@ -391,6 +359,14 @@ function commaSep1(rule) {
|
|
|
391
359
|
return sep1(rule, ',')
|
|
392
360
|
}
|
|
393
361
|
|
|
362
|
+
function pipeSep1(rule) {
|
|
363
|
+
return sep1(rule, '|')
|
|
364
|
+
}
|
|
365
|
+
|
|
394
366
|
function sep1(rule, separator) {
|
|
395
367
|
return seq(rule, repeat(seq(separator, rule)))
|
|
396
368
|
}
|
|
369
|
+
|
|
370
|
+
function series_of(rule, separator) {
|
|
371
|
+
return seq(rule, repeat(seq(separator, rule)), optional(separator));
|
|
372
|
+
}
|
package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"name": "tree-sitter-
|
|
2
|
+
"name": "tree-sitter-palm",
|
|
3
3
|
"version": "0.1.0",
|
|
4
4
|
"main": "bindings/node",
|
|
5
5
|
"description": "Tree-Sitter grammar for pine",
|
src/grammar.json
CHANGED
|
@@ -1,104 +1,299 @@
|
|
|
1
1
|
{
|
|
2
|
-
"name": "
|
|
2
|
+
"name": "palm",
|
|
3
3
|
"rules": {
|
|
4
4
|
"source_file": {
|
|
5
5
|
"type": "SEQ",
|
|
6
6
|
"members": [
|
|
7
7
|
{
|
|
8
|
-
"type": "SEQ",
|
|
9
|
-
"members": [
|
|
10
|
-
{
|
|
11
|
-
"type": "STRING",
|
|
12
|
-
"value": "package"
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
|
|
8
|
+
"type": "SYMBOL",
|
|
16
|
-
|
|
9
|
+
"name": "module"
|
|
17
|
-
}
|
|
18
|
-
]
|
|
19
10
|
},
|
|
20
11
|
{
|
|
21
12
|
"type": "REPEAT",
|
|
22
13
|
"content": {
|
|
23
14
|
"type": "SYMBOL",
|
|
24
|
-
"name": "
|
|
15
|
+
"name": "import"
|
|
25
16
|
}
|
|
26
17
|
},
|
|
27
18
|
{
|
|
28
19
|
"type": "REPEAT",
|
|
29
20
|
"content": {
|
|
21
|
+
"type": "CHOICE",
|
|
22
|
+
"members": [
|
|
23
|
+
{
|
|
30
|
-
|
|
24
|
+
"type": "SYMBOL",
|
|
31
|
-
|
|
25
|
+
"name": "record"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"type": "SYMBOL",
|
|
29
|
+
"name": "type"
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
]
|
|
35
35
|
},
|
|
36
|
-
"
|
|
36
|
+
"module": {
|
|
37
37
|
"type": "SEQ",
|
|
38
38
|
"members": [
|
|
39
39
|
{
|
|
40
40
|
"type": "STRING",
|
|
41
|
-
"value": "
|
|
41
|
+
"value": "module"
|
|
42
42
|
},
|
|
43
43
|
{
|
|
44
|
+
"type": "FIELD",
|
|
45
|
+
"name": "module",
|
|
46
|
+
"content": {
|
|
44
|
-
|
|
47
|
+
"type": "SYMBOL",
|
|
45
|
-
|
|
48
|
+
"name": "module_name"
|
|
49
|
+
}
|
|
46
50
|
}
|
|
47
51
|
]
|
|
48
52
|
},
|
|
49
|
-
"
|
|
53
|
+
"import": {
|
|
50
|
-
"type": "
|
|
54
|
+
"type": "SEQ",
|
|
51
55
|
"members": [
|
|
52
56
|
{
|
|
53
|
-
"type": "
|
|
57
|
+
"type": "STRING",
|
|
54
|
-
"
|
|
58
|
+
"value": "import"
|
|
55
59
|
},
|
|
56
60
|
{
|
|
61
|
+
"type": "FIELD",
|
|
62
|
+
"name": "module",
|
|
63
|
+
"content": {
|
|
57
|
-
|
|
64
|
+
"type": "SYMBOL",
|
|
58
|
-
|
|
65
|
+
"name": "module_name"
|
|
66
|
+
}
|
|
59
67
|
},
|
|
60
68
|
{
|
|
69
|
+
"type": "CHOICE",
|
|
70
|
+
"members": [
|
|
71
|
+
{
|
|
72
|
+
"type": "SEQ",
|
|
73
|
+
"members": [
|
|
74
|
+
{
|
|
75
|
+
"type": "STRING",
|
|
76
|
+
"value": "."
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"type": "FIELD",
|
|
80
|
+
"name": "imports",
|
|
81
|
+
"content": {
|
|
61
|
-
|
|
82
|
+
"type": "SYMBOL",
|
|
62
|
-
|
|
83
|
+
"name": "unqualified_imports"
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
]
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"type": "BLANK"
|
|
90
|
+
}
|
|
91
|
+
]
|
|
63
92
|
},
|
|
64
93
|
{
|
|
94
|
+
"type": "CHOICE",
|
|
95
|
+
"members": [
|
|
96
|
+
{
|
|
97
|
+
"type": "SEQ",
|
|
98
|
+
"members": [
|
|
99
|
+
{
|
|
100
|
+
"type": "STRING",
|
|
101
|
+
"value": "as"
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"type": "FIELD",
|
|
105
|
+
"name": "alias",
|
|
106
|
+
"content": {
|
|
65
|
-
|
|
107
|
+
"type": "SYMBOL",
|
|
66
|
-
|
|
108
|
+
"name": "identifier"
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
]
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
"type": "BLANK"
|
|
115
|
+
}
|
|
116
|
+
]
|
|
67
117
|
}
|
|
68
118
|
]
|
|
69
119
|
},
|
|
70
|
-
"
|
|
120
|
+
"module_name": {
|
|
71
121
|
"type": "SEQ",
|
|
72
122
|
"members": [
|
|
73
123
|
{
|
|
124
|
+
"type": "SYMBOL",
|
|
125
|
+
"name": "_name"
|
|
126
|
+
},
|
|
127
|
+
{
|
|
74
|
-
"type": "
|
|
128
|
+
"type": "REPEAT",
|
|
75
|
-
"name": "decorators",
|
|
76
129
|
"content": {
|
|
77
|
-
"type": "
|
|
130
|
+
"type": "SEQ",
|
|
78
131
|
"members": [
|
|
79
132
|
{
|
|
80
|
-
"type": "REPEAT",
|
|
81
|
-
"content": {
|
|
82
|
-
|
|
133
|
+
"type": "STRING",
|
|
83
|
-
|
|
134
|
+
"value": "/"
|
|
84
|
-
}
|
|
85
135
|
},
|
|
86
136
|
{
|
|
87
|
-
"type": "
|
|
137
|
+
"type": "SYMBOL",
|
|
138
|
+
"name": "_name"
|
|
88
139
|
}
|
|
89
140
|
]
|
|
90
141
|
}
|
|
142
|
+
}
|
|
143
|
+
]
|
|
144
|
+
},
|
|
145
|
+
"unqualified_imports": {
|
|
146
|
+
"type": "SEQ",
|
|
147
|
+
"members": [
|
|
148
|
+
{
|
|
149
|
+
"type": "STRING",
|
|
150
|
+
"value": "{"
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
"type": "CHOICE",
|
|
154
|
+
"members": [
|
|
155
|
+
{
|
|
156
|
+
"type": "SEQ",
|
|
157
|
+
"members": [
|
|
158
|
+
{
|
|
159
|
+
"type": "SYMBOL",
|
|
160
|
+
"name": "unqualified_import"
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
"type": "REPEAT",
|
|
164
|
+
"content": {
|
|
165
|
+
"type": "SEQ",
|
|
166
|
+
"members": [
|
|
167
|
+
{
|
|
168
|
+
"type": "STRING",
|
|
169
|
+
"value": ","
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
"type": "SYMBOL",
|
|
173
|
+
"name": "unqualified_import"
|
|
174
|
+
}
|
|
175
|
+
]
|
|
176
|
+
}
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
"type": "CHOICE",
|
|
180
|
+
"members": [
|
|
181
|
+
{
|
|
182
|
+
"type": "STRING",
|
|
183
|
+
"value": ","
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
"type": "BLANK"
|
|
187
|
+
}
|
|
188
|
+
]
|
|
189
|
+
}
|
|
190
|
+
]
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
"type": "BLANK"
|
|
194
|
+
}
|
|
195
|
+
]
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
"type": "STRING",
|
|
199
|
+
"value": "}"
|
|
200
|
+
}
|
|
201
|
+
]
|
|
202
|
+
},
|
|
203
|
+
"unqualified_import": {
|
|
204
|
+
"type": "CHOICE",
|
|
205
|
+
"members": [
|
|
206
|
+
{
|
|
207
|
+
"type": "SEQ",
|
|
208
|
+
"members": [
|
|
209
|
+
{
|
|
210
|
+
"type": "FIELD",
|
|
211
|
+
"name": "name",
|
|
212
|
+
"content": {
|
|
213
|
+
"type": "SYMBOL",
|
|
214
|
+
"name": "identifier"
|
|
215
|
+
}
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
"type": "CHOICE",
|
|
219
|
+
"members": [
|
|
220
|
+
{
|
|
221
|
+
"type": "SEQ",
|
|
222
|
+
"members": [
|
|
223
|
+
{
|
|
224
|
+
"type": "STRING",
|
|
225
|
+
"value": "as"
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
"type": "FIELD",
|
|
229
|
+
"name": "alias",
|
|
230
|
+
"content": {
|
|
231
|
+
"type": "SYMBOL",
|
|
232
|
+
"name": "identifier"
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
]
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
"type": "BLANK"
|
|
239
|
+
}
|
|
240
|
+
]
|
|
241
|
+
}
|
|
242
|
+
]
|
|
91
243
|
},
|
|
244
|
+
{
|
|
245
|
+
"type": "SEQ",
|
|
246
|
+
"members": [
|
|
247
|
+
{
|
|
248
|
+
"type": "FIELD",
|
|
249
|
+
"name": "name",
|
|
250
|
+
"content": {
|
|
251
|
+
"type": "SYMBOL",
|
|
252
|
+
"name": "type_identifier"
|
|
253
|
+
}
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
"type": "CHOICE",
|
|
257
|
+
"members": [
|
|
258
|
+
{
|
|
259
|
+
"type": "SEQ",
|
|
260
|
+
"members": [
|
|
261
|
+
{
|
|
262
|
+
"type": "STRING",
|
|
263
|
+
"value": "as"
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
"type": "FIELD",
|
|
267
|
+
"name": "alias",
|
|
268
|
+
"content": {
|
|
269
|
+
"type": "SYMBOL",
|
|
270
|
+
"name": "type_identifier"
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
]
|
|
274
|
+
},
|
|
275
|
+
{
|
|
276
|
+
"type": "BLANK"
|
|
277
|
+
}
|
|
278
|
+
]
|
|
279
|
+
}
|
|
280
|
+
]
|
|
281
|
+
}
|
|
282
|
+
]
|
|
283
|
+
},
|
|
284
|
+
"record": {
|
|
285
|
+
"type": "SEQ",
|
|
286
|
+
"members": [
|
|
92
287
|
{
|
|
93
288
|
"type": "STRING",
|
|
94
|
-
"value": "
|
|
289
|
+
"value": "record"
|
|
95
290
|
},
|
|
96
291
|
{
|
|
97
292
|
"type": "FIELD",
|
|
98
293
|
"name": "name",
|
|
99
294
|
"content": {
|
|
100
295
|
"type": "SYMBOL",
|
|
101
|
-
"name": "
|
|
296
|
+
"name": "type_identifier"
|
|
102
297
|
}
|
|
103
298
|
},
|
|
104
299
|
{
|
|
@@ -117,79 +312,32 @@
|
|
|
117
312
|
]
|
|
118
313
|
}
|
|
119
314
|
},
|
|
120
|
-
{
|
|
121
|
-
"type": "FIELD",
|
|
122
|
-
"name": "traits",
|
|
123
|
-
"content": {
|
|
124
|
-
"type": "CHOICE",
|
|
125
|
-
"members": [
|
|
126
|
-
{
|
|
127
|
-
"type": "SYMBOL",
|
|
128
|
-
"name": "trait_list"
|
|
129
|
-
},
|
|
130
|
-
{
|
|
131
|
-
"type": "BLANK"
|
|
132
|
-
}
|
|
133
|
-
]
|
|
134
|
-
}
|
|
135
|
-
},
|
|
136
315
|
{
|
|
137
316
|
"type": "FIELD",
|
|
138
317
|
"name": "fields",
|
|
139
318
|
"content": {
|
|
140
|
-
"type": "
|
|
319
|
+
"type": "REPEAT",
|
|
141
|
-
"
|
|
320
|
+
"content": {
|
|
142
|
-
{
|
|
143
|
-
"type": "STRING",
|
|
144
|
-
"value": "("
|
|
145
|
-
},
|
|
146
|
-
{
|
|
147
|
-
"type": "SEQ",
|
|
148
|
-
"members": [
|
|
149
|
-
{
|
|
150
|
-
|
|
321
|
+
"type": "SYMBOL",
|
|
151
|
-
|
|
322
|
+
"name": "type_field"
|
|
152
|
-
},
|
|
153
|
-
{
|
|
154
|
-
"type": "REPEAT",
|
|
155
|
-
"content": {
|
|
156
|
-
"type": "SEQ",
|
|
157
|
-
"members": [
|
|
158
|
-
{
|
|
159
|
-
"type": "STRING",
|
|
160
|
-
"value": ","
|
|
161
|
-
},
|
|
162
|
-
{
|
|
163
|
-
"type": "SYMBOL",
|
|
164
|
-
"name": "type_field"
|
|
165
|
-
|
|
323
|
+
}
|
|
166
|
-
]
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
]
|
|
170
|
-
},
|
|
171
|
-
{
|
|
172
|
-
"type": "STRING",
|
|
173
|
-
"value": ")"
|
|
174
|
-
}
|
|
175
|
-
]
|
|
176
324
|
}
|
|
177
325
|
}
|
|
178
326
|
]
|
|
179
327
|
},
|
|
180
|
-
"
|
|
328
|
+
"type": {
|
|
181
329
|
"type": "SEQ",
|
|
182
330
|
"members": [
|
|
183
331
|
{
|
|
184
332
|
"type": "STRING",
|
|
185
|
-
"value": "
|
|
333
|
+
"value": "type"
|
|
186
334
|
},
|
|
187
335
|
{
|
|
188
336
|
"type": "FIELD",
|
|
189
337
|
"name": "name",
|
|
190
338
|
"content": {
|
|
191
339
|
"type": "SYMBOL",
|
|
192
|
-
"name": "
|
|
340
|
+
"name": "type_identifier"
|
|
193
341
|
}
|
|
194
342
|
},
|
|
195
343
|
{
|
|
@@ -208,229 +356,71 @@
|
|
|
208
356
|
]
|
|
209
357
|
}
|
|
210
358
|
},
|
|
359
|
+
{
|
|
360
|
+
"type": "STRING",
|
|
361
|
+
"value": "="
|
|
362
|
+
},
|
|
211
363
|
{
|
|
212
364
|
"type": "FIELD",
|
|
213
|
-
"name": "
|
|
365
|
+
"name": "types",
|
|
214
366
|
"content": {
|
|
215
367
|
"type": "SEQ",
|
|
216
368
|
"members": [
|
|
217
369
|
{
|
|
218
|
-
"type": "
|
|
370
|
+
"type": "SYMBOL",
|
|
219
|
-
"
|
|
371
|
+
"name": "type_name"
|
|
220
372
|
},
|
|
221
373
|
{
|
|
374
|
+
"type": "REPEAT",
|
|
375
|
+
"content": {
|
|
222
|
-
|
|
376
|
+
"type": "SEQ",
|
|
223
|
-
|
|
377
|
+
"members": [
|
|
224
|
-
|
|
378
|
+
{
|
|
379
|
+
"type": "STRING",
|
|
380
|
+
"value": "|"
|
|
381
|
+
},
|
|
382
|
+
{
|
|
225
|
-
|
|
383
|
+
"type": "SYMBOL",
|
|
226
|
-
|
|
384
|
+
"name": "type_name"
|
|
227
|
-
},
|
|
228
|
-
{
|
|
229
|
-
"type": "REPEAT",
|
|
230
|
-
"content": {
|
|
231
|
-
"type": "SEQ",
|
|
232
|
-
"members": [
|
|
233
|
-
{
|
|
234
|
-
"type": "STRING",
|
|
235
|
-
"value": ","
|
|
236
|
-
},
|
|
237
|
-
{
|
|
238
|
-
"type": "SYMBOL",
|
|
239
|
-
"name": "trait_field"
|
|
240
|
-
}
|
|
241
|
-
]
|
|
242
385
|
}
|
|
386
|
+
]
|
|
243
|
-
|
|
387
|
+
}
|
|
244
|
-
]
|
|
245
|
-
},
|
|
246
|
-
{
|
|
247
|
-
"type": "STRING",
|
|
248
|
-
"value": ")"
|
|
249
388
|
}
|
|
250
389
|
]
|
|
251
390
|
}
|
|
252
391
|
}
|
|
253
392
|
]
|
|
254
393
|
},
|
|
255
|
-
"
|
|
394
|
+
"return_type": {
|
|
256
395
|
"type": "SEQ",
|
|
257
396
|
"members": [
|
|
258
|
-
{
|
|
259
|
-
"type": "STRING",
|
|
260
|
-
"value": "enum"
|
|
261
|
-
},
|
|
262
397
|
{
|
|
263
398
|
"type": "FIELD",
|
|
264
399
|
"name": "name",
|
|
265
400
|
"content": {
|
|
266
401
|
"type": "SYMBOL",
|
|
267
|
-
"name": "definition_name"
|
|
268
|
-
}
|
|
269
|
-
},
|
|
270
|
-
{
|
|
271
|
-
"type": "FIELD",
|
|
272
|
-
"name": "types",
|
|
273
|
-
"content": {
|
|
274
|
-
"type": "SEQ",
|
|
275
|
-
"members": [
|
|
276
|
-
{
|
|
277
|
-
"type": "STRING",
|
|
278
|
-
"value": "("
|
|
279
|
-
},
|
|
280
|
-
{
|
|
281
|
-
"type": "SEQ",
|
|
282
|
-
"members": [
|
|
283
|
-
{
|
|
284
|
-
"type": "SYMBOL",
|
|
285
|
-
|
|
402
|
+
"name": "type_identifier"
|
|
286
|
-
},
|
|
287
|
-
{
|
|
288
|
-
"type": "REPEAT",
|
|
289
|
-
"content": {
|
|
290
|
-
"type": "SEQ",
|
|
291
|
-
"members": [
|
|
292
|
-
{
|
|
293
|
-
"type": "STRING",
|
|
294
|
-
"value": ","
|
|
295
|
-
},
|
|
296
|
-
{
|
|
297
|
-
"type": "SYMBOL",
|
|
298
|
-
"name": "type_field"
|
|
299
|
-
}
|
|
300
|
-
]
|
|
301
|
-
}
|
|
302
|
-
}
|
|
303
|
-
]
|
|
304
|
-
},
|
|
305
|
-
{
|
|
306
|
-
"type": "STRING",
|
|
307
|
-
"value": ")"
|
|
308
|
-
}
|
|
309
|
-
]
|
|
310
403
|
}
|
|
311
404
|
},
|
|
312
405
|
{
|
|
313
406
|
"type": "FIELD",
|
|
314
|
-
"name": "
|
|
407
|
+
"name": "generics",
|
|
315
408
|
"content": {
|
|
316
|
-
"type": "
|
|
409
|
+
"type": "CHOICE",
|
|
317
410
|
"members": [
|
|
318
|
-
{
|
|
319
|
-
"type": "STRING",
|
|
320
|
-
"value": "{"
|
|
321
|
-
},
|
|
322
411
|
{
|
|
323
412
|
"type": "SEQ",
|
|
324
413
|
"members": [
|
|
325
414
|
{
|
|
326
|
-
"type": "
|
|
415
|
+
"type": "STRING",
|
|
327
|
-
"
|
|
416
|
+
"value": "("
|
|
328
417
|
},
|
|
329
|
-
{
|
|
330
|
-
"type": "REPEAT",
|
|
331
|
-
"content": {
|
|
332
|
-
"type": "SEQ",
|
|
333
|
-
"members": [
|
|
334
|
-
{
|
|
335
|
-
"type": "STRING",
|
|
336
|
-
"value": ","
|
|
337
|
-
},
|
|
338
|
-
{
|
|
339
|
-
"type": "SYMBOL",
|
|
340
|
-
"name": "enum_field"
|
|
341
|
-
}
|
|
342
|
-
]
|
|
343
|
-
}
|
|
344
|
-
}
|
|
345
|
-
]
|
|
346
|
-
},
|
|
347
|
-
{
|
|
348
|
-
"type": "STRING",
|
|
349
|
-
"value": "}"
|
|
350
|
-
}
|
|
351
|
-
]
|
|
352
|
-
}
|
|
353
|
-
}
|
|
354
|
-
]
|
|
355
|
-
},
|
|
356
|
-
"fun_definition": {
|
|
357
|
-
"type": "SEQ",
|
|
358
|
-
"members": [
|
|
359
|
-
{
|
|
360
|
-
"type": "FIELD",
|
|
361
|
-
"name": "decorators",
|
|
362
|
-
"content": {
|
|
363
|
-
"type": "CHOICE",
|
|
364
|
-
"members": [
|
|
365
|
-
{
|
|
366
|
-
"type": "REPEAT",
|
|
367
|
-
"content": {
|
|
368
|
-
"type": "SYMBOL",
|
|
369
|
-
"name": "decorator_name"
|
|
370
|
-
}
|
|
371
|
-
},
|
|
372
|
-
{
|
|
373
|
-
"type": "BLANK"
|
|
374
|
-
}
|
|
375
|
-
]
|
|
376
|
-
}
|
|
377
|
-
},
|
|
378
|
-
{
|
|
379
|
-
"type": "STRING",
|
|
380
|
-
"value": "fun"
|
|
381
|
-
},
|
|
382
|
-
{
|
|
383
|
-
"type": "FIELD",
|
|
384
|
-
"name": "name",
|
|
385
|
-
"content": {
|
|
386
|
-
"type": "CHOICE",
|
|
387
|
-
"members": [
|
|
388
|
-
{
|
|
389
|
-
"type": "SYMBOL",
|
|
390
|
-
"name": "identifier"
|
|
391
|
-
},
|
|
392
|
-
{
|
|
393
|
-
"type": "SYMBOL",
|
|
394
|
-
"name": "_extension"
|
|
395
|
-
}
|
|
396
|
-
]
|
|
397
|
-
}
|
|
398
|
-
},
|
|
399
|
-
{
|
|
400
|
-
"type": "FIELD",
|
|
401
|
-
"name": "generics",
|
|
402
|
-
"content": {
|
|
403
|
-
"type": "CHOICE",
|
|
404
|
-
"members": [
|
|
405
|
-
{
|
|
406
|
-
"type": "SYMBOL",
|
|
407
|
-
"name": "generic_list"
|
|
408
|
-
},
|
|
409
|
-
{
|
|
410
|
-
"type": "BLANK"
|
|
411
|
-
}
|
|
412
|
-
]
|
|
413
|
-
}
|
|
414
|
-
},
|
|
415
|
-
{
|
|
416
|
-
"type": "FIELD",
|
|
417
|
-
"name": "params",
|
|
418
|
-
"content": {
|
|
419
|
-
"type": "SEQ",
|
|
420
|
-
"members": [
|
|
421
|
-
{
|
|
422
|
-
"type": "STRING",
|
|
423
|
-
"value": "("
|
|
424
|
-
},
|
|
425
|
-
{
|
|
426
|
-
"type": "CHOICE",
|
|
427
|
-
"members": [
|
|
428
418
|
{
|
|
429
419
|
"type": "SEQ",
|
|
430
420
|
"members": [
|
|
431
421
|
{
|
|
432
422
|
"type": "SYMBOL",
|
|
433
|
-
"name": "
|
|
423
|
+
"name": "identifier"
|
|
434
424
|
},
|
|
435
425
|
{
|
|
436
426
|
"type": "REPEAT",
|
|
@@ -443,7 +433,7 @@
|
|
|
443
433
|
},
|
|
444
434
|
{
|
|
445
435
|
"type": "SYMBOL",
|
|
446
|
-
"name": "
|
|
436
|
+
"name": "identifier"
|
|
447
437
|
}
|
|
448
438
|
]
|
|
449
439
|
}
|
|
@@ -451,162 +441,126 @@
|
|
|
451
441
|
]
|
|
452
442
|
},
|
|
453
443
|
{
|
|
454
|
-
"type": "
|
|
444
|
+
"type": "STRING",
|
|
445
|
+
"value": ")"
|
|
455
446
|
}
|
|
456
447
|
]
|
|
457
448
|
},
|
|
458
449
|
{
|
|
459
|
-
"type": "
|
|
450
|
+
"type": "BLANK"
|
|
460
|
-
"value": ")"
|
|
461
451
|
}
|
|
462
452
|
]
|
|
463
453
|
}
|
|
454
|
+
}
|
|
455
|
+
]
|
|
464
|
-
|
|
456
|
+
},
|
|
465
|
-
|
|
457
|
+
"type_name": {
|
|
466
|
-
|
|
458
|
+
"type": "SEQ",
|
|
467
|
-
|
|
459
|
+
"members": [
|
|
468
|
-
},
|
|
469
460
|
{
|
|
470
461
|
"type": "FIELD",
|
|
471
|
-
"name": "
|
|
462
|
+
"name": "name",
|
|
472
463
|
"content": {
|
|
464
|
+
"type": "SYMBOL",
|
|
465
|
+
"name": "type_identifier"
|
|
466
|
+
}
|
|
467
|
+
},
|
|
468
|
+
{
|
|
473
|
-
|
|
469
|
+
"type": "CHOICE",
|
|
474
|
-
|
|
470
|
+
"members": [
|
|
475
|
-
|
|
471
|
+
{
|
|
476
|
-
|
|
472
|
+
"type": "SEQ",
|
|
477
|
-
|
|
473
|
+
"members": [
|
|
478
|
-
|
|
474
|
+
{
|
|
475
|
+
"type": "STRING",
|
|
476
|
+
"value": "("
|
|
477
|
+
},
|
|
478
|
+
{
|
|
479
|
+
"type": "CHOICE",
|
|
480
|
+
"members": [
|
|
481
|
+
{
|
|
479
|
-
|
|
482
|
+
"type": "SYMBOL",
|
|
480
|
-
|
|
483
|
+
"name": "identifier"
|
|
481
|
-
|
|
484
|
+
},
|
|
482
|
-
|
|
485
|
+
{
|
|
483
|
-
"type": "REPEAT",
|
|
484
|
-
"content": {
|
|
485
486
|
"type": "SEQ",
|
|
486
487
|
"members": [
|
|
487
488
|
{
|
|
488
|
-
"type": "
|
|
489
|
+
"type": "SYMBOL",
|
|
489
|
-
"
|
|
490
|
+
"name": "type_field"
|
|
490
491
|
},
|
|
491
492
|
{
|
|
493
|
+
"type": "REPEAT",
|
|
494
|
+
"content": {
|
|
495
|
+
"type": "SEQ",
|
|
496
|
+
"members": [
|
|
497
|
+
{
|
|
498
|
+
"type": "STRING",
|
|
499
|
+
"value": ","
|
|
500
|
+
},
|
|
501
|
+
{
|
|
492
|
-
|
|
502
|
+
"type": "SYMBOL",
|
|
493
|
-
|
|
503
|
+
"name": "type_field"
|
|
504
|
+
}
|
|
505
|
+
]
|
|
506
|
+
}
|
|
494
507
|
}
|
|
495
508
|
]
|
|
496
509
|
}
|
|
510
|
+
]
|
|
511
|
+
},
|
|
512
|
+
{
|
|
513
|
+
"type": "STRING",
|
|
514
|
+
"value": ")"
|
|
497
|
-
|
|
515
|
+
}
|
|
498
|
-
|
|
516
|
+
]
|
|
499
|
-
|
|
517
|
+
},
|
|
500
|
-
|
|
518
|
+
{
|
|
501
|
-
|
|
519
|
+
"type": "BLANK"
|
|
502
|
-
|
|
520
|
+
}
|
|
503
|
-
|
|
521
|
+
]
|
|
504
|
-
}
|
|
505
|
-
},
|
|
506
|
-
{
|
|
507
|
-
"type": "FIELD",
|
|
508
|
-
"name": "body",
|
|
509
|
-
"content": {
|
|
510
|
-
"type": "SYMBOL",
|
|
511
|
-
"name": "_block"
|
|
512
|
-
}
|
|
513
522
|
}
|
|
514
523
|
]
|
|
515
524
|
},
|
|
516
|
-
"
|
|
525
|
+
"type_field": {
|
|
517
526
|
"type": "SEQ",
|
|
518
527
|
"members": [
|
|
519
528
|
{
|
|
520
|
-
"type": "
|
|
529
|
+
"type": "FIELD",
|
|
521
|
-
"
|
|
530
|
+
"name": "name",
|
|
522
|
-
},
|
|
523
|
-
|
|
531
|
+
"content": {
|
|
524
|
-
|
|
532
|
+
"type": "SYMBOL",
|
|
525
|
-
|
|
533
|
+
"name": "identifier"
|
|
534
|
+
}
|
|
526
535
|
},
|
|
527
536
|
{
|
|
528
537
|
"type": "STRING",
|
|
529
|
-
"value": "
|
|
538
|
+
"value": ":"
|
|
530
539
|
},
|
|
531
540
|
{
|
|
532
|
-
"type": "CHOICE",
|
|
533
|
-
"members": [
|
|
534
|
-
{
|
|
535
|
-
|
|
541
|
+
"type": "FIELD",
|
|
542
|
+
"name": "type",
|
|
536
|
-
|
|
543
|
+
"content": {
|
|
537
|
-
{
|
|
538
|
-
|
|
544
|
+
"type": "SYMBOL",
|
|
539
|
-
|
|
545
|
+
"name": "identifier"
|
|
540
|
-
},
|
|
541
|
-
{
|
|
542
|
-
"type": "REPEAT",
|
|
543
|
-
"content": {
|
|
544
|
-
"type": "SEQ",
|
|
545
|
-
"members": [
|
|
546
|
-
{
|
|
547
|
-
"type": "STRING",
|
|
548
|
-
"value": ","
|
|
549
|
-
},
|
|
550
|
-
{
|
|
551
|
-
"type": "SYMBOL",
|
|
552
|
-
"name": "_primary_expression"
|
|
553
|
-
|
|
546
|
+
}
|
|
554
|
-
]
|
|
555
|
-
}
|
|
556
|
-
}
|
|
557
|
-
]
|
|
558
|
-
},
|
|
559
|
-
{
|
|
560
|
-
"type": "BLANK"
|
|
561
|
-
}
|
|
562
|
-
]
|
|
563
|
-
},
|
|
564
|
-
{
|
|
565
|
-
"type": "STRING",
|
|
566
|
-
"value": ")"
|
|
567
547
|
}
|
|
568
548
|
]
|
|
569
549
|
},
|
|
570
|
-
"
|
|
550
|
+
"identifier": {
|
|
571
|
-
"type": "SEQ",
|
|
572
|
-
"members": [
|
|
573
|
-
{
|
|
574
|
-
|
|
551
|
+
"type": "PATTERN",
|
|
575
|
-
|
|
552
|
+
"value": "[a-zA-Z_][a-zA-Z_0-9]*"
|
|
576
|
-
|
|
553
|
+
},
|
|
577
|
-
{
|
|
578
|
-
"type": "SEQ",
|
|
579
|
-
|
|
554
|
+
"type_identifier": {
|
|
580
|
-
{
|
|
581
|
-
|
|
555
|
+
"type": "SYMBOL",
|
|
582
|
-
|
|
556
|
+
"name": "_upname"
|
|
583
|
-
},
|
|
584
|
-
{
|
|
585
|
-
"type": "REPEAT",
|
|
586
|
-
"content": {
|
|
587
|
-
"type": "SEQ",
|
|
588
|
-
"members": [
|
|
589
|
-
{
|
|
590
|
-
"type": "STRING",
|
|
591
|
-
"value": ","
|
|
592
|
-
},
|
|
593
|
-
{
|
|
594
|
-
"type": "SYMBOL",
|
|
595
|
-
"name": "definition_name"
|
|
596
|
-
}
|
|
597
|
-
]
|
|
598
|
-
}
|
|
599
|
-
}
|
|
600
|
-
]
|
|
601
|
-
}
|
|
602
|
-
]
|
|
603
557
|
},
|
|
604
558
|
"generic_list": {
|
|
605
559
|
"type": "SEQ",
|
|
606
560
|
"members": [
|
|
607
561
|
{
|
|
608
562
|
"type": "STRING",
|
|
609
|
-
"value": "
|
|
563
|
+
"value": "("
|
|
610
564
|
},
|
|
611
565
|
{
|
|
612
566
|
"type": "SEQ",
|
|
@@ -635,885 +589,55 @@
|
|
|
635
589
|
},
|
|
636
590
|
{
|
|
637
591
|
"type": "STRING",
|
|
638
|
-
"value": "
|
|
592
|
+
"value": ")"
|
|
639
593
|
}
|
|
640
594
|
]
|
|
641
595
|
},
|
|
642
|
-
"
|
|
596
|
+
"_discard_name": {
|
|
643
|
-
"type": "SEQ",
|
|
644
|
-
"members": [
|
|
645
|
-
{
|
|
646
|
-
"type": "SYMBOL",
|
|
647
|
-
"name": "definition_name"
|
|
648
|
-
},
|
|
649
|
-
{
|
|
650
|
-
"type": "CHOICE",
|
|
651
|
-
"members": [
|
|
652
|
-
{
|
|
653
|
-
|
|
597
|
+
"type": "PATTERN",
|
|
654
|
-
|
|
598
|
+
"value": "_[_0-9a-z]*"
|
|
655
|
-
},
|
|
656
|
-
{
|
|
657
|
-
"type": "BLANK"
|
|
658
|
-
}
|
|
659
|
-
]
|
|
660
|
-
}
|
|
661
|
-
]
|
|
662
599
|
},
|
|
663
|
-
"
|
|
600
|
+
"_name": {
|
|
664
|
-
"type": "SEQ",
|
|
665
|
-
"members": [
|
|
666
|
-
{
|
|
667
|
-
"type": "FIELD",
|
|
668
|
-
"name": "name",
|
|
669
|
-
"content": {
|
|
670
|
-
"type": "SYMBOL",
|
|
671
|
-
"name": "variable_name"
|
|
672
|
-
}
|
|
673
|
-
},
|
|
674
|
-
{
|
|
675
|
-
|
|
601
|
+
"type": "PATTERN",
|
|
676
|
-
|
|
602
|
+
"value": "[_a-z][_0-9a-z]*"
|
|
677
|
-
},
|
|
678
|
-
{
|
|
679
|
-
"type": "FIELD",
|
|
680
|
-
"name": "type",
|
|
681
|
-
"content": {
|
|
682
|
-
"type": "SYMBOL",
|
|
683
|
-
"name": "type"
|
|
684
|
-
}
|
|
685
|
-
}
|
|
686
|
-
]
|
|
687
603
|
},
|
|
688
|
-
"
|
|
604
|
+
"_upname": {
|
|
689
|
-
"type": "SEQ",
|
|
690
|
-
"members": [
|
|
691
|
-
{
|
|
692
|
-
|
|
605
|
+
"type": "PATTERN",
|
|
693
|
-
|
|
606
|
+
"value": "[A-Z][0-9a-zA-Z]*"
|
|
694
|
-
},
|
|
695
|
-
{
|
|
696
|
-
"type": "FIELD",
|
|
697
|
-
"name": "name",
|
|
698
|
-
"content": {
|
|
699
|
-
"type": "SYMBOL",
|
|
700
|
-
"name": "variable_name"
|
|
701
|
-
}
|
|
702
|
-
},
|
|
703
|
-
{
|
|
704
|
-
"type": "STRING",
|
|
705
|
-
"value": ":"
|
|
706
|
-
},
|
|
707
|
-
{
|
|
708
|
-
"type": "FIELD",
|
|
709
|
-
"name": "type",
|
|
710
|
-
"content": {
|
|
711
|
-
"type": "SYMBOL",
|
|
712
|
-
"name": "type"
|
|
713
|
-
}
|
|
714
|
-
}
|
|
715
|
-
]
|
|
716
607
|
},
|
|
717
|
-
"
|
|
608
|
+
"url": {
|
|
718
609
|
"type": "SEQ",
|
|
719
610
|
"members": [
|
|
720
611
|
{
|
|
721
|
-
"type": "
|
|
612
|
+
"type": "PATTERN",
|
|
722
|
-
"value": "
|
|
613
|
+
"value": "[a-zA-Z_][a-zA-Z_0-9]*"
|
|
723
|
-
},
|
|
724
|
-
{
|
|
725
|
-
"type": "FIELD",
|
|
726
|
-
"name": "name",
|
|
727
|
-
"content": {
|
|
728
|
-
"type": "SYMBOL",
|
|
729
|
-
"name": "identifier"
|
|
730
|
-
}
|
|
731
614
|
},
|
|
732
615
|
{
|
|
733
|
-
"type": "
|
|
616
|
+
"type": "REPEAT",
|
|
734
|
-
"name": "params",
|
|
735
617
|
"content": {
|
|
736
618
|
"type": "SEQ",
|
|
737
619
|
"members": [
|
|
738
620
|
{
|
|
739
621
|
"type": "STRING",
|
|
740
|
-
"value": "("
|
|
741
|
-
},
|
|
742
|
-
{
|
|
743
|
-
"type": "CHOICE",
|
|
744
|
-
"members": [
|
|
745
|
-
{
|
|
746
|
-
"type": "SEQ",
|
|
747
|
-
"members": [
|
|
748
|
-
{
|
|
749
|
-
"type": "SYMBOL",
|
|
750
|
-
"name": "param"
|
|
751
|
-
},
|
|
752
|
-
{
|
|
753
|
-
"type": "REPEAT",
|
|
754
|
-
"content": {
|
|
755
|
-
"type": "SEQ",
|
|
756
|
-
"members": [
|
|
757
|
-
{
|
|
758
|
-
"type": "STRING",
|
|
759
|
-
"value": ","
|
|
760
|
-
},
|
|
761
|
-
{
|
|
762
|
-
"type": "SYMBOL",
|
|
763
|
-
"name": "param"
|
|
764
|
-
}
|
|
765
|
-
]
|
|
766
|
-
}
|
|
767
|
-
}
|
|
768
|
-
]
|
|
769
|
-
},
|
|
770
|
-
{
|
|
771
|
-
"type": "BLANK"
|
|
772
|
-
}
|
|
773
|
-
]
|
|
774
|
-
},
|
|
775
|
-
{
|
|
776
|
-
"type": "STRING",
|
|
777
|
-
"value": ")"
|
|
778
|
-
}
|
|
779
|
-
]
|
|
780
|
-
}
|
|
781
|
-
},
|
|
782
|
-
{
|
|
783
|
-
"type": "STRING",
|
|
784
|
-
|
|
622
|
+
"value": "/"
|
|
785
|
-
},
|
|
786
|
-
{
|
|
787
|
-
"type": "FIELD",
|
|
788
|
-
"name": "returns",
|
|
789
|
-
"content": {
|
|
790
|
-
"type": "CHOICE",
|
|
791
|
-
"members": [
|
|
792
|
-
{
|
|
793
|
-
"type": "SEQ",
|
|
794
|
-
"members": [
|
|
795
|
-
{
|
|
796
|
-
"type": "SYMBOL",
|
|
797
|
-
"name": "type"
|
|
798
|
-
},
|
|
799
|
-
{
|
|
800
|
-
"type": "REPEAT",
|
|
801
|
-
"content": {
|
|
802
|
-
"type": "SEQ",
|
|
803
|
-
"members": [
|
|
804
|
-
{
|
|
805
|
-
"type": "STRING",
|
|
806
|
-
"value": ","
|
|
807
|
-
},
|
|
808
|
-
{
|
|
809
|
-
"type": "SYMBOL",
|
|
810
|
-
"name": "type"
|
|
811
|
-
}
|
|
812
|
-
]
|
|
813
|
-
}
|
|
814
|
-
}
|
|
815
|
-
]
|
|
816
623
|
},
|
|
817
624
|
{
|
|
818
|
-
"type": "
|
|
625
|
+
"type": "PATTERN",
|
|
626
|
+
"value": "[a-zA-Z_][a-zA-Z_0-9]*"
|
|
819
627
|
}
|
|
820
628
|
]
|
|
821
629
|
}
|
|
822
630
|
}
|
|
823
631
|
]
|
|
824
|
-
},
|
|
825
|
-
"trait_field": {
|
|
826
|
-
"type": "CHOICE",
|
|
827
|
-
"members": [
|
|
828
|
-
{
|
|
829
|
-
"type": "SYMBOL",
|
|
830
|
-
"name": "type_field"
|
|
831
|
-
},
|
|
832
|
-
{
|
|
833
|
-
"type": "SYMBOL",
|
|
834
|
-
"name": "fun_field"
|
|
835
|
-
}
|
|
836
|
-
]
|
|
837
|
-
},
|
|
838
|
-
"enum_field": {
|
|
839
|
-
"type": "SEQ",
|
|
840
|
-
"members": [
|
|
841
|
-
{
|
|
842
|
-
"type": "SYMBOL",
|
|
843
|
-
"name": "enum_field_name"
|
|
844
|
-
},
|
|
845
|
-
{
|
|
846
|
-
"type": "STRING",
|
|
847
|
-
"value": "("
|
|
848
|
-
},
|
|
849
|
-
{
|
|
850
|
-
"type": "SEQ",
|
|
851
|
-
"members": [
|
|
852
|
-
{
|
|
853
|
-
"type": "SYMBOL",
|
|
854
|
-
"name": "_primary_expression"
|
|
855
|
-
},
|
|
856
|
-
{
|
|
857
|
-
"type": "REPEAT",
|
|
858
|
-
"content": {
|
|
859
|
-
"type": "SEQ",
|
|
860
|
-
"members": [
|
|
861
|
-
{
|
|
862
|
-
"type": "STRING",
|
|
863
|
-
"value": ","
|
|
864
|
-
},
|
|
865
|
-
{
|
|
866
|
-
"type": "SYMBOL",
|
|
867
|
-
"name": "_primary_expression"
|
|
868
|
-
}
|
|
869
|
-
]
|
|
870
|
-
}
|
|
871
|
-
}
|
|
872
|
-
]
|
|
873
|
-
},
|
|
874
|
-
{
|
|
875
|
-
"type": "STRING",
|
|
876
|
-
"value": ")"
|
|
877
|
-
}
|
|
878
|
-
]
|
|
879
|
-
},
|
|
880
|
-
"_block": {
|
|
881
|
-
"type": "PREC",
|
|
882
|
-
"value": 1,
|
|
883
|
-
"content": {
|
|
884
|
-
"type": "SEQ",
|
|
885
|
-
"members": [
|
|
886
|
-
{
|
|
887
|
-
"type": "STRING",
|
|
888
|
-
"value": "{"
|
|
889
|
-
},
|
|
890
|
-
{
|
|
891
|
-
"type": "STRING",
|
|
892
|
-
"value": "}"
|
|
893
|
-
}
|
|
894
|
-
]
|
|
895
|
-
}
|
|
896
|
-
},
|
|
897
|
-
"_primary_expression": {
|
|
898
|
-
"type": "CHOICE",
|
|
899
|
-
"members": [
|
|
900
|
-
{
|
|
901
|
-
"type": "SYMBOL",
|
|
902
|
-
"name": "_literal_constant"
|
|
903
|
-
},
|
|
904
|
-
{
|
|
905
|
-
"type": "SYMBOL",
|
|
906
|
-
"name": "_string_literal"
|
|
907
|
-
}
|
|
908
|
-
]
|
|
909
|
-
},
|
|
910
|
-
"_extension": {
|
|
911
|
-
"type": "SEQ",
|
|
912
|
-
"members": [
|
|
913
|
-
{
|
|
914
|
-
"type": "SYMBOL",
|
|
915
|
-
"name": "identifier"
|
|
916
|
-
},
|
|
917
|
-
{
|
|
918
|
-
"type": "STRING",
|
|
919
|
-
"value": "."
|
|
920
|
-
},
|
|
921
|
-
{
|
|
922
|
-
"type": "SYMBOL",
|
|
923
|
-
"name": "identifier"
|
|
924
|
-
}
|
|
925
|
-
]
|
|
926
|
-
},
|
|
927
|
-
"url": {
|
|
928
|
-
"type": "SEQ",
|
|
929
|
-
"members": [
|
|
930
|
-
{
|
|
931
|
-
"type": "PATTERN",
|
|
932
|
-
"value": "[a-zA-Z_][a-zA-Z_0-9]*"
|
|
933
|
-
},
|
|
934
|
-
{
|
|
935
|
-
"type": "REPEAT",
|
|
936
|
-
"content": {
|
|
937
|
-
"type": "SEQ",
|
|
938
|
-
"members": [
|
|
939
|
-
{
|
|
940
|
-
"type": "STRING",
|
|
941
|
-
"value": "/"
|
|
942
|
-
},
|
|
943
|
-
{
|
|
944
|
-
"type": "PATTERN",
|
|
945
|
-
"value": "[a-zA-Z_][a-zA-Z_0-9]*"
|
|
946
|
-
}
|
|
947
|
-
]
|
|
948
|
-
}
|
|
949
|
-
}
|
|
950
|
-
]
|
|
951
|
-
},
|
|
952
|
-
"package": {
|
|
953
|
-
"type": "SYMBOL",
|
|
954
|
-
"name": "identifier"
|
|
955
|
-
},
|
|
956
|
-
"identifier": {
|
|
957
|
-
"type": "PATTERN",
|
|
958
|
-
"value": "[a-zA-Z_][a-zA-Z_0-9]*"
|
|
959
|
-
},
|
|
960
|
-
"definition_name": {
|
|
961
|
-
"type": "PATTERN",
|
|
962
|
-
"value": "[A-Z](([a-z]+[A-Z]?)*)"
|
|
963
|
-
},
|
|
964
|
-
"variable_name": {
|
|
965
|
-
"type": "PATTERN",
|
|
966
|
-
"value": "[a-z][a-z]*(([A-Z][a-z]+)*[A-Z]?|([a-z]+[A-Z])*|[A-Z])"
|
|
967
|
-
},
|
|
968
|
-
"enum_field_name": {
|
|
969
|
-
"type": "PATTERN",
|
|
970
|
-
"value": "[A-Z_][A-Z_0-9]*"
|
|
971
|
-
},
|
|
972
|
-
"boolean_literal": {
|
|
973
|
-
"type": "CHOICE",
|
|
974
|
-
"members": [
|
|
975
|
-
{
|
|
976
|
-
"type": "STRING",
|
|
977
|
-
"value": "true"
|
|
978
|
-
},
|
|
979
|
-
{
|
|
980
|
-
"type": "STRING",
|
|
981
|
-
"value": "false"
|
|
982
|
-
}
|
|
983
|
-
]
|
|
984
|
-
},
|
|
985
|
-
"integer_literal": {
|
|
986
|
-
"type": "TOKEN",
|
|
987
|
-
"content": {
|
|
988
|
-
"type": "SEQ",
|
|
989
|
-
"members": [
|
|
990
|
-
{
|
|
991
|
-
"type": "CHOICE",
|
|
992
|
-
"members": [
|
|
993
|
-
{
|
|
994
|
-
"type": "PATTERN",
|
|
995
|
-
"value": "[1-9]"
|
|
996
|
-
},
|
|
997
|
-
{
|
|
998
|
-
"type": "BLANK"
|
|
999
|
-
}
|
|
1000
|
-
]
|
|
1001
|
-
},
|
|
1002
|
-
{
|
|
1003
|
-
"type": "TOKEN",
|
|
1004
|
-
"content": {
|
|
1005
|
-
"type": "SEQ",
|
|
1006
|
-
"members": [
|
|
1007
|
-
{
|
|
1008
|
-
"type": "PATTERN",
|
|
1009
|
-
"value": "[0-9]+"
|
|
1010
|
-
},
|
|
1011
|
-
{
|
|
1012
|
-
"type": "REPEAT",
|
|
1013
|
-
"content": {
|
|
1014
|
-
"type": "SEQ",
|
|
1015
|
-
"members": [
|
|
1016
|
-
{
|
|
1017
|
-
"type": "PATTERN",
|
|
1018
|
-
"value": "_+"
|
|
1019
|
-
},
|
|
1020
|
-
{
|
|
1021
|
-
"type": "PATTERN",
|
|
1022
|
-
"value": "[0-9]+"
|
|
1023
|
-
}
|
|
1024
|
-
]
|
|
1025
|
-
}
|
|
1026
|
-
}
|
|
1027
|
-
]
|
|
1028
|
-
}
|
|
1029
|
-
}
|
|
1030
|
-
]
|
|
1031
|
-
}
|
|
1032
|
-
},
|
|
1033
|
-
"hex_literal": {
|
|
1034
|
-
"type": "TOKEN",
|
|
1035
|
-
"content": {
|
|
1036
|
-
"type": "SEQ",
|
|
1037
|
-
"members": [
|
|
1038
|
-
{
|
|
1039
|
-
"type": "STRING",
|
|
1040
|
-
"value": "0"
|
|
1041
|
-
},
|
|
1042
|
-
{
|
|
1043
|
-
"type": "PATTERN",
|
|
1044
|
-
"value": "[xX]"
|
|
1045
|
-
},
|
|
1046
|
-
{
|
|
1047
|
-
"type": "TOKEN",
|
|
1048
|
-
"content": {
|
|
1049
|
-
"type": "SEQ",
|
|
1050
|
-
"members": [
|
|
1051
|
-
{
|
|
1052
|
-
"type": "PATTERN",
|
|
1053
|
-
"value": "[0-9a-fA-F]+"
|
|
1054
|
-
},
|
|
1055
|
-
{
|
|
1056
|
-
"type": "REPEAT",
|
|
1057
|
-
"content": {
|
|
1058
|
-
"type": "SEQ",
|
|
1059
|
-
"members": [
|
|
1060
|
-
{
|
|
1061
|
-
"type": "PATTERN",
|
|
1062
|
-
"value": "_+"
|
|
1063
|
-
},
|
|
1064
|
-
{
|
|
1065
|
-
"type": "PATTERN",
|
|
1066
|
-
"value": "[0-9a-fA-F]+"
|
|
1067
|
-
}
|
|
1068
|
-
]
|
|
1069
|
-
}
|
|
1070
|
-
}
|
|
1071
|
-
]
|
|
1072
|
-
}
|
|
1073
|
-
}
|
|
1074
|
-
]
|
|
1075
|
-
}
|
|
1076
|
-
},
|
|
1077
|
-
"bin_literal": {
|
|
1078
|
-
"type": "TOKEN",
|
|
1079
|
-
"content": {
|
|
1080
|
-
"type": "SEQ",
|
|
1081
|
-
"members": [
|
|
1082
|
-
{
|
|
1083
|
-
"type": "STRING",
|
|
1084
|
-
"value": "0"
|
|
1085
|
-
},
|
|
1086
|
-
{
|
|
1087
|
-
"type": "PATTERN",
|
|
1088
|
-
"value": "[bB]"
|
|
1089
|
-
},
|
|
1090
|
-
{
|
|
1091
|
-
"type": "TOKEN",
|
|
1092
|
-
"content": {
|
|
1093
|
-
"type": "SEQ",
|
|
1094
|
-
"members": [
|
|
1095
|
-
{
|
|
1096
|
-
"type": "PATTERN",
|
|
1097
|
-
"value": "[01]"
|
|
1098
|
-
},
|
|
1099
|
-
{
|
|
1100
|
-
"type": "REPEAT",
|
|
1101
|
-
"content": {
|
|
1102
|
-
"type": "SEQ",
|
|
1103
|
-
"members": [
|
|
1104
|
-
{
|
|
1105
|
-
"type": "PATTERN",
|
|
1106
|
-
"value": "_+"
|
|
1107
|
-
},
|
|
1108
|
-
{
|
|
1109
|
-
"type": "PATTERN",
|
|
1110
|
-
"value": "[01]"
|
|
1111
|
-
}
|
|
1112
|
-
]
|
|
1113
|
-
}
|
|
1114
|
-
}
|
|
1115
|
-
]
|
|
1116
|
-
}
|
|
1117
|
-
}
|
|
1118
|
-
]
|
|
1119
|
-
}
|
|
1120
|
-
},
|
|
1121
|
-
"float_literal": {
|
|
1122
|
-
"type": "TOKEN",
|
|
1123
|
-
"content": {
|
|
1124
|
-
"type": "CHOICE",
|
|
1125
|
-
"members": [
|
|
1126
|
-
{
|
|
1127
|
-
"type": "SEQ",
|
|
1128
|
-
"members": [
|
|
1129
|
-
{
|
|
1130
|
-
"type": "SEQ",
|
|
1131
|
-
"members": [
|
|
1132
|
-
{
|
|
1133
|
-
"type": "CHOICE",
|
|
1134
|
-
"members": [
|
|
1135
|
-
{
|
|
1136
|
-
"type": "TOKEN",
|
|
1137
|
-
"content": {
|
|
1138
|
-
"type": "SEQ",
|
|
1139
|
-
"members": [
|
|
1140
|
-
{
|
|
1141
|
-
"type": "PATTERN",
|
|
1142
|
-
"value": "[0-9]+"
|
|
1143
|
-
},
|
|
1144
|
-
{
|
|
1145
|
-
"type": "REPEAT",
|
|
1146
|
-
"content": {
|
|
1147
|
-
"type": "SEQ",
|
|
1148
|
-
"members": [
|
|
1149
|
-
{
|
|
1150
|
-
"type": "PATTERN",
|
|
1151
|
-
"value": "_+"
|
|
1152
|
-
},
|
|
1153
|
-
{
|
|
1154
|
-
"type": "PATTERN",
|
|
1155
|
-
"value": "[0-9]+"
|
|
1156
|
-
}
|
|
1157
|
-
]
|
|
1158
|
-
}
|
|
1159
|
-
}
|
|
1160
|
-
]
|
|
1161
|
-
}
|
|
1162
|
-
},
|
|
1163
|
-
{
|
|
1164
|
-
"type": "BLANK"
|
|
1165
|
-
}
|
|
1166
|
-
]
|
|
1167
|
-
},
|
|
1168
|
-
{
|
|
1169
|
-
"type": "STRING",
|
|
1170
|
-
"value": "."
|
|
1171
|
-
},
|
|
1172
|
-
{
|
|
1173
|
-
"type": "TOKEN",
|
|
1174
|
-
"content": {
|
|
1175
|
-
"type": "SEQ",
|
|
1176
|
-
"members": [
|
|
1177
|
-
{
|
|
1178
|
-
"type": "PATTERN",
|
|
1179
|
-
"value": "[0-9]+"
|
|
1180
|
-
},
|
|
1181
|
-
{
|
|
1182
|
-
"type": "REPEAT",
|
|
1183
|
-
"content": {
|
|
1184
|
-
"type": "SEQ",
|
|
1185
|
-
"members": [
|
|
1186
|
-
{
|
|
1187
|
-
"type": "PATTERN",
|
|
1188
|
-
"value": "_+"
|
|
1189
|
-
},
|
|
1190
|
-
{
|
|
1191
|
-
"type": "PATTERN",
|
|
1192
|
-
"value": "[0-9]+"
|
|
1193
|
-
}
|
|
1194
|
-
]
|
|
1195
|
-
}
|
|
1196
|
-
}
|
|
1197
|
-
]
|
|
1198
|
-
}
|
|
1199
|
-
}
|
|
1200
|
-
]
|
|
1201
|
-
},
|
|
1202
|
-
{
|
|
1203
|
-
"type": "CHOICE",
|
|
1204
|
-
"members": [
|
|
1205
|
-
{
|
|
1206
|
-
"type": "PATTERN",
|
|
1207
|
-
"value": "[fF]"
|
|
1208
|
-
},
|
|
1209
|
-
{
|
|
1210
|
-
"type": "BLANK"
|
|
1211
|
-
}
|
|
1212
|
-
]
|
|
1213
|
-
}
|
|
1214
|
-
]
|
|
1215
|
-
},
|
|
1216
|
-
{
|
|
1217
|
-
"type": "SEQ",
|
|
1218
|
-
"members": [
|
|
1219
|
-
{
|
|
1220
|
-
"type": "TOKEN",
|
|
1221
|
-
"content": {
|
|
1222
|
-
"type": "SEQ",
|
|
1223
|
-
"members": [
|
|
1224
|
-
{
|
|
1225
|
-
"type": "PATTERN",
|
|
1226
|
-
"value": "[0-9]+"
|
|
1227
|
-
},
|
|
1228
|
-
{
|
|
1229
|
-
"type": "REPEAT",
|
|
1230
|
-
"content": {
|
|
1231
|
-
"type": "SEQ",
|
|
1232
|
-
"members": [
|
|
1233
|
-
{
|
|
1234
|
-
"type": "PATTERN",
|
|
1235
|
-
"value": "_+"
|
|
1236
|
-
},
|
|
1237
|
-
{
|
|
1238
|
-
"type": "PATTERN",
|
|
1239
|
-
"value": "[0-9]+"
|
|
1240
|
-
}
|
|
1241
|
-
]
|
|
1242
|
-
}
|
|
1243
|
-
}
|
|
1244
|
-
]
|
|
1245
|
-
}
|
|
1246
|
-
},
|
|
1247
|
-
{
|
|
1248
|
-
"type": "PATTERN",
|
|
1249
|
-
"value": "[fF]"
|
|
1250
|
-
}
|
|
1251
|
-
]
|
|
1252
|
-
}
|
|
1253
|
-
]
|
|
1254
|
-
}
|
|
1255
|
-
},
|
|
1256
|
-
"character_literal": {
|
|
1257
|
-
"type": "SEQ",
|
|
1258
|
-
"members": [
|
|
1259
|
-
{
|
|
1260
|
-
"type": "STRING",
|
|
1261
|
-
"value": "'"
|
|
1262
|
-
},
|
|
1263
|
-
{
|
|
1264
|
-
"type": "CHOICE",
|
|
1265
|
-
"members": [
|
|
1266
|
-
{
|
|
1267
|
-
"type": "SYMBOL",
|
|
1268
|
-
"name": "character_escape_seq"
|
|
1269
|
-
},
|
|
1270
|
-
{
|
|
1271
|
-
"type": "PATTERN",
|
|
1272
|
-
"value": "[^\\n\\r'\\\\]"
|
|
1273
|
-
}
|
|
1274
|
-
]
|
|
1275
|
-
},
|
|
1276
|
-
{
|
|
1277
|
-
"type": "STRING",
|
|
1278
|
-
"value": "'"
|
|
1279
|
-
}
|
|
1280
|
-
]
|
|
1281
|
-
},
|
|
1282
|
-
"character_escape_seq": {
|
|
1283
|
-
"type": "CHOICE",
|
|
1284
|
-
"members": [
|
|
1285
|
-
{
|
|
1286
|
-
"type": "SYMBOL",
|
|
1287
|
-
"name": "_uni_character_literal"
|
|
1288
|
-
},
|
|
1289
|
-
{
|
|
1290
|
-
"type": "SYMBOL",
|
|
1291
|
-
"name": "_escaped_identifier"
|
|
1292
|
-
}
|
|
1293
|
-
]
|
|
1294
|
-
},
|
|
1295
|
-
"_uni_character_literal": {
|
|
1296
|
-
"type": "SEQ",
|
|
1297
|
-
"members": [
|
|
1298
|
-
{
|
|
1299
|
-
"type": "STRING",
|
|
1300
|
-
"value": "\\u"
|
|
1301
|
-
},
|
|
1302
|
-
{
|
|
1303
|
-
"type": "PATTERN",
|
|
1304
|
-
"value": "[0-9a-fA-F]{4}"
|
|
1305
|
-
}
|
|
1306
|
-
]
|
|
1307
|
-
},
|
|
1308
|
-
"_escaped_identifier": {
|
|
1309
|
-
"type": "PATTERN",
|
|
1310
|
-
"value": "\\\\[tbrn'\"\\\\$]"
|
|
1311
|
-
},
|
|
1312
|
-
"_string_literal": {
|
|
1313
|
-
"type": "CHOICE",
|
|
1314
|
-
"members": [
|
|
1315
|
-
{
|
|
1316
|
-
"type": "SYMBOL",
|
|
1317
|
-
"name": "line_string_literal"
|
|
1318
|
-
},
|
|
1319
|
-
{
|
|
1320
|
-
"type": "SYMBOL",
|
|
1321
|
-
"name": "multi_line_string_literal"
|
|
1322
|
-
}
|
|
1323
|
-
]
|
|
1324
|
-
},
|
|
1325
|
-
"line_string_literal": {
|
|
1326
|
-
"type": "SEQ",
|
|
1327
|
-
"members": [
|
|
1328
|
-
{
|
|
1329
|
-
"type": "STRING",
|
|
1330
|
-
"value": "\""
|
|
1331
|
-
},
|
|
1332
|
-
{
|
|
1333
|
-
"type": "REPEAT",
|
|
1334
|
-
"content": {
|
|
1335
|
-
"type": "CHOICE",
|
|
1336
|
-
"members": [
|
|
1337
|
-
{
|
|
1338
|
-
"type": "SYMBOL",
|
|
1339
|
-
"name": "_line_string_content"
|
|
1340
|
-
},
|
|
1341
|
-
{
|
|
1342
|
-
"type": "SYMBOL",
|
|
1343
|
-
"name": "_interpolation"
|
|
1344
|
-
}
|
|
1345
|
-
]
|
|
1346
|
-
}
|
|
1347
|
-
},
|
|
1348
|
-
{
|
|
1349
|
-
"type": "STRING",
|
|
1350
|
-
"value": "\""
|
|
1351
|
-
}
|
|
1352
|
-
]
|
|
1353
|
-
},
|
|
1354
|
-
"multi_line_string_literal": {
|
|
1355
|
-
"type": "SEQ",
|
|
1356
|
-
"members": [
|
|
1357
|
-
{
|
|
1358
|
-
"type": "STRING",
|
|
1359
|
-
"value": "`"
|
|
1360
|
-
},
|
|
1361
|
-
{
|
|
1362
|
-
"type": "REPEAT",
|
|
1363
|
-
"content": {
|
|
1364
|
-
"type": "CHOICE",
|
|
1365
|
-
"members": [
|
|
1366
|
-
{
|
|
1367
|
-
"type": "SYMBOL",
|
|
1368
|
-
"name": "_multi_line_string_content"
|
|
1369
|
-
},
|
|
1370
|
-
{
|
|
1371
|
-
"type": "SYMBOL",
|
|
1372
|
-
"name": "_interpolation"
|
|
1373
|
-
}
|
|
1374
|
-
]
|
|
1375
|
-
}
|
|
1376
|
-
},
|
|
1377
|
-
{
|
|
1378
|
-
"type": "STRING",
|
|
1379
|
-
"value": "`"
|
|
1380
|
-
}
|
|
1381
|
-
]
|
|
1382
|
-
},
|
|
1383
|
-
"_line_string_content": {
|
|
1384
|
-
"type": "CHOICE",
|
|
1385
|
-
"members": [
|
|
1386
|
-
{
|
|
1387
|
-
"type": "SYMBOL",
|
|
1388
|
-
"name": "_line_str_text"
|
|
1389
|
-
},
|
|
1390
|
-
{
|
|
1391
|
-
"type": "SYMBOL",
|
|
1392
|
-
"name": "character_escape_seq"
|
|
1393
|
-
}
|
|
1394
|
-
]
|
|
1395
|
-
},
|
|
1396
|
-
"_multi_line_string_content": {
|
|
1397
|
-
"type": "CHOICE",
|
|
1398
|
-
"members": [
|
|
1399
|
-
{
|
|
1400
|
-
"type": "SYMBOL",
|
|
1401
|
-
"name": "_multi_line_str_text"
|
|
1402
|
-
},
|
|
1403
|
-
{
|
|
1404
|
-
"type": "STRING",
|
|
1405
|
-
"value": "\""
|
|
1406
|
-
}
|
|
1407
|
-
]
|
|
1408
|
-
},
|
|
1409
|
-
"_line_str_text": {
|
|
1410
|
-
"type": "PATTERN",
|
|
1411
|
-
"value": "[^\\\\\"$]+"
|
|
1412
|
-
},
|
|
1413
|
-
"_multi_line_str_text": {
|
|
1414
|
-
"type": "PATTERN",
|
|
1415
|
-
"value": "[^\"$]+"
|
|
1416
|
-
},
|
|
1417
|
-
"_interpolation": {
|
|
1418
|
-
"type": "CHOICE",
|
|
1419
|
-
"members": [
|
|
1420
|
-
{
|
|
1421
|
-
"type": "SEQ",
|
|
1422
|
-
"members": [
|
|
1423
|
-
{
|
|
1424
|
-
"type": "STRING",
|
|
1425
|
-
"value": "$"
|
|
1426
|
-
},
|
|
1427
|
-
{
|
|
1428
|
-
"type": "ALIAS",
|
|
1429
|
-
"content": {
|
|
1430
|
-
"type": "SYMBOL",
|
|
1431
|
-
"name": "identifier"
|
|
1432
|
-
},
|
|
1433
|
-
"named": true,
|
|
1434
|
-
"value": "interpolated_identifier"
|
|
1435
|
-
}
|
|
1436
|
-
]
|
|
1437
|
-
}
|
|
1438
|
-
]
|
|
1439
|
-
},
|
|
1440
|
-
"_literal_constant": {
|
|
1441
|
-
"type": "CHOICE",
|
|
1442
|
-
"members": [
|
|
1443
|
-
{
|
|
1444
|
-
"type": "SYMBOL",
|
|
1445
|
-
"name": "boolean_literal"
|
|
1446
|
-
},
|
|
1447
|
-
{
|
|
1448
|
-
"type": "SYMBOL",
|
|
1449
|
-
"name": "integer_literal"
|
|
1450
|
-
},
|
|
1451
|
-
{
|
|
1452
|
-
"type": "SYMBOL",
|
|
1453
|
-
"name": "hex_literal"
|
|
1454
|
-
},
|
|
1455
|
-
{
|
|
1456
|
-
"type": "SYMBOL",
|
|
1457
|
-
"name": "bin_literal"
|
|
1458
|
-
},
|
|
1459
|
-
{
|
|
1460
|
-
"type": "SYMBOL",
|
|
1461
|
-
"name": "character_literal"
|
|
1462
|
-
},
|
|
1463
|
-
{
|
|
1464
|
-
"type": "SYMBOL",
|
|
1465
|
-
"name": "float_literal"
|
|
1466
|
-
},
|
|
1467
|
-
{
|
|
1468
|
-
"type": "STRING",
|
|
1469
|
-
"value": "null"
|
|
1470
|
-
}
|
|
1471
|
-
]
|
|
1472
|
-
},
|
|
1473
|
-
"comment": {
|
|
1474
|
-
"type": "TOKEN",
|
|
1475
|
-
"content": {
|
|
1476
|
-
"type": "PREC",
|
|
1477
|
-
"value": 0,
|
|
1478
|
-
"content": {
|
|
1479
|
-
"type": "CHOICE",
|
|
1480
|
-
"members": [
|
|
1481
|
-
{
|
|
1482
|
-
"type": "SEQ",
|
|
1483
|
-
"members": [
|
|
1484
|
-
{
|
|
1485
|
-
"type": "STRING",
|
|
1486
|
-
"value": "#"
|
|
1487
|
-
},
|
|
1488
|
-
{
|
|
1489
|
-
"type": "PATTERN",
|
|
1490
|
-
"value": ".*"
|
|
1491
|
-
}
|
|
1492
|
-
]
|
|
1493
|
-
}
|
|
1494
|
-
]
|
|
1495
|
-
}
|
|
1496
|
-
}
|
|
1497
632
|
}
|
|
1498
633
|
},
|
|
1499
634
|
"extras": [
|
|
1500
|
-
{
|
|
1501
|
-
"type": "SYMBOL",
|
|
1502
|
-
"name": "comment"
|
|
1503
|
-
},
|
|
1504
635
|
{
|
|
1505
636
|
"type": "PATTERN",
|
|
1506
|
-
"value": "\\s
|
|
637
|
+
"value": "\\s"
|
|
1507
638
|
}
|
|
1508
639
|
],
|
|
1509
|
-
"conflicts": [
|
|
640
|
+
"conflicts": [],
|
|
1510
|
-
[
|
|
1511
|
-
"fun_field"
|
|
1512
|
-
],
|
|
1513
|
-
[
|
|
1514
|
-
"decorator_name"
|
|
1515
|
-
]
|
|
1516
|
-
],
|
|
1517
641
|
"precedences": [],
|
|
1518
642
|
"externals": [],
|
|
1519
643
|
"inline": [],
|
src/node-types.json
CHANGED
|
@@ -1,91 +1,70 @@
|
|
|
1
1
|
[
|
|
2
2
|
{
|
|
3
|
-
"type": "
|
|
3
|
+
"type": "generic_list",
|
|
4
|
-
"named": true,
|
|
5
|
-
"fields": {}
|
|
6
|
-
},
|
|
7
|
-
{
|
|
8
|
-
"type": "character_escape_seq",
|
|
9
|
-
"named": true,
|
|
10
|
-
"fields": {}
|
|
11
|
-
},
|
|
12
|
-
{
|
|
13
|
-
"type": "character_literal",
|
|
14
4
|
"named": true,
|
|
15
5
|
"fields": {},
|
|
16
6
|
"children": {
|
|
17
|
-
"multiple":
|
|
7
|
+
"multiple": true,
|
|
18
|
-
"required":
|
|
8
|
+
"required": true,
|
|
19
9
|
"types": [
|
|
20
10
|
{
|
|
21
|
-
"type": "
|
|
11
|
+
"type": "identifier",
|
|
22
12
|
"named": true
|
|
23
13
|
}
|
|
24
14
|
]
|
|
25
15
|
}
|
|
26
16
|
},
|
|
27
17
|
{
|
|
28
|
-
"type": "
|
|
18
|
+
"type": "identifier",
|
|
19
|
+
"named": true,
|
|
20
|
+
"fields": {}
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"type": "import",
|
|
29
24
|
"named": true,
|
|
30
25
|
"fields": {
|
|
31
|
-
"
|
|
26
|
+
"alias": {
|
|
32
|
-
"multiple":
|
|
27
|
+
"multiple": false,
|
|
33
28
|
"required": false,
|
|
34
29
|
"types": [
|
|
35
30
|
{
|
|
36
|
-
"type": "decorator_name",
|
|
37
|
-
"named": true
|
|
38
|
-
}
|
|
39
|
-
]
|
|
40
|
-
},
|
|
41
|
-
"fields": {
|
|
42
|
-
"multiple": true,
|
|
43
|
-
"required": true,
|
|
44
|
-
"types": [
|
|
45
|
-
{
|
|
46
|
-
"type": "(",
|
|
47
|
-
"named": false
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
"type": ")",
|
|
51
|
-
"named": false
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
"type": ",",
|
|
55
|
-
"named": false
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
"type": "
|
|
31
|
+
"type": "identifier",
|
|
59
32
|
"named": true
|
|
60
33
|
}
|
|
61
34
|
]
|
|
62
35
|
},
|
|
63
|
-
"
|
|
36
|
+
"imports": {
|
|
64
37
|
"multiple": false,
|
|
65
38
|
"required": false,
|
|
66
39
|
"types": [
|
|
67
40
|
{
|
|
68
|
-
"type": "
|
|
41
|
+
"type": "unqualified_imports",
|
|
69
42
|
"named": true
|
|
70
43
|
}
|
|
71
44
|
]
|
|
72
45
|
},
|
|
73
|
-
"
|
|
46
|
+
"module": {
|
|
74
47
|
"multiple": false,
|
|
75
48
|
"required": true,
|
|
76
49
|
"types": [
|
|
77
50
|
{
|
|
78
|
-
"type": "
|
|
51
|
+
"type": "module_name",
|
|
79
52
|
"named": true
|
|
80
53
|
}
|
|
81
54
|
]
|
|
55
|
+
}
|
|
56
|
+
}
|
|
82
|
-
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"type": "module",
|
|
60
|
+
"named": true,
|
|
83
|
-
|
|
61
|
+
"fields": {
|
|
62
|
+
"module": {
|
|
84
63
|
"multiple": false,
|
|
85
|
-
"required":
|
|
64
|
+
"required": true,
|
|
86
65
|
"types": [
|
|
87
66
|
{
|
|
88
|
-
"type": "
|
|
67
|
+
"type": "module_name",
|
|
89
68
|
"named": true
|
|
90
69
|
}
|
|
91
70
|
]
|
|
@@ -93,133 +72,40 @@
|
|
|
93
72
|
}
|
|
94
73
|
},
|
|
95
74
|
{
|
|
96
|
-
"type": "
|
|
75
|
+
"type": "module_name",
|
|
97
|
-
"named": true,
|
|
98
|
-
"fields": {},
|
|
99
|
-
"children": {
|
|
100
|
-
"multiple": true,
|
|
101
|
-
"required": true,
|
|
102
|
-
"types": [
|
|
103
|
-
{
|
|
104
|
-
"type": "bin_literal",
|
|
105
|
-
"named": true
|
|
106
|
-
},
|
|
107
|
-
{
|
|
108
|
-
"type": "boolean_literal",
|
|
109
|
-
"named": true
|
|
110
|
-
},
|
|
111
|
-
{
|
|
112
|
-
"type": "character_literal",
|
|
113
|
-
"named": true
|
|
114
|
-
},
|
|
115
|
-
{
|
|
116
|
-
"type": "float_literal",
|
|
117
|
-
"named": true
|
|
118
|
-
},
|
|
119
|
-
{
|
|
120
|
-
"type": "hex_literal",
|
|
121
|
-
"named": true
|
|
122
|
-
},
|
|
123
|
-
{
|
|
124
|
-
"type": "identifier",
|
|
125
|
-
"named": true
|
|
126
|
-
},
|
|
127
|
-
{
|
|
128
|
-
"type": "integer_literal",
|
|
129
|
-
"named": true
|
|
130
|
-
},
|
|
131
|
-
{
|
|
132
|
-
"type": "line_string_literal",
|
|
133
|
-
"named": true
|
|
134
|
-
},
|
|
135
|
-
{
|
|
136
|
-
"type": "multi_line_string_literal",
|
|
137
|
-
"named": true
|
|
138
|
-
}
|
|
139
|
-
]
|
|
140
|
-
}
|
|
141
|
-
},
|
|
142
|
-
{
|
|
143
|
-
"type": "definitions",
|
|
144
76
|
"named": true,
|
|
145
|
-
"fields": {}
|
|
77
|
+
"fields": {}
|
|
146
|
-
"children": {
|
|
147
|
-
"multiple": false,
|
|
148
|
-
"required": true,
|
|
149
|
-
"types": [
|
|
150
|
-
{
|
|
151
|
-
"type": "class_definition",
|
|
152
|
-
"named": true
|
|
153
|
-
},
|
|
154
|
-
{
|
|
155
|
-
"type": "enum_definition",
|
|
156
|
-
"named": true
|
|
157
|
-
},
|
|
158
|
-
{
|
|
159
|
-
"type": "fun_definition",
|
|
160
|
-
"named": true
|
|
161
|
-
},
|
|
162
|
-
{
|
|
163
|
-
"type": "trait_definition",
|
|
164
|
-
"named": true
|
|
165
|
-
}
|
|
166
|
-
]
|
|
167
|
-
}
|
|
168
78
|
},
|
|
169
79
|
{
|
|
170
|
-
"type": "
|
|
80
|
+
"type": "record",
|
|
171
81
|
"named": true,
|
|
172
82
|
"fields": {
|
|
173
83
|
"fields": {
|
|
174
84
|
"multiple": true,
|
|
175
|
-
"required":
|
|
85
|
+
"required": false,
|
|
176
86
|
"types": [
|
|
177
87
|
{
|
|
178
|
-
"type": ",",
|
|
179
|
-
"named": false
|
|
180
|
-
},
|
|
181
|
-
{
|
|
182
|
-
"type": "
|
|
88
|
+
"type": "type_field",
|
|
183
89
|
"named": true
|
|
184
|
-
},
|
|
185
|
-
{
|
|
186
|
-
"type": "{",
|
|
187
|
-
"named": false
|
|
188
|
-
},
|
|
189
|
-
{
|
|
190
|
-
"type": "}",
|
|
191
|
-
"named": false
|
|
192
90
|
}
|
|
193
91
|
]
|
|
194
92
|
},
|
|
195
|
-
"
|
|
93
|
+
"generics": {
|
|
196
94
|
"multiple": false,
|
|
197
|
-
"required":
|
|
95
|
+
"required": false,
|
|
198
96
|
"types": [
|
|
199
97
|
{
|
|
200
|
-
"type": "
|
|
98
|
+
"type": "generic_list",
|
|
201
99
|
"named": true
|
|
202
100
|
}
|
|
203
101
|
]
|
|
204
102
|
},
|
|
205
|
-
"
|
|
103
|
+
"name": {
|
|
206
|
-
"multiple":
|
|
104
|
+
"multiple": false,
|
|
207
105
|
"required": true,
|
|
208
106
|
"types": [
|
|
209
107
|
{
|
|
210
|
-
"type": "(",
|
|
211
|
-
"named": false
|
|
212
|
-
},
|
|
213
|
-
{
|
|
214
|
-
"type": ")",
|
|
215
|
-
"named": false
|
|
216
|
-
},
|
|
217
|
-
{
|
|
218
|
-
"type": ",",
|
|
219
|
-
"named": false
|
|
220
|
-
},
|
|
221
|
-
{
|
|
222
|
-
"type": "
|
|
108
|
+
"type": "type_identifier",
|
|
223
109
|
"named": true
|
|
224
110
|
}
|
|
225
111
|
]
|
|
@@ -227,7 +113,7 @@
|
|
|
227
113
|
}
|
|
228
114
|
},
|
|
229
115
|
{
|
|
230
|
-
"type": "
|
|
116
|
+
"type": "source_file",
|
|
231
117
|
"named": true,
|
|
232
118
|
"fields": {},
|
|
233
119
|
"children": {
|
|
@@ -235,72 +121,28 @@
|
|
|
235
121
|
"required": true,
|
|
236
122
|
"types": [
|
|
237
123
|
{
|
|
238
|
-
"type": "
|
|
124
|
+
"type": "import",
|
|
239
|
-
"named": true
|
|
240
|
-
},
|
|
241
|
-
{
|
|
242
|
-
"type": "boolean_literal",
|
|
243
|
-
"named": true
|
|
244
|
-
},
|
|
245
|
-
{
|
|
246
|
-
"type": "character_literal",
|
|
247
125
|
"named": true
|
|
248
126
|
},
|
|
249
127
|
{
|
|
250
|
-
"type": "
|
|
128
|
+
"type": "module",
|
|
251
129
|
"named": true
|
|
252
130
|
},
|
|
253
131
|
{
|
|
254
|
-
"type": "
|
|
132
|
+
"type": "record",
|
|
255
133
|
"named": true
|
|
256
134
|
},
|
|
257
135
|
{
|
|
258
|
-
"type": "
|
|
136
|
+
"type": "type",
|
|
259
|
-
"named": true
|
|
260
|
-
},
|
|
261
|
-
{
|
|
262
|
-
"type": "integer_literal",
|
|
263
|
-
"named": true
|
|
264
|
-
},
|
|
265
|
-
{
|
|
266
|
-
"type": "line_string_literal",
|
|
267
|
-
"named": true
|
|
268
|
-
},
|
|
269
|
-
{
|
|
270
|
-
"type": "multi_line_string_literal",
|
|
271
137
|
"named": true
|
|
272
138
|
}
|
|
273
139
|
]
|
|
274
140
|
}
|
|
275
141
|
},
|
|
276
142
|
{
|
|
277
|
-
"type": "
|
|
143
|
+
"type": "type",
|
|
278
144
|
"named": true,
|
|
279
145
|
"fields": {
|
|
280
|
-
"body": {
|
|
281
|
-
"multiple": true,
|
|
282
|
-
"required": true,
|
|
283
|
-
"types": [
|
|
284
|
-
{
|
|
285
|
-
"type": "{",
|
|
286
|
-
"named": false
|
|
287
|
-
},
|
|
288
|
-
{
|
|
289
|
-
"type": "}",
|
|
290
|
-
"named": false
|
|
291
|
-
}
|
|
292
|
-
]
|
|
293
|
-
},
|
|
294
|
-
"decorators": {
|
|
295
|
-
"multiple": true,
|
|
296
|
-
"required": false,
|
|
297
|
-
"types": [
|
|
298
|
-
{
|
|
299
|
-
"type": "decorator_name",
|
|
300
|
-
"named": true
|
|
301
|
-
}
|
|
302
|
-
]
|
|
303
|
-
},
|
|
304
146
|
"generics": {
|
|
305
147
|
"multiple": false,
|
|
306
148
|
"required": false,
|
|
@@ -312,59 +154,33 @@
|
|
|
312
154
|
]
|
|
313
155
|
},
|
|
314
156
|
"name": {
|
|
315
|
-
"multiple":
|
|
157
|
+
"multiple": false,
|
|
316
158
|
"required": true,
|
|
317
159
|
"types": [
|
|
318
160
|
{
|
|
319
|
-
"type": ".",
|
|
320
|
-
"named": false
|
|
321
|
-
},
|
|
322
|
-
{
|
|
323
|
-
"type": "
|
|
161
|
+
"type": "type_identifier",
|
|
324
162
|
"named": true
|
|
325
163
|
}
|
|
326
164
|
]
|
|
327
165
|
},
|
|
328
|
-
"
|
|
166
|
+
"types": {
|
|
329
167
|
"multiple": true,
|
|
330
168
|
"required": true,
|
|
331
169
|
"types": [
|
|
332
170
|
{
|
|
333
|
-
"type": "(",
|
|
334
|
-
"named": false
|
|
335
|
-
},
|
|
336
|
-
{
|
|
337
|
-
"type": ")",
|
|
338
|
-
"named": false
|
|
339
|
-
},
|
|
340
|
-
{
|
|
341
|
-
"type": ",",
|
|
342
|
-
"named": false
|
|
343
|
-
},
|
|
344
|
-
{
|
|
345
|
-
"type": "
|
|
171
|
+
"type": "type_name",
|
|
346
172
|
"named": true
|
|
347
|
-
}
|
|
348
|
-
]
|
|
349
|
-
},
|
|
350
|
-
"returns": {
|
|
351
|
-
"multiple": true,
|
|
352
|
-
"required": false,
|
|
353
|
-
"types": [
|
|
354
|
-
{
|
|
355
|
-
"type": ",",
|
|
356
|
-
"named": false
|
|
357
173
|
},
|
|
358
174
|
{
|
|
359
|
-
"type": "
|
|
175
|
+
"type": "|",
|
|
360
|
-
"named":
|
|
176
|
+
"named": false
|
|
361
177
|
}
|
|
362
178
|
]
|
|
363
179
|
}
|
|
364
180
|
}
|
|
365
181
|
},
|
|
366
182
|
{
|
|
367
|
-
"type": "
|
|
183
|
+
"type": "type_field",
|
|
368
184
|
"named": true,
|
|
369
185
|
"fields": {
|
|
370
186
|
"name": {
|
|
@@ -377,38 +193,12 @@
|
|
|
377
193
|
}
|
|
378
194
|
]
|
|
379
195
|
},
|
|
380
|
-
"
|
|
196
|
+
"type": {
|
|
381
|
-
"multiple":
|
|
197
|
+
"multiple": false,
|
|
382
198
|
"required": true,
|
|
383
199
|
"types": [
|
|
384
200
|
{
|
|
385
|
-
"type": "(",
|
|
386
|
-
"named": false
|
|
387
|
-
},
|
|
388
|
-
{
|
|
389
|
-
"type": ")",
|
|
390
|
-
"named": false
|
|
391
|
-
},
|
|
392
|
-
{
|
|
393
|
-
"type": ",",
|
|
394
|
-
"named": false
|
|
395
|
-
},
|
|
396
|
-
{
|
|
397
|
-
"type": "param",
|
|
398
|
-
"named": true
|
|
399
|
-
}
|
|
400
|
-
]
|
|
401
|
-
},
|
|
402
|
-
"returns": {
|
|
403
|
-
"multiple": true,
|
|
404
|
-
"required": false,
|
|
405
|
-
"types": [
|
|
406
|
-
{
|
|
407
|
-
"type": ",",
|
|
408
|
-
"named": false
|
|
409
|
-
},
|
|
410
|
-
{
|
|
411
|
-
"type": "
|
|
201
|
+
"type": "identifier",
|
|
412
202
|
"named": true
|
|
413
203
|
}
|
|
414
204
|
]
|
|
@@ -416,96 +206,12 @@
|
|
|
416
206
|
}
|
|
417
207
|
},
|
|
418
208
|
{
|
|
419
|
-
"type": "generic_list",
|
|
420
|
-
"named": true,
|
|
421
|
-
"fields": {},
|
|
422
|
-
"children": {
|
|
423
|
-
"multiple": true,
|
|
424
|
-
"required": true,
|
|
425
|
-
"types": [
|
|
426
|
-
{
|
|
427
|
-
|
|
209
|
+
"type": "type_identifier",
|
|
428
|
-
"named": true
|
|
429
|
-
}
|
|
430
|
-
]
|
|
431
|
-
}
|
|
432
|
-
},
|
|
433
|
-
{
|
|
434
|
-
"type": "identifier",
|
|
435
|
-
"named": true,
|
|
436
|
-
"fields": {}
|
|
437
|
-
},
|
|
438
|
-
{
|
|
439
|
-
"type": "import_statement",
|
|
440
|
-
"named": true,
|
|
441
|
-
"fields": {},
|
|
442
|
-
"children": {
|
|
443
|
-
"multiple": false,
|
|
444
|
-
"required": true,
|
|
445
|
-
"types": [
|
|
446
|
-
{
|
|
447
|
-
"type": "url",
|
|
448
|
-
"named": true
|
|
449
|
-
}
|
|
450
|
-
]
|
|
451
|
-
}
|
|
452
|
-
},
|
|
453
|
-
{
|
|
454
|
-
"type": "interpolated_identifier",
|
|
455
210
|
"named": true,
|
|
456
211
|
"fields": {}
|
|
457
212
|
},
|
|
458
213
|
{
|
|
459
|
-
"type": "line_string_literal",
|
|
460
|
-
"named": true,
|
|
461
|
-
"fields": {},
|
|
462
|
-
"children": {
|
|
463
|
-
"multiple": true,
|
|
464
|
-
"required": false,
|
|
465
|
-
"types": [
|
|
466
|
-
{
|
|
467
|
-
"type": "character_escape_seq",
|
|
468
|
-
"named": true
|
|
469
|
-
},
|
|
470
|
-
{
|
|
471
|
-
"type": "interpolated_identifier",
|
|
472
|
-
"named": true
|
|
473
|
-
}
|
|
474
|
-
]
|
|
475
|
-
}
|
|
476
|
-
},
|
|
477
|
-
{
|
|
478
|
-
"type": "multi_line_string_literal",
|
|
479
|
-
"named": true,
|
|
480
|
-
"fields": {},
|
|
481
|
-
"children": {
|
|
482
|
-
"multiple": true,
|
|
483
|
-
"required": false,
|
|
484
|
-
"types": [
|
|
485
|
-
{
|
|
486
|
-
"type": "interpolated_identifier",
|
|
487
|
-
"named": true
|
|
488
|
-
}
|
|
489
|
-
]
|
|
490
|
-
}
|
|
491
|
-
},
|
|
492
|
-
{
|
|
493
|
-
"type": "
|
|
214
|
+
"type": "type_name",
|
|
494
|
-
"named": true,
|
|
495
|
-
"fields": {},
|
|
496
|
-
"children": {
|
|
497
|
-
"multiple": false,
|
|
498
|
-
"required": true,
|
|
499
|
-
"types": [
|
|
500
|
-
{
|
|
501
|
-
"type": "identifier",
|
|
502
|
-
"named": true
|
|
503
|
-
}
|
|
504
|
-
]
|
|
505
|
-
}
|
|
506
|
-
},
|
|
507
|
-
{
|
|
508
|
-
"type": "param",
|
|
509
215
|
"named": true,
|
|
510
216
|
"fields": {
|
|
511
217
|
"name": {
|
|
@@ -513,78 +219,41 @@
|
|
|
513
219
|
"required": true,
|
|
514
220
|
"types": [
|
|
515
221
|
{
|
|
516
|
-
"type": "variable_name",
|
|
517
|
-
"named": true
|
|
518
|
-
}
|
|
519
|
-
]
|
|
520
|
-
},
|
|
521
|
-
"type": {
|
|
522
|
-
"multiple": false,
|
|
523
|
-
"required": true,
|
|
524
|
-
"types": [
|
|
525
|
-
{
|
|
526
|
-
"type": "
|
|
222
|
+
"type": "type_identifier",
|
|
527
223
|
"named": true
|
|
528
224
|
}
|
|
529
225
|
]
|
|
530
226
|
}
|
|
531
|
-
}
|
|
532
|
-
|
|
227
|
+
},
|
|
533
|
-
{
|
|
534
|
-
"type": "source_file",
|
|
535
|
-
"named": true,
|
|
536
|
-
"fields": {},
|
|
537
228
|
"children": {
|
|
538
229
|
"multiple": true,
|
|
539
|
-
"required":
|
|
230
|
+
"required": false,
|
|
540
231
|
"types": [
|
|
541
232
|
{
|
|
542
|
-
"type": "
|
|
233
|
+
"type": "identifier",
|
|
543
|
-
"named": true
|
|
544
|
-
},
|
|
545
|
-
{
|
|
546
|
-
"type": "import_statement",
|
|
547
234
|
"named": true
|
|
548
235
|
},
|
|
549
236
|
{
|
|
550
|
-
"type": "
|
|
237
|
+
"type": "type_field",
|
|
551
238
|
"named": true
|
|
552
239
|
}
|
|
553
240
|
]
|
|
554
241
|
}
|
|
555
242
|
},
|
|
556
243
|
{
|
|
557
|
-
"type": "
|
|
244
|
+
"type": "unqualified_import",
|
|
558
245
|
"named": true,
|
|
559
246
|
"fields": {
|
|
560
|
-
"
|
|
247
|
+
"alias": {
|
|
561
|
-
"multiple": true,
|
|
562
|
-
"required": true,
|
|
563
|
-
"types": [
|
|
564
|
-
{
|
|
565
|
-
"type": "(",
|
|
566
|
-
"named": false
|
|
567
|
-
},
|
|
568
|
-
{
|
|
569
|
-
"type": ")",
|
|
570
|
-
"named": false
|
|
571
|
-
},
|
|
572
|
-
{
|
|
573
|
-
"type": ",",
|
|
574
|
-
"named": false
|
|
575
|
-
},
|
|
576
|
-
{
|
|
577
|
-
"type": "trait_field",
|
|
578
|
-
"named": true
|
|
579
|
-
}
|
|
580
|
-
]
|
|
581
|
-
},
|
|
582
|
-
"generics": {
|
|
583
248
|
"multiple": false,
|
|
584
249
|
"required": false,
|
|
585
250
|
"types": [
|
|
586
251
|
{
|
|
587
|
-
"type": "
|
|
252
|
+
"type": "identifier",
|
|
253
|
+
"named": true
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
"type": "type_identifier",
|
|
588
257
|
"named": true
|
|
589
258
|
}
|
|
590
259
|
]
|
|
@@ -594,7 +263,11 @@
|
|
|
594
263
|
"required": true,
|
|
595
264
|
"types": [
|
|
596
265
|
{
|
|
597
|
-
"type": "
|
|
266
|
+
"type": "identifier",
|
|
267
|
+
"named": true
|
|
268
|
+
},
|
|
269
|
+
{
|
|
270
|
+
"type": "type_identifier",
|
|
598
271
|
"named": true
|
|
599
272
|
}
|
|
600
273
|
]
|
|
@@ -602,97 +275,20 @@
|
|
|
602
275
|
}
|
|
603
276
|
},
|
|
604
277
|
{
|
|
605
|
-
"type": "trait_field",
|
|
606
|
-
"named": true,
|
|
607
|
-
"fields": {},
|
|
608
|
-
"children": {
|
|
609
|
-
"multiple": false,
|
|
610
|
-
"required": true,
|
|
611
|
-
"types": [
|
|
612
|
-
{
|
|
613
|
-
"type": "fun_field",
|
|
614
|
-
"named": true
|
|
615
|
-
},
|
|
616
|
-
{
|
|
617
|
-
"type": "type_field",
|
|
618
|
-
"named": true
|
|
619
|
-
}
|
|
620
|
-
]
|
|
621
|
-
}
|
|
622
|
-
},
|
|
623
|
-
{
|
|
624
|
-
"type": "
|
|
278
|
+
"type": "unqualified_imports",
|
|
625
279
|
"named": true,
|
|
626
280
|
"fields": {},
|
|
627
281
|
"children": {
|
|
628
282
|
"multiple": true,
|
|
629
|
-
"required":
|
|
283
|
+
"required": false,
|
|
630
|
-
"types": [
|
|
631
|
-
{
|
|
632
|
-
"type": "definition_name",
|
|
633
|
-
"named": true
|
|
634
|
-
}
|
|
635
|
-
]
|
|
636
|
-
}
|
|
637
|
-
},
|
|
638
|
-
{
|
|
639
|
-
"type": "type",
|
|
640
|
-
"named": true,
|
|
641
|
-
"fields": {},
|
|
642
|
-
"children": {
|
|
643
|
-
"multiple": false,
|
|
644
|
-
"required": true,
|
|
645
284
|
"types": [
|
|
646
285
|
{
|
|
647
|
-
"type": "
|
|
286
|
+
"type": "unqualified_import",
|
|
648
287
|
"named": true
|
|
649
288
|
}
|
|
650
289
|
]
|
|
651
290
|
}
|
|
652
291
|
},
|
|
653
|
-
{
|
|
654
|
-
"type": "type_field",
|
|
655
|
-
"named": true,
|
|
656
|
-
"fields": {
|
|
657
|
-
"name": {
|
|
658
|
-
"multiple": false,
|
|
659
|
-
"required": true,
|
|
660
|
-
"types": [
|
|
661
|
-
{
|
|
662
|
-
"type": "variable_name",
|
|
663
|
-
"named": true
|
|
664
|
-
}
|
|
665
|
-
]
|
|
666
|
-
},
|
|
667
|
-
"type": {
|
|
668
|
-
"multiple": false,
|
|
669
|
-
"required": true,
|
|
670
|
-
"types": [
|
|
671
|
-
{
|
|
672
|
-
"type": "type",
|
|
673
|
-
"named": true
|
|
674
|
-
}
|
|
675
|
-
]
|
|
676
|
-
}
|
|
677
|
-
}
|
|
678
|
-
},
|
|
679
|
-
{
|
|
680
|
-
"type": "url",
|
|
681
|
-
"named": true,
|
|
682
|
-
"fields": {}
|
|
683
|
-
},
|
|
684
|
-
{
|
|
685
|
-
"type": "\"",
|
|
686
|
-
"named": false
|
|
687
|
-
},
|
|
688
|
-
{
|
|
689
|
-
"type": "$",
|
|
690
|
-
"named": false
|
|
691
|
-
},
|
|
692
|
-
{
|
|
693
|
-
"type": "'",
|
|
694
|
-
"named": false
|
|
695
|
-
},
|
|
696
292
|
{
|
|
697
293
|
"type": "(",
|
|
698
294
|
"named": false
|
|
@@ -718,107 +314,35 @@
|
|
|
718
314
|
"named": false
|
|
719
315
|
},
|
|
720
316
|
{
|
|
721
|
-
"type": "<",
|
|
722
|
-
"named": false
|
|
723
|
-
},
|
|
724
|
-
{
|
|
725
|
-
"type": "=>",
|
|
726
|
-
"named": false
|
|
727
|
-
},
|
|
728
|
-
{
|
|
729
|
-
"type": ">",
|
|
730
|
-
"named": false
|
|
731
|
-
},
|
|
732
|
-
{
|
|
733
|
-
"type": "
|
|
317
|
+
"type": "=",
|
|
734
|
-
"named": false
|
|
735
|
-
},
|
|
736
|
-
{
|
|
737
|
-
"type": "@",
|
|
738
|
-
"named": false
|
|
739
|
-
},
|
|
740
|
-
{
|
|
741
|
-
"type": "\\u",
|
|
742
|
-
"named": false
|
|
743
|
-
},
|
|
744
|
-
{
|
|
745
|
-
"type": "`",
|
|
746
|
-
"named": false
|
|
747
|
-
},
|
|
748
|
-
{
|
|
749
|
-
"type": "bin_literal",
|
|
750
|
-
"named": true
|
|
751
|
-
},
|
|
752
|
-
{
|
|
753
|
-
"type": "class",
|
|
754
318
|
"named": false
|
|
755
319
|
},
|
|
756
320
|
{
|
|
757
|
-
"type": "comment",
|
|
758
|
-
"named": true
|
|
759
|
-
},
|
|
760
|
-
{
|
|
761
|
-
"type": "definition_name",
|
|
762
|
-
"named": true
|
|
763
|
-
},
|
|
764
|
-
{
|
|
765
|
-
"type": "
|
|
321
|
+
"type": "as",
|
|
766
322
|
"named": false
|
|
767
323
|
},
|
|
768
|
-
{
|
|
769
|
-
"type": "enum_field_name",
|
|
770
|
-
"named": true
|
|
771
|
-
},
|
|
772
|
-
{
|
|
773
|
-
"type": "false",
|
|
774
|
-
"named": false
|
|
775
|
-
},
|
|
776
|
-
{
|
|
777
|
-
"type": "float_literal",
|
|
778
|
-
"named": true
|
|
779
|
-
},
|
|
780
|
-
{
|
|
781
|
-
"type": "fun",
|
|
782
|
-
"named": false
|
|
783
|
-
},
|
|
784
|
-
{
|
|
785
|
-
"type": "hex_literal",
|
|
786
|
-
"named": true
|
|
787
|
-
},
|
|
788
324
|
{
|
|
789
325
|
"type": "import",
|
|
790
326
|
"named": false
|
|
791
327
|
},
|
|
792
328
|
{
|
|
793
|
-
"type": "integer_literal",
|
|
794
|
-
"named": true
|
|
795
|
-
},
|
|
796
|
-
{
|
|
797
|
-
"type": "
|
|
329
|
+
"type": "module",
|
|
798
|
-
"named": false
|
|
799
|
-
},
|
|
800
|
-
{
|
|
801
|
-
"type": "package",
|
|
802
330
|
"named": false
|
|
803
331
|
},
|
|
804
332
|
{
|
|
805
|
-
"type": "
|
|
333
|
+
"type": "record",
|
|
806
334
|
"named": false
|
|
807
335
|
},
|
|
808
336
|
{
|
|
809
|
-
"type": "
|
|
337
|
+
"type": "type",
|
|
810
338
|
"named": false
|
|
811
339
|
},
|
|
812
340
|
{
|
|
813
|
-
"type": "
|
|
341
|
+
"type": "{",
|
|
814
342
|
"named": false
|
|
815
343
|
},
|
|
816
344
|
{
|
|
817
|
-
"type": "variable_name",
|
|
818
|
-
"named": true
|
|
819
|
-
},
|
|
820
|
-
{
|
|
821
|
-
"type": "
|
|
345
|
+
"type": "|",
|
|
822
346
|
"named": false
|
|
823
347
|
},
|
|
824
348
|
{
|
test/corpus/class_definitions.txt
DELETED
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
================================================================================
|
|
2
|
-
Class definitions - Simple
|
|
3
|
-
================================================================================
|
|
4
|
-
|
|
5
|
-
package definitions
|
|
6
|
-
|
|
7
|
-
class AnimalStrong(
|
|
8
|
-
val count: String,
|
|
9
|
-
val userName: Int,
|
|
10
|
-
val currentAddress: Address
|
|
11
|
-
)
|
|
12
|
-
|
|
13
|
-
--------------------------------------------------------------------------------
|
|
14
|
-
|
|
15
|
-
(source_file
|
|
16
|
-
(package
|
|
17
|
-
(identifier))
|
|
18
|
-
(definitions
|
|
19
|
-
(class_definition
|
|
20
|
-
(definition_name)
|
|
21
|
-
(type_field
|
|
22
|
-
(variable_name)
|
|
23
|
-
(type
|
|
24
|
-
(definition_name)))
|
|
25
|
-
(type_field
|
|
26
|
-
(variable_name)
|
|
27
|
-
(type
|
|
28
|
-
(definition_name)))
|
|
29
|
-
(type_field
|
|
30
|
-
(variable_name)
|
|
31
|
-
(type
|
|
32
|
-
(definition_name))))))
|
|
33
|
-
|
|
34
|
-
================================================================================
|
|
35
|
-
Class definitions - Generic
|
|
36
|
-
================================================================================
|
|
37
|
-
|
|
38
|
-
package definitions
|
|
39
|
-
|
|
40
|
-
class Bat<S, T>(
|
|
41
|
-
val a: S,
|
|
42
|
-
val b: T
|
|
43
|
-
)
|
|
44
|
-
|
|
45
|
-
--------------------------------------------------------------------------------
|
|
46
|
-
|
|
47
|
-
(source_file
|
|
48
|
-
(package
|
|
49
|
-
(identifier))
|
|
50
|
-
(definitions
|
|
51
|
-
(class_definition
|
|
52
|
-
(definition_name)
|
|
53
|
-
(generic_list
|
|
54
|
-
(identifier)
|
|
55
|
-
(identifier))
|
|
56
|
-
(type_field
|
|
57
|
-
(variable_name)
|
|
58
|
-
(type
|
|
59
|
-
(definition_name)))
|
|
60
|
-
(type_field
|
|
61
|
-
(variable_name)
|
|
62
|
-
(type
|
|
63
|
-
(definition_name))))))
|
|
64
|
-
|
|
65
|
-
================================================================================
|
|
66
|
-
Class definitions - Traits
|
|
67
|
-
================================================================================
|
|
68
|
-
|
|
69
|
-
package definitions
|
|
70
|
-
|
|
71
|
-
class AnimalSubSpecies : B, C (
|
|
72
|
-
val a: String,
|
|
73
|
-
val b: Float
|
|
74
|
-
)
|
|
75
|
-
|
|
76
|
-
--------------------------------------------------------------------------------
|
|
77
|
-
|
|
78
|
-
(source_file
|
|
79
|
-
(package
|
|
80
|
-
(identifier))
|
|
81
|
-
(definitions
|
|
82
|
-
(class_definition
|
|
83
|
-
(definition_name)
|
|
84
|
-
(trait_list
|
|
85
|
-
(definition_name)
|
|
86
|
-
(definition_name))
|
|
87
|
-
(type_field
|
|
88
|
-
(variable_name)
|
|
89
|
-
(type
|
|
90
|
-
(definition_name)))
|
|
91
|
-
(type_field
|
|
92
|
-
(variable_name)
|
|
93
|
-
(type
|
|
94
|
-
(definition_name))))))
|
|
95
|
-
|
|
96
|
-
================================================================================
|
|
97
|
-
Class definitions - Genrics + Traits
|
|
98
|
-
================================================================================
|
|
99
|
-
|
|
100
|
-
package definitions
|
|
101
|
-
|
|
102
|
-
class A<S, T>: B, C (
|
|
103
|
-
val a: S,
|
|
104
|
-
val b: T
|
|
105
|
-
)
|
|
106
|
-
|
|
107
|
-
--------------------------------------------------------------------------------
|
|
108
|
-
|
|
109
|
-
(source_file
|
|
110
|
-
(package
|
|
111
|
-
(identifier))
|
|
112
|
-
(definitions
|
|
113
|
-
(class_definition
|
|
114
|
-
(definition_name)
|
|
115
|
-
(generic_list
|
|
116
|
-
(identifier)
|
|
117
|
-
(identifier))
|
|
118
|
-
(trait_list
|
|
119
|
-
(definition_name)
|
|
120
|
-
(definition_name))
|
|
121
|
-
(type_field
|
|
122
|
-
(variable_name)
|
|
123
|
-
(type
|
|
124
|
-
(definition_name)))
|
|
125
|
-
(type_field
|
|
126
|
-
(variable_name)
|
|
127
|
-
(type
|
|
128
|
-
(definition_name))))))
|
test/corpus/enum_definitions.txt
DELETED
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
================================================================================
|
|
2
|
-
Enum definitions - Int
|
|
3
|
-
================================================================================
|
|
4
|
-
|
|
5
|
-
package definitions
|
|
6
|
-
|
|
7
|
-
enum Colors(val rgb: Int) { # define colors here
|
|
8
|
-
RED(0xFF0000),
|
|
9
|
-
GREEN(0x00FF00), # this needs to sorted
|
|
10
|
-
BLUE(0x0000FF)
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
--------------------------------------------------------------------------------
|
|
14
|
-
|
|
15
|
-
(source_file
|
|
16
|
-
(package
|
|
17
|
-
(identifier))
|
|
18
|
-
(definitions
|
|
19
|
-
(enum_definition
|
|
20
|
-
(definition_name)
|
|
21
|
-
(type_field
|
|
22
|
-
(variable_name)
|
|
23
|
-
(type
|
|
24
|
-
(definition_name)))
|
|
25
|
-
(comment)
|
|
26
|
-
(enum_field
|
|
27
|
-
(enum_field_name)
|
|
28
|
-
(hex_literal))
|
|
29
|
-
(enum_field
|
|
30
|
-
(enum_field_name)
|
|
31
|
-
(hex_literal))
|
|
32
|
-
(comment)
|
|
33
|
-
(enum_field
|
|
34
|
-
(enum_field_name)
|
|
35
|
-
(hex_literal)))))
|
|
36
|
-
|
|
37
|
-
================================================================================
|
|
38
|
-
Enum definitions - Float
|
|
39
|
-
================================================================================
|
|
40
|
-
|
|
41
|
-
package definitions
|
|
42
|
-
|
|
43
|
-
enum ColorsAlpha(val a: Int, val b: Float) {
|
|
44
|
-
RED(1, 0.1),
|
|
45
|
-
GREEN(2, 0.2),
|
|
46
|
-
BLUE(3, 0.3)
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
--------------------------------------------------------------------------------
|
|
50
|
-
|
|
51
|
-
(source_file
|
|
52
|
-
(package
|
|
53
|
-
(identifier))
|
|
54
|
-
(definitions
|
|
55
|
-
(enum_definition
|
|
56
|
-
(definition_name)
|
|
57
|
-
(type_field
|
|
58
|
-
(variable_name)
|
|
59
|
-
(type
|
|
60
|
-
(definition_name)))
|
|
61
|
-
(type_field
|
|
62
|
-
(variable_name)
|
|
63
|
-
(type
|
|
64
|
-
(definition_name)))
|
|
65
|
-
(enum_field
|
|
66
|
-
(enum_field_name)
|
|
67
|
-
(integer_literal)
|
|
68
|
-
(float_literal))
|
|
69
|
-
(enum_field
|
|
70
|
-
(enum_field_name)
|
|
71
|
-
(integer_literal)
|
|
72
|
-
(float_literal))
|
|
73
|
-
(enum_field
|
|
74
|
-
(enum_field_name)
|
|
75
|
-
(integer_literal)
|
|
76
|
-
(float_literal)))))
|
|
77
|
-
|
|
78
|
-
================================================================================
|
|
79
|
-
Enum definitions - String
|
|
80
|
-
================================================================================
|
|
81
|
-
|
|
82
|
-
package definitions
|
|
83
|
-
|
|
84
|
-
enum ColorsAlpha(val a: Int, val b: String) {
|
|
85
|
-
RED(1, "1"),
|
|
86
|
-
GREEN(2, "2"),
|
|
87
|
-
BLUE(3, "3")
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
--------------------------------------------------------------------------------
|
|
91
|
-
|
|
92
|
-
(source_file
|
|
93
|
-
(package
|
|
94
|
-
(identifier))
|
|
95
|
-
(definitions
|
|
96
|
-
(enum_definition
|
|
97
|
-
(definition_name)
|
|
98
|
-
(type_field
|
|
99
|
-
(variable_name)
|
|
100
|
-
(type
|
|
101
|
-
(definition_name)))
|
|
102
|
-
(type_field
|
|
103
|
-
(variable_name)
|
|
104
|
-
(type
|
|
105
|
-
(definition_name)))
|
|
106
|
-
(enum_field
|
|
107
|
-
(enum_field_name)
|
|
108
|
-
(integer_literal)
|
|
109
|
-
(line_string_literal))
|
|
110
|
-
(enum_field
|
|
111
|
-
(enum_field_name)
|
|
112
|
-
(integer_literal)
|
|
113
|
-
(line_string_literal))
|
|
114
|
-
(enum_field
|
|
115
|
-
(enum_field_name)
|
|
116
|
-
(integer_literal)
|
|
117
|
-
(line_string_literal)))))
|
test/corpus/functions.txt
CHANGED
|
@@ -4,8 +4,8 @@ Functions - Simple
|
|
|
4
4
|
|
|
5
5
|
package definitions
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
main() =
|
|
8
|
-
|
|
8
|
+
todo("Not done")
|
|
9
9
|
|
|
10
10
|
--------------------------------------------------------------------------------
|
|
11
11
|
|
test/corpus/import.txt
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
================================================================================
|
|
2
|
+
Module Statement
|
|
3
|
+
================================================================================
|
|
4
|
+
|
|
5
|
+
module palm
|
|
6
|
+
|
|
7
|
+
--------------------------------------------------------------------------------
|
|
8
|
+
|
|
9
|
+
(source_file
|
|
10
|
+
(module
|
|
11
|
+
(module_name)))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
================================================================================
|
|
15
|
+
Import statements
|
|
16
|
+
================================================================================
|
|
17
|
+
|
|
18
|
+
module palm/std
|
|
19
|
+
|
|
20
|
+
import palm/std/list
|
|
21
|
+
import palm/std/list.{List, contains}
|
|
22
|
+
import palm/std/bool as boolean
|
|
23
|
+
|
|
24
|
+
--------------------------------------------------------------------------------
|
|
25
|
+
|
|
26
|
+
(source_file
|
|
27
|
+
(module
|
|
28
|
+
(module_name))
|
|
29
|
+
(import
|
|
30
|
+
(module_name))
|
|
31
|
+
(import
|
|
32
|
+
(module_name)
|
|
33
|
+
(unqualified_imports
|
|
34
|
+
(unqualified_import
|
|
35
|
+
(identifier))
|
|
36
|
+
(unqualified_import
|
|
37
|
+
(identifier))))
|
|
38
|
+
(import
|
|
39
|
+
(module_name)
|
|
40
|
+
(identifier)))
|
test/corpus/import_statements.txt
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
================================================================================
|
|
2
|
-
Import statements
|
|
3
|
-
================================================================================
|
|
4
|
-
|
|
5
|
-
package imports
|
|
6
|
-
|
|
7
|
-
import github/pine/std # importing std library here
|
|
8
|
-
|
|
9
|
-
--------------------------------------------------------------------------------
|
|
10
|
-
|
|
11
|
-
(source_file
|
|
12
|
-
(package
|
|
13
|
-
(identifier))
|
|
14
|
-
(import_statement
|
|
15
|
-
(url))
|
|
16
|
-
(comment))
|
test/corpus/record.txt
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
================================================================================
|
|
2
|
+
Record - Simple
|
|
3
|
+
================================================================================
|
|
4
|
+
|
|
5
|
+
module std
|
|
6
|
+
|
|
7
|
+
record Cat
|
|
8
|
+
firstName: String
|
|
9
|
+
middleName: String
|
|
10
|
+
lastName: String
|
|
11
|
+
age : Int
|
|
12
|
+
|
|
13
|
+
record Dog
|
|
14
|
+
name: String
|
|
15
|
+
|
|
16
|
+
--------------------------------------------------------------------------------
|
|
17
|
+
|
|
18
|
+
(source_file
|
|
19
|
+
(module
|
|
20
|
+
(module_name))
|
|
21
|
+
(record
|
|
22
|
+
(type_identifier)
|
|
23
|
+
(type_field
|
|
24
|
+
(identifier)
|
|
25
|
+
(identifier))
|
|
26
|
+
(type_field
|
|
27
|
+
(identifier)
|
|
28
|
+
(identifier))
|
|
29
|
+
(type_field
|
|
30
|
+
(identifier)
|
|
31
|
+
(identifier))
|
|
32
|
+
(type_field
|
|
33
|
+
(identifier)
|
|
34
|
+
(identifier)))
|
|
35
|
+
(record
|
|
36
|
+
(type_identifier)
|
|
37
|
+
(type_field
|
|
38
|
+
(identifier)
|
|
39
|
+
(identifier))))
|
|
40
|
+
|
|
41
|
+
================================================================================
|
|
42
|
+
Record - Generic
|
|
43
|
+
================================================================================
|
|
44
|
+
|
|
45
|
+
module std
|
|
46
|
+
|
|
47
|
+
record Shape(a)
|
|
48
|
+
name: String
|
|
49
|
+
area: a
|
|
50
|
+
|
|
51
|
+
--------------------------------------------------------------------------------
|
|
52
|
+
|
|
53
|
+
(source_file
|
|
54
|
+
(module
|
|
55
|
+
(module_name))
|
|
56
|
+
(record
|
|
57
|
+
(type_identifier)
|
|
58
|
+
(generic_list
|
|
59
|
+
(identifier))
|
|
60
|
+
(type_field
|
|
61
|
+
(identifier)
|
|
62
|
+
(identifier))
|
|
63
|
+
(type_field
|
|
64
|
+
(identifier)
|
|
65
|
+
(identifier))))
|
test/corpus/traits.txt
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
================================================================================
|
|
2
|
-
Traits - Simple
|
|
3
|
-
================================================================================
|
|
4
|
-
|
|
5
|
-
package definitions
|
|
6
|
-
|
|
7
|
-
trait Animal(
|
|
8
|
-
val name: String,
|
|
9
|
-
fun legs() => Int
|
|
10
|
-
)
|
|
11
|
-
|
|
12
|
-
--------------------------------------------------------------------------------
|
|
13
|
-
|
|
14
|
-
(source_file
|
|
15
|
-
(package
|
|
16
|
-
(identifier))
|
|
17
|
-
(definitions
|
|
18
|
-
(trait_definition
|
|
19
|
-
(definition_name)
|
|
20
|
-
(trait_field
|
|
21
|
-
(type_field
|
|
22
|
-
(variable_name)
|
|
23
|
-
(type
|
|
24
|
-
(definition_name))))
|
|
25
|
-
(trait_field
|
|
26
|
-
(fun_field
|
|
27
|
-
(identifier)
|
|
28
|
-
(type
|
|
29
|
-
(definition_name)))))))
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
================================================================================
|
|
33
|
-
Traits - Generics
|
|
34
|
-
================================================================================
|
|
35
|
-
|
|
36
|
-
package definitions
|
|
37
|
-
|
|
38
|
-
trait Shape<T>(
|
|
39
|
-
val name: T,
|
|
40
|
-
fun area(size: Float) => T
|
|
41
|
-
)
|
|
42
|
-
--------------------------------------------------------------------------------
|
|
43
|
-
|
|
44
|
-
(source_file
|
|
45
|
-
(package
|
|
46
|
-
(identifier))
|
|
47
|
-
(definitions
|
|
48
|
-
(trait_definition
|
|
49
|
-
(definition_name)
|
|
50
|
-
(generic_list
|
|
51
|
-
(identifier))
|
|
52
|
-
(trait_field
|
|
53
|
-
(type_field
|
|
54
|
-
(variable_name)
|
|
55
|
-
(type
|
|
56
|
-
(definition_name))))
|
|
57
|
-
(trait_field
|
|
58
|
-
(fun_field
|
|
59
|
-
(identifier)
|
|
60
|
-
(param
|
|
61
|
-
(variable_name)
|
|
62
|
-
(type
|
|
63
|
-
(definition_name)))
|
|
64
|
-
(type
|
|
65
|
-
(definition_name)))))))
|
test/corpus/type.txt
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
================================================================================
|
|
2
|
+
Type - Simple
|
|
3
|
+
================================================================================
|
|
4
|
+
|
|
5
|
+
module palm
|
|
6
|
+
|
|
7
|
+
type User = Guest | LoggedIn(name: String, session_id: String)
|
|
8
|
+
|
|
9
|
+
--------------------------------------------------------------------------------
|
|
10
|
+
|
|
11
|
+
(source_file
|
|
12
|
+
(module
|
|
13
|
+
(module_name))
|
|
14
|
+
(type
|
|
15
|
+
(type_identifier)
|
|
16
|
+
(type_name
|
|
17
|
+
(type_identifier))
|
|
18
|
+
(type_name
|
|
19
|
+
(type_identifier)
|
|
20
|
+
(type_field
|
|
21
|
+
(identifier)
|
|
22
|
+
(identifier))
|
|
23
|
+
(type_field
|
|
24
|
+
(identifier)
|
|
25
|
+
(identifier)))))
|
|
26
|
+
|
|
27
|
+
================================================================================
|
|
28
|
+
Type - Generic
|
|
29
|
+
================================================================================
|
|
30
|
+
|
|
31
|
+
module palm
|
|
32
|
+
|
|
33
|
+
type User(a) = Guest | LoggedIn(name: a, age: Int)
|
|
34
|
+
|
|
35
|
+
type Option(a) = Some(a) | None
|
|
36
|
+
|
|
37
|
+
type Result(a, b) = Ok(a) | Error(b)
|
|
38
|
+
|
|
39
|
+
--------------------------------------------------------------------------------
|
|
40
|
+
|
|
41
|
+
(source_file
|
|
42
|
+
(module
|
|
43
|
+
(module_name))
|
|
44
|
+
(type
|
|
45
|
+
(type_identifier)
|
|
46
|
+
(generic_list
|
|
47
|
+
(identifier))
|
|
48
|
+
(type_name
|
|
49
|
+
(type_identifier))
|
|
50
|
+
(type_name
|
|
51
|
+
(type_identifier)
|
|
52
|
+
(type_field
|
|
53
|
+
(identifier)
|
|
54
|
+
(identifier))
|
|
55
|
+
(type_field
|
|
56
|
+
(identifier)
|
|
57
|
+
(identifier))))
|
|
58
|
+
(type
|
|
59
|
+
(type_identifier)
|
|
60
|
+
(generic_list
|
|
61
|
+
(identifier))
|
|
62
|
+
(type_name
|
|
63
|
+
(type_identifier)
|
|
64
|
+
(identifier))
|
|
65
|
+
(type_name
|
|
66
|
+
(type_identifier)))
|
|
67
|
+
(type
|
|
68
|
+
(type_identifier)
|
|
69
|
+
(generic_list
|
|
70
|
+
(identifier)
|
|
71
|
+
(identifier))
|
|
72
|
+
(type_name
|
|
73
|
+
(type_identifier)
|
|
74
|
+
(identifier))
|
|
75
|
+
(type_name
|
|
76
|
+
(type_identifier)
|
|
77
|
+
(identifier))))
|