Implement list
This commit is contained in:
parent
5a6c92372a
commit
b0b4bfe59e
@ -1 +1 @@
|
||||
Subproject commit 823bb3130591716771190e3123c5772250e00dc7
|
||||
Subproject commit dd939db9241c670f72794bf28b50dac3b68e445c
|
@ -1,9 +1,9 @@
|
||||
==================
|
||||
Table Declarations
|
||||
Table Declaration
|
||||
==================
|
||||
|
||||
table <text, number> {
|
||||
("answer", 42)
|
||||
['answer', 42]
|
||||
}
|
||||
|
||||
---
|
||||
@ -22,3 +22,40 @@ table <text, number> {
|
||||
(string))
|
||||
(value
|
||||
(integer))))))))))
|
||||
|
||||
==================
|
||||
Table Assignment
|
||||
==================
|
||||
|
||||
foobar = table <text, number> {
|
||||
['answer', 42]
|
||||
}
|
||||
|
||||
foobar
|
||||
|
||||
---
|
||||
|
||||
(root
|
||||
(item
|
||||
(statement
|
||||
(open_statement
|
||||
(expression
|
||||
(operation
|
||||
(expression
|
||||
(identifier))
|
||||
(operator)
|
||||
(expression
|
||||
(value
|
||||
(table
|
||||
(identifier)
|
||||
(identifier)
|
||||
(list
|
||||
(value
|
||||
(string))
|
||||
(value
|
||||
(integer)))))))))))
|
||||
(item
|
||||
(statement
|
||||
(open_statement
|
||||
(expression
|
||||
(identifier))))))
|
||||
|
@ -55,9 +55,9 @@ module.exports = grammar({
|
||||
),
|
||||
|
||||
list: $ => seq(
|
||||
'(',
|
||||
'[',
|
||||
repeat1(seq($.value, optional(','))),
|
||||
')'
|
||||
']'
|
||||
),
|
||||
|
||||
function: $ => seq(
|
||||
|
@ -168,7 +168,7 @@
|
||||
"members": [
|
||||
{
|
||||
"type": "STRING",
|
||||
"value": "("
|
||||
"value": "["
|
||||
},
|
||||
{
|
||||
"type": "REPEAT1",
|
||||
@ -196,7 +196,7 @@
|
||||
},
|
||||
{
|
||||
"type": "STRING",
|
||||
"value": ")"
|
||||
"value": "]"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
@ -275,14 +275,6 @@
|
||||
"type": "#",
|
||||
"named": false
|
||||
},
|
||||
{
|
||||
"type": "(",
|
||||
"named": false
|
||||
},
|
||||
{
|
||||
"type": ")",
|
||||
"named": false
|
||||
},
|
||||
{
|
||||
"type": "+",
|
||||
"named": false
|
||||
@ -311,6 +303,14 @@
|
||||
"type": ">",
|
||||
"named": false
|
||||
},
|
||||
{
|
||||
"type": "[",
|
||||
"named": false
|
||||
},
|
||||
{
|
||||
"type": "]",
|
||||
"named": false
|
||||
},
|
||||
{
|
||||
"type": "else",
|
||||
"named": false
|
||||
|
474
src/parser.c
474
src/parser.c
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user