@@ -61,11 +61,11 @@ function getNodeMatchText(rule: any): string {
6161 for ( const patternIndex in rule . patterns ) {
6262 const pattern = rule . patterns [ patternIndex ] ;
6363 if ( pattern . include !== null ) {
64- patterns . push ( "(?" + pattern . include + ")" ) ;
64+ patterns . push ( `(? ${ pattern . include } )` ) ;
6565 }
6666 }
6767
68- return " (?:" + patterns . join ( "|" ) + ")" ;
68+ return ` (?:${ patterns . join ( "|" ) } )` ;
6969 } else {
7070 return "" ;
7171 }
@@ -149,8 +149,8 @@ function visitAllMatchesInRule(rule: any, action: (match: any) => any) {
149149 * @param key Base key of the property to be transformed.
150150 */
151151function expandPatternMatchProperties ( rule : any , key : "begin" | "end" ) {
152- const patternKey = key + " Pattern" ;
153- const capturesKey = key + " Captures" ;
152+ const patternKey = ` ${ key } Pattern` ;
153+ const capturesKey = ` ${ key } Captures` ;
154154 const pattern = rule [ patternKey ] ;
155155 if ( pattern !== undefined ) {
156156 const patterns : string [ ] = Array . isArray ( pattern ) ? pattern : [ pattern ] ;
@@ -207,7 +207,7 @@ function transformFile(yaml: any) {
207207 } ) ;
208208
209209 if ( yaml . regexOptions !== undefined ) {
210- const regexOptions = "(?" + yaml . regexOptions + ")" ;
210+ const regexOptions = `(? ${ yaml . regexOptions } )` ;
211211 visitAllRulesInFile ( yaml , ( rule ) => {
212212 visitAllMatchesInRule ( rule , ( match ) => {
213213 return regexOptions + match ;
0 commit comments