Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better parsing of double quoted texts. #374

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

sgoodgrove
Copy link

This should resolve DbUp/dbup-sqlserver#3 by supporting double quoted strings in the same manner as single quoted strings. It may be that IsDoubleQuote should be a protected member, but that throws out the API tests for changes to the public signature.

@droyad droyad self-assigned this Sep 12, 2019
@droyad droyad added this to the 4.3.0 milestone Sep 12, 2019
@droyad
Copy link
Member

droyad commented Sep 12, 2019

@jburger or @AdrianJSClark Could you have a quick look at this? From what I can see it shouldn't break anything, but this parser always make me nervous.

@@ -355,6 +364,7 @@ private bool IsEndOfSlashStarComment
/// </summary>
private void ReadQuotedString()
{
var quoteChar = CurrentChar;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
var quoteChar = CurrentChar;
var currentQuoteChar = CurrentChar;

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This variable naming makes more sense to me, especially further down where it is used. YMMV - happy to leave it as-is.

@@ -364,7 +374,7 @@ private void ReadQuotedString()
Read();
}
ReadCharacter(CharacterType.QuotedString, CurrentChar);
if (IsQuote)
if (CurrentChar == quoteChar)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (CurrentChar == quoteChar)
if (CurrentChar == currentQuoteChar)

@droyad droyad removed this from the 4.3.0 milestone Nov 26, 2019
@sungam3r
Copy link
Member

@sgoodgrove Please rebase onto master if you are still interested.

@sungam3r sungam3r added the needs confirmation An issue or pull request await confirmation from their author label Aug 21, 2023
@sgoodgrove
Copy link
Author

@sungam3r this is not a huge issue for me, but happy to update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs confirmation An issue or pull request await confirmation from their author
Projects
Status: Bugs
Development

Successfully merging this pull request may close these issues.

Combination of double quotes, asterisks, and GO command breaks deployment
5 participants