From 46f60b6f9d858d7cc3ef0316848155928c6b3bd8 Mon Sep 17 00:00:00 2001 From: DrMaxNix Date: Fri, 9 Sep 2022 13:39:19 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=91=E2=80=8D=F0=9F=92=BB=20move=20some?= =?UTF-8?q?=20syntax=20checks=20to=20parser?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/lexer.js | 25 +------------------------ 1 file changed, 1 insertion(+), 24 deletions(-) diff --git a/src/lexer.js b/src/lexer.js index f4fd347..934db89 100644 --- a/src/lexer.js +++ b/src/lexer.js @@ -184,15 +184,7 @@ class Juicescript_lexer { // SPECIAL CHARS // // 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 error - this.error("unexpected character '" + this.char + "'"); + this.token_add({type: Juicescript.token_type.AMPERSAND}); break; // question mark @@ -365,21 +357,6 @@ class Juicescript_lexer { let variable = this.source.substring(this.start + 1, this.end); - // CHECK IF THERE EVEN IS A NAME // - if(variable.length <= 0){ - // has curly bracket after it? - if(this.peek() === "{"){ - // add token without value - this.token_add({type: Juicescript.token_type.VARIABLE}); - return; - } - - // ignore with error - this.error("unexpected character '" + this.source.charAt(this.start) + "'"); - return; - } - - // ADD TOKEN // this.token_add({type: Juicescript.token_type.VARIABLE, value: variable}); }