0
0

add scanner for variables prefixed with ampersand

This commit is contained in:
DrMaxNix 2022-09-07 17:09:03 +02:00
parent dd13d9e32c
commit ad8d67413f
2 changed files with 17 additions and 0 deletions

View File

@ -173,6 +173,20 @@ class Juicescript_lexer {
break;
// AMPERSAND //
case "&":
// only if there's a dollar sign after it
if(this.peek() === "$"){
// add token
this.token_add({type: Juicescript.token_type.AMPERSAND});
break;
}
// ignore with warning
this.warning("unexpected character '" + char + "'");
break;
// EVERYTHING ELSE //
default:
// numbers

View File

@ -23,6 +23,9 @@ class Juicescript {
"BRACKET_SQUARE_OPEN", "BRACKET_SQUARE_CLOSE",
"BRACKET_CURLY_OPEN", "BRACKET_CURLY_CLOSE",
// special chars
"AMPERSAND",
// meta stuff
"EOF"
);