Fix various syntactic problems

This commit is contained in:
Atermonera
2020-01-20 22:05:25 -08:00
committed by VirgoBot
parent c877f3d265
commit 5bcb9cc934
25 changed files with 72 additions and 59 deletions

View File

@@ -53,10 +53,9 @@
if(/token/word)
return new/node/expression/value/variable(T.value)
if(/token/accessor)
var
token/accessor/A=T
node/expression/value/variable/E//=new(A.member)
stack/S=new()
var/token/accessor/A=T
var/node/expression/value/variable/E//=new(A.member)
var/stack/S=new()
while(istype(A.object, /token/accessor))
S.Push(A)
A=A.object
@@ -181,11 +180,10 @@
- <ParseParamExpression()>
*/
ParseExpression(list/end=list(/token/end), list/ErrChars=list("{", "}"))
var/stack
opr=new
val=new
var/stack/opr=new
var/stack/val=new
src.expecting=VALUE
for()
while(TRUE)
if(EndOfExpression(end))
break
if(istype(curToken, /token/symbol) && ErrChars.Find(curToken.value))
@@ -278,7 +276,7 @@
NextToken() //skip open parenthesis, already found
var/loops = 0
for()
while(TRUE)
loops++
if(loops>=1000)
CRASH("Something TERRIBLE has gone wrong in ParseFunctionExpression ;__;")

View File

@@ -134,7 +134,7 @@ var/const/Represents a special statement in the code triggered by a keyword.
parser.NextToken()
if(!parser.CheckToken("(", /token/symbol))
return KW_FAIL
for() //for now parameters can be separated by whitespace - they don't need a comma in between
while(TRUE) //for now parameters can be separated by whitespace - they don't need a comma in between
if(istype(parser.curToken, /token/symbol))
switch(parser.curToken.value)
if(",")

View File

@@ -172,7 +172,7 @@
if(!CheckToken("(", /token/symbol)) //Check for and skip open parenthesis
return
var/loops = 0
for()
while(TRUE)
loops++
if(loops>=6000)
CRASH("Something TERRIBLE has gone wrong in ParseFunctionStatement ;__;")