Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The gfortran linter is not working? [Win 10] #28

Open
8fdafs2 opened this issue Aug 29, 2016 · 2 comments
Open

The gfortran linter is not working? [Win 10] #28

8fdafs2 opened this issue Aug 29, 2016 · 2 comments

Comments

@8fdafs2
Copy link

8fdafs2 commented Aug 29, 2016

The gfortran is already in system path and I also tried putting its path in linter setting file.
Either way it's not working.

@8fdafs2
Copy link
Author

8fdafs2 commented Aug 29, 2016

I have changed the regex variable in linter.py so it works now.

    regex = (
        # filename:line:col: is common for multiline and single line warnings
        r'.*:(?P<line>\d+):(?P<col>\d+):'
        # Then we either have a space or (a newline, a newline, some source code,
        # a newline, a col number, a newline)
        r'(?:(\s*.*\s*\d+\s*))'
        # Finally we have (Error|Warning): message to the end of the line
        r'(?P<error>(Error|Fatal Error)|(?P<warning>Warning)): (?P<message>.*)'
    )

@Kailang
Copy link

Kailang commented Sep 11, 2016

I'm using GNU Fortran (GCC) 5.3.0 on Windows 10 as part of MinGW.

I got error messages that SublimeFortran's regex cannot handle.
Something like:

c:\users\kailang\appdata\local\temp\SublimeLinter3-Kailang\psddf.f90:285:21:

         last_print = printt(ntime)
                     1
Warning: Possible change of value in conversion from REAL(8) to INTEGER(4) at (1) [-Wconversion]

And @8fdafs2 's regex works, as it correctly extracts some information.
As shown here: https://regex101.com/r/xR8gH0/2

But, it incorrectly assigns "Warning" to both P<error> and P<warning>, which let SublimeLinter recognize every message as an error.

The good news is, the 3rd line of original regex can work!
So I simply substitute the @8fdafs2's 3rd line with the original one, and it works perfectly.

    regex = (
        # filename:line:col: is common for multiline and single line warnings
        r'.*:(?P<line>\d+):(?P<col>\d+):'
        # Then we either have a space or (a newline, a newline, some source code,
        # a newline, a col number, a newline)
        r'(?:(\s*.*\s*\d+\s*))'
        # Finally we have (Error|Warning): message to the end of the line
        r'(?:(?P<error>Error|Fatal\sError)|(?P<warning>Warning)): (?P<message>.*$)'
    )

As shown here: https://regex101.com/r/xR8gH0/3

Maybe the original regex was written for a different of gfortran.

Thanks, @8fdafs2.

jm-cc added a commit to jm-cc/SublimeFortran that referenced this issue Mar 9, 2017
martixy added a commit to martixy/SublimeFortran that referenced this issue May 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants