Skip to content

Commit

Permalink
Fix #5945: tiny fix to stdout-parsing regexes (#5946)
Browse files Browse the repository at this point in the history
Tiny change to regexes parsing compiler stdout lines, to make them stop
classifying lines like "(0.00 s) Setup: DONE" as errors.

One could imagine other, more thorough, fixes to [this
code](https://github.com/compiler-explorer/compiler-explorer/blob/ec8f8e5d50f81f4fb65b37bc5337f1ad93784f38/lib/utils.ts#L195-L202)
- it currently attempts to capture errors from all compilers, *not*
differentiating by compiler but instead by some general output formats
(`<source>`:line:col , or "file.ext":line, etc.). I settled for a 1-char
fix that seems to makes sense by itself.
  • Loading branch information
OfekShilon committed Jan 5, 2024
1 parent ec8f8e5 commit 464536e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ function parseSeverity(message: string): number {
}

const SOURCE_RE = /^\s*<source>[(:](\d+)(:?,?(\d+):?)?[):]*\s*(.*)/;
const SOURCE_WITH_FILENAME = /^\s*([\w.]*)[(:](\d+)(:?,?(\d+):?)?[):]*\s*(.*)/;
const ATFILELINE_RE = /\s*at ([\w-/.]*):(\d+)/;
const SOURCE_WITH_FILENAME = /^\s*([\w.]+)[(:](\d+)(:?,?(\d+):?)?[):]*\s*(.*)/;
const ATFILELINE_RE = /\s*at ([\w-/.]+):(\d+)/;

export enum LineParseOption {
SourceMasking,
Expand Down

0 comments on commit 464536e

Please sign in to comment.