2
0
mirror of https://github.com/tenrok/BBob.git synced 2026-06-14 18:42:24 +03:00

fix(parser): tokenizer error with quotemark strings

This commit is contained in:
Nikolay Kostyurin
2018-07-11 23:37:51 +02:00
parent 3119314b07
commit 7f400506d4
6 changed files with 64 additions and 6 deletions
+10 -4
View File
@@ -167,9 +167,15 @@ const handleTagEnd = (token) => {
if (lastNestedNode) {
appendNode(lastNestedNode);
} else {
// eslint-disable-next-line no-console
console.warn(`Inconsistent tag '${getTokenValue(token)}' on line ${getTokenLine(token)} and column ${getTokenColumn(token)}`);
} else if (options.onError) {
const tag = getTokenValue(token);
const line = getTokenLine(token);
const column = getTokenColumn(token);
options.onError({
message: `Inconsistent tag '${tag}' on line ${line} and column ${column}`,
lineNumber: line,
columnNumber: column,
});
}
}
};
@@ -228,8 +234,8 @@ const parseToken = (token) => {
* @return {Array}
*/
const parse = (input, opts = {}) => {
tokenizer = createTokenizer(input, parseToken);
options = opts;
tokenizer = createTokenizer(input, parseToken);
nodes = [];
nestedNodes = [];