Skip to content

Conversation

@kartben
Copy link
Contributor

@kartben kartben commented Jan 5, 2025

Commit 2dad7c0 (PR #2767) introduced regression in the handling of strings with double quotes.

The bug was even "featured" in the golden for test_quoted_entries.txt since key 2 attribute was improperly parsed as literal string "key 2 = ".

---input---
[section]
key 1 = "value1"
key 2 = "value2" # comment
key 3 = "value3 ; value 3bis" ; comment
---tokens---
'[section]' Keyword
'\n ' Text.Whitespace
'key 1' Name.Attribute
' ' Text.Whitespace
'=' Operator
' ' Text.Whitespace
'"' Literal.String
'value1' Literal.String
'"' Literal.String
'\n ' Text.Whitespace
'key 2 = ' Literal.String

Commit 2dad7c0 introduced regression in the handling of strings with double quotes. The bug was even "featured" in the golden for test_quoted_entries.txt since `key 2` attribute was improperly parsed as literal string "key 2 = ". Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
@kartben kartben marked this pull request as draft January 5, 2025 21:08
@Anteru Anteru added this to the 2.19.1 milestone Jan 6, 2025
@Anteru Anteru added the A-lexing area: changes to individual lexers label Jan 6, 2025
@Anteru Anteru marked this pull request as ready for review January 6, 2025 07:52
@Anteru Anteru merged commit a985866 into pygments:master Jan 6, 2025
@Anteru
Copy link
Collaborator

Anteru commented Jan 6, 2025

Thanks a lot for the PR!

@kartben
Copy link
Contributor Author

kartben commented Jan 6, 2025

Thanks a lot for the PR!

@Anteru Oh wow, didn't expect this to be merged as it was still in draft (but thanks, I guess!) :) There's, I think, several other issues with the current implementation that I was hoping to address, in addition to adding the snippets allowing to add the missing test coverage

ex:

 key 4 = { "abc" = "def" } key 5 = "hello 'world'" 

"key 4" would be to have coverage for what @ThomasWaldmann mentioned in #2834, which is still not quite right, by a fair margin :)

image
@Anteru
Copy link
Collaborator

Anteru commented Jan 6, 2025

But that's not really an ini file at that stage. Feels more like you'll want TOML or something else at that point?

@kartben
Copy link
Contributor Author

kartben commented Jan 6, 2025

But that's not really an ini file at that stage. Feels more like you'll want TOML or something else at that point?

ya, true -- given there's no common / agreed upon grammar for .ini files anyway, I think it's fair to say there will always be corner cases

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-lexing area: changes to individual lexers

2 participants