File tree 2 files changed +14
-14
lines changed
2 files changed +14
-14
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ function encode(str) {
6
6
return str
7
7
. replace ( / \\ / g, '\\\\' )
8
8
. replace ( / ` / g, '\\`' )
9
+ . replace ( / \$ \{ / g, '$\\{' )
9
10
. trim ( ) ;
10
11
}
11
12
Original file line number Diff line number Diff line change 2
2
const globby = require ( 'globby' ) ;
3
3
const fs = require ( 'fs' ) ;
4
4
5
- var kernel = fs . readFileSync ( 'jison-lexer-kernel.js' , 'utf8' ) ;
6
- kernel = kernel
7
- . replace ( / \\ / g, '\\\\' )
8
- . replace ( / ` / g, '\\`' )
9
- // strip header comment too:
10
- . replace ( / ^ [ ^ { ] * / , '' )
11
- . replace ( / [ \s \r \n ] + $ / , '' ) // rtrim()
12
- ;
13
-
14
- var errorClassCode = fs . readFileSync ( 'jison-lexer-error-code.js' , 'utf8' ) ;
15
- errorClassCode = errorClassCode
16
- . replace ( / \\ / g, '\\\\' )
17
- . replace ( / ` / g, '\\`' )
18
- . trim ( ) ;
5
+ function encode ( str ) {
6
+ return str
7
+ . replace ( / \\ / g, '\\\\' )
8
+ . replace ( / ` / g, '\\`' )
9
+ . replace ( / \$ \{ / g, '$\\{' )
10
+ . trim ( ) ;
11
+ }
12
+
13
+ var kernel = encode ( fs . readFileSync ( 'jison-lexer-kernel.js' , 'utf8' ) )
14
+ // strip header comment too:
15
+ . replace ( / ^ [ ^ { ] * / , '' ) ;
16
+
17
+ var errorClassCode = encode ( fs . readFileSync ( 'jison-lexer-error-code.js' , 'utf8' ) ) ;
19
18
20
19
globby ( [ 'regexp-lexer.js' ] ) . then ( paths => {
21
20
var count = 0 ;
You can’t perform that action at this time.
0 commit comments