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,15 +1,15 @@
proto Test
function __init(self, x)
func __init(self, x)
self.x = x
end
function print(self)
func print(self)
print(self.x)
end
end
// stressing the GC
for (var i = 0; i < 100000; i++) do
var x = Test("Hello world " .. i)
for (let i = 0; i < 100000; i++) do
let x = Test("Hello world " .. i)
x:print()
end