Skip to content

Commit

Permalink
fix Issue 3838 - PrimaryExpression rule doesn't permit module scope t…
Browse files Browse the repository at this point in the history
…emplate instances
  • Loading branch information
WalterBright committed Jan 23, 2012
1 parent baa8b09 commit 79ecd14
Showing 1 changed file with 17 additions and 15 deletions.
32 changes: 17 additions & 15 deletions expression.dd
Expand Up @@ -708,7 +708,7 @@ $(GNAME UnaryExpression):
$(B +) $(I UnaryExpression)
$(B !) $(I UnaryExpression)
$(GLINK ComplementExpression)
$(B $(LPAREN)) $(GLINK2 declaration, Type) $(B $(RPAREN) .) $(I Identifier)
$(B $(LPAREN)) $(GLINK2 declaration, Type) $(B $(RPAREN) .) $(IDENTIFIER)
$(GLINK NewExpression)
$(GLINK DeleteExpression)
$(GLINK CastExpression)
Expand Down Expand Up @@ -1015,7 +1015,7 @@ $(GNAME PowExpression):
$(GRAMMAR
$(GNAME PostfixExpression):
$(GLINK PrimaryExpression)
$(I PostfixExpression) $(B .) $(I Identifier)
$(I PostfixExpression) $(B .) $(IDENTIFIER)
$(I PostfixExpression) $(B .) $(GLINK2 template, TemplateInstance)
$(I PostfixExpression) $(B .) $(GLINK NewExpression)
$(I PostfixExpression) $(B ++)
Expand Down Expand Up @@ -1104,9 +1104,10 @@ $(GNAME SliceExpression):

$(GRAMMAR
$(GNAME PrimaryExpression):
$(I Identifier)
$(B .)$(I Identifier)
$(IDENTIFIER)
$(B .)$(IDENTIFIER)
$(GLINK2 template, TemplateInstance)
$(B .)$(GLINK2 template, TemplateInstance)
$(LINK2 #this, $(B this))
$(LINK2 #super, $(B super))
$(LINK2 #null, $(B null))
Expand All @@ -1126,7 +1127,7 @@ $(V2 $(B __FILE__)
$(GLINK AssertExpression)
$(GLINK MixinExpression)
$(GLINK ImportExpression)
$(DDSUBLINK declaration, BasicTypeX, $(I BasicType)) $(B .) $(I Identifier)
$(DDSUBLINK declaration, BasicTypeX, $(I BasicType)) $(B .) $(IDENTIFIER)
$(GLINK2 declaration, Typeof)
$(GLINK TypeidExpression)
$(GLINK IsExpression)
Expand All @@ -1136,7 +1137,7 @@ $(V2 $(GLINK2 traits, TraitsExpression))

<h3>.Identifier</h3>

$(I Identifier) is looked up at module scope, rather than the current
$(IDENTIFIER) is looked up at module scope, rather than the current
lexically nested scope.

<h3>$(LNAME2 this, this)</h3>
Expand Down Expand Up @@ -1359,15 +1360,15 @@ $(GNAME ValueExpression):

$(GRAMMAR
$(GNAME Lambda):
$(I Identifier) $(B =&gt;) $(GLINK AssignExpression)
$(IDENTIFIER) $(B =&gt;) $(GLINK AssignExpression)
$(GLINK ParameterAttributes) $(B =&gt;) $(GLINK AssignExpression)
)

$(P $(I Lambda)s are a shorthand syntax for $(GLINK FunctionLiteral)s.
The first form is equivalent to:
)
---
delegate ( $(I Identifier) ) { return $(I AssignExpression); }
delegate ( $(IDENTIFIER) ) { return $(I AssignExpression); }
---

$(P And the second:)
Expand Down Expand Up @@ -1646,11 +1647,11 @@ $(GNAME IsExpression):
$(B is $(LPAREN)) $(GLINK2 declaration, Type) $(B $(RPAREN))
$(B is $(LPAREN)) $(GLINK2 declaration, Type) $(B :) $(GLINK TypeSpecialization) $(B $(RPAREN))
$(B is $(LPAREN)) $(GLINK2 declaration, Type) $(B ==) $(GLINK TypeSpecialization) $(B $(RPAREN))
$(B is $(LPAREN)) $(GLINK2 declaration, Type) $(I Identifier) $(B $(RPAREN))
$(B is $(LPAREN)) $(GLINK2 declaration, Type) $(I Identifier) $(B :) $(GLINK TypeSpecialization) $(B $(RPAREN))
$(B is $(LPAREN)) $(GLINK2 declaration, Type) $(I Identifier) $(B ==) $(GLINK TypeSpecialization) $(B $(RPAREN))
$(V2 $(B is $(LPAREN)) $(GLINK2 declaration, Type) $(I Identifier) $(B :) $(GLINK TypeSpecialization) $(B ,) $(GLINK2 template, TemplateParameterList) $(B $(RPAREN))
$(B is $(LPAREN)) $(GLINK2 declaration, Type) $(I Identifier) $(B ==) $(GLINK TypeSpecialization) $(B ,) $(GLINK2 template, TemplateParameterList) $(B $(RPAREN))
$(B is $(LPAREN)) $(GLINK2 declaration, Type) $(IDENTIFIER) $(B $(RPAREN))
$(B is $(LPAREN)) $(GLINK2 declaration, Type) $(IDENTIFIER) $(B :) $(GLINK TypeSpecialization) $(B $(RPAREN))
$(B is $(LPAREN)) $(GLINK2 declaration, Type) $(IDENTIFIER) $(B ==) $(GLINK TypeSpecialization) $(B $(RPAREN))
$(V2 $(B is $(LPAREN)) $(GLINK2 declaration, Type) $(IDENTIFIER) $(B :) $(GLINK TypeSpecialization) $(B ,) $(GLINK2 template, TemplateParameterList) $(B $(RPAREN))
$(B is $(LPAREN)) $(GLINK2 declaration, Type) $(IDENTIFIER) $(B ==) $(GLINK TypeSpecialization) $(B ,) $(GLINK2 template, TemplateParameterList) $(B $(RPAREN))
)

$(GNAME TypeSpecialization):
Expand Down Expand Up @@ -1684,8 +1685,8 @@ $(V2 $(B const)
If it is not semantically correct, the condition is not satisfied.
<p>

$(I Identifier) is declared to be an alias of the resulting
type if the condition is satisfied. The $(I Identifier) forms
$(IDENTIFIER) is declared to be an alias of the resulting
type if the condition is satisfied. The $(IDENTIFIER) forms
can only be used if the $(I IsExpression) appears in a
$(GLINK2 version, StaticIfCondition).
<p>
Expand Down Expand Up @@ -2013,6 +2014,7 @@ void main() {
Macros:
TITLE=Expressions
WIKI=Expression
IDENTIFIER=$(GLINK2 lex, Identifier)
CATEGORY_SPEC=$0
FOO=

0 comments on commit 79ecd14

Please sign in to comment.