mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Upgrade parser.
This commit is contained in:
parent
9281d8029d
commit
170d3f646b
1 changed files with 16 additions and 2 deletions
|
@ -1,6 +1,6 @@
|
||||||
// Generated by CoffeeScript 1.10.0
|
// Generated by CoffeeScript 1.10.0
|
||||||
define(function() {
|
define(function() {
|
||||||
var BibLogParser, LINE_SPLITTER_REGEX, MESSAGE_LEVELS, MULTILINE_ERROR_REGEX, MULTILINE_WARNING_REGEX, SINGLELINE_WARNING_REGEX, consume;
|
var BAD_CROSS_REFERENCE_REGEX, BibLogParser, LINE_SPLITTER_REGEX, MESSAGE_LEVELS, MULTILINE_ERROR_REGEX, MULTILINE_WARNING_REGEX, SINGLELINE_WARNING_REGEX, consume;
|
||||||
LINE_SPLITTER_REGEX = /^\[(\d+)].*>\s(INFO|WARN|ERROR)\s-\s(.*)$/;
|
LINE_SPLITTER_REGEX = /^\[(\d+)].*>\s(INFO|WARN|ERROR)\s-\s(.*)$/;
|
||||||
MESSAGE_LEVELS = {
|
MESSAGE_LEVELS = {
|
||||||
"INFO": "info",
|
"INFO": "info",
|
||||||
|
@ -35,9 +35,10 @@ define(function() {
|
||||||
MULTILINE_WARNING_REGEX = /^Warning--(.+)\n--line (\d+) of file (.+)$/m;
|
MULTILINE_WARNING_REGEX = /^Warning--(.+)\n--line (\d+) of file (.+)$/m;
|
||||||
SINGLELINE_WARNING_REGEX = /^Warning--(.+)$/m;
|
SINGLELINE_WARNING_REGEX = /^Warning--(.+)$/m;
|
||||||
MULTILINE_ERROR_REGEX = /^(.*)---line (\d+) of file (.*)\n([^]+?)\nI'm skipping whatever remains of this entry$/m;
|
MULTILINE_ERROR_REGEX = /^(.*)---line (\d+) of file (.*)\n([^]+?)\nI'm skipping whatever remains of this entry$/m;
|
||||||
|
BAD_CROSS_REFERENCE_REGEX = /^(A bad cross reference---entry ".+?"\nrefers to entry.+?, which doesn't exist)$/m;
|
||||||
(function() {
|
(function() {
|
||||||
this.parseBibtex = function() {
|
this.parseBibtex = function() {
|
||||||
var multiLineErrors, multiLineWarnings, ref, ref1, ref2, remainingText, result, singleLineWarnings;
|
var crossReferenceErrors, multiLineErrors, multiLineWarnings, ref, ref1, ref2, ref3, remainingText, result, singleLineWarnings;
|
||||||
result = {
|
result = {
|
||||||
all: [],
|
all: [],
|
||||||
errors: [],
|
errors: [],
|
||||||
|
@ -84,6 +85,19 @@ define(function() {
|
||||||
}), multiLineErrors = ref2[0], remainingText = ref2[1];
|
}), multiLineErrors = ref2[0], remainingText = ref2[1];
|
||||||
result.all = result.all.concat(multiLineErrors);
|
result.all = result.all.concat(multiLineErrors);
|
||||||
result.errors = multiLineErrors;
|
result.errors = multiLineErrors;
|
||||||
|
ref3 = consume(remainingText, BAD_CROSS_REFERENCE_REGEX, function(match) {
|
||||||
|
var fullMatch, message;
|
||||||
|
fullMatch = match[0], message = match[1];
|
||||||
|
return {
|
||||||
|
file: null,
|
||||||
|
level: "error",
|
||||||
|
message: message,
|
||||||
|
line: null,
|
||||||
|
raw: fullMatch
|
||||||
|
};
|
||||||
|
}), crossReferenceErrors = ref3[0], remainingText = ref3[1];
|
||||||
|
result.all = result.all.concat(crossReferenceErrors);
|
||||||
|
result.errors = result.errors.concat(crossReferenceErrors);
|
||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
this.parseBiber = function() {
|
this.parseBiber = function() {
|
||||||
|
|
Loading…
Reference in a new issue