Generalized the Lexer a bit more and renamed a function in the parser.

This commit is contained in:
TomyLobo
2011-10-23 05:10:41 +02:00
parent 7dfc2a34e5
commit c2191f4fc7
2 changed files with 44 additions and 38 deletions

View File

@ -95,7 +95,7 @@ public class Parser {
final Token next = peek();
if (next.id() == '(') {
halfProcessed.add(parseFunction(identifierToken));
halfProcessed.add(parseFunctionCall(identifierToken));
}
else {
Invokable variable = variables.get(identifierToken.value);
@ -301,9 +301,9 @@ public class Parser {
return tokens.get(position);
}
private Identifiable parseFunction(IdentifierToken identifierToken) throws ParserException {
private Identifiable parseFunctionCall(IdentifierToken identifierToken) throws ParserException {
if (peek().id() != '(') {
throw new ParserException(peek().getPosition(), "Unexpected character in parseBracket");
throw new ParserException(peek().getPosition(), "Unexpected character in parseFunctionCall");
}
++position;