Implement assignment

This commit is contained in:
Jeff 2023-10-01 02:43:42 -04:00
parent 8c05154e43
commit 96d0e96768
7 changed files with 4653 additions and 4665 deletions

@ -1 +1 @@
Subproject commit 1f829d930a8a5d4683ac41c6a2085c5f482868cd
Subproject commit b476818ba3a5e005684fe3e3ee144b1014a6d5d0

View File

@ -1,4 +1,4 @@
raw_data = download("https://api.sampleapis.com/futurama/cast");
data = from_json(raw_data);
raw_data = download <"https://api.sampleapis.com/futurama/cast">
dust_data = from_json <raw_data>
assert_equal("Billy West", data.0.name);
assert_equal <"Billy West", data.0.name>

View File

@ -1,12 +1,7 @@
# Lists are created by grouping items in partheses and separating them with
# commas.
numbers = [1, 2 3]
numbers = (1, 2, 3);
x = numbers.0
y = numbers.1
z = numbers.2
# To access the values in a list, use an integer as an index.
x = numbers.0;
y = numbers.1;
z = numbers.2;
assert_equal(x + y, z);
assert_equal <x + y, z>

View File

@ -123,7 +123,7 @@ module.exports = grammar({
assignment: $ => prec.right(seq(
$.identifier,
choice("=", "+=", "-="),
$.expression,
$.statement,
)),
select: $ => prec.right(seq(

View File

@ -550,7 +550,7 @@
},
{
"type": "SYMBOL",
"name": "expression"
"name": "statement"
}
]
}

View File

@ -8,11 +8,11 @@
"required": true,
"types": [
{
"type": "expression",
"type": "identifier",
"named": true
},
{
"type": "identifier",
"type": "statement",
"named": true
}
]

File diff suppressed because it is too large Load Diff