From 0d90955e7dfb338527c03519be064d90e165bbfb Mon Sep 17 00:00:00 2001 From: PhilippeChab Date: Sun, 22 Oct 2023 22:43:39 -0400 Subject: [PATCH] Fix struct tokenization --- server/src/Tokenizer/Tokenizer.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/src/Tokenizer/Tokenizer.ts b/server/src/Tokenizer/Tokenizer.ts index 5abde92..04c7d01 100644 --- a/server/src/Tokenizer/Tokenizer.ts +++ b/server/src/Tokenizer/Tokenizer.ts @@ -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)) ); }