Adds line number
This commit is contained in:
parent
d766e1c879
commit
d9a198079b
|
@ -27,7 +27,7 @@ function fetchData(path, start, end, callback) {
|
||||||
xhr.send();
|
xhr.send();
|
||||||
}
|
}
|
||||||
|
|
||||||
function parseLine(line) {
|
function parseLine(line, number) {
|
||||||
let element = {};
|
let element = {};
|
||||||
let split = line.split(/[ \t]+/);
|
let split = line.split(/[ \t]+/);
|
||||||
|
|
||||||
|
@ -125,7 +125,7 @@ function parseLine(line) {
|
||||||
return;
|
return;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
throw new Error(split[0] + " is not a defined macro");
|
throw new Error(split[0] + " is not a defined macro in line " + number);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -187,8 +187,8 @@ class Loader {
|
||||||
split[0] = this.remainder + split[0];
|
split[0] = this.remainder + split[0];
|
||||||
this.remainder = split.pop();
|
this.remainder = split.pop();
|
||||||
|
|
||||||
for (let line of split) {
|
for (let i = 0; i < split.length; i++) {
|
||||||
elements.push(parseLine(line));
|
elements.push(parseLine(split[i], i));
|
||||||
}
|
}
|
||||||
|
|
||||||
callback(elements);
|
callback(elements);
|
||||||
|
|
Loading…
Reference in New Issue