Skip to content

Commit 97b410b

Browse files
committed
Merge pull request #342 from Exteris/bugfix/gfortran-6.3.1
Update line marker pattern for new gfortran
1 parent 78b05d3 commit 97b410b

File tree

2 files changed

+119
-1
lines changed

2 files changed

+119
-1
lines changed

ale_linters/fortran/gcc.vim

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ function! ale_linters#fortran#gcc#Handle(buffer, lines) abort
1212
"
1313
" :21.34:
1414
" Error: Expected comma in I/O list at (1)
15-
let l:line_marker_pattern = '^:\(\d\+\)\.\(\d\+\):$'
15+
let l:line_marker_pattern = ':\(\d\+\)[.:]\=\(\d\+\)\=:\=$'
1616
let l:message_pattern = '^\(Error\|Warning\): \(.\+\)$'
1717
let l:looking_for_message = 0
1818
let l:last_loclist_obj = {}

test/test_fortran_handler.vader

+118
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
Execute(The fortran handler should parse lines from GCC 4.1.2 correctly):
2+
runtime ale_linters/fortran/gcc.vim
3+
4+
AssertEqual
5+
\ [
6+
\ {
7+
\ 'bufnr': 357,
8+
\ 'lnum': 4,
9+
\ 'vcol': 0,
10+
\ 'col': 0,
11+
\ 'text': "Symbol ‘b’ at (1) has no IMPLICIT type",
12+
\ 'type': 'E',
13+
\ 'nr': -1,
14+
\ },
15+
\ {
16+
\ 'bufnr': 357,
17+
\ 'lnum': 3,
18+
\ 'vcol': 0,
19+
\ 'col': 0,
20+
\ 'text': "Symbol ‘a’ at (1) has no IMPLICIT type",
21+
\ 'type': 'E',
22+
\ 'nr': -1,
23+
\ },
24+
\ ],
25+
\ ale_linters#fortran#gcc#Handle(357, [
26+
\ " In file :4",
27+
\ "",
28+
\ "write(*,*) b",
29+
\ " 1",
30+
\ "Error: Symbol ‘b’ at (1) has no IMPLICIT type",
31+
\ " In file :3",
32+
\ "",
33+
\ "write(*,*) a",
34+
\ " 1",
35+
\ "Error: Symbol ‘a’ at (1) has no IMPLICIT type",
36+
\ ])
37+
38+
After:
39+
call ale#linter#Reset()
40+
41+
42+
Execute(The fortran handler should parse lines from GCC 4.9.3 correctly):
43+
runtime ale_linters/fortran/gcc.vim
44+
45+
AssertEqual
46+
\ [
47+
\ {
48+
\ 'bufnr': 357,
49+
\ 'lnum': 3,
50+
\ 'vcol': 0,
51+
\ 'col': 12,
52+
\ 'text': "Symbol ‘a’ at (1) has no IMPLICIT type",
53+
\ 'type': 'E',
54+
\ 'nr': -1,
55+
\ },
56+
\ {
57+
\ 'bufnr': 357,
58+
\ 'lnum': 4,
59+
\ 'vcol': 0,
60+
\ 'col': 12,
61+
\ 'text': "Symbol ‘b’ at (1) has no IMPLICIT type",
62+
\ 'type': 'E',
63+
\ 'nr': -1,
64+
\ },
65+
\ ],
66+
\ ale_linters#fortran#gcc#Handle(357, [
67+
\ ":3.12:",
68+
\ "",
69+
\ "write(*,*) a",
70+
\ " 1",
71+
\ "Error: Symbol ‘a’ at (1) has no IMPLICIT type",
72+
\ ":4.12:",
73+
\ "",
74+
\ "write(*,*) b",
75+
\ " 1",
76+
\ "Error: Symbol ‘b’ at (1) has no IMPLICIT type",
77+
\ ])
78+
79+
After:
80+
call ale#linter#Reset()
81+
82+
83+
84+
Execute(The fortran handler should parse lines from GCC 6.3.1 correctly):
85+
runtime ale_linters/fortran/gcc.vim
86+
87+
AssertEqual
88+
\ [
89+
\ {
90+
\ 'bufnr': 337,
91+
\ 'lnum': 3,
92+
\ 'vcol': 0,
93+
\ 'col': 12,
94+
\ 'text': "Symbol ‘a’ at (1) has no IMPLICIT type",
95+
\ 'type': 'E',
96+
\ 'nr': -1,
97+
\ },
98+
\ {
99+
\ 'bufnr': 337,
100+
\ 'lnum': 4,
101+
\ 'vcol': 0,
102+
\ 'col': 12,
103+
\ 'text': "Symbol ‘b’ at (1) has no IMPLICIT type",
104+
\ 'type': 'E',
105+
\ 'nr': -1,
106+
\ },
107+
\ ],
108+
\ ale_linters#fortran#gcc#Handle(337, [
109+
\ "<stdin>:3:12:",
110+
\ "",
111+
\ "Error: Symbol ‘a’ at (1) has no IMPLICIT type",
112+
\ "<stdin>:4:12:",
113+
\ "",
114+
\ "Error: Symbol ‘b’ at (1) has no IMPLICIT type",
115+
\ ])
116+
117+
After:
118+
call ale#linter#Reset()

0 commit comments

Comments
 (0)