Fix to ensure labels are not mistaken for comments (#7926)

Ensured labels are not mistaken for comments by skipping comment
filtering when the line matches a label definition

Added a regression test verifying that labels starting with “@” remain
visible even when comment filtering is enabled

Fixes #7889 

Tested with 
npm run lint
npm run ts-check
npm run test-min
npm run check-frontend-imports
make check
This commit is contained in:
Jacob Panov
2025-07-21 05:06:49 -04:00
committed by GitHub
parent 5edc911180
commit d9a124fe8d
2 changed files with 14 additions and 0 deletions

View File

@@ -43,6 +43,17 @@ describe('AsmParser tests', () => {
});
});
describe('AsmParser comment filtering', () => {
const parser = new AsmParser();
it('should keep label lines starting with @ when filtering comments', () => {
const input = '@cube@4:\n ret';
const result = parser.processAsm(input, {commentOnly: true});
const lines = result.asm.map(line => line.text);
expect(lines[0]).toBe('@cube@4:');
expect(lines[1]).toBe(' ret');
});
});
describe('PTXAsmParser tests', () => {
const parser = new PTXAsmParser();