-
Notifications
You must be signed in to change notification settings - Fork 535
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
base: main
Are you sure you want to change the base?
Conversation
@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. |
src/dbup-core/Support/SqlParser.cs
Outdated
@@ -355,6 +364,7 @@ private bool IsEndOfSlashStarComment | |||
/// </summary> | |||
private void ReadQuotedString() | |||
{ | |||
var quoteChar = CurrentChar; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
var quoteChar = CurrentChar; | |
var currentQuoteChar = CurrentChar; |
There was a problem hiding this comment.
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.
src/dbup-core/Support/SqlParser.cs
Outdated
@@ -364,7 +374,7 @@ private void ReadQuotedString() | |||
Read(); | |||
} | |||
ReadCharacter(CharacterType.QuotedString, CurrentChar); | |||
if (IsQuote) | |||
if (CurrentChar == quoteChar) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (CurrentChar == quoteChar) | |
if (CurrentChar == currentQuoteChar) |
@sgoodgrove Please rebase onto |
@sungam3r this is not a huge issue for me, but happy to update. |
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.