Skip to content

Conversation

@616c
Copy link
Contributor

@616c 616c commented Jul 18, 2025

fixed two bugs in magic parser in two separate commits:

  • escaped backslash (was wrongly translated to '\\')
  • empty quoted strings (were not possible)

616c added 2 commits July 18, 2025 12:29
im magic parameters, an escaped backslash '\\'
should be replaced by a single backslash, not by
a two backslashes
in magics parameters, a quoted string should be
able to be empty: "", so the check for current's length
greater than 0 was removed
@andrus
Copy link
Contributor

andrus commented Jul 18, 2025

Thanks for the PR. Could you add some unit tests to MagicParserTest to demonstrate the conditions being addressed?

616c added 2 commits July 18, 2025 14:39
Test for
- escaped backslash
- quoted empty string
@616c
Copy link
Contributor Author

616c commented Jul 18, 2025

Done.
Thank you for considering the changes!

@andrus andrus merged commit 7dadbc3 into dflib:main Jul 19, 2025
@andrus
Copy link
Contributor

andrus commented Jul 19, 2025

Thanks for the PR. Just to test the end user experience, I wrote a little dummy %echo magic, comparing the "before" and "after" outputs, and clearly it wasn't doing the right thing previously.

image

@andrus andrus changed the title Magic parser fixes Magic parser - handling escapes and empty strings Jul 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants