Changeset 116

Show
Ignore:
Timestamp:
09/19/07 02:17:58 (1 year ago)
Author:
Don Clugston
Message:

Tidying up

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/blade/SyntaxTree.d

    r115 r116  
    5656char [] syntaxtreeof(char [] expression) 
    5757{ 
    58     char [] expr=expression; 
     58    char [] expr = expression; 
    5959    char [][] symbols = replaceSymbolsWithPlaceholders(expr); 
    6060//    if (symbols.length> 25) return `static assert(0, "Too many symbols in expression.");`; 
     
    127127 * 
    128128 * Returns: an array of symbols (with no duplicates, though aliasing may exist) 
     129 * 
     130 * Supports all D syntax, except D2.004 string literals. 
    129131 */ 
    130132char [][] replaceSymbolsWithPlaceholders(inout char [] expr) 
     
    179181               code ~= "."; 
    180182           } 
    181            if (c!='/' || i >= expr.length-1) code ~= c; 
    182            else { 
    183                 // Remove comments 
     183           if (c!='/' || i >= expr.length-1) { 
     184                code ~= c; 
     185           } else { 
     186                // Remove comments. 
    184187                if (expr[i..i+2]=="//") { 
    185188                    for ( ; i<expr.length && expr[i]!='\n' ; ++i) {} 
     
    220223operation was performed. This gives the associativity and precedence rules 
    221224which the compiler used. 
    222  
    223 Bugs: 
    224  Doesn't support:  
    225    unary operators & ! 
    226    && and || operators 
    227    ?: 
    228    $ not really supported: a[$-1] should be replaced by a[a.length-1] 
    229    Comparison and NCEG floating point operators 
    230    cast 
    231    new, delete, anonymous classes 
    232    mixin, assert, and import expressions 
    233225*/ 
    234226class AST(char [] expr) 
     
    306298 * Insert parentheses around each symbol, to enforce normal D precedence rules. 
    307299 * Returns: a string which, when mixed in, generates a parenthesised expression. 
    308 */ 
     300 *     
     301 *   Bugs: 
     302 *    Doesn't support:  
     303 *      unary operators & ! 
     304 *      && and || operators 
     305 *      ?: 
     306 *      $ not really supported: a[$-1] should be replaced by a[a.length-1] 
     307 *      Comparison and NCEG floating point operators 
     308 *      cast 
     309 *      new, delete, anonymous classes 
     310 *      mixin, assert, and import expressions 
     311 */ 
    309312char [] mixin_getPrecedence(char [] expr) 
    310313{