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

Changeset 1375

Show
Ignore:
Timestamp:
12/13/09 07:48:13 (15 years ago)
Author:
walter
Message:

bugzilla 3612 ExpressionList? is undefined

Files:

Legend:

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

    r1365 r1375  
    682682    $(GLINK DeleteExpression) 
    683683    $(GLINK CastExpression) 
    684684    $(LINK2 class.html#anonymous, $(I NewAnonClassExpression)) 
    685685) 
    686686 
    687687 
    688688<h3>New Expressions</h3> 
    689689 
    690690$(GRAMMAR 
    691691$(GNAME NewExpression): 
    692     $(I NewArguments) $(I Type) $(B [) $(I AssignExpression) $(B ]) 
     692    $(I NewArguments) $(I Type) $(B [) $(GLINK AssignExpression) $(B ]) 
    693693    $(I NewArguments) $(I Type) $(B $(LPAREN)) $(GLINK ArgumentList) $(B $(RPAREN)) 
    694694    $(I NewArguments) $(I Type) 
    695695    $(I NewArguments) $(I ClassArguments) $(I BaseClasslist)<sub>opt</sub> $(B {) $(I DeclDefs) $(B } ) 
    696696 
    697697$(GNAME NewArguments): 
    698698    $(B new $(LPAREN)) $(GLINK ArgumentList) $(B $(RPAREN)) 
    699699    $(B new ( )) 
    700700    $(B new) 
    701701 
    702702$(GNAME ClassArguments): 
    703703    $(B class $(LPAREN)) $(GLINK ArgumentList) $(B $(RPAREN)) 
    704704    $(B class ( )) 
    705705    $(B class) 
    706706 
    707707$(GNAME ArgumentList): 
    708     $(I AssignExpression) 
    709     $(I AssignExpression) $(B ,) $(I ArgumentList) 
     708    $(GLINK AssignExpression) 
     709    $(GLINK AssignExpression) $(B ,) $(I ArgumentList) 
    710710) 
    711711 
    712712    $(P $(I NewExpression)s are used to allocate memory on the garbage 
    713713    collected heap (default) or using a class or struct specific allocator. 
    714714    ) 
    715715 
    716716    $(P To allocate multidimensional arrays, the declaration reads 
    717717    in the same order as the prefix array declaration order. 
    718718    ) 
    719719 
     
    928928    expression in the $(I ExpressionTuple), which is the result 
    929929    of the $(I IndexExpression). 
    930930    It is an error if $(I n) is out of bounds of the $(I ExpressionTuple). 
    931931    ) 
    932932 
    933933<h2>Slice Expressions</h2> 
    934934 
    935935$(GRAMMAR 
    936936$(GNAME SliceExpression): 
    937937    $(GLINK PostfixExpression) $(B [ ]) 
    938     $(GLINK PostfixExpression) $(B [) $(I AssignExpression) $(B ..) $(I AssignExpression) $(B ]) 
     938    $(GLINK PostfixExpression) $(B [) $(GLINK AssignExpression) $(B ..) $(GLINK AssignExpression) $(B ]) 
    939939) 
    940940 
    941941    $(P $(I PostfixExpression) is evaluated. 
    942942    if $(I PostfixExpression) is an expression of type 
    943943    static array or dynamic array, the variable $(B length) 
    944944    (and the special variable $(DOLLAR)) 
    945945    is declared and set to be the length of the array. 
    946946    A new declaration scope is created for the evaluation of the 
    947     $(I AssignExpression)..$(I AssignExpression) 
     947    $(GLINK AssignExpression)..$(GLINK AssignExpression) 
    948948    and $(B length) (and $(DOLLAR)) appears in that scope only. 
    949949    ) 
    950950 
    951951    $(P The first $(I AssignExpression) is taken to be the inclusive 
    952952    lower bound 
    953953    of the slice, and the second $(I AssignExpression) is the 
    954954    exclusive upper bound. 
    955955    The result of the expression is a slice of the $(I PostfixExpression) 
    956956    array. 
    957957    ) 
     
    11221122    string literal. 
    11231123    ) 
    11241124 
    11251125<h3>Array Literals</h3> 
    11261126 
    11271127$(GRAMMAR 
    11281128$(GNAME ArrayLiteral): 
    11291129    $(B [) $(GLINK ArgumentList) $(B ]) 
    11301130) 
    11311131 
    1132     $(P Array literals are a comma-separated list of $(I AssignExpression)s 
     1132    $(P Array literals are a comma-separated list of $(GLINK AssignExpression)s 
    11331133    between square brackets [ and ]. 
    11341134    The $(I AssignExpression)s form the elements of a static array, 
    11351135    the length of the array is the number of elements. 
    11361136    The type of the first element is taken to be the type of 
    11371137    all the elements, and all elements are implicitly converted 
    11381138    to that type. 
    11391139    If that type is a static array, it is converted to a dynamic 
    11401140    array. 
    11411141    ) 
    11421142 
     
    13461346    or non-nested functions, and the $(B delegate) form is 
    13471347    analogous to non-static nested functions. In other words, 
    13481348    a delegate literal can access stack variables in its enclosing 
    13491349    function, a function literal cannot. 
    13501350 
    13511351 
    13521352<h3>Assert Expressions</h3> 
    13531353 
    13541354$(GRAMMAR 
    13551355$(GNAME AssertExpression): 
    1356     $(B assert $(LPAREN)) $(I AssignExpression) $(B $(RPAREN)) 
    1357     $(B assert $(LPAREN)) $(I AssignExpression) $(B ,) $(I AssignExpression) $(B $(RPAREN)) 
     1356    $(B assert $(LPAREN)) $(GLINK AssignExpression) $(B $(RPAREN)) 
     1357    $(B assert $(LPAREN)) $(GLINK AssignExpression) $(B ,) $(GLINK AssignExpression) $(B $(RPAREN)) 
    13581358) 
    13591359 
    13601360    $(P Asserts evaluate the $(I expression). If the result is false, 
    13611361    an $(B AssertError) is thrown. If the result is true, then no 
    13621362    exception is thrown. 
    13631363    It is an error if the $(I expression) contains any side effects 
    13641364    that the program depends on. The compiler may optionally not 
    13651365    evaluate assert expressions at all. 
    13661366    The result type of an assert expression is $(TT void). 
    13671367    Asserts are a fundamental part of the 
  • trunk/docsrc/pragma.dd

    r671 r1375  
    11Ddoc 
    22 
    33$(SPEC_S Pragmas, 
    44 
    55$(GRAMMAR 
    66$(GNAME Pragma): 
    77    $(B pragma) $(B $(LPAREN)) $(I Identifier) $(B $(RPAREN)) 
    8     $(B pragma) $(B $(LPAREN)) $(I Identifier) $(B ,) $(I ExpressionList) $(B $(RPAREN)) 
    9  
    10 $(GNAME ExpressionList): 
    11     $(I ExpressionList) $(B ,) $(I Expression) 
    12     $(I Expression) 
     8    $(B pragma) $(B $(LPAREN)) $(I Identifier) $(B ,) $(LINK2 expression.html#ArgumentList, $(I ArgumentList)) $(B $(RPAREN)) 
    139) 
    1410 
    1511 
    1612    $(P Pragmas are a way to pass special information to the compiler 
    1713    and to add vendor specific extensions to D. 
    1814    Pragmas can be used by themselves terminated with a ';', 
    1915    they can influence a statement, a block of statements, a declaration, or 
    2016    a block of declarations. 
    2117    ) 
    2218 
  • trunk/docsrc/statement.dd

    r1346 r1375  
    799799 
    800800    A switch statement goes to one of a collection of case 
    801801    statements depending on the value of the switch 
    802802    expression. 
    803803 
    804804$(GRAMMAR 
    805805$(I SwitchStatement): 
    806806    $(B switch $(LPAREN)) $(EXPRESSION) $(B $(RPAREN)) $(PSSCOPE) 
    807807 
    808808$(GNAME CaseStatement): 
    809     $(B case) $(I ExpressionList) $(B :) $(PSSEMI_PSCURLYSCOPE) 
     809    $(B case) $(LINK2 expression.html#ArgumentList, $(I ArgumentList)) $(B :) $(PSSEMI_PSCURLYSCOPE) 
    810810 
    811811$(V2 $(GNAME CaseRangeStatement): 
    812812    $(B case) $(I FirstExp) $(B : .. case) $(I LastExp) $(B :) $(PSSEMI_PSCURLYSCOPE) 
    813813 
    814814$(I FirstExp): 
    815815    $(I AssignExpression) 
    816816 
    817817$(I LastExp): 
    818818    $(I AssignExpression) 
    819819) 
     
    821821    $(B default :) $(PSSEMI_PSCURLYSCOPE) 
    822822) 
    823823 
    824824    $(P $(EXPRESSION) is evaluated. The result type T must be 
    825825    of integral type or $(CODE char[]), $(CODE wchar[]) or $(CODE dchar[]). 
    826826    The result is 
    827827    compared against each of the case expressions. If there is 
    828828    a match, the corresponding case statement is transferred to. 
    829829    ) 
    830830 
    831     $(P The case expressions, $(I ExpressionList), are a comma separated 
    832     list of expressions. 
     831    $(P The case expressions, $(LINK2 expression.html#ArgumentList, $(I ArgumentList)), 
     832    are a comma separated list of expressions. 
    833833    ) 
    834834 
    835835$(V2 
    836836    $(P A $(I CaseRangeStatement) is a shorthand for listing a series 
    837837    of case statements from $(I FirstExp) to $(I LastExp). 
    838838    ) 
    839839) 
    840840 
    841841    $(P If none of the case expressions match, and there is a default 
    842842    statement, the default statement is transferred to.