Show
Ignore:
Timestamp:
08/12/08 23:46:19 (5 months ago)
Author:
Chuck.Esterbrook
Message:

New .no-warnings. compiler directive to suppress all warnings on a given line of source code. ticket:37
Code cleanup. ticket:36

Files:
1 modified

Legend:

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

    r1569 r1574  
    7575        var _messages as List<of SourceException>  # all errors and warnings 
    7676        var _messagesPerSourceLine as IDictionary<of String, List<of SourceException>>  # key is 'filename:lineNum' 
     77        var _noWarningLines as ISet<of String>          # key is 'filename:lineNum' 
    7778 
    7879        var _intermediateFileNames as List<of String> 
     
    105106                _messages = List<of SourceException>() 
    106107                _messagesPerSourceLine = Dictionary<of String, List<of SourceException>>() 
     108                _noWarningLines = Set<of String>() 
    107109                _errors = List<of SourceException>() 
    108110                _warnings = List<of SourceException>() 
     
    182184 
    183185        get messages from var 
     186 
     187        pro noWarningLines from var 
    184188 
    185189        pro htmlWriter from var 
     
    11541158        def warning(cw as CobraWarning) 
    11551159                require not cw.isError 
     1160                if _suppressWarning(cw), return 
    11561161                _addMessage(cw) 
    1157                  
     1162         
     1163        def _suppressWarning(cw as CobraWarning) as bool 
     1164                # TODO: add suppress all warnings (cmdline sw) - maybe? 
     1165                # TODO: add suppress by error tag - maybe? 
     1166                entry = if(cw.hasSourceSite, '[cw.fileName]:[cw.lineNum]', '') 
     1167                return _noWarningLines.contains(entry) 
     1168                         
    11581169        def augmentWarning(node as ISyntaxNode, lookFor as String, search as String, augment as String) as bool 
    11591170                require