diff options
| author | Richard M. Stallman | 1997-01-23 21:49:59 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1997-01-23 21:49:59 +0000 |
| commit | 2fa55e202f54007576d48ee36b484384e1e2a34c (patch) | |
| tree | fec9b13bdde437396835006601ec8af376811c94 | |
| parent | 1146fab338b968eec37f14acb0ea6a7f790895af (diff) | |
| download | emacs-2fa55e202f54007576d48ee36b484384e1e2a34c.tar.gz emacs-2fa55e202f54007576d48ee36b484384e1e2a34c.zip | |
(compilation-parse-errors): Use looking-at on each line.
(compilation-error-regexp-alist): Change these regexps
so that they assume matching only at start of line.
Delete \n at beginning; otherwise add `.*'.
| -rw-r--r-- | lisp/progmodes/compile.el | 50 |
1 files changed, 28 insertions, 22 deletions
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index 48c247bb984..baf42a93261 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el | |||
| @@ -133,24 +133,24 @@ or when it is used with \\[next-error] or \\[compile-goto-error].") | |||
| 133 | ;; We'll insist that the number be followed by a colon or closing | 133 | ;; We'll insist that the number be followed by a colon or closing |
| 134 | ;; paren, because otherwise this matches just about anything | 134 | ;; paren, because otherwise this matches just about anything |
| 135 | ;; containing a number with spaces around it. | 135 | ;; containing a number with spaces around it. |
| 136 | ("\n\ | 136 | ("\ |
| 137 | \\([a-zA-Z]?:?[^:( \t\n]+\\)[:(][ \t]*\\([0-9]+\\)\\([) \t]\\|\ | 137 | \\([a-zA-Z]?:?[^:( \t\n]+\\)[:(][ \t]*\\([0-9]+\\)\\([) \t]\\|\ |
| 138 | :\\([^0-9\n]\\|\\([0-9]+:\\)\\)\\)" 1 2 5) | 138 | :\\([^0-9\n]\\|\\([0-9]+:\\)\\)\\)" 1 2 5) |
| 139 | 139 | ||
| 140 | ;; Microsoft C/C++: | 140 | ;; Microsoft C/C++: |
| 141 | ;; keyboard.c(537) : warning C4005: 'min' : macro redefinition | 141 | ;; keyboard.c(537) : warning C4005: 'min' : macro redefinition |
| 142 | ;; d:\tmp\test.c(23) : error C2143: syntax error : missing ';' before 'if' | 142 | ;; d:\tmp\test.c(23) : error C2143: syntax error : missing ';' before 'if' |
| 143 | ("\n\\(\\([a-zA-Z]:\\)?[^:( \t\n-]+\\)[:(][ \t]*\\([0-9]+\\)[:) \t]" 1 3) | 143 | ("\\(\\([a-zA-Z]:\\)?[^:( \t\n-]+\\)[:(][ \t]*\\([0-9]+\\)[:) \t]" 1 3) |
| 144 | 144 | ||
| 145 | ;; Borland C++: | 145 | ;; Borland C++: |
| 146 | ;; Error ping.c 15: Unable to open include file 'sys/types.h' | 146 | ;; Error ping.c 15: Unable to open include file 'sys/types.h' |
| 147 | ;; Warning ping.c 68: Call to function 'func' with no prototype | 147 | ;; Warning ping.c 68: Call to function 'func' with no prototype |
| 148 | ("\n\\(Error\\|Warning\\) \\([a-zA-Z]?:?[^:( \t\n]+\\)\ | 148 | ("\\(Error\\|Warning\\) \\([a-zA-Z]?:?[^:( \t\n]+\\)\ |
| 149 | \\([0-9]+\\)\\([) \t]\\|:[^0-9\n]\\)" 2 3) | 149 | \\([0-9]+\\)\\([) \t]\\|:[^0-9\n]\\)" 2 3) |
| 150 | 150 | ||
| 151 | ;; 4.3BSD lint pass 2 | 151 | ;; 4.3BSD lint pass 2 |
| 152 | ;; strcmp: variable # of args. llib-lc(359) :: /usr/src/foo/foo.c(8) | 152 | ;; strcmp: variable # of args. llib-lc(359) :: /usr/src/foo/foo.c(8) |
| 153 | ("[ \t:]\\([a-zA-Z]?:?[^:( \t\n]+\\)[:(](+[ \t]*\\([0-9]+\\))[:) \t]*$" | 153 | (".*[ \t:]\\([a-zA-Z]?:?[^:( \t\n]+\\)[:(](+[ \t]*\\([0-9]+\\))[:) \t]*$" |
| 154 | 1 2) | 154 | 1 2) |
| 155 | 155 | ||
| 156 | ;; 4.3BSD lint pass 3 | 156 | ;; 4.3BSD lint pass 3 |
| @@ -158,26 +158,26 @@ or when it is used with \\[next-error] or \\[compile-goto-error].") | |||
| 158 | ;; This used to be | 158 | ;; This used to be |
| 159 | ;; ("[ \t(]+\\([a-zA-Z]?:?[^:( \t\n]+\\)[:( \t]+\\([0-9]+\\)[:) \t]+" 1 2) | 159 | ;; ("[ \t(]+\\([a-zA-Z]?:?[^:( \t\n]+\\)[:( \t]+\\([0-9]+\\)[:) \t]+" 1 2) |
| 160 | ;; which is regexp Impressionism - it matches almost anything! | 160 | ;; which is regexp Impressionism - it matches almost anything! |
| 161 | ("([ \t]*\\([a-zA-Z]?:?[^:( \t\n]+\\)[:(][ \t]*\\([0-9]+\\))" 1 2) | 161 | (".*([ \t]*\\([a-zA-Z]?:?[^:( \t\n]+\\)[:(][ \t]*\\([0-9]+\\))" 1 2) |
| 162 | 162 | ||
| 163 | ;; MIPS lint pass<n>; looks good for SunPro lint also | 163 | ;; MIPS lint pass<n>; looks good for SunPro lint also |
| 164 | ;; TrimMask (255) in solomon.c may be indistinguishable from TrimMasks (93) in solomon.c due to truncation | 164 | ;; TrimMask (255) in solomon.c may be indistinguishable from TrimMasks (93) in solomon.c due to truncation |
| 165 | ("\n[^\n ]+ (\\([0-9]+\\)) in \\([^ \n]+\\)" 2 1) | 165 | ("[^\n ]+ (\\([0-9]+\\)) in \\([^ \n]+\\)" 2 1) |
| 166 | ;; name defined but never used: LinInt in cmap_calc.c(199) | 166 | ;; name defined but never used: LinInt in cmap_calc.c(199) |
| 167 | ("in \\([^(\n]+\\)(\\([0-9]+\\))$" 1 2) | 167 | (".*in \\([^(\n]+\\)(\\([0-9]+\\))$" 1 2) |
| 168 | 168 | ||
| 169 | ;; Ultrix 3.0 f77: | 169 | ;; Ultrix 3.0 f77: |
| 170 | ;; fort: Severe: addstf.f, line 82: Missing operator or delimiter symbol | 170 | ;; fort: Severe: addstf.f, line 82: Missing operator or delimiter symbol |
| 171 | ;; Some SGI cc version: | 171 | ;; Some SGI cc version: |
| 172 | ;; cfe: Warning 835: foo.c, line 2: something | 172 | ;; cfe: Warning 835: foo.c, line 2: something |
| 173 | ("\n\\(cfe\\|fort\\): [^:\n]*: \\([^ \n]*\\), line \\([0-9]+\\):" 2 3) | 173 | ("\\(cfe\\|fort\\): [^:\n]*: \\([^ \n]*\\), line \\([0-9]+\\):" 2 3) |
| 174 | ;; Error on line 3 of t.f: Execution error unclassifiable statement | 174 | ;; Error on line 3 of t.f: Execution error unclassifiable statement |
| 175 | ;; Unknown who does this: | 175 | ;; Unknown who does this: |
| 176 | ;; Line 45 of "foo.c": bloofle undefined | 176 | ;; Line 45 of "foo.c": bloofle undefined |
| 177 | ;; Absoft FORTRAN 77 Compiler 3.1.3 | 177 | ;; Absoft FORTRAN 77 Compiler 3.1.3 |
| 178 | ;; error on line 19 of fplot.f: spelling error? | 178 | ;; error on line 19 of fplot.f: spelling error? |
| 179 | ;; warning on line 17 of fplot.f: data type is undefined for variable d | 179 | ;; warning on line 17 of fplot.f: data type is undefined for variable d |
| 180 | ("\\(\n\\|on \\)[Ll]ine[ \t]+\\([0-9]+\\)[ \t]+\ | 180 | ("\\(\\|.* on \\)[Ll]ine[ \t]+\\([0-9]+\\)[ \t]+\ |
| 181 | of[ \t]+\"?\\([a-zA-Z]?:?[^\":\n]+\\)\"?:" 3 2) | 181 | of[ \t]+\"?\\([a-zA-Z]?:?[^\":\n]+\\)\"?:" 3 2) |
| 182 | 182 | ||
| 183 | ;; Apollo cc, 4.3BSD fc: | 183 | ;; Apollo cc, 4.3BSD fc: |
| @@ -192,46 +192,46 @@ of[ \t]+\"?\\([a-zA-Z]?:?[^\":\n]+\\)\"?:" 3 2) | |||
| 192 | ;; "foo.adb", line 2(11): warning: file name does not match ... | 192 | ;; "foo.adb", line 2(11): warning: file name does not match ... |
| 193 | ;; IBM AIX xlc compiler: | 193 | ;; IBM AIX xlc compiler: |
| 194 | ;; "src/swapping.c", line 30.34: 1506-342 (W) "/*" detected in comment. | 194 | ;; "src/swapping.c", line 30.34: 1506-342 (W) "/*" detected in comment. |
| 195 | ("\"\\([^,\" \n\t]+\\)\", lines? \ | 195 | (".*\"\\([^,\" \n\t]+\\)\", lines? \ |
| 196 | \\([0-9]+\\)\\([\(.]\\([0-9]+\\)\)?\\)?[:., (-]" 1 2 4) | 196 | \\([0-9]+\\)\\([\(.]\\([0-9]+\\)\)?\\)?[:., (-]" 1 2 4) |
| 197 | 197 | ||
| 198 | ;; MIPS RISC CC - the one distributed with Ultrix: | 198 | ;; MIPS RISC CC - the one distributed with Ultrix: |
| 199 | ;; ccom: Error: foo.c, line 2: syntax error | 199 | ;; ccom: Error: foo.c, line 2: syntax error |
| 200 | ;; DEC AXP OSF/1 cc | 200 | ;; DEC AXP OSF/1 cc |
| 201 | ;; /usr/lib/cmplrs/cc/cfe: Error: foo.c: 1: blah blah | 201 | ;; /usr/lib/cmplrs/cc/cfe: Error: foo.c: 1: blah blah |
| 202 | ("rror: \\([^,\" \n\t]+\\)[,:] \\(line \\)?\\([0-9]+\\):" 1 3) | 202 | (".*rror: \\([^,\" \n\t]+\\)[,:] \\(line \\)?\\([0-9]+\\):" 1 3) |
| 203 | 203 | ||
| 204 | ;; IBM AIX PS/2 C version 1.1: | 204 | ;; IBM AIX PS/2 C version 1.1: |
| 205 | ;; ****** Error number 140 in line 8 of file errors.c ****** | 205 | ;; ****** Error number 140 in line 8 of file errors.c ****** |
| 206 | ("in line \\([0-9]+\\) of file \\([^ \n]+[^. \n]\\)\\.? " 2 1) | 206 | (".*in line \\([0-9]+\\) of file \\([^ \n]+[^. \n]\\)\\.? " 2 1) |
| 207 | ;; IBM AIX lint is too painful to do right this way. File name | 207 | ;; IBM AIX lint is too painful to do right this way. File name |
| 208 | ;; prefixes entire sections rather than being on each line. | 208 | ;; prefixes entire sections rather than being on each line. |
| 209 | 209 | ||
| 210 | ;; Lucid Compiler, lcc 3.x | 210 | ;; Lucid Compiler, lcc 3.x |
| 211 | ;; E, file.cc(35,52) Illegal operation on pointers | 211 | ;; E, file.cc(35,52) Illegal operation on pointers |
| 212 | ("\n[EW], \\([^(\n]*\\)(\\([0-9]+\\),[ \t]*\\([0-9]+\\)" 1 2 3) | 212 | ("[EW], \\([^(\n]*\\)(\\([0-9]+\\),[ \t]*\\([0-9]+\\)" 1 2 3) |
| 213 | 213 | ||
| 214 | ;; GNU messages with program name and optional column number. | 214 | ;; GNU messages with program name and optional column number. |
| 215 | ("\n[a-zA-Z]?:?[^0-9 \n\t:]+:[ \t]*\\([^ \n\t:]+\\):\ | 215 | ("[a-zA-Z]?:?[^0-9 \n\t:]+:[ \t]*\\([^ \n\t:]+\\):\ |
| 216 | \\([0-9]+\\):\\(\\([0-9]+\\)[: \t]\\)?" 1 2 4) | 216 | \\([0-9]+\\):\\(\\([0-9]+\\)[: \t]\\)?" 1 2 4) |
| 217 | 217 | ||
| 218 | ;; GNU messages with program name and optional column number | 218 | ;; GNU messages with program name and optional column number |
| 219 | ;; and a severity letter after that. nsgmls makes them. | 219 | ;; and a severity letter after that. nsgmls makes them. |
| 220 | ("\n[^0-9 \n\t:]+:[ \t]*\\([^ \n\t:]+\\):\ | 220 | ("[^0-9 \n\t:]+:[ \t]*\\([^ \n\t:]+\\):\ |
| 221 | \\([0-9]+\\):\\(\\([0-9]+\\):\\)?[A-Za-z]:" 1 2 4) | 221 | \\([0-9]+\\):\\(\\([0-9]+\\):\\)?[A-Za-z]:" 1 2 4) |
| 222 | 222 | ||
| 223 | ;; Cray C compiler error messages | 223 | ;; Cray C compiler error messages |
| 224 | ("\n\\(cc\\| cft\\)-[0-9]+ c\\(c\\|f77\\): ERROR \\([^,\n]+, \\)* File = \\([^,\n]+\\), Line = \\([0-9]+\\)" 4 5) | 224 | ("\\(cc\\| cft\\)-[0-9]+ c\\(c\\|f77\\): ERROR \\([^,\n]+, \\)* File = \\([^,\n]+\\), Line = \\([0-9]+\\)" 4 5) |
| 225 | 225 | ||
| 226 | ;; IBM C/C++ Tools 2.01: | 226 | ;; IBM C/C++ Tools 2.01: |
| 227 | ;; foo.c(2:0) : informational EDC0804: Function foo is not referenced. | 227 | ;; foo.c(2:0) : informational EDC0804: Function foo is not referenced. |
| 228 | ;; foo.c(3:8) : warning EDC0833: Implicit return statement encountered. | 228 | ;; foo.c(3:8) : warning EDC0833: Implicit return statement encountered. |
| 229 | ;; foo.c(5:5) : error EDC0350: Syntax error. | 229 | ;; foo.c(5:5) : error EDC0350: Syntax error. |
| 230 | ("\n\\([^( \n\t]+\\)(\\([0-9]+\\):\\([0-9]+\\)) : " 1 2 3) | 230 | ("\\([^( \n\t]+\\)(\\([0-9]+\\):\\([0-9]+\\)) : " 1 2 3) |
| 231 | 231 | ||
| 232 | ;; Sun ada (VADS, Solaris): | 232 | ;; Sun ada (VADS, Solaris): |
| 233 | ;; /home3/xdhar/rcds_rc/main.a, line 361, char 6:syntax error: "," inserted | 233 | ;; /home3/xdhar/rcds_rc/main.a, line 361, char 6:syntax error: "," inserted |
| 234 | ("\n\\([^, \n\t]+\\), line \\([0-9]+\\), char \\([0-9]+\\)[:., \(-]" 1 2 3) | 234 | ("\\([^, \n\t]+\\), line \\([0-9]+\\), char \\([0-9]+\\)[:., \(-]" 1 2 3) |
| 235 | ) | 235 | ) |
| 236 | "Alist that specifies how to match errors in compiler output. | 236 | "Alist that specifies how to match errors in compiler output. |
| 237 | Each elt has the form (REGEXP FILE-IDX LINE-IDX [COLUMN-IDX FILE-FORMAT...]) | 237 | Each elt has the form (REGEXP FILE-IDX LINE-IDX [COLUMN-IDX FILE-FORMAT...]) |
| @@ -1371,10 +1371,16 @@ See variable `compilation-parse-errors-function' for the interface it uses." | |||
| 1371 | (expand-file-name "../" orig-expanded))) | 1371 | (expand-file-name "../" orig-expanded))) |
| 1372 | 1372 | ||
| 1373 | (while (and (not found-desired) | 1373 | (while (and (not found-desired) |
| 1374 | ;; We don't just pass LIMIT-SEARCH to re-search-forward | 1374 | ;; Instead of using re-search-forward, |
| 1375 | ;; because we want to find matches containing LIMIT-SEARCH | 1375 | ;; we use this loop which tries only at each line. |
| 1376 | ;; but which extend past it. | 1376 | (progn |
| 1377 | (re-search-forward regexp nil t)) | 1377 | (while (and (not (eobp)) |
| 1378 | (not (looking-at regexp))) | ||
| 1379 | (forward-line 1)) | ||
| 1380 | (not (eobp)))) | ||
| 1381 | |||
| 1382 | ;; Move to the end of the match we just found. | ||
| 1383 | (goto-char (match-end 0)) | ||
| 1378 | 1384 | ||
| 1379 | ;; Figure out which constituent regexp matched. | 1385 | ;; Figure out which constituent regexp matched. |
| 1380 | (cond ((match-beginning enter-group) | 1386 | (cond ((match-beginning enter-group) |