syntax: 'var'->'let' 'function'->'func'

- 'var' has some weird scoping connotations with users of JS. better to change it to 'let', which will decide whether to make the variable a local or a global
- 'func' looks visually appealing lol
- some minor refactoring done in cparse.c
This commit is contained in:
2023-02-09 15:58:25 -06:00
committed by cpunch
parent e335fd95d6
commit 8ac8085d20
16 changed files with 95 additions and 99 deletions

View File

@@ -1,8 +1,8 @@
// just testing continues and breaks
for (var x = 0; x < 700; x++) do
for (var i = 0; true; i++) do
var str = i .. "." .. x
for (let x = 0; x < 700; x++) do
for (let i = 0; true; i++) do
let str = i .. "." .. x
if (i == 998) then
print(i .. " reached")
break // exits the loop
@@ -13,9 +13,9 @@ for (var x = 0; x < 700; x++) do
end
// same example as the for loop but done manually using a while loop
var i = 0
let i = 0
while true do
var str = i .. "." .. x
let str = i .. "." .. x
if (i++ == 998) then
print("done")
break