Skip to content

Commit 48a94ef

Browse files
committed
refactor(parser): rename files and add docs
1 parent 57f122d commit 48a94ef

File tree

5 files changed

+273
-233
lines changed

5 files changed

+273
-233
lines changed

__tests__/matcher/path-parser.spec.ts

+5-6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
1-
import {
2-
tokenizePath,
3-
TokenType,
4-
tokensToParser,
5-
} from '../../src/matcher/tokenizer'
1+
import { tokenizePath, TokenType } from '../../src/matcher/path-tokenizer'
2+
import { tokensToParser } from '../../src/matcher/path-parser-ranker'
63

74
describe('Path parser', () => {
85
describe('tokenizer', () => {
@@ -28,6 +25,8 @@ describe('Path parser', () => {
2825
])
2926
})
3027

28+
// not sure how useful this is and if it's worth supporting because of the
29+
// cost to support the ranking as well
3130
it.skip('groups', () => {
3231
expect(tokenizePath('/one{-b_:id}')).toEqual([
3332
[
@@ -43,7 +42,7 @@ describe('Path parser', () => {
4342
])
4443
})
4544

46-
// TODO: add test when groups exist
45+
// same as above
4746
it.skip('escapes } inside group', () => {
4847
expect(tokenizePath('/{\\{}')).toEqual([
4948
[{ type: TokenType.Static, value: '{' }],

__tests__/matcher/path-ranking.spec.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1+
import { tokenizePath } from '../../src/matcher/path-tokenizer'
12
import {
23
tokensToParser,
3-
tokenizePath,
44
comparePathParserScore,
5-
} from '../../src/matcher/tokenizer'
5+
} from '../../src/matcher/path-parser-ranker'
66

77
type PathParserOptions = Parameters<typeof tokensToParser>[1]
88

0 commit comments

Comments
 (0)