Skip to content

Commit a66034b

Browse files
authored
Merge pull request #6 from particle-iot/feature/ch69771/gcc-output-parser-should-handle-output-from
Support gcc 9.2 output
2 parents 7f252ed + 5b8069f commit a66034b

File tree

6 files changed

+2561
-21
lines changed

6 files changed

+2561
-21
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
node_modules
22
.DS_Store
33
.idea
4+
.vscode
45
npm-debug.log

.travis.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
language: node_js
22
node_js:
3-
- "0.12"
4-
- "0.11"
5-
- "0.10"
6-
- "iojs"
3+
- "12"
4+
- "10"
5+
- "8"
76
after_success:
87
- npm run coveralls

lib/main.js

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -17,28 +17,29 @@ module.exports = {
1717
var messages = [];
1818
var match = null;
1919

20-
var deepRegex = /([^:^\n]+):(\d+):(\d+):\s(\w+\s*\w*):\s(.+)\n(\s+)(.*)\s+\^+/gm;
21-
// ^ ^ ^ ^ ^ ^ ^
22-
// | | | | | | +- affected code
23-
// | | | | | +- whitespace before code
24-
// | | | | +- message text
25-
// | | | +- type (error|warning|note)
26-
// | | +- column
27-
// | +- line
28-
// +- filename
20+
var deepRegex = /([^:^\n]+):(\d+):(\d+):\s(\w+\s*\w*):\s(.+)\n(\s+)\d*\s*[|]*\s*(.*)\s+[|]*\s*\^+/gm;
21+
// ^ ^ ^ ^ ^ ^ ^ ^
22+
// | | | | | | | +- affected code
23+
// | | | | | | +- optional gcc 9.2 markup
24+
// | | | | | +- whitespace before code
25+
// | | | | +- message text
26+
// | | | +- type (error|warning|note)
27+
// | | +- column
28+
// | +- line
29+
// +- filename
2930
while (match = deepRegex.exec(stdout)) {
3031
messages.push(new Message().fromGcc(match, stdout));
3132
}
3233

3334
var simpleRegex = /([^:^\n]+):(\d+):(\d+):\s(\w+\s*\w*):\s(.+)\n(?!\s)/gm;
34-
// ^ ^ ^ ^ ^ ^ ^
35-
// | | | | | | +- affected code
36-
// | | | | | +- whitespace before code
37-
// | | | | +- message text
38-
// | | | +- type (error|warning|note)
39-
// | | +- column
40-
// | +- line
41-
// +- filename
35+
// ^ ^ ^ ^ ^ ^
36+
// | | | | | |
37+
// | | | | | +- whitespace before code
38+
// | | | | +- message text
39+
// | | | +- type (error|warning|note)
40+
// | | +- column
41+
// | +- line
42+
// +- filename
4243
match = null;
4344
while (match = simpleRegex.exec(stdout)) {
4445
messages.push(new Message().fromGcc(match, stdout));

0 commit comments

Comments
 (0)