From 545551f2df05f5c1ed5723581b7918f67c8dfdb5 Mon Sep 17 00:00:00 2001 From: Nicolas Cannasse Date: Thu, 24 May 2012 09:50:33 +0000 Subject: [PATCH] fixed two issues with genas3 --- hscript/Parser.hx | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/hscript/Parser.hx b/hscript/Parser.hx index b85bb92..eba421f 100644 --- a/hscript/Parser.hx +++ b/hscript/Parser.hx @@ -450,7 +450,8 @@ class Parser { var args = new Array(); tk = token(); if( tk != TPClose ) { - while( true ) { + var arg = true; + while( arg ) { var name = null; switch( tk ) { case TId(id): name = id; @@ -462,13 +463,15 @@ class Parser { t = parseType(); tk = token(); } - args.push({ name : name, t : t }); + args.push( { name : name, t : t } ); switch( tk ) { case TComma: - case TPClose: break; - default: unexpected(tk); + tk = token(); + case TPClose: + arg = false; + default: + unexpected(tk); } - tk = token(); } } var ret = null; @@ -493,7 +496,8 @@ class Parser { case TId(id): a.push(id); default: unexpected(tk); } - while( true ) { + var next = true; + while( next ) { tk = token(); switch( tk ) { case TDot: @@ -503,7 +507,7 @@ class Parser { default: unexpected(tk); } case TPOpen: - break; + next = false; default: unexpected(tk); }