Changeset 1605

Show
Ignore:
Timestamp:
08/28/08 07:42:22 (3 months ago)
Author:
Chuck.Esterbrook
Message:

Code cleanup.

Location:
cobra/trunk/Source
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • cobra/trunk/Source/CobraParser.cobra

    r1596 r1605  
    16621662                        isMissingType = true 
    16631663                # note: isTypeless is currently used to generate a warning in .paramDecls above, but in the future it may also be needed for when parameter types are inferred for anon methods 
    1664                 p = Param(token, type) # CC: put property sets in initializer (absorb next line) 
    1665                 p.isMissingType = isMissingType 
    1666                 p.kind = kind 
    1667                 return p 
     1664                return Param(token, type, isMissingType=isMissingType, kind=kind) 
    16681665 
    16691666 
  • cobra/trunk/Source/Expr.cobra

    r1603 r1605  
    14951495                        i += 1 
    14961496                name = '_ch_ext_init_[.serialNum]'  # ch = class helper, ext = extended, init = initializer 
    1497                 m = Method(token.copy('ID', name), box, name, paramsForDecl, _type, nil, ['shared', 'private'], AttributeList(), '') 
    1498                 m.isCompilerGenerated = true 
     1497                m = Method(token.copy('ID', name), box, name, paramsForDecl, _type, nil, ['shared', 'private'], AttributeList(), '', isCompilerGenerated=true) 
    14991498                m.locals.add(LocalVar(token.copy('ID', 'obj'), .type)) 
    15001499 
  • cobra/trunk/Source/Tokenizer.cobra

    r1574 r1605  
    441441                """ 
    442442                tokens = List<of IToken>() 
    443                 start = DateTime.now 
     443#               start = DateTime.now 
    444444                while true 
    445445                        t = .nextToken 
     
    447447                        else, break 
    448448                # determine timings for various Tokenizer lexing changes 
    449                 if false  # CC: can use /# ... #/ in the future 
    450                         duration = DateTime.now.subtract(start) 
    451                         if  tokens.count > 100 and duration > TimeSpan(0) 
    452                                 ticksPerToken = (duration.ticks to int) / tokens.count 
    453                                 ticksPerTokenMS = ticksPerToken / 10_000 
    454                                 fileName = _fileName 
    455                                 if fileName.startsWith('('), fileName = '(None)' 
    456                                 else, fileName = Path.getFileName(fileName) 
    457                                 print '[fileName.padRight(20)]\t[duration]\t[tokens.count]\t' stop 
    458                                 print ' [ticksPerTokenMS:N3] ms/Token av ([ticksPerTokenMS/1000:N3]sec)' 
     449/# 
     450                duration = DateTime.now.subtract(start) 
     451                if  tokens.count > 100 and duration > TimeSpan(0) 
     452                        ticksPerToken = (duration.ticks to int) / tokens.count 
     453                        ticksPerTokenMS = ticksPerToken / 10_000 
     454                        fileName = _fileName 
     455                        if fileName.startsWith('('), fileName = '(None)' 
     456                        else, fileName = Path.getFileName(fileName) 
     457                        print '[fileName.padRight(20)]\t[duration]\t[tokens.count]\t' stop 
     458                        print ' [ticksPerTokenMS:N3] ms/Token av ([ticksPerTokenMS/1000:N3]sec)' 
     459#/ 
    459460                return tokens 
    460461 
     
    940941                return t 
    941942 
    942         # CC: get firstChars from var is override 
    943         get firstChars as List<of char> is override 
    944                 return _firstChars 
    945  
    946         # CC: get length from var is override 
    947         get length as int is override 
    948                 return _length 
     943        get firstChars from var is override 
     944 
     945        get length from var is override 
    949946         
    950947        get regExSource from var