Fixed parsing of dot-path identifiers

Updated test case
This commit is contained in:
Tristan B. Velloza Kildaire 2021-03-29 13:48:32 +02:00
parent e469cc3ec3
commit 61aaa84daf
3 changed files with 11 additions and 3 deletions

View File

@ -90,7 +90,7 @@ public final class Lexer
*/
private bool hasToken()
{
return currentToken.length == 0;
return currentToken.length != 0;
}
/* Perform the lexing process */
@ -129,7 +129,7 @@ public final class Lexer
*/
import misc.utils;
if(currentChar == '.' && isBackward() && isCharacterAlpha(sourceCode[position-1]))
if(currentChar == '.' && hasToken() && isBuildUpValidIdent())
{
gprintln("Bruh");
/**

View File

@ -112,6 +112,14 @@ public bool isPathIdentifier(string token)
}
}
if(token.length)
{
if(token[token.length-1] == '.')
{
return false;
}
}
return isDot;
}

View File

@ -9,7 +9,7 @@ int b = a.a;
int c = b;
int f = f.L(f(1+f.d.d.d()));
int p = f2p.j2p.p;
int p = f2p.j2.p;
public ubyte k = 1;
private ubyte k2 = 1;