File tree 1 file changed +11
-1
lines changed
1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -77,16 +77,26 @@ protected function getSegments($json)
77
77
}
78
78
79
79
protected function inStringOrCommentEnd ($ prev , $ char , $ charnext )
80
+ {
81
+ return $ this ->inString ($ char , $ prev ) || $ this ->inCommentEnd ($ charnext );
82
+ }
83
+
84
+ protected function inString ($ char , $ prev )
80
85
{
81
86
if (0 === $ this ->comment && $ char === '" ' && $ prev !== '\\' ) {
82
87
$ this ->inStr = !$ this ->inStr ;
83
88
}
84
89
90
+ return $ this ->inStr ;
91
+ }
92
+
93
+ protected function inCommentEnd ($ charnext )
94
+ {
85
95
if (!$ this ->inStr && 0 === $ this ->comment ) {
86
96
$ this ->comment = $ charnext === '// ' ? 1 : ($ charnext === '/* ' ? 2 : 0 );
87
97
}
88
98
89
- return $ this -> inStr || 0 === $ this ->comment ;
99
+ return 0 === $ this ->comment ;
90
100
}
91
101
92
102
protected function hasCommentEnded ($ char , $ charnext )
You can’t perform that action at this time.
0 commit comments