File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -226,10 +226,22 @@ export const getParser =
226226
227227 if ( region && region . block ) {
228228 preserveProc = preserveProcs ( preserveProc , region , node , model ) ;
229+ if ( preserveProc === 0 && i === tokens . length - 1 ) {
230+ // force finish at file end
231+ const fakeNode : Token = { ...node , text : ";" , type : "sep" } ;
232+ if ( node . text . endsWith ( "\n\n" ) ) {
233+ // printer will add trailing new line
234+ fakeNode . end = { line : node . end . line - 1 , column : 0 } ;
235+ }
236+ preserveProc = preserveProcs ( 1 , region , fakeNode , model ) ;
237+ }
229238 if ( preserveProc >= 0 ) {
230239 continue ;
231240 }
232241 }
242+ if ( node . type === "embedded-code" ) {
243+ continue ;
244+ }
233245
234246 // --- Check for block start: DATA, PROC, %MACRO ---
235247 if ( node . type === "sec-keyword" || node . type === "macro-sec-keyword" ) {
You can’t perform that action at this time.
0 commit comments