private void EnsureParenthesesAreWellFormed(Token token, AnalyzingContext context) { if (token.TokenTypeIsSet(TokenType.OpeningParenthesis)) { context.NumberOfOpenedParentheses++; } else if (token.TokenTypeIsSet(TokenType.ClosingParenthesis)) { context.NumberOfClosedParentheses++; } }
private void EnsureStringsAreWellFormed(Token token, AnalyzingContext context) { if (!context.IsInString && token.TokenTypeIsSet(TokenType.String)) { context.IsInString = true; context.OpenedStrings++; } else if (context.IsInString && token.TokenTypeIsSet(TokenType.String)) { context.IsInString = false; context.ClosedStrings++; } }