"Unterminated String" error on Calculate()

Oct 8, 2014 at 9:02 PM
There is an issue with the "EnsureStringsAreWellFormed" function (seen below), whereby it's identifying a single quote within double quotes as a new "OpenedString".
private void EnsureStringsAreWellFormed(Token token, AnalyzingContext context)
        {
            if (!context.IsInString && token.TokenType == TokenType.String)
            {
                context.IsInString = true;
                context.OpenedStrings++;
            }
            else if (context.IsInString && token.TokenType == TokenType.String)
            {
                context.IsInString = false;
                context.ClosedStrings++;
            }
        }