summaryrefslogtreecommitdiff
path: root/docs/tutorial/LangImpl2.html
diff options
context:
space:
mode:
Diffstat (limited to 'docs/tutorial/LangImpl2.html')
-rw-r--r--docs/tutorial/LangImpl2.html36
1 files changed, 20 insertions, 16 deletions
diff --git a/docs/tutorial/LangImpl2.html b/docs/tutorial/LangImpl2.html
index 7eed8d644b..b8b6112884 100644
--- a/docs/tutorial/LangImpl2.html
+++ b/docs/tutorial/LangImpl2.html
@@ -325,16 +325,18 @@ static ExprAST *ParseIdentifierExpr() {
// Call.
getNextToken(); // eat (
std::vector<ExprAST*> Args;
- while (1) {
- ExprAST *Arg = ParseExpression();
- if (!Arg) return 0;
- Args.push_back(Arg);
+ if (CurTok != ')') {
+ while (1) {
+ ExprAST *Arg = ParseExpression();
+ if (!Arg) return 0;
+ Args.push_back(Arg);
- if (CurTok == ')') break;
+ if (CurTok == ')') break;
- if (CurTok != ',')
- return Error("Expected ')'");
- getNextToken();
+ if (CurTok != ',')
+ return Error("Expected ')'");
+ getNextToken();
+ }
}
// Eat the ')'.
@@ -985,16 +987,18 @@ static ExprAST *ParseIdentifierExpr() {
// Call.
getNextToken(); // eat (
std::vector<ExprAST*> Args;
- while (1) {
- ExprAST *Arg = ParseExpression();
- if (!Arg) return 0;
- Args.push_back(Arg);
+ if (CurTok != ')') {
+ while (1) {
+ ExprAST *Arg = ParseExpression();
+ if (!Arg) return 0;
+ Args.push_back(Arg);
- if (CurTok == ')') break;
+ if (CurTok == ')') break;
- if (CurTok != ',')
- return Error("Expected ')'");
- getNextToken();
+ if (CurTok != ',')
+ return Error("Expected ')'");
+ getNextToken();
+ }
}
// Eat the ')'.