Note: This website is archived. For up-to-date information about D projects and development, please visit wiki.dlang.org.

Changeset 1383

Show
Ignore:
Timestamp:
12/14/09 09:57:36 (15 years ago)
Author:
walter
Message:

bugzilla 3588 WithStatement? rule references unspecified Symbol

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/docsrc/expression.dd

    r1376 r1383  
    968968    It is an error if those 
    969969    bounds are out of range. 
    970970    ) 
    971971 
    972972<h2>Primary Expressions</h2> 
    973973 
    974974$(GRAMMAR 
    975975$(GNAME PrimaryExpression): 
    976976    $(I Identifier) 
    977977    $(B .)$(I Identifier) 
     978    $(LINK2 template.html#TemplateInstance, $(I TemplateInstance)) 
    978979    $(LINK2 #this, $(B this)) 
    979980    $(LINK2 #super, $(B super)) 
    980981    $(LINK2 #null, $(B null)) 
    981982    $(B true) 
    982983    $(B false) 
    983984    $(B $) 
    984985$(V2 
    985986    $(B __FILE__) 
    986987    $(B __LINE__)) 
    987988    $(I NumericLiteral) 
    988989    $(GLINK CharacterLiteral) 
    989990    $(GLINK StringLiterals) 
    990991    $(GLINK ArrayLiteral) 
    991992    $(GLINK AssocArrayLiteral) 
    992993    $(GLINK FunctionLiteral) 
    993994    $(GLINK AssertExpression) 
    994995    $(GLINK MixinExpression) 
    995996    $(GLINK ImportExpression) 
    996997    $(I BasicType) $(B .) $(I Identifier) 
     998    $(LINK2 declaration.html#Typeof, $(I Typeof)) 
    997999    $(GLINK TypeidExpression) 
    9981000    $(GLINK IsExpression) 
    9991001    $(B $(LPAREN)) $(I Expression) $(B $(RPAREN)) 
    10001002$(V2 
    10011003    $(I TraitsExpression)) 
    10021004) 
    10031005 
    10041006<h3>.Identifier</h3> 
    10051007 
    10061008    $(I Identifier) is looked up at module scope, rather than the current 
  • trunk/docsrc/statement.dd

    r1378 r1383  
    11541154    initializations. 
    11551155 
    11561156<h2>$(LNAME2 WithStatement, With Statement)</h2> 
    11571157 
    11581158    The with statement is a way to simplify repeated references 
    11591159    to the same object. 
    11601160 
    11611161$(GRAMMAR 
    11621162$(I WithStatement): 
    11631163    $(B with) $(B $(LPAREN)) $(EXPRESSION) $(B $(RPAREN)) $(PSSCOPE) 
    1164     $(B with) $(B $(LPAREN)) $(I Symbol) $(B $(RPAREN)) $(PSSCOPE) 
    1165     $(B with) $(B $(LPAREN)) $(I TemplateInstance) $(B $(RPAREN)) $(PSSCOPE) 
     1164    $(B with) $(B $(LPAREN)) $(LINK2 template.html#Symbol, $(I Symbol)) $(B $(RPAREN)) $(PSSCOPE) 
     1165    $(B with) $(B $(LPAREN)) $(LINK2 template.html#TemplateInstance, $(I TemplateInstance)) $(B $(RPAREN)) $(PSSCOPE) 
    11661166) 
    11671167 
    11681168    where $(EXPRESSION) evaluates to a class reference or struct 
    11691169    instance. 
    11701170    Within the with body the referenced object is searched first for 
    11711171    identifier symbols. The $(I WithStatement) 
    11721172 
    11731173-------------- 
    11741174$(B with) (expression) 
    11751175{ 
  • trunk/docsrc/template.dd

    r1382 r1383  
    7171    $(I Identifier) 
    7272 
    7373$(GNAME TemplateArgumentList): 
    7474    $(I TemplateArgument) 
    7575    $(I TemplateArgument) , $(I TemplateArgumentList) 
    7676 
    7777$(GNAME TemplateArgument): 
    7878    $(I Type) 
    7979    $(ASSIGNEXPRESSION) 
    8080    $(I Symbol) 
     81 
     82$(GNAME Symbol): 
     83    $(I SymbolTail) 
     84    $(B .) $(I SymbolTail) 
     85 
     86$(GNAME SymbolTail): 
     87    $(I Identifier) 
     88    $(I Identifier) $(B .) $(I SymbolTail) 
     89    $(GLINK TemplateInstance) 
     90    $(GLINK TemplateInstance) $(B .) $(I SymbolTail) 
    8191) 
    8292 
    8393$(P 
    8494    Once instantiated, the declarations inside the template, called 
    8595    the template members, are in the scope 
    8696    of the $(I TemplateInstance): 
    8797) 
    8898 
    8999------ 
    90100template TFoo(T) { alias T* t; }