Implement list

This commit is contained in:
Jeff 2023-09-29 16:34:20 -04:00
parent 5a6c92372a
commit b0b4bfe59e
6 changed files with 290 additions and 251 deletions

@ -1 +1 @@
Subproject commit 823bb3130591716771190e3123c5772250e00dc7
Subproject commit dd939db9241c670f72794bf28b50dac3b68e445c

View File

@ -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))))))

View File

@ -55,9 +55,9 @@ module.exports = grammar({
),
list: $ => seq(
'(',
'[',
repeat1(seq($.value, optional(','))),
')'
']'
),
function: $ => seq(

View File

@ -168,7 +168,7 @@
"members": [
{
"type": "STRING",
"value": "("
"value": "["
},
{
"type": "REPEAT1",
@ -196,7 +196,7 @@
},
{
"type": "STRING",
"value": ")"
"value": "]"
}
]
},

View File

@ -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

File diff suppressed because it is too large Load Diff