mirror of
https://github.com/CPunch/Cosmo.git
synced 2026-06-25 10:50:04 +00:00
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:
@@ -14,7 +14,7 @@ CReservedWord reservedWords[] = {
|
||||
{ TOKEN_END, "end", 3},
|
||||
{ TOKEN_FALSE, "false", 5},
|
||||
{ TOKEN_FOR, "for", 3},
|
||||
{TOKEN_FUNCTION, "function", 8},
|
||||
{ TOKEN_FUNC, "func", 4},
|
||||
{ TOKEN_IF, "if", 2},
|
||||
{ TOKEN_IN, "in", 2},
|
||||
{ TOKEN_LOCAL, "local", 5},
|
||||
@@ -25,7 +25,7 @@ CReservedWord reservedWords[] = {
|
||||
{ TOKEN_RETURN, "return", 6},
|
||||
{ TOKEN_THEN, "then", 4},
|
||||
{ TOKEN_TRUE, "true", 4},
|
||||
{ TOKEN_VAR, "var", 3},
|
||||
{ TOKEN_LET, "let", 3},
|
||||
{ TOKEN_WHILE, "while", 5}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user