mirror of
https://github.com/zadam/trilium.git
synced 2025-11-08 22:35:50 +01:00
refactoring to ParserContext
This commit is contained in:
18
src/services/search/parsing_context.js
Normal file
18
src/services/search/parsing_context.js
Normal 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;
|
||||
Reference in New Issue
Block a user