Skip to content

Commit

Permalink
Fix struct tokenization
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilippeChab committed Oct 23, 2023
1 parent e1f4643 commit 0d90955
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions server/src/Tokenizer/Tokenizer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,9 +225,9 @@ export default class Tokenizer {
private isStructDeclaration(token: IToken, lastToken: IToken, lineIndex: number, tokensArrays: (IToken[] | undefined)[]) {
return (
token.scopes.includes(LanguageScopes.structIdentifier) &&
((lastToken.scopes.includes(LanguageScopes.structIdentifier) &&
lastToken.scopes.includes(LanguageScopes.blockDeclaraction)) ||
tokensArrays[lineIndex + 1]?.at(0)?.scopes.includes(LanguageScopes.blockDeclaraction))
((tokensArrays[lineIndex + 1]?.at(0)?.scopes.includes(LanguageScopes.blockDeclaraction) &&
lastToken.scopes.includes(LanguageScopes.structIdentifier)) ||
lastToken.scopes.includes(LanguageScopes.blockDeclaraction))
);
}

Expand Down

0 comments on commit 0d90955

Please sign in to comment.