File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed
src/Propel/Generator/Util Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -239,25 +239,28 @@ public function getNextStatement(): string
239239 $ lowercaseString = '' ; // helper variable for performance sake
240240 while ($ this ->pos <= $ this ->len ) {
241241 $ char = $ this ->sql [$ this ->pos ] ?? '' ;
242+
243+ $ newLine = !isset ($ this ->sql [$ this ->pos - 1 ]) || $ this ->sql [$ this ->pos - 1 ] === PHP_EOL ;
244+
242245 // Skip comments
243- if ($ isCommentLine === true && $ char !== PHP_EOL ) {
246+ if ($ isCommentLine === true ) {
244247 $ this ->pos ++;
248+ if ($ char === PHP_EOL ) {
249+ $ isCommentLine = false ; // end of comments line
250+ }
245251
246252 continue ;
247253 }
248254 // check flags for strings or escaper
249255 switch ($ char ) {
250256 case '# ' :
251257 // detect comment line
252- if ($ this ->sql [$ this ->pos --] === PHP_EOL ) {
258+ if ($ newLine === true && $ isCommentLine === false ) {
259+ $ this ->pos ++;
253260 $ isCommentLine = true ;
254261
255262 continue 2 ;
256263 }
257- case "\n" :
258- if ($ isCommentLine === true ) {
259- $ isCommentLine = false ;
260- }
261264
262265 break ;
263266 case '\\' :
You can’t perform that action at this time.
0 commit comments