Skip to content

Commit 13fe793

Browse files
committed
fix issue with ast line count being off when the file starts with empty lines
1 parent 6a2fb34 commit 13fe793

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Resources/OSL Utils.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2151,7 +2151,7 @@ class OSLUtils {
21512151
}
21522152
let line = 0;
21532153
// Normalize line endings to Unix-style (\n) to handle Windows/Mac differences
2154-
CODE = this.normalizeLineEndings(String(CODE).trim());
2154+
CODE = this.normalizeLineEndings(String(CODE));
21552155
let result = MAIN ? `/@line ${++line}\n` : "";
21562156
let lastIndex = 0;
21572157

@@ -4366,7 +4366,7 @@ if (typeof Scratch !== "undefined") {
43664366

43674367
const code = 'state.folder_sidebar = !state.folder_sidebar'
43684368

4369-
const result = utils.lintSyntax({CODE: code});
4369+
const result = utils.generateFullAST({CODE: code});
43704370

43714371
fs.writeFileSync("lol.json", JSON.stringify(result, null, 2));
43724372
}

0 commit comments

Comments
 (0)