File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change 1
1
import type { RegexElement } from './types' ;
2
2
import { characterClasses , isCharacterClass } from './character-classes' ;
3
+ import { compileChoiceOf } from './components/choiceOf' ;
3
4
import { baseQuantifiers , isBaseQuantifier } from './quantifiers/base' ;
4
5
import { compileRepeat } from './quantifiers/repeat' ;
5
6
@@ -38,6 +39,10 @@ function compileSingle(element: RegexElement): string {
38
39
return characterClasses [ element . type ] ;
39
40
}
40
41
42
+ if ( element . type === 'choiceOf' ) {
43
+ return compileChoiceOf ( element )
44
+ }
45
+
41
46
const compiledChildren = compileList ( element . children ) ;
42
47
43
48
if ( element . type === 'repeat' ) {
Original file line number Diff line number Diff line change @@ -8,6 +8,6 @@ export function choiceOf(...children: string[]): ChoiceOf {
8
8
} ;
9
9
}
10
10
11
- export function compileChoiceOf ( component : ChoiceOf ) : string {
12
- return wrapGroup ( component . children . join ( '|' ) ) ;
11
+ export function compileChoiceOf ( element : ChoiceOf ) : string {
12
+ return wrapGroup ( element . children . join ( '|' ) ) ;
13
13
}
You can’t perform that action at this time.
0 commit comments