✨ add scanner for variables prefixed with ampersand
This commit is contained in:
parent
dd13d9e32c
commit
ad8d67413f
14
src/lexer.js
14
src/lexer.js
@ -173,6 +173,20 @@ class Juicescript_lexer {
|
|||||||
break;
|
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 //
|
// EVERYTHING ELSE //
|
||||||
default:
|
default:
|
||||||
// numbers
|
// numbers
|
||||||
|
@ -23,6 +23,9 @@ class Juicescript {
|
|||||||
"BRACKET_SQUARE_OPEN", "BRACKET_SQUARE_CLOSE",
|
"BRACKET_SQUARE_OPEN", "BRACKET_SQUARE_CLOSE",
|
||||||
"BRACKET_CURLY_OPEN", "BRACKET_CURLY_CLOSE",
|
"BRACKET_CURLY_OPEN", "BRACKET_CURLY_CLOSE",
|
||||||
|
|
||||||
|
// special chars
|
||||||
|
"AMPERSAND",
|
||||||
|
|
||||||
// meta stuff
|
// meta stuff
|
||||||
"EOF"
|
"EOF"
|
||||||
);
|
);
|
||||||
|
Reference in New Issue
Block a user