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

feat(parser): optimize size

This commit is contained in:
Nikolay Kostyurin
2018-07-14 01:50:33 +02:00
parent 0bea22d3ca
commit 4c8dbed95f
4 changed files with 37 additions and 66 deletions
+1 -18
View File
@@ -339,27 +339,10 @@ class Tokenizer {
}
isTokenNested(token) {
const value = getChar(OPEN_BRAKET) + getChar(SLASH) + Token.getTokenValue(token);
const value = getChar(OPEN_BRAKET) + getChar(SLASH) + token.getValue();
return this.buffer.indexOf(value) > -1;
}
}
new Tokenizer('[ [g]G[/g] ]').tokenize()
module.exports = Tokenizer;
module.exports.createTokenOfType = createTokenOfType;
module.exports.TYPE = {
WORD: Token.TYPE_WORD,
TAG: Token.TYPE_TAG,
ATTR_NAME: Token.TYPE_ATTR_NAME,
ATTR_VALUE: Token.TYPE_ATTR_VALUE,
SPACE: Token.TYPE_SPACE,
NEW_LINE: Token.TYPE_NEW_LINE,
};
module.exports.TOKEN = {
TYPE_ID: Token.TYPE_ID,
VALUE_ID: Token.VALUE_ID,
LINE_ID: Token.LINE_ID,
COLUMN_ID: Token.COLUMN_ID,
};