✨ tokenize question mark
This commit is contained in:
parent
bfbd49c9fe
commit
46461c9de0
@ -180,7 +180,8 @@ class Juicescript_lexer {
|
||||
break;
|
||||
|
||||
|
||||
// AMPERSAND //
|
||||
// SPECIAL CHARS //
|
||||
// ampersand
|
||||
case "&":
|
||||
// only if there's a dollar sign after it
|
||||
if(this.peek() === "$"){
|
||||
@ -193,6 +194,11 @@ class Juicescript_lexer {
|
||||
this.error("unexpected character '" + this.char + "'");
|
||||
break;
|
||||
|
||||
// question mark
|
||||
case "?":
|
||||
this.token_add({type: Juicescript.token_type.QUESTION_MARK});
|
||||
break;
|
||||
|
||||
|
||||
// EVERYTHING ELSE //
|
||||
default:
|
||||
|
@ -23,7 +23,7 @@ class Juicescript {
|
||||
"BRACKET_CURLY_OPEN", "BRACKET_CURLY_CLOSE",
|
||||
|
||||
// special chars
|
||||
"AMPERSAND",
|
||||
"AMPERSAND", "QUESTION_MARK",
|
||||
|
||||
// delimiters
|
||||
"DELIMITER",
|
||||
@ -79,6 +79,7 @@ class Juicescript {
|
||||
|
||||
// run lexical analysis
|
||||
let token_list = lexer.scan();
|
||||
/**/console.log(token_list);
|
||||
|
||||
// stop here if unsuccessful
|
||||
if(lexer.error_count > 0) return false;
|
||||
|
Reference in New Issue
Block a user