refactoring to ParserContext

This commit is contained in:
zadam
2020-05-21 11:46:01 +02:00
parent a8d12f723f
commit 75d8627f1c
4 changed files with 48 additions and 26 deletions

View File

@@ -0,0 +1,18 @@
"use strict";
class ParsingContext {
constructor(includeNoteContent) {
this.includeNoteContent = includeNoteContent;
this.highlightedTokens = [];
this.error = null;
}
addError(error) {
// we record only the first error, subsequent ones are usually consequence of the first
if (!this.error) {
this.error = error;
}
}
}
module.exports = ParsingContext;