File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 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)
7777 }
7878
7979 protected function inStringOrCommentEnd ($ prev , $ char , $ charnext )
80+ {
81+ return $ this ->inString ($ char , $ prev ) || $ this ->inCommentEnd ($ charnext );
82+ }
83+
84+ protected function inString ($ char , $ prev )
8085 {
8186 if (0 === $ this ->comment && $ char === '" ' && $ prev !== '\\' ) {
8287 $ this ->inStr = !$ this ->inStr ;
8388 }
8489
90+ return $ this ->inStr ;
91+ }
92+
93+ protected function inCommentEnd ($ charnext )
94+ {
8595 if (!$ this ->inStr && 0 === $ this ->comment ) {
8696 $ this ->comment = $ charnext === '// ' ? 1 : ($ charnext === '/* ' ? 2 : 0 );
8797 }
8898
89- return $ this -> inStr || 0 === $ this ->comment ;
99+ return 0 === $ this ->comment ;
90100 }
91101
92102 protected function hasCommentEnded ($ char , $ charnext )
You can’t perform that action at this time.
0 commit comments