mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-15 06:33:55 +01:00
Merge pull request #5721 from overleaf/hb-fix-log-line-parsing
Improve file line error log parser regex GitOrigin-RevId: d3fbb39b4a6d99e339c1d6e6eb81d9cfb3ec5935
This commit is contained in:
@@ -7,6 +7,7 @@ const PACKAGE_WARNING_REGEX = /^(Package \b.+\b Warning:.*)$/
|
||||
const LINES_REGEX = /lines? ([0-9]+)/
|
||||
// This is used to parse the package name from the package warnings
|
||||
const PACKAGE_REGEX = /^Package (\b.+\b) Warning/
|
||||
const FILE_LINE_ERROR_REGEX = /^([./].*):(\d+): (.*)/
|
||||
|
||||
const STATE = {
|
||||
NORMAL: 0,
|
||||
@@ -83,7 +84,7 @@ export default class LatexParser {
|
||||
}
|
||||
|
||||
currentLineIsFileLineError() {
|
||||
return /^\/.*:\d+: .*/.test(this.currentLine)
|
||||
return FILE_LINE_ERROR_REGEX.test(this.currentLine)
|
||||
}
|
||||
|
||||
currentLineIsRunawayArgument() {
|
||||
@@ -103,7 +104,7 @@ export default class LatexParser {
|
||||
}
|
||||
|
||||
parseFileLineError() {
|
||||
const result = this.currentLine.match(/^(\/.*):(\d+): (.*)/)
|
||||
const result = this.currentLine.match(FILE_LINE_ERROR_REGEX)
|
||||
this.currentError = {
|
||||
line: result[2],
|
||||
file: result[1],
|
||||
|
||||
Reference in New Issue
Block a user