Wiki

Ticket #41: fixNoWarnings.patch

File fixNoWarnings.patch, 1.7 KB (added by hopscc, 9 years ago)
  • Source/Tokenizer.cobra

     
    800800 
    801801    def addNoWarning(token as IToken) 
    802802        _noWarningLines.add('[token.fileName]:[token.lineNum]') 
    803          
     803 
    804804    def checkTokens(tokens as List<of IToken>, expected as String) 
    805805        is shared 
    806806        """ 
  • Source/Compiler.cobra

     
    7474    var _warnings as List<of SourceException> 
    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' 
     77    var _noWarningLines as Set<of String>   # key is 'filename:lineNum' 
    7878 
    7979    var _intermediateFileNames as List<of String> 
    8080    var _baseExeFileName as String = '' 
     
    184184 
    185185    get messages from var 
    186186 
    187     pro noWarningLines from var 
     187    set noWarningLines as ISet<of String> #from var 
     188        if value.count and value inherits Set<of String> 
     189            _noWarningLines.addRange(value) 
    188190 
    189191    pro htmlWriter from var 
    190192        """ 
     
    11701172        # TODO: add suppress all warnings (cmdline sw) - maybe? 
    11711173        # TODO: add suppress by error tag - maybe? 
    11721174        entry = if(cw.hasSourceSite, '[cw.fileName]:[cw.lineNum]', '') 
    1173         return _noWarningLines.contains(entry) 
    1174              
     1175        return _noWarningLines.contains(entry)  
     1176 
    11751177    def augmentWarning(node as ISyntaxNode, lookFor as String, search as String, augment as String) as bool 
    11761178        require  
    11771179            lookFor.length