diff options
author | Chris Lattner <sabre@nondot.org> | 2007-11-06 01:39:12 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2007-11-06 01:39:12 +0000 |
commit | 711552174e3a666175228c72ab88f1c37439e284 (patch) | |
tree | 8ed0cc3ce60c04670b2696d58d16b298457844d9 /docs/tutorial/LangImpl2.html | |
parent | 89c94f5cedbb975f7820b85acbe56d62f11bdfe5 (diff) | |
download | external_llvm-711552174e3a666175228c72ab88f1c37439e284.zip external_llvm-711552174e3a666175228c72ab88f1c37439e284.tar.gz external_llvm-711552174e3a666175228c72ab88f1c37439e284.tar.bz2 |
fixes from Ryan Brown.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43747 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'docs/tutorial/LangImpl2.html')
-rw-r--r-- | docs/tutorial/LangImpl2.html | 36 |
1 files changed, 20 insertions, 16 deletions
diff --git a/docs/tutorial/LangImpl2.html b/docs/tutorial/LangImpl2.html index 7eed8d6..b8b6112 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 ')'. |