[cfe-commits] r50666 - /cfe/trunk/lib/Lex/PPExpressions.cpp
Chris Lattner
sabre at nondot.org
Mon May 5 13:09:27 PDT 2008
Author: lattner
Date: Mon May 5 15:09:27 2008
New Revision: 50666
URL: http://llvm.org/viewvc/llvm-project?rev=50666&view=rev
Log:
Fix typo, improve comment.
Modified:
cfe/trunk/lib/Lex/PPExpressions.cpp
Modified: cfe/trunk/lib/Lex/PPExpressions.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/PPExpressions.cpp?rev=50666&r1=50665&r2=50666&view=diff
==============================================================================
--- cfe/trunk/lib/Lex/PPExpressions.cpp (original)
+++ cfe/trunk/lib/Lex/PPExpressions.cpp Mon May 5 15:09:27 2008
@@ -434,10 +434,10 @@
// Decide whether to include the next binop in this subexpression. For
// example, when parsing x+y*z and looking at '*', we want to recursively
- // handling y*z as a single subexpression. We do this because the
- // precedence of * is higher than that of +. The only strange case we have
- // to handle here is for the ?: operator, where the precedence is actually
- // lower than the LHS of the '?'. The grammar rule is:
+ // handle y*z as a single subexpression. We do this because the precedence
+ // of * is higher than that of +. The only strange case we have to handle
+ // here is for the ?: operator, where the precedence is actually lower than
+ // the LHS of the '?'. The grammar rule is:
//
// conditional-expression ::=
// logical-OR-expression ? expression : conditional-expression
@@ -620,7 +620,8 @@
if (EvaluateValue(AfterColonVal, PeekTok, DT, AfterColonLive, PP))
return true;
- // Parse anything after the : with the same precedence as ?.
+ // Parse anything after the : with the same precedence as ?. We allow
+ // things of equal precedence because ?: is right associative.
if (EvaluateDirectiveSubExpr(AfterColonVal, ThisPrec,
PeekTok, AfterColonLive, PP))
return true;
More information about the cfe-commits
mailing list