
import sublime
from SublimeLinter.lint import Linter, util


class Iverilog(Linter):
    # linter basic settings
    syntax = ('verilog')
    cmd = 'iverilog -t null'
    tempfile_suffix = 'verilog'
    error_stream = util.STREAM_BOTH

    # what kind of message should be caught?
    if sublime.platform() == 'windows':
        regex = (
            r'^([^:]+):.*:(?P<line>\d*):'
            r'.((?P<error>error)|(?P<warning>warning))?'
            r'(?P<message>.*)'
        )
    else:
        regex = (
            r'^([^:]+):(?P<line>\d+): '
            r'(?:(?P<error>error)|(?P<warning>warning): )?'
            r'(?P<message>.+)'
        )


import sublime
from SublimeLinter.lint import Linter, util


class Iverilog(Linter):
    # linter basic settings
    syntax = ('verilog')
    cmd = 'iverilog -t null'
    tempfile_suffix = 'verilog'
    multiline = False
    error_stream = util.STREAM_BOTH

    # there is a ":" in the filepath under Windows
    # like C:\SOME_FOLDERS\...\FILE
    if sublime.platform() == 'windows':
        filepath = r'[^:]+:[^:]+'
    else:
        filepath = r'[^:]+'

    # what kind of message should be caught?
    regex = (
        r'(?P<file>{0}):(?P<line>\d+): '
        r'((?P<warning>warning: )|(?P<error>error: |))'
        r'(?P<message>.*)'
        .format(filepath)
    )

Add match error msg pattern like "<file>:<line>: syntax error"
Add match error msg pattern like "<file>:<line>: syntax error"

This error msg is available in iverilog 0.10.0 (devel).

  
  import sublime
  from SublimeLinter.lint import Linter, util
  
  
  class Iverilog(Linter):
      # linter basic settings
      syntax = ('verilog')
      cmd = 'iverilog -t null'
      tempfile_suffix = 'verilog'
+     multiline = False
      error_stream = util.STREAM_BOTH
  
+     # there is a ":" in the filepath under Windows
+     # like C:\SOME_FOLDERS\...\FILE
+     if sublime.platform() == 'windows':
+         filepath = r'[^:]+:[^:]+'
+     else:
+         filepath = r'[^:]+'
+ 
      # what kind of message should be caught?
-     if sublime.platform() == 'windows':
-         regex = (
+     regex = (
-             r'^([^:]+):.*:(?P<line>\d*):'
-             r'.((?P<error>error)|(?P<warning>warning))?'
+         r'(?P<file>{0}):(?P<line>\d+): '
+         r'((?P<warning>warning: )|(?P<error>error: |))'
-             r'(?P<message>.*)'
+         r'(?P<message>.*)'
+         .format(filepath)
+     )
-         )
-     else:
-         regex = (
-             r'^([^:]+):(?P<line>\d+): '
-             r'(?:(?P<error>error)|(?P<warning>warning): )?'
-             r'(?P<message>.+)'
-         )
  
Add match error msg pattern like "<file>:<line>: syntax error"
## Code Before:

import sublime
from SublimeLinter.lint import Linter, util


class Iverilog(Linter):
    # linter basic settings
    syntax = ('verilog')
    cmd = 'iverilog -t null'
    tempfile_suffix = 'verilog'
    error_stream = util.STREAM_BOTH

    # what kind of message should be caught?
    if sublime.platform() == 'windows':
        regex = (
            r'^([^:]+):.*:(?P<line>\d*):'
            r'.((?P<error>error)|(?P<warning>warning))?'
            r'(?P<message>.*)'
        )
    else:
        regex = (
            r'^([^:]+):(?P<line>\d+): '
            r'(?:(?P<error>error)|(?P<warning>warning): )?'
            r'(?P<message>.+)'
        )

## Instruction:
Add match error msg pattern like "<file>:<line>: syntax error"
## Code After:

import sublime
from SublimeLinter.lint import Linter, util


class Iverilog(Linter):
    # linter basic settings
    syntax = ('verilog')
    cmd = 'iverilog -t null'
    tempfile_suffix = 'verilog'
    multiline = False
    error_stream = util.STREAM_BOTH

    # there is a ":" in the filepath under Windows
    # like C:\SOME_FOLDERS\...\FILE
    if sublime.platform() == 'windows':
        filepath = r'[^:]+:[^:]+'
    else:
        filepath = r'[^:]+'

    # what kind of message should be caught?
    regex = (
        r'(?P<file>{0}):(?P<line>\d+): '
        r'((?P<warning>warning: )|(?P<error>error: |))'
        r'(?P<message>.*)'
        .format(filepath)
    )
