summaryrefslogtreecommitdiffstats
path: root/llvm/docs/tutorial/LangImpl2.html
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-11-06 01:39:12 +0000
committerChris Lattner <sabre@nondot.org>2007-11-06 01:39:12 +0000
commite6819aeee0ccd91d71397c7872aa86b228b6db84 (patch)
tree4fff12d178e007d6ed805b25469d00afe2e632e4 /llvm/docs/tutorial/LangImpl2.html
parent0d28238a1f642c2dbe4c16a730be31064619a7f4 (diff)
downloadbcm5719-llvm-e6819aeee0ccd91d71397c7872aa86b228b6db84.tar.gz
bcm5719-llvm-e6819aeee0ccd91d71397c7872aa86b228b6db84.zip
fixes from Ryan Brown.
llvm-svn: 43747
Diffstat (limited to 'llvm/docs/tutorial/LangImpl2.html')
-rw-r--r--llvm/docs/tutorial/LangImpl2.html36
1 files changed, 20 insertions, 16 deletions
diff --git a/llvm/docs/tutorial/LangImpl2.html b/llvm/docs/tutorial/LangImpl2.html
index 7eed8d644b2..b8b61128841 100644
--- a/llvm/docs/tutorial/LangImpl2.html
+++ b/llvm/docs/tutorial/LangImpl2.html
@@ -325,16 +325,18 @@ static ExprAST *ParseIdentifierExpr() {
// Call.
getNextToken(); // eat (
std::vector&lt;ExprAST*&gt; 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&lt;ExprAST*&gt; 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 ')'.
OpenPOWER on IntegriCloud