Implement assignment
This commit is contained in:
parent
8c05154e43
commit
96d0e96768
@ -1 +1 @@
|
||||
Subproject commit 1f829d930a8a5d4683ac41c6a2085c5f482868cd
|
||||
Subproject commit b476818ba3a5e005684fe3e3ee144b1014a6d5d0
|
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -123,7 +123,7 @@ module.exports = grammar({
|
||||
assignment: $ => prec.right(seq(
|
||||
$.identifier,
|
||||
choice("=", "+=", "-="),
|
||||
$.expression,
|
||||
$.statement,
|
||||
)),
|
||||
|
||||
select: $ => prec.right(seq(
|
||||
|
@ -550,7 +550,7 @@
|
||||
},
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "expression"
|
||||
"name": "statement"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -8,11 +8,11 @@
|
||||
"required": true,
|
||||
"types": [
|
||||
{
|
||||
"type": "expression",
|
||||
"type": "identifier",
|
||||
"named": true
|
||||
},
|
||||
{
|
||||
"type": "identifier",
|
||||
"type": "statement",
|
||||
"named": true
|
||||
}
|
||||
]
|
||||
|
9287
src/parser.c
9287
src/parser.c
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user