File tree Expand file tree Collapse file tree 2 files changed +17
-3
lines changed Expand file tree Collapse file tree 2 files changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -103,15 +103,19 @@ module.exports = {
103
103
if ( ch == '"' ) {
104
104
return this . tok . T_CONSTANT_ENCAPSED_STRING ;
105
105
} else {
106
+ var prefix = 1 ;
107
+ if ( this . yytext [ 0 ] === 'b' || this . yytext [ 0 ] === 'B' ) {
108
+ prefix = 2 ;
109
+ }
106
110
if ( this . yytext . length > 2 ) {
107
111
this . appendToken (
108
112
this . tok . T_ENCAPSED_AND_WHITESPACE ,
109
- this . yytext . length - 1
113
+ this . yytext . length - prefix
110
114
) ;
111
115
}
112
- this . unput ( this . yytext . length - 1 ) ;
116
+ this . unput ( this . yytext . length - prefix ) ;
113
117
this . begin ( "ST_DOUBLE_QUOTES" ) ;
114
- return '"' ;
118
+ return this . yytext ;
115
119
}
116
120
} ,
117
121
Original file line number Diff line number Diff line change @@ -17,6 +17,16 @@ module.exports = {
17
17
}
18
18
} else {
19
19
id = this . tok . T_STRING ;
20
+ if ( token === 'b' || token === 'B' ) {
21
+ var ch = this . input ( 1 ) ;
22
+ if ( ch === '"' ) {
23
+ return this . ST_DOUBLE_QUOTES ( ) ;
24
+ } else if ( ch === '\'' ) {
25
+ return this . T_CONSTANT_ENCAPSED_STRING ( ) ;
26
+ } else {
27
+ this . unput ( 1 ) ;
28
+ }
29
+ }
20
30
}
21
31
}
22
32
return id ;
You can’t perform that action at this time.
0 commit comments