Changeset 1383
- Timestamp:
- 12/14/09 09:57:36 (15 years ago)
- Files:
-
- trunk/docsrc/expression.dd (modified) (1 diff)
- trunk/docsrc/statement.dd (modified) (1 diff)
- trunk/docsrc/template.dd (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/docsrc/expression.dd
r1376 r1383 968 968 It is an error if those 969 969 bounds are out of range. 970 970 ) 971 971 972 972 <h2>Primary Expressions</h2> 973 973 974 974 $(GRAMMAR 975 975 $(GNAME PrimaryExpression): 976 976 $(I Identifier) 977 977 $(B .)$(I Identifier) 978 $(LINK2 template.html#TemplateInstance, $(I TemplateInstance)) 978 979 $(LINK2 #this, $(B this)) 979 980 $(LINK2 #super, $(B super)) 980 981 $(LINK2 #null, $(B null)) 981 982 $(B true) 982 983 $(B false) 983 984 $(B $) 984 985 $(V2 985 986 $(B __FILE__) 986 987 $(B __LINE__)) 987 988 $(I NumericLiteral) 988 989 $(GLINK CharacterLiteral) 989 990 $(GLINK StringLiterals) 990 991 $(GLINK ArrayLiteral) 991 992 $(GLINK AssocArrayLiteral) 992 993 $(GLINK FunctionLiteral) 993 994 $(GLINK AssertExpression) 994 995 $(GLINK MixinExpression) 995 996 $(GLINK ImportExpression) 996 997 $(I BasicType) $(B .) $(I Identifier) 998 $(LINK2 declaration.html#Typeof, $(I Typeof)) 997 999 $(GLINK TypeidExpression) 998 1000 $(GLINK IsExpression) 999 1001 $(B $(LPAREN)) $(I Expression) $(B $(RPAREN)) 1000 1002 $(V2 1001 1003 $(I TraitsExpression)) 1002 1004 ) 1003 1005 1004 1006 <h3>.Identifier</h3> 1005 1007 1006 1008 $(I Identifier) is looked up at module scope, rather than the current trunk/docsrc/statement.dd
r1378 r1383 1154 1154 initializations. 1155 1155 1156 1156 <h2>$(LNAME2 WithStatement, With Statement)</h2> 1157 1157 1158 1158 The with statement is a way to simplify repeated references 1159 1159 to the same object. 1160 1160 1161 1161 $(GRAMMAR 1162 1162 $(I WithStatement): 1163 1163 $(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) 1166 1166 ) 1167 1167 1168 1168 where $(EXPRESSION) evaluates to a class reference or struct 1169 1169 instance. 1170 1170 Within the with body the referenced object is searched first for 1171 1171 identifier symbols. The $(I WithStatement) 1172 1172 1173 1173 -------------- 1174 1174 $(B with) (expression) 1175 1175 { trunk/docsrc/template.dd
r1382 r1383 71 71 $(I Identifier) 72 72 73 73 $(GNAME TemplateArgumentList): 74 74 $(I TemplateArgument) 75 75 $(I TemplateArgument) , $(I TemplateArgumentList) 76 76 77 77 $(GNAME TemplateArgument): 78 78 $(I Type) 79 79 $(ASSIGNEXPRESSION) 80 80 $(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) 81 91 ) 82 92 83 93 $(P 84 94 Once instantiated, the declarations inside the template, called 85 95 the template members, are in the scope 86 96 of the $(I TemplateInstance): 87 97 ) 88 98 89 99 ------ 90 100 template TFoo(T) { alias T* t; }
