Compare commits
2 Commits
0c37e5e3a6
...
02cded4af4
Author | SHA1 | Date | |
---|---|---|---|
02cded4af4 | |||
47f50931d9 |
@ -7,16 +7,14 @@ async { (output 'Whaddup') }
|
||||
---
|
||||
|
||||
(root
|
||||
(item
|
||||
(statement
|
||||
(async
|
||||
(item
|
||||
(statement
|
||||
(expression
|
||||
(tool
|
||||
(expression
|
||||
(value
|
||||
(string)))))))))))
|
||||
(string)))))))))
|
||||
|
||||
==================
|
||||
Complex Async Statements
|
||||
@ -35,10 +33,8 @@ async {
|
||||
---
|
||||
|
||||
(root
|
||||
(item
|
||||
(statement
|
||||
(async
|
||||
(item
|
||||
(statement
|
||||
(if_else
|
||||
(if
|
||||
@ -57,18 +53,15 @@ async {
|
||||
(expression
|
||||
(value
|
||||
(integer)))))
|
||||
(item
|
||||
(statement
|
||||
(expression
|
||||
(value
|
||||
(boolean)))))
|
||||
(else
|
||||
(statement
|
||||
(expression
|
||||
(value
|
||||
(boolean))))))
|
||||
(else
|
||||
(item
|
||||
(statement
|
||||
(expression
|
||||
(value
|
||||
(boolean))))))))
|
||||
(statement
|
||||
(expression
|
||||
(value
|
||||
(string)))))))))
|
||||
(string)))))))
|
||||
|
@ -1,240 +0,0 @@
|
||||
==================
|
||||
If
|
||||
==================
|
||||
|
||||
if true { "True" }
|
||||
|
||||
---
|
||||
|
||||
(root
|
||||
(item
|
||||
(statement
|
||||
(if_else
|
||||
(if
|
||||
(expression
|
||||
(value
|
||||
(boolean)))
|
||||
(item
|
||||
(statement
|
||||
(expression
|
||||
(value
|
||||
(string))))))))))
|
||||
|
||||
==================
|
||||
Complex If
|
||||
==================
|
||||
|
||||
if (1 == 1) && (2 == 2) && (3 == 3) { "True" }
|
||||
|
||||
---
|
||||
|
||||
(root
|
||||
(item
|
||||
(statement
|
||||
(if_else
|
||||
(if
|
||||
(expression
|
||||
(logic
|
||||
(expression
|
||||
(logic
|
||||
(expression
|
||||
(value
|
||||
(integer)))
|
||||
(logic_operator)
|
||||
(expression
|
||||
(value
|
||||
(integer)))))
|
||||
(logic_operator)
|
||||
(expression
|
||||
(logic
|
||||
(expression
|
||||
(logic
|
||||
(expression
|
||||
(value
|
||||
(integer)))
|
||||
(logic_operator)
|
||||
(expression
|
||||
(value
|
||||
(integer)))))
|
||||
(logic_operator)
|
||||
(expression
|
||||
(logic
|
||||
(expression
|
||||
(value
|
||||
(integer)))
|
||||
(logic_operator)
|
||||
(expression
|
||||
(value
|
||||
(integer)))))))))
|
||||
(item
|
||||
(statement
|
||||
(expression
|
||||
(value
|
||||
(string))))))))))
|
||||
|
||||
==================
|
||||
If Assignment
|
||||
==================
|
||||
|
||||
x = if true { 1 }
|
||||
|
||||
---
|
||||
|
||||
(root
|
||||
(item
|
||||
(statement
|
||||
(assignment
|
||||
(identifier)
|
||||
(assignment_operator)
|
||||
(statement
|
||||
(if_else
|
||||
(if
|
||||
(expression
|
||||
(value
|
||||
(boolean)))
|
||||
(item
|
||||
(statement
|
||||
(expression
|
||||
(value
|
||||
(integer))))))))))))
|
||||
|
||||
==================
|
||||
If Else
|
||||
==================
|
||||
|
||||
if false { "True" } else { "False" }
|
||||
|
||||
---
|
||||
|
||||
(root
|
||||
(item
|
||||
(statement
|
||||
(if_else
|
||||
(if
|
||||
(expression
|
||||
(value
|
||||
(boolean)))
|
||||
(item
|
||||
(statement
|
||||
(expression
|
||||
(value
|
||||
(string))))))
|
||||
(else
|
||||
(item
|
||||
(statement
|
||||
(expression
|
||||
(value
|
||||
(string))))))))))
|
||||
|
||||
==================
|
||||
If Else If
|
||||
==================
|
||||
|
||||
if 1 == 1 {
|
||||
"math is fun"
|
||||
} else if 4 == 9 {
|
||||
"math is broken"
|
||||
}
|
||||
|
||||
---
|
||||
|
||||
(root
|
||||
(item
|
||||
(statement
|
||||
(if_else
|
||||
(if
|
||||
(expression
|
||||
(logic
|
||||
(expression
|
||||
(value
|
||||
(integer)))
|
||||
(logic_operator)
|
||||
(expression
|
||||
(value
|
||||
(integer)))))
|
||||
(item
|
||||
(statement
|
||||
(expression
|
||||
(value
|
||||
(string))))))
|
||||
(else_if
|
||||
(expression
|
||||
(logic
|
||||
(expression
|
||||
(value
|
||||
(integer)))
|
||||
(logic_operator)
|
||||
(expression
|
||||
(value
|
||||
(integer)))))
|
||||
(item
|
||||
(statement
|
||||
(expression
|
||||
(value
|
||||
(string))))))))))
|
||||
|
||||
==================
|
||||
If Else Else If Else
|
||||
==================
|
||||
|
||||
if false {
|
||||
"no"
|
||||
} else if false {
|
||||
"no"
|
||||
} else if 1 + 1 == 9 {
|
||||
"not the answer"
|
||||
} else {
|
||||
"42"
|
||||
}
|
||||
|
||||
---
|
||||
|
||||
(root
|
||||
(item
|
||||
(statement
|
||||
(if_else
|
||||
(if
|
||||
(expression
|
||||
(value
|
||||
(boolean)))
|
||||
(item
|
||||
(statement
|
||||
(expression
|
||||
(value
|
||||
(string))))))
|
||||
(else_if
|
||||
(expression
|
||||
(value
|
||||
(boolean)))
|
||||
(item
|
||||
(statement
|
||||
(expression
|
||||
(value
|
||||
(string))))))
|
||||
(else_if
|
||||
(expression
|
||||
(logic
|
||||
(expression
|
||||
(math
|
||||
(expression
|
||||
(value
|
||||
(integer)))
|
||||
(math_operator)
|
||||
(expression
|
||||
(value
|
||||
(integer)))))
|
||||
(logic_operator)
|
||||
(expression
|
||||
(value
|
||||
(integer)))))
|
||||
(item
|
||||
(statement
|
||||
(expression
|
||||
(value
|
||||
(string))))))
|
||||
(else
|
||||
(item
|
||||
(statement
|
||||
(expression
|
||||
(value
|
||||
(string))))))))))
|
@ -1,5 +1,5 @@
|
||||
==================
|
||||
Filter Loop
|
||||
Simple Filter Loop
|
||||
==================
|
||||
|
||||
filter i in [1, 2, 3] {
|
||||
@ -9,7 +9,6 @@ filter i in [1, 2, 3] {
|
||||
---
|
||||
|
||||
(root
|
||||
(item
|
||||
(statement
|
||||
(filter
|
||||
(identifier)
|
||||
@ -25,7 +24,39 @@ filter i in [1, 2, 3] {
|
||||
(expression
|
||||
(value
|
||||
(integer))))))
|
||||
(item
|
||||
(statement
|
||||
(expression
|
||||
(logic
|
||||
(expression
|
||||
(identifier))
|
||||
(logic_operator)
|
||||
(expression
|
||||
(value
|
||||
(integer)))))))))
|
||||
|
||||
==================
|
||||
Nested Filter Loop
|
||||
==================
|
||||
|
||||
filter i in big_list {
|
||||
filter j in i {
|
||||
i != 42
|
||||
}
|
||||
}
|
||||
|
||||
---
|
||||
|
||||
(root
|
||||
(statement
|
||||
(filter
|
||||
(identifier)
|
||||
(expression
|
||||
(identifier))
|
||||
(statement
|
||||
(filter
|
||||
(identifier)
|
||||
(expression
|
||||
(identifier))
|
||||
(statement
|
||||
(expression
|
||||
(logic
|
||||
@ -35,45 +66,3 @@ filter i in [1, 2, 3] {
|
||||
(expression
|
||||
(value
|
||||
(integer)))))))))))
|
||||
|
||||
==================
|
||||
Filter Loop Assignment
|
||||
==================
|
||||
|
||||
list = filter i in ["one", "two", "three"] {
|
||||
i == "one"
|
||||
}
|
||||
|
||||
---
|
||||
|
||||
(root
|
||||
(item
|
||||
(statement
|
||||
(assignment
|
||||
(identifier)
|
||||
(assignment_operator)
|
||||
(statement
|
||||
(filter
|
||||
(identifier)
|
||||
(expression
|
||||
(value
|
||||
(list
|
||||
(expression
|
||||
(value
|
||||
(string)))
|
||||
(expression
|
||||
(value
|
||||
(string)))
|
||||
(expression
|
||||
(value
|
||||
(string))))))
|
||||
(item
|
||||
(statement
|
||||
(expression
|
||||
(logic
|
||||
(expression
|
||||
(identifier))
|
||||
(logic_operator)
|
||||
(expression
|
||||
(value
|
||||
(string)))))))))))))
|
||||
|
@ -1,5 +1,5 @@
|
||||
==================
|
||||
Find Loop
|
||||
Simple Find Loop
|
||||
==================
|
||||
|
||||
find i in [1, 2, 3] {
|
||||
@ -9,7 +9,6 @@ find i in [1, 2, 3] {
|
||||
---
|
||||
|
||||
(root
|
||||
(item
|
||||
(statement
|
||||
(find
|
||||
(identifier)
|
||||
@ -25,7 +24,6 @@ find i in [1, 2, 3] {
|
||||
(expression
|
||||
(value
|
||||
(integer))))))
|
||||
(item
|
||||
(statement
|
||||
(expression
|
||||
(logic
|
||||
@ -34,24 +32,28 @@ find i in [1, 2, 3] {
|
||||
(logic_operator)
|
||||
(expression
|
||||
(value
|
||||
(integer)))))))))))
|
||||
(integer)))))))))
|
||||
|
||||
==================
|
||||
Find Loop Assignment
|
||||
Nested Find Loop
|
||||
==================
|
||||
|
||||
found = find i in ["one", "two", "three"] {
|
||||
i == "three"
|
||||
find i in ["one", "two", "three"] {
|
||||
found = find j in i {
|
||||
i == "e"
|
||||
}
|
||||
|
||||
if (type found) != 'empty' {
|
||||
true
|
||||
} else {
|
||||
false
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
---
|
||||
|
||||
(root
|
||||
(item
|
||||
(statement
|
||||
(assignment
|
||||
(identifier)
|
||||
(assignment_operator)
|
||||
(statement
|
||||
(find
|
||||
(identifier)
|
||||
@ -67,7 +69,15 @@ found = find i in ["one", "two", "three"] {
|
||||
(expression
|
||||
(value
|
||||
(string))))))
|
||||
(item
|
||||
(statement
|
||||
(assignment
|
||||
(identifier)
|
||||
(assignment_operator)
|
||||
(statement
|
||||
(find
|
||||
(identifier)
|
||||
(expression
|
||||
(identifier))
|
||||
(statement
|
||||
(expression
|
||||
(logic
|
||||
@ -76,4 +86,25 @@ found = find i in ["one", "two", "three"] {
|
||||
(logic_operator)
|
||||
(expression
|
||||
(value
|
||||
(string)))))))))))))
|
||||
(string)))))))))
|
||||
(if_else
|
||||
(if
|
||||
(expression
|
||||
(logic
|
||||
(expression
|
||||
(tool
|
||||
(expression
|
||||
(identifier))))
|
||||
(logic_operator)
|
||||
(expression
|
||||
(value
|
||||
(string)))))
|
||||
(statement
|
||||
(expression
|
||||
(value
|
||||
(boolean)))))
|
||||
(else
|
||||
(statement
|
||||
(expression
|
||||
(value
|
||||
(boolean))))))))))
|
||||
|
@ -9,7 +9,6 @@ for i in [1, 2, 3] {
|
||||
---
|
||||
|
||||
(root
|
||||
(item
|
||||
(statement
|
||||
(for
|
||||
(identifier)
|
||||
@ -25,12 +24,11 @@ for i in [1, 2, 3] {
|
||||
(expression
|
||||
(value
|
||||
(integer))))))
|
||||
(item
|
||||
(statement
|
||||
(expression
|
||||
(tool
|
||||
(expression
|
||||
(identifier))))))))))
|
||||
(identifier))))))))
|
||||
|
||||
==================
|
||||
Nested For Loop
|
||||
@ -45,21 +43,18 @@ for list in list_of_lists {
|
||||
---
|
||||
|
||||
(root
|
||||
(item
|
||||
(statement
|
||||
(for
|
||||
(identifier)
|
||||
(expression
|
||||
(identifier))
|
||||
(item
|
||||
(statement
|
||||
(for
|
||||
(identifier)
|
||||
(expression
|
||||
(identifier))
|
||||
(item
|
||||
(statement
|
||||
(expression
|
||||
(tool
|
||||
(expression
|
||||
(identifier)))))))))))))
|
||||
(identifier))))))))))
|
||||
|
@ -7,16 +7,14 @@ function { "Hiya" }
|
||||
---
|
||||
|
||||
(root
|
||||
(item
|
||||
(statement
|
||||
(expression
|
||||
(value
|
||||
(function
|
||||
(item
|
||||
(statement
|
||||
(expression
|
||||
(value
|
||||
(string)))))))))))
|
||||
(string)))))))))
|
||||
|
||||
==================
|
||||
Function Call
|
||||
@ -27,14 +25,13 @@ Function Call
|
||||
---
|
||||
|
||||
(root
|
||||
(item
|
||||
(statement
|
||||
(expression
|
||||
(function_call
|
||||
(identifier)
|
||||
(expression
|
||||
(value
|
||||
(string))))))))
|
||||
(string)))))))
|
||||
|
||||
==================
|
||||
Complex Function
|
||||
@ -48,24 +45,21 @@ function <message number> {
|
||||
---
|
||||
|
||||
(root
|
||||
(item
|
||||
(statement
|
||||
(expression
|
||||
(value
|
||||
(function
|
||||
(identifier)
|
||||
(identifier)
|
||||
(item
|
||||
(statement
|
||||
(expression
|
||||
(tool
|
||||
(expression
|
||||
(identifier)))))
|
||||
(statement
|
||||
(identifier))))
|
||||
(expression
|
||||
(tool
|
||||
(expression
|
||||
(identifier))))))))))))
|
||||
(identifier))))))))))
|
||||
|
||||
==================
|
||||
Complex Function Call
|
||||
@ -83,7 +77,6 @@ Complex Function Call
|
||||
---
|
||||
|
||||
(root
|
||||
(item
|
||||
(statement
|
||||
(expression
|
||||
(function_call
|
||||
@ -104,4 +97,4 @@ Complex Function Call
|
||||
(identifier)
|
||||
(expression
|
||||
(value
|
||||
(integer)))))))))))
|
||||
(integer))))))))))
|
||||
|
@ -9,15 +9,12 @@ __xyz__
|
||||
---
|
||||
|
||||
(root
|
||||
(item
|
||||
(statement
|
||||
(expression
|
||||
(identifier)))
|
||||
(statement
|
||||
(expression
|
||||
(identifier)))
|
||||
(statement
|
||||
(expression
|
||||
(identifier))))
|
||||
(item
|
||||
(statement
|
||||
(expression
|
||||
(identifier))))
|
||||
(item
|
||||
(statement
|
||||
(expression
|
||||
(identifier)))))
|
||||
|
242
tree-sitter-dust/corpus/if_else.txt
Normal file
242
tree-sitter-dust/corpus/if_else.txt
Normal file
@ -0,0 +1,242 @@
|
||||
==================
|
||||
Simple If
|
||||
==================
|
||||
|
||||
if true { "True" }
|
||||
|
||||
---
|
||||
|
||||
(root
|
||||
(statement
|
||||
(if_else
|
||||
(if
|
||||
(expression
|
||||
(value
|
||||
(boolean)))
|
||||
(statement
|
||||
(expression
|
||||
(value
|
||||
(string))))))))
|
||||
|
||||
==================
|
||||
Complex If
|
||||
==================
|
||||
|
||||
if 1 == 1 && 2 == 2 && 3 == 3 { "True" }
|
||||
|
||||
---
|
||||
|
||||
(root
|
||||
(statement
|
||||
(if_else
|
||||
(if
|
||||
(expression
|
||||
(logic
|
||||
(expression
|
||||
(value
|
||||
(integer)))
|
||||
(logic_operator)
|
||||
(expression
|
||||
(logic
|
||||
(expression
|
||||
(value
|
||||
(integer)))
|
||||
(logic_operator)
|
||||
(expression
|
||||
(logic
|
||||
(expression
|
||||
(value
|
||||
(integer)))
|
||||
(logic_operator)
|
||||
(expression
|
||||
(logic
|
||||
(expression
|
||||
(value
|
||||
(integer)))
|
||||
(logic_operator)
|
||||
(expression
|
||||
(logic
|
||||
(expression
|
||||
(value
|
||||
(integer)))
|
||||
(logic_operator)
|
||||
(expression
|
||||
(value
|
||||
(integer)))))))))))))
|
||||
(statement
|
||||
(expression
|
||||
(value
|
||||
(string))))))))
|
||||
|
||||
==================
|
||||
Nested If
|
||||
==================
|
||||
|
||||
if true {
|
||||
if 42 == 12 {
|
||||
'hiya'
|
||||
} else {
|
||||
'bye'
|
||||
}
|
||||
}
|
||||
|
||||
---
|
||||
|
||||
(root
|
||||
(statement
|
||||
(if_else
|
||||
(if
|
||||
(expression
|
||||
(value
|
||||
(boolean)))
|
||||
(statement
|
||||
(if_else
|
||||
(if
|
||||
(expression
|
||||
(logic
|
||||
(expression
|
||||
(value
|
||||
(integer)))
|
||||
(logic_operator)
|
||||
(expression
|
||||
(value
|
||||
(integer)))))
|
||||
(statement
|
||||
(expression
|
||||
(value
|
||||
(string)))))
|
||||
(else
|
||||
(statement
|
||||
(expression
|
||||
(value
|
||||
(string)))))))))))
|
||||
|
||||
==================
|
||||
If Else
|
||||
==================
|
||||
|
||||
if false { "True" } else { "False" }
|
||||
|
||||
---
|
||||
|
||||
(root
|
||||
(statement
|
||||
(if_else
|
||||
(if
|
||||
(expression
|
||||
(value
|
||||
(boolean)))
|
||||
(statement
|
||||
(expression
|
||||
(value
|
||||
(string)))))
|
||||
(else
|
||||
(statement
|
||||
(expression
|
||||
(value
|
||||
(string))))))))
|
||||
|
||||
==================
|
||||
If Else If
|
||||
==================
|
||||
|
||||
if 1 == 1 {
|
||||
"math is fun"
|
||||
} else if 4 == 9 {
|
||||
"math is broken"
|
||||
}
|
||||
|
||||
---
|
||||
|
||||
(root
|
||||
(statement
|
||||
(if_else
|
||||
(if
|
||||
(expression
|
||||
(logic
|
||||
(expression
|
||||
(value
|
||||
(integer)))
|
||||
(logic_operator)
|
||||
(expression
|
||||
(value
|
||||
(integer)))))
|
||||
(statement
|
||||
(expression
|
||||
(value
|
||||
(string)))))
|
||||
(else_if
|
||||
(expression
|
||||
(logic
|
||||
(expression
|
||||
(value
|
||||
(integer)))
|
||||
(logic_operator)
|
||||
(expression
|
||||
(value
|
||||
(integer)))))
|
||||
(statement
|
||||
(expression
|
||||
(value
|
||||
(string))))))))
|
||||
|
||||
==================
|
||||
If Else Else If Else
|
||||
==================
|
||||
|
||||
if false {
|
||||
"no"
|
||||
} else if false {
|
||||
"no"
|
||||
} else if 1 + 1 == 9 {
|
||||
"not the answer"
|
||||
} else {
|
||||
"42"
|
||||
}
|
||||
|
||||
---
|
||||
|
||||
(root
|
||||
(statement
|
||||
(if_else
|
||||
(if
|
||||
(expression
|
||||
(value
|
||||
(boolean)))
|
||||
(statement
|
||||
(expression
|
||||
(value
|
||||
(string)))))
|
||||
(else_if
|
||||
(expression
|
||||
(value
|
||||
(boolean)))
|
||||
(statement
|
||||
(expression
|
||||
(value
|
||||
(string)))))
|
||||
(else_if
|
||||
(expression
|
||||
(logic
|
||||
(expression
|
||||
(math
|
||||
(expression
|
||||
(value
|
||||
(integer)))
|
||||
(math_operator)
|
||||
(expression
|
||||
(value
|
||||
(integer)))))
|
||||
(logic_operator)
|
||||
(expression
|
||||
(value
|
||||
(integer)))))
|
||||
(statement
|
||||
(expression
|
||||
(value
|
||||
(string)))))
|
||||
(else
|
||||
(statement
|
||||
(expression
|
||||
(value
|
||||
(string))))))))
|
@ -1,5 +1,5 @@
|
||||
==================
|
||||
Indexing
|
||||
Simple Indexes
|
||||
==================
|
||||
|
||||
dust_data:1:name
|
||||
@ -11,7 +11,6 @@ foobar:1:42
|
||||
---
|
||||
|
||||
(root
|
||||
(item
|
||||
(statement
|
||||
(expression
|
||||
(index
|
||||
@ -23,16 +22,14 @@ foobar:1:42
|
||||
(value
|
||||
(integer)))))
|
||||
(expression
|
||||
(identifier))))))
|
||||
(item
|
||||
(identifier)))))
|
||||
(statement
|
||||
(expression
|
||||
(index
|
||||
(expression
|
||||
(identifier))
|
||||
(expression
|
||||
(identifier))))))
|
||||
(item
|
||||
(identifier)))))
|
||||
(statement
|
||||
(expression
|
||||
(index
|
||||
@ -45,36 +42,51 @@ foobar:1:42
|
||||
(integer)))))
|
||||
(expression
|
||||
(value
|
||||
(integer))))))))
|
||||
(integer)))))))
|
||||
|
||||
==================
|
||||
Sublist
|
||||
Nested Indexes
|
||||
==================
|
||||
|
||||
['answers', 42, 666]:1..2
|
||||
[['answers' 'foobar'], 42, 666]:0:1:0..2
|
||||
|
||||
---
|
||||
|
||||
(root
|
||||
(item
|
||||
(statement
|
||||
(expression
|
||||
(index
|
||||
(expression
|
||||
(index
|
||||
(expression
|
||||
(index
|
||||
(expression
|
||||
(value
|
||||
(list
|
||||
(expression
|
||||
(value
|
||||
(list
|
||||
(expression
|
||||
(value
|
||||
(string)))
|
||||
(expression
|
||||
(value
|
||||
(string))))))
|
||||
(expression
|
||||
(value
|
||||
(integer)))
|
||||
(expression
|
||||
(value
|
||||
(integer))))))
|
||||
(expression
|
||||
(value
|
||||
(integer)))))
|
||||
(expression
|
||||
(value
|
||||
(integer)))))
|
||||
(expression
|
||||
(value
|
||||
(integer)))
|
||||
(expression
|
||||
(value
|
||||
(integer))))))))
|
||||
(integer)))))))
|
||||
|
@ -7,7 +7,6 @@ List Declaration
|
||||
---
|
||||
|
||||
(root
|
||||
(item
|
||||
(statement
|
||||
(expression
|
||||
(value
|
||||
@ -17,39 +16,7 @@ List Declaration
|
||||
(string)))
|
||||
(expression
|
||||
(value
|
||||
(integer)))))))))
|
||||
|
||||
==================
|
||||
List Assignment
|
||||
==================
|
||||
|
||||
empty = []
|
||||
foobar = ['foobar']
|
||||
|
||||
---
|
||||
|
||||
(root
|
||||
(item
|
||||
(statement
|
||||
(assignment
|
||||
(identifier)
|
||||
(assignment_operator)
|
||||
(statement
|
||||
(expression
|
||||
(value
|
||||
(list)))))))
|
||||
(item
|
||||
(statement
|
||||
(assignment
|
||||
(identifier)
|
||||
(assignment_operator)
|
||||
(statement
|
||||
(expression
|
||||
(value
|
||||
(list
|
||||
(expression
|
||||
(value
|
||||
(string)))))))))))
|
||||
(integer))))))))
|
||||
|
||||
==================
|
||||
List Nesting
|
||||
@ -60,7 +27,6 @@ List Nesting
|
||||
---
|
||||
|
||||
(root
|
||||
(item
|
||||
(statement
|
||||
(expression
|
||||
(value
|
||||
@ -79,4 +45,4 @@ List Nesting
|
||||
(list
|
||||
(expression
|
||||
(value
|
||||
(integer)))))))))))))))
|
||||
(integer))))))))))))))
|
||||
|
@ -2,14 +2,11 @@
|
||||
Simple Map
|
||||
==================
|
||||
|
||||
{
|
||||
answer = 42
|
||||
}
|
||||
{ answer = 42 }
|
||||
|
||||
---
|
||||
|
||||
(root
|
||||
(item
|
||||
(statement
|
||||
(expression
|
||||
(value
|
||||
@ -17,20 +14,25 @@ Simple Map
|
||||
(identifier)
|
||||
(expression
|
||||
(value
|
||||
(integer)))))))))
|
||||
(integer))))))))
|
||||
|
||||
==================
|
||||
Map Assignment
|
||||
Nested Maps
|
||||
==================
|
||||
|
||||
x = {
|
||||
answer = 42
|
||||
y = {
|
||||
foo = 'bar'
|
||||
z = {
|
||||
message = 'hiya'
|
||||
}
|
||||
}
|
||||
f = 12
|
||||
}
|
||||
|
||||
---
|
||||
|
||||
(root
|
||||
(item
|
||||
(statement
|
||||
(assignment
|
||||
(identifier)
|
||||
@ -42,4 +44,20 @@ x = {
|
||||
(identifier)
|
||||
(expression
|
||||
(value
|
||||
(integer)))))))))))
|
||||
(map
|
||||
(identifier)
|
||||
(expression
|
||||
(value
|
||||
(string)))
|
||||
(identifier)
|
||||
(expression
|
||||
(value
|
||||
(map
|
||||
(identifier)
|
||||
(expression
|
||||
(value
|
||||
(string)))))))))
|
||||
(identifier)
|
||||
(expression
|
||||
(value
|
||||
(integer))))))))))
|
||||
|
@ -7,7 +7,6 @@ Equality
|
||||
---
|
||||
|
||||
(root
|
||||
(item
|
||||
(statement
|
||||
(expression
|
||||
(logic
|
||||
@ -29,19 +28,17 @@ Equality
|
||||
(math_operator)
|
||||
(expression
|
||||
(value
|
||||
(integer))))))))))
|
||||
(integer)))))))))
|
||||
|
||||
==================
|
||||
&&
|
||||
==================
|
||||
|
||||
4 + 2 == 42 && true
|
||||
(((4 + 2) == 42) && true)
|
||||
|
||||
---
|
||||
|
||||
(root
|
||||
(item
|
||||
(statement
|
||||
(expression
|
||||
(logic
|
||||
@ -64,40 +61,16 @@ Equality
|
||||
(expression
|
||||
(value
|
||||
(boolean)))))))))
|
||||
(item
|
||||
(statement
|
||||
(expression
|
||||
(logic
|
||||
(expression
|
||||
(logic
|
||||
(expression
|
||||
(math
|
||||
(expression
|
||||
(value
|
||||
(integer)))
|
||||
(math_operator)
|
||||
(expression
|
||||
(value
|
||||
(integer)))))
|
||||
(logic_operator)
|
||||
(expression
|
||||
(value
|
||||
(integer)))))
|
||||
(logic_operator)
|
||||
(expression
|
||||
(value
|
||||
(boolean))))))))
|
||||
|
||||
==================
|
||||
\||
|
||||
==================
|
||||
|
||||
4 + 2 == 42 || true
|
||||
((4 + 2) == 42) || true
|
||||
|
||||
---
|
||||
|
||||
(root
|
||||
(item
|
||||
(statement
|
||||
(expression
|
||||
(logic
|
||||
@ -120,26 +93,3 @@ Equality
|
||||
(expression
|
||||
(value
|
||||
(boolean)))))))))
|
||||
(item
|
||||
(statement
|
||||
(expression
|
||||
(logic
|
||||
(expression
|
||||
(logic
|
||||
(expression
|
||||
(math
|
||||
(expression
|
||||
(value
|
||||
(integer)))
|
||||
(math_operator)
|
||||
(expression
|
||||
(value
|
||||
(integer)))))
|
||||
(logic_operator)
|
||||
(expression
|
||||
(value
|
||||
(integer)))))
|
||||
(logic_operator)
|
||||
(expression
|
||||
(value
|
||||
(boolean))))))))
|
@ -8,16 +8,14 @@ false
|
||||
---
|
||||
|
||||
(root
|
||||
(item
|
||||
(statement
|
||||
(expression
|
||||
(value
|
||||
(boolean))))
|
||||
(statement
|
||||
(expression
|
||||
(value
|
||||
(boolean)))))
|
||||
(item
|
||||
(statement
|
||||
(expression
|
||||
(value
|
||||
(boolean))))))
|
||||
|
||||
==================
|
||||
Integers
|
||||
@ -29,31 +27,26 @@ Integers
|
||||
---
|
||||
|
||||
(root
|
||||
(item
|
||||
(statement
|
||||
(expression
|
||||
(value
|
||||
(integer))))
|
||||
(statement
|
||||
(expression
|
||||
(value
|
||||
(integer))))
|
||||
(statement
|
||||
(expression
|
||||
(value
|
||||
(integer))))
|
||||
(statement
|
||||
(expression
|
||||
(value
|
||||
(integer))))
|
||||
(statement
|
||||
(expression
|
||||
(value
|
||||
(integer)))))
|
||||
(item
|
||||
(statement
|
||||
(expression
|
||||
(value
|
||||
(integer)))))
|
||||
(item
|
||||
(statement
|
||||
(expression
|
||||
(value
|
||||
(integer)))))
|
||||
(item
|
||||
(statement
|
||||
(expression
|
||||
(value
|
||||
(integer)))))
|
||||
(item
|
||||
(statement
|
||||
(expression
|
||||
(value
|
||||
(integer))))))
|
||||
|
||||
==================
|
||||
Strings
|
||||
@ -64,28 +57,23 @@ Strings
|
||||
---
|
||||
|
||||
(root
|
||||
(item
|
||||
(statement
|
||||
(expression
|
||||
(value
|
||||
(string))))
|
||||
(statement
|
||||
(expression
|
||||
(value
|
||||
(string))))
|
||||
(statement
|
||||
(expression
|
||||
(value
|
||||
(string))))
|
||||
(statement
|
||||
(expression
|
||||
(value
|
||||
(string))))
|
||||
(statement
|
||||
(expression
|
||||
(value
|
||||
(string)))))
|
||||
(item
|
||||
(statement
|
||||
(expression
|
||||
(value
|
||||
(string)))))
|
||||
(item
|
||||
(statement
|
||||
(expression
|
||||
(value
|
||||
(string)))))
|
||||
(item
|
||||
(statement
|
||||
(expression
|
||||
(value
|
||||
(string)))))
|
||||
(item
|
||||
(statement
|
||||
(expression
|
||||
(value
|
||||
(string))))))
|
||||
|
@ -9,20 +9,17 @@ x
|
||||
---
|
||||
|
||||
(root
|
||||
(item
|
||||
(statement
|
||||
(expression
|
||||
(value
|
||||
(integer)))))
|
||||
(item
|
||||
(integer))))
|
||||
(statement
|
||||
(expression
|
||||
(value
|
||||
(string)))))
|
||||
(item
|
||||
(string))))
|
||||
(statement
|
||||
(expression
|
||||
(identifier)))))
|
||||
(identifier))))
|
||||
|
||||
==================
|
||||
Simple Assignment
|
||||
@ -34,7 +31,6 @@ y = "one"
|
||||
---
|
||||
|
||||
(root
|
||||
(item
|
||||
(statement
|
||||
(assignment
|
||||
(identifier)
|
||||
@ -42,8 +38,7 @@ y = "one"
|
||||
(statement
|
||||
(expression
|
||||
(value
|
||||
(integer)))))))
|
||||
(item
|
||||
(integer))))))
|
||||
(statement
|
||||
(assignment
|
||||
(identifier)
|
||||
@ -51,23 +46,30 @@ y = "one"
|
||||
(statement
|
||||
(expression
|
||||
(value
|
||||
(string))))))))
|
||||
(string)))))))
|
||||
|
||||
==================
|
||||
Complex Assignment
|
||||
==================
|
||||
|
||||
x = 1 + 1
|
||||
x = if 1 + 1 == 2 {
|
||||
'yo'
|
||||
} else {
|
||||
'no'
|
||||
}
|
||||
|
||||
---
|
||||
|
||||
(root
|
||||
(item
|
||||
(statement
|
||||
(assignment
|
||||
(identifier)
|
||||
(assignment_operator)
|
||||
(statement
|
||||
(if_else
|
||||
(if
|
||||
(expression
|
||||
(logic
|
||||
(expression
|
||||
(math
|
||||
(expression
|
||||
@ -76,18 +78,30 @@ x = 1 + 1
|
||||
(math_operator)
|
||||
(expression
|
||||
(value
|
||||
(integer))))))))))
|
||||
(integer)))))
|
||||
(logic_operator)
|
||||
(expression
|
||||
(value
|
||||
(integer)))))
|
||||
(statement
|
||||
(expression
|
||||
(value
|
||||
(string)))))
|
||||
(else
|
||||
(statement
|
||||
(expression
|
||||
(value
|
||||
(string))))))))))
|
||||
|
||||
==================
|
||||
Expression Precedence
|
||||
==================
|
||||
|
||||
x = (3 == (1 + (2 + 2)))
|
||||
x = 3 == 1 + 2 + 2
|
||||
|
||||
---
|
||||
|
||||
(root
|
||||
(item
|
||||
(statement
|
||||
(assignment
|
||||
(identifier)
|
||||
@ -101,10 +115,6 @@ x = (3 == (1 + (2 + 2)))
|
||||
(logic_operator)
|
||||
(expression
|
||||
(math
|
||||
(expression
|
||||
(value
|
||||
(integer)))
|
||||
(math_operator)
|
||||
(expression
|
||||
(math
|
||||
(expression
|
||||
@ -113,4 +123,8 @@ x = (3 == (1 + (2 + 2)))
|
||||
(math_operator)
|
||||
(expression
|
||||
(value
|
||||
(integer))))))))))))))
|
||||
(integer)))))
|
||||
(math_operator)
|
||||
(expression
|
||||
(value
|
||||
(integer)))))))))))
|
||||
|
@ -11,7 +11,6 @@ table <messages, numbers> [
|
||||
---
|
||||
|
||||
(root
|
||||
(item
|
||||
(statement
|
||||
(expression
|
||||
(value
|
||||
@ -47,43 +46,7 @@ table <messages, numbers> [
|
||||
(string)))
|
||||
(expression
|
||||
(value
|
||||
(float)))))))))))))))
|
||||
|
||||
==================
|
||||
Table Assignment
|
||||
==================
|
||||
|
||||
foobar = table <text, number> [
|
||||
['answer', 42]
|
||||
]
|
||||
|
||||
---
|
||||
|
||||
(root
|
||||
(item
|
||||
(statement
|
||||
(assignment
|
||||
(identifier)
|
||||
(assignment_operator)
|
||||
(statement
|
||||
(expression
|
||||
(value
|
||||
(table
|
||||
(identifier)
|
||||
(identifier)
|
||||
(expression
|
||||
(value
|
||||
(list
|
||||
(expression
|
||||
(value
|
||||
(list
|
||||
(expression
|
||||
(value
|
||||
(string)))
|
||||
(expression
|
||||
(value
|
||||
(integer)))))))))))))))))
|
||||
|
||||
(float))))))))))))))
|
||||
==================
|
||||
Table Access
|
||||
==================
|
||||
@ -95,13 +58,11 @@ select <number> from foobar {
|
||||
---
|
||||
|
||||
(root
|
||||
(item
|
||||
(statement
|
||||
(select
|
||||
(identifier)
|
||||
(expression
|
||||
(identifier))
|
||||
(item
|
||||
(statement
|
||||
(expression
|
||||
(logic
|
||||
@ -110,7 +71,7 @@ select <number> from foobar {
|
||||
(logic_operator)
|
||||
(expression
|
||||
(value
|
||||
(string)))))))))))
|
||||
(string)))))))))
|
||||
|
||||
==================
|
||||
Table Insert
|
||||
@ -123,7 +84,6 @@ insert into foobar [
|
||||
---
|
||||
|
||||
(root
|
||||
(item
|
||||
(statement
|
||||
(insert
|
||||
(identifier)
|
||||
@ -138,4 +98,4 @@ insert into foobar [
|
||||
(string)))
|
||||
(expression
|
||||
(value
|
||||
(integer)))))))))))))
|
||||
(integer))))))))))))
|
@ -9,7 +9,6 @@ transform i in [1, 2, 3] {
|
||||
---
|
||||
|
||||
(root
|
||||
(item
|
||||
(statement
|
||||
(transform
|
||||
(identifier)
|
||||
@ -25,29 +24,25 @@ transform i in [1, 2, 3] {
|
||||
(expression
|
||||
(value
|
||||
(integer))))))
|
||||
(item
|
||||
(statement
|
||||
(expression
|
||||
(tool
|
||||
(expression
|
||||
(identifier))))))))))
|
||||
(identifier))))))))
|
||||
|
||||
==================
|
||||
Transform Loop Assignment
|
||||
Nested Transform Loop
|
||||
==================
|
||||
|
||||
list = transform i in ["one", "two", "three"] {
|
||||
(output i)
|
||||
transform i in [['one'] ['two'] ['three']] {
|
||||
transform j in i {
|
||||
j += 'foobar'
|
||||
}
|
||||
}
|
||||
|
||||
---
|
||||
|
||||
(root
|
||||
(item
|
||||
(statement
|
||||
(assignment
|
||||
(identifier)
|
||||
(assignment_operator)
|
||||
(statement
|
||||
(transform
|
||||
(identifier)
|
||||
@ -56,16 +51,32 @@ list = transform i in ["one", "two", "three"] {
|
||||
(list
|
||||
(expression
|
||||
(value
|
||||
(string)))
|
||||
(expression
|
||||
(value
|
||||
(string)))
|
||||
(list
|
||||
(expression
|
||||
(value
|
||||
(string))))))
|
||||
(item
|
||||
(expression
|
||||
(value
|
||||
(list
|
||||
(expression
|
||||
(value
|
||||
(string))))))
|
||||
(expression
|
||||
(value
|
||||
(list
|
||||
(expression
|
||||
(value
|
||||
(string)))))))))
|
||||
(statement
|
||||
(transform
|
||||
(identifier)
|
||||
(expression
|
||||
(identifier))
|
||||
(statement
|
||||
(assignment
|
||||
(identifier)
|
||||
(assignment_operator)
|
||||
(statement
|
||||
(expression
|
||||
(tool
|
||||
(expression
|
||||
(identifier))))))))))))
|
||||
(value
|
||||
(string)))))))))))
|
||||
|
@ -9,42 +9,58 @@ while true {
|
||||
---
|
||||
|
||||
(root
|
||||
(item
|
||||
(statement
|
||||
(while
|
||||
(expression
|
||||
(value
|
||||
(boolean)))
|
||||
(item
|
||||
(statement
|
||||
(expression
|
||||
(tool
|
||||
(expression
|
||||
(value
|
||||
(string)))))))))))
|
||||
(string)))))))))
|
||||
|
||||
==================
|
||||
While Loop Assignment
|
||||
Nested While Loop
|
||||
==================
|
||||
|
||||
answer = while false {
|
||||
42
|
||||
while true {
|
||||
x = 4
|
||||
while x > 0 {
|
||||
x -= 1
|
||||
}
|
||||
}
|
||||
|
||||
---
|
||||
|
||||
(root
|
||||
(item
|
||||
(statement
|
||||
(assignment
|
||||
(identifier)
|
||||
(assignment_operator)
|
||||
(statement
|
||||
(while
|
||||
(expression
|
||||
(value
|
||||
(boolean)))
|
||||
(item
|
||||
(statement
|
||||
(assignment
|
||||
(identifier)
|
||||
(assignment_operator)
|
||||
(statement
|
||||
(expression
|
||||
(value
|
||||
(integer)))))
|
||||
(while
|
||||
(expression
|
||||
(logic
|
||||
(expression
|
||||
(identifier))
|
||||
(logic_operator)
|
||||
(expression
|
||||
(value
|
||||
(integer)))))
|
||||
(statement
|
||||
(assignment
|
||||
(identifier)
|
||||
(assignment_operator)
|
||||
(statement
|
||||
(expression
|
||||
(value
|
||||
|
@ -11,8 +11,8 @@ module.exports = grammar({
|
||||
comment: $ => /[#][^#\n]*[#|\n]/,
|
||||
|
||||
statement: $ => prec.left(choice(
|
||||
$._statement_kind,
|
||||
seq('{', $._statement_kind, '}'),
|
||||
repeat1($._statement_kind),
|
||||
seq('{', repeat1($._statement_kind), '}'),
|
||||
)),
|
||||
|
||||
_statement_kind: $ => prec.left(choice(
|
||||
@ -37,7 +37,7 @@ module.exports = grammar({
|
||||
seq('(', $._expression_kind, ')'),
|
||||
),
|
||||
|
||||
_expression_kind: $ => prec.left(choice(
|
||||
_expression_kind: $ => prec.right(choice(
|
||||
$.function_call,
|
||||
$.identifier,
|
||||
$.index,
|
||||
@ -60,9 +60,19 @@ module.exports = grammar({
|
||||
$.map,
|
||||
),
|
||||
|
||||
integer: $ => /0[bB][01](_?[01])*|0[oO]?[0-7](_?[0-7])*|(0[dD])?\d(_?\d)*|0[xX][0-9a-fA-F](_?[0-9a-fA-F])*/,
|
||||
integer: $ => prec.left(token(seq(
|
||||
optional('-'),
|
||||
repeat1(
|
||||
choice('1', '2', '3', '4', '5', '6', '7', '8', '9', '0')
|
||||
),
|
||||
))),
|
||||
|
||||
float: $ => /\d(_?\d)*(\.\d)?(_?\d)*([eE][\+-]?\d(_?\d)*)?/,
|
||||
float: $ => prec.left(token(seq(
|
||||
optional('-'),
|
||||
repeat1(choice('1', '2', '3', '4', '5', '6', '7', '8', '9', '0')),
|
||||
'.',
|
||||
repeat1(choice('1', '2', '3', '4', '5', '6', '7', '8', '9', '0')),
|
||||
))),
|
||||
|
||||
string: $ => /("[^"]*?")|('[^']*?')|(`[^`]*?`)/,
|
||||
|
||||
@ -73,13 +83,18 @@ module.exports = grammar({
|
||||
|
||||
list: $ => seq(
|
||||
'[',
|
||||
repeat(seq($.expression, optional(','))),
|
||||
repeat(prec.left(seq($.expression, optional(',')))),
|
||||
']',
|
||||
),
|
||||
|
||||
map: $ => seq(
|
||||
'{',
|
||||
$.assignment,
|
||||
repeat(seq(
|
||||
$.identifier,
|
||||
'=',
|
||||
$.expression,
|
||||
optional(',')
|
||||
)),
|
||||
'}',
|
||||
),
|
||||
|
||||
@ -113,13 +128,13 @@ module.exports = grammar({
|
||||
$.expression,
|
||||
)),
|
||||
|
||||
math_operator: $ => choice(
|
||||
math_operator: $ => token(choice(
|
||||
'+',
|
||||
'-',
|
||||
'*',
|
||||
'/',
|
||||
'%',
|
||||
),
|
||||
)),
|
||||
|
||||
logic: $ => prec.right(seq(
|
||||
$.expression,
|
||||
@ -127,7 +142,7 @@ module.exports = grammar({
|
||||
$.expression,
|
||||
)),
|
||||
|
||||
logic_operator: $ => choice(
|
||||
logic_operator: $ => token(choice(
|
||||
'==',
|
||||
'!=',
|
||||
'&&',
|
||||
@ -136,7 +151,7 @@ module.exports = grammar({
|
||||
'<',
|
||||
">=",
|
||||
"<=",
|
||||
),
|
||||
)),
|
||||
|
||||
assignment: $ => prec.right(seq(
|
||||
$.identifier,
|
||||
@ -144,11 +159,11 @@ module.exports = grammar({
|
||||
$.statement,
|
||||
)),
|
||||
|
||||
assignment_operator: $ => choice(
|
||||
assignment_operator: $ => token(choice(
|
||||
"=",
|
||||
"+=",
|
||||
"-=",
|
||||
),
|
||||
)),
|
||||
|
||||
if_else: $ => prec.left(seq(
|
||||
$.if,
|
||||
@ -182,7 +197,7 @@ module.exports = grammar({
|
||||
function_call: $ => seq(
|
||||
'(',
|
||||
$.identifier,
|
||||
repeat(seq($.expression, optional(','))),
|
||||
repeat(prec.left(seq($.expression, optional(',')))),
|
||||
')',
|
||||
),
|
||||
|
||||
@ -289,15 +304,13 @@ module.exports = grammar({
|
||||
async: $ => seq(
|
||||
'async',
|
||||
'{',
|
||||
repeat($.statement),
|
||||
$.statement,
|
||||
'}'
|
||||
),
|
||||
|
||||
tool: $ => prec.right(seq(
|
||||
'(',
|
||||
$._tool_kind,
|
||||
repeat(seq($.expression, optional(','))),
|
||||
')',
|
||||
repeat(prec.left(seq($.expression, optional(',')))),
|
||||
)),
|
||||
|
||||
_tool_kind: $ => choice(
|
||||
@ -317,7 +330,6 @@ module.exports = grammar({
|
||||
'metadata',
|
||||
'move',
|
||||
'read',
|
||||
'remove',
|
||||
'write',
|
||||
|
||||
// Format conversion
|
||||
|
@ -20,8 +20,11 @@
|
||||
"type": "CHOICE",
|
||||
"members": [
|
||||
{
|
||||
"type": "REPEAT1",
|
||||
"content": {
|
||||
"type": "SYMBOL",
|
||||
"name": "_statement_kind"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "SEQ",
|
||||
@ -31,8 +34,11 @@
|
||||
"value": "{"
|
||||
},
|
||||
{
|
||||
"type": "REPEAT1",
|
||||
"content": {
|
||||
"type": "SYMBOL",
|
||||
"name": "_statement_kind"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "STRING",
|
||||
@ -135,7 +141,7 @@
|
||||
]
|
||||
},
|
||||
"_expression_kind": {
|
||||
"type": "PREC_LEFT",
|
||||
"type": "PREC_RIGHT",
|
||||
"value": 0,
|
||||
"content": {
|
||||
"type": "CHOICE",
|
||||
@ -213,12 +219,200 @@
|
||||
]
|
||||
},
|
||||
"integer": {
|
||||
"type": "PATTERN",
|
||||
"value": "0[bB][01](_?[01])*|0[oO]?[0-7](_?[0-7])*|(0[dD])?\\d(_?\\d)*|0[xX][0-9a-fA-F](_?[0-9a-fA-F])*"
|
||||
"type": "PREC_LEFT",
|
||||
"value": 0,
|
||||
"content": {
|
||||
"type": "TOKEN",
|
||||
"content": {
|
||||
"type": "SEQ",
|
||||
"members": [
|
||||
{
|
||||
"type": "CHOICE",
|
||||
"members": [
|
||||
{
|
||||
"type": "STRING",
|
||||
"value": "-"
|
||||
},
|
||||
{
|
||||
"type": "BLANK"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "REPEAT1",
|
||||
"content": {
|
||||
"type": "CHOICE",
|
||||
"members": [
|
||||
{
|
||||
"type": "STRING",
|
||||
"value": "1"
|
||||
},
|
||||
{
|
||||
"type": "STRING",
|
||||
"value": "2"
|
||||
},
|
||||
{
|
||||
"type": "STRING",
|
||||
"value": "3"
|
||||
},
|
||||
{
|
||||
"type": "STRING",
|
||||
"value": "4"
|
||||
},
|
||||
{
|
||||
"type": "STRING",
|
||||
"value": "5"
|
||||
},
|
||||
{
|
||||
"type": "STRING",
|
||||
"value": "6"
|
||||
},
|
||||
{
|
||||
"type": "STRING",
|
||||
"value": "7"
|
||||
},
|
||||
{
|
||||
"type": "STRING",
|
||||
"value": "8"
|
||||
},
|
||||
{
|
||||
"type": "STRING",
|
||||
"value": "9"
|
||||
},
|
||||
{
|
||||
"type": "STRING",
|
||||
"value": "0"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"float": {
|
||||
"type": "PATTERN",
|
||||
"value": "\\d(_?\\d)*(\\.\\d)?(_?\\d)*([eE][\\+-]?\\d(_?\\d)*)?"
|
||||
"type": "PREC_LEFT",
|
||||
"value": 0,
|
||||
"content": {
|
||||
"type": "TOKEN",
|
||||
"content": {
|
||||
"type": "SEQ",
|
||||
"members": [
|
||||
{
|
||||
"type": "CHOICE",
|
||||
"members": [
|
||||
{
|
||||
"type": "STRING",
|
||||
"value": "-"
|
||||
},
|
||||
{
|
||||
"type": "BLANK"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "REPEAT1",
|
||||
"content": {
|
||||
"type": "CHOICE",
|
||||
"members": [
|
||||
{
|
||||
"type": "STRING",
|
||||
"value": "1"
|
||||
},
|
||||
{
|
||||
"type": "STRING",
|
||||
"value": "2"
|
||||
},
|
||||
{
|
||||
"type": "STRING",
|
||||
"value": "3"
|
||||
},
|
||||
{
|
||||
"type": "STRING",
|
||||
"value": "4"
|
||||
},
|
||||
{
|
||||
"type": "STRING",
|
||||
"value": "5"
|
||||
},
|
||||
{
|
||||
"type": "STRING",
|
||||
"value": "6"
|
||||
},
|
||||
{
|
||||
"type": "STRING",
|
||||
"value": "7"
|
||||
},
|
||||
{
|
||||
"type": "STRING",
|
||||
"value": "8"
|
||||
},
|
||||
{
|
||||
"type": "STRING",
|
||||
"value": "9"
|
||||
},
|
||||
{
|
||||
"type": "STRING",
|
||||
"value": "0"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "STRING",
|
||||
"value": "."
|
||||
},
|
||||
{
|
||||
"type": "REPEAT1",
|
||||
"content": {
|
||||
"type": "CHOICE",
|
||||
"members": [
|
||||
{
|
||||
"type": "STRING",
|
||||
"value": "1"
|
||||
},
|
||||
{
|
||||
"type": "STRING",
|
||||
"value": "2"
|
||||
},
|
||||
{
|
||||
"type": "STRING",
|
||||
"value": "3"
|
||||
},
|
||||
{
|
||||
"type": "STRING",
|
||||
"value": "4"
|
||||
},
|
||||
{
|
||||
"type": "STRING",
|
||||
"value": "5"
|
||||
},
|
||||
{
|
||||
"type": "STRING",
|
||||
"value": "6"
|
||||
},
|
||||
{
|
||||
"type": "STRING",
|
||||
"value": "7"
|
||||
},
|
||||
{
|
||||
"type": "STRING",
|
||||
"value": "8"
|
||||
},
|
||||
{
|
||||
"type": "STRING",
|
||||
"value": "9"
|
||||
},
|
||||
{
|
||||
"type": "STRING",
|
||||
"value": "0"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"string": {
|
||||
"type": "PATTERN",
|
||||
@ -246,6 +440,9 @@
|
||||
},
|
||||
{
|
||||
"type": "REPEAT",
|
||||
"content": {
|
||||
"type": "PREC_LEFT",
|
||||
"value": 0,
|
||||
"content": {
|
||||
"type": "SEQ",
|
||||
"members": [
|
||||
@ -267,6 +464,7 @@
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "STRING",
|
||||
@ -281,9 +479,37 @@
|
||||
"type": "STRING",
|
||||
"value": "{"
|
||||
},
|
||||
{
|
||||
"type": "REPEAT",
|
||||
"content": {
|
||||
"type": "SEQ",
|
||||
"members": [
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "assignment"
|
||||
"name": "identifier"
|
||||
},
|
||||
{
|
||||
"type": "STRING",
|
||||
"value": "="
|
||||
},
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "expression"
|
||||
},
|
||||
{
|
||||
"type": "CHOICE",
|
||||
"members": [
|
||||
{
|
||||
"type": "STRING",
|
||||
"value": ","
|
||||
},
|
||||
{
|
||||
"type": "BLANK"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "STRING",
|
||||
@ -475,6 +701,8 @@
|
||||
}
|
||||
},
|
||||
"math_operator": {
|
||||
"type": "TOKEN",
|
||||
"content": {
|
||||
"type": "CHOICE",
|
||||
"members": [
|
||||
{
|
||||
@ -498,6 +726,7 @@
|
||||
"value": "%"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"logic": {
|
||||
"type": "PREC_RIGHT",
|
||||
@ -521,6 +750,8 @@
|
||||
}
|
||||
},
|
||||
"logic_operator": {
|
||||
"type": "TOKEN",
|
||||
"content": {
|
||||
"type": "CHOICE",
|
||||
"members": [
|
||||
{
|
||||
@ -556,6 +787,7 @@
|
||||
"value": "<="
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"assignment": {
|
||||
"type": "PREC_RIGHT",
|
||||
@ -579,6 +811,8 @@
|
||||
}
|
||||
},
|
||||
"assignment_operator": {
|
||||
"type": "TOKEN",
|
||||
"content": {
|
||||
"type": "CHOICE",
|
||||
"members": [
|
||||
{
|
||||
@ -594,6 +828,7 @@
|
||||
"value": "-="
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"if_else": {
|
||||
"type": "PREC_LEFT",
|
||||
@ -716,6 +951,9 @@
|
||||
},
|
||||
{
|
||||
"type": "REPEAT",
|
||||
"content": {
|
||||
"type": "PREC_LEFT",
|
||||
"value": 0,
|
||||
"content": {
|
||||
"type": "SEQ",
|
||||
"members": [
|
||||
@ -737,6 +975,7 @@
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "STRING",
|
||||
@ -1159,11 +1398,8 @@
|
||||
"value": "{"
|
||||
},
|
||||
{
|
||||
"type": "REPEAT",
|
||||
"content": {
|
||||
"type": "SYMBOL",
|
||||
"name": "statement"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "STRING",
|
||||
@ -1177,16 +1413,15 @@
|
||||
"content": {
|
||||
"type": "SEQ",
|
||||
"members": [
|
||||
{
|
||||
"type": "STRING",
|
||||
"value": "("
|
||||
},
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "_tool_kind"
|
||||
},
|
||||
{
|
||||
"type": "REPEAT",
|
||||
"content": {
|
||||
"type": "PREC_LEFT",
|
||||
"value": 0,
|
||||
"content": {
|
||||
"type": "SEQ",
|
||||
"members": [
|
||||
@ -1208,10 +1443,7 @@
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "STRING",
|
||||
"value": ")"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -1271,10 +1503,6 @@
|
||||
"type": "STRING",
|
||||
"value": "read"
|
||||
},
|
||||
{
|
||||
"type": "STRING",
|
||||
"value": "remove"
|
||||
},
|
||||
{
|
||||
"type": "STRING",
|
||||
"value": "write"
|
||||
|
@ -22,18 +22,13 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "assignment_operator",
|
||||
"named": true,
|
||||
"fields": {}
|
||||
},
|
||||
{
|
||||
"type": "async",
|
||||
"named": true,
|
||||
"fields": {},
|
||||
"children": {
|
||||
"multiple": true,
|
||||
"required": false,
|
||||
"multiple": false,
|
||||
"required": true,
|
||||
"types": [
|
||||
{
|
||||
"type": "statement",
|
||||
@ -189,6 +184,11 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "float",
|
||||
"named": true,
|
||||
"fields": {}
|
||||
},
|
||||
{
|
||||
"type": "for",
|
||||
"named": true,
|
||||
@ -326,6 +326,11 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"named": true,
|
||||
"fields": {}
|
||||
},
|
||||
{
|
||||
"type": "list",
|
||||
"named": true,
|
||||
@ -360,21 +365,20 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "logic_operator",
|
||||
"named": true,
|
||||
"fields": {}
|
||||
},
|
||||
{
|
||||
"type": "map",
|
||||
"named": true,
|
||||
"fields": {},
|
||||
"children": {
|
||||
"multiple": false,
|
||||
"required": true,
|
||||
"multiple": true,
|
||||
"required": false,
|
||||
"types": [
|
||||
{
|
||||
"type": "assignment",
|
||||
"type": "expression",
|
||||
"named": true
|
||||
},
|
||||
{
|
||||
"type": "identifier",
|
||||
"named": true
|
||||
}
|
||||
]
|
||||
@ -418,11 +422,6 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "math_operator",
|
||||
"named": true,
|
||||
"fields": {}
|
||||
},
|
||||
{
|
||||
"type": "reduce",
|
||||
"named": true,
|
||||
@ -512,7 +511,7 @@
|
||||
"named": true,
|
||||
"fields": {},
|
||||
"children": {
|
||||
"multiple": false,
|
||||
"multiple": true,
|
||||
"required": true,
|
||||
"types": [
|
||||
{
|
||||
@ -693,18 +692,6 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "!=",
|
||||
"named": false
|
||||
},
|
||||
{
|
||||
"type": "%",
|
||||
"named": false
|
||||
},
|
||||
{
|
||||
"type": "&&",
|
||||
"named": false
|
||||
},
|
||||
{
|
||||
"type": "(",
|
||||
"named": false
|
||||
@ -713,38 +700,14 @@
|
||||
"type": ")",
|
||||
"named": false
|
||||
},
|
||||
{
|
||||
"type": "*",
|
||||
"named": false
|
||||
},
|
||||
{
|
||||
"type": "+",
|
||||
"named": false
|
||||
},
|
||||
{
|
||||
"type": "+=",
|
||||
"named": false
|
||||
},
|
||||
{
|
||||
"type": ",",
|
||||
"named": false
|
||||
},
|
||||
{
|
||||
"type": "-",
|
||||
"named": false
|
||||
},
|
||||
{
|
||||
"type": "-=",
|
||||
"named": false
|
||||
},
|
||||
{
|
||||
"type": "..",
|
||||
"named": false
|
||||
},
|
||||
{
|
||||
"type": "/",
|
||||
"named": false
|
||||
},
|
||||
{
|
||||
"type": ":",
|
||||
"named": false
|
||||
@ -753,18 +716,10 @@
|
||||
"type": "<",
|
||||
"named": false
|
||||
},
|
||||
{
|
||||
"type": "<=",
|
||||
"named": false
|
||||
},
|
||||
{
|
||||
"type": "=",
|
||||
"named": false
|
||||
},
|
||||
{
|
||||
"type": "==",
|
||||
"named": false
|
||||
},
|
||||
{
|
||||
"type": "=>",
|
||||
"named": false
|
||||
@ -773,10 +728,6 @@
|
||||
"type": ">",
|
||||
"named": false
|
||||
},
|
||||
{
|
||||
"type": ">=",
|
||||
"named": false
|
||||
},
|
||||
{
|
||||
"type": "[",
|
||||
"named": false
|
||||
@ -797,6 +748,10 @@
|
||||
"type": "assert_equal",
|
||||
"named": false
|
||||
},
|
||||
{
|
||||
"type": "assignment_operator",
|
||||
"named": true
|
||||
},
|
||||
{
|
||||
"type": "async",
|
||||
"named": false
|
||||
@ -841,10 +796,6 @@
|
||||
"type": "fish",
|
||||
"named": false
|
||||
},
|
||||
{
|
||||
"type": "float",
|
||||
"named": true
|
||||
},
|
||||
{
|
||||
"type": "for",
|
||||
"named": false
|
||||
@ -881,10 +832,6 @@
|
||||
"type": "insert",
|
||||
"named": false
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"named": true
|
||||
},
|
||||
{
|
||||
"type": "into",
|
||||
"named": false
|
||||
@ -893,10 +840,18 @@
|
||||
"type": "length",
|
||||
"named": false
|
||||
},
|
||||
{
|
||||
"type": "logic_operator",
|
||||
"named": true
|
||||
},
|
||||
{
|
||||
"type": "match",
|
||||
"named": false
|
||||
},
|
||||
{
|
||||
"type": "math_operator",
|
||||
"named": true
|
||||
},
|
||||
{
|
||||
"type": "metadata",
|
||||
"named": false
|
||||
@ -1017,10 +972,6 @@
|
||||
"type": "{",
|
||||
"named": false
|
||||
},
|
||||
{
|
||||
"type": "||",
|
||||
"named": false
|
||||
},
|
||||
{
|
||||
"type": "}",
|
||||
"named": false
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user