Wiki

Ticket #212: with-colnum.patch

File with-colnum.patch, 1.6 KB (added by hopscc, 14 years ago)
  • Source/Parser.cobra

     
    2020        base.init(message) 
    2121        _fileName = '' 
    2222 
     23    def consoleString as String is override 
     24        if _token  
     25            type = if(.isError, 'error', 'warning') 
     26            msg = '[_token.fileName]([_token.lineNum],[_token.colNum]): [type]: [.message]'  
     27            return msg 
     28        return base.consoleString 
     29 
    2330    get hasSourceSite as bool is override 
    2431        return true 
    2532 
  • Tests/700-command-line/900-check-complier-message-format/200-check-compiler-message-format.cobra

     
    1919        .check('120-bind-error.cobra') 
    2020 
    2121    def check(sourceName as String) 
    22         re = Regex(r"[A-Za-z\.]+cobra\(\d+\): (error|warning): [^\(]+$", RegexOptions(Compiled, CultureInvariant)) 
     22        re = Regex(r"[A-Za-z\.]+cobra\(\d+(,\d+)?\): (error|warning): [^\(]+$", RegexOptions(Compiled, CultureInvariant)) 
    2323        # example output for regex ta match: 
    2424        # bind-error.cobra(4): error: Cannot find "y". There is a member named ".getType" with a similar name. 
     25        # tokenizer-error.cobra(3,1): error: Space-based indentation must be a multiple of 4. This line has a remainder of 3. 
    2526 
    2627        output = .run('-c ' + sourceName) 
    2728        assert 'Compilation failed' in output