Skip to content

Commit

Permalink
add same change for p1 semantic parser (#include highlight) (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
ironsheep committed May 10, 2024
1 parent ac32c3e commit 936b10e
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions spin2/server/src/parser/spin1.documentSemanticParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1480,6 +1480,25 @@ export class Spin1DocumentSemanticParser {
});
}
}
const lineHasFilename: boolean = directive.toLowerCase() == '#include';
if (lineHasFilename) {
const openQuoteOffset: number = line.indexOf('"');
if (openQuoteOffset != -1) {
const closeQuoteOffset: number = line.indexOf('"', openQuoteOffset + 1);
if (closeQuoteOffset != -1) {
const symbolLength = closeQuoteOffset - openQuoteOffset + 1;
// record an filename
this._recordToken(tokenSet, line, {
line: lineIdx,
startCharacter: openQuoteOffset,
length: symbolLength,
ptTokenType: 'filename',
ptTokenModifiers: []
});
this._logPreProc(` -- filename=[${line.substring(openQuoteOffset, closeQuoteOffset + 1)}]`);
}
}
}
}
} else {
// DO NOTHING we don't highlight these (flexspin support not enabled)
Expand Down

0 comments on commit 936b10e

Please sign in to comment.