0
0

allow missing var name on following curly bracket

This commit is contained in:
DrMaxNix 2022-09-07 17:03:19 +02:00
parent 8981e225e4
commit dd13d9e32c

View File

@ -339,6 +339,13 @@ class Juicescript_lexer {
// CHECK IF THERE EVEN IS A NAME // // CHECK IF THERE EVEN IS A NAME //
if(variable.length <= 0){ 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 warning // ignore with warning
this.warning("unexpected character '" + this.source.charAt(this.start) + "'"); this.warning("unexpected character '" + this.source.charAt(this.start) + "'");
return; return;