Skip to content

Commit

Permalink
fix: benchmark imports
Browse files Browse the repository at this point in the history
  • Loading branch information
JiLiZART committed Oct 30, 2023
1 parent 67beb89 commit 2f639eb
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 8 deletions.
2 changes: 1 addition & 1 deletion benchmark/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ suite
});
})
.add('@bbob/parser lexer old', () => {
const lexer1 = require('@bbob/parser/src/lexer_old');
const lexer1 = require('./lexer_old');

return require('@bbob/parser').parse(stub, {
onlyAllowTags: ['ch'],
Expand Down
13 changes: 6 additions & 7 deletions packages/bbob-parser/src/lexer_old.js → benchmark/lexer_old.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable no-plusplus,no-param-reassign */
import {
const {
OPEN_BRAKET,
CLOSE_BRAKET,
QUOTEMARK,
Expand All @@ -9,12 +9,12 @@ import {
TAB,
EQ,
N,
} from '@bbob/plugin-helper';
} = require('@bbob/plugin-helper');

import {
const {
Token, TYPE_ATTR_NAME, TYPE_ATTR_VALUE, TYPE_NEW_LINE, TYPE_SPACE, TYPE_TAG, TYPE_WORD,
} from './Token';
import { createCharGrabber, trimChar, unquote } from './utils';
} = require('@bbob/parser/Token');
const { createCharGrabber, trimChar, unquote } = require('@bbob/parser/utils');

// for cases <!-- -->
const EM = '!';
Expand Down Expand Up @@ -238,5 +238,4 @@ function createLexer(buffer, options = {}) {
};
}

export const createTokenOfType = createToken;
export { createLexer };
module.exports.createLexer = createLexer;
1 change: 1 addition & 0 deletions benchmark/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
},
"dependencies": {
"@bbob/parser": "workspace:*",
"@bbob/plugin-helper": "workspace:*",
"benchmark": "2.1.4",
"picocolors": "1.0.0",
"xbbcode-parser": "0.1.2",
Expand Down
7 changes: 7 additions & 0 deletions packages/bbob-parser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@
"require": "./lib/Token.js",
"browser": "./dist/index.min.js",
"umd": "./dist/index.min.js"
},
"./utils": {
"types": "./types/utils.d.ts",
"import": "./es/utils.js",
"require": "./lib/utils.js",
"browser": "./dist/index.min.js",
"umd": "./dist/index.min.js"
}
},
"homepage": "https://github.com/JiLiZART/bbob",
Expand Down
3 changes: 3 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 2f639eb

Please sign in to comment.