Fix backslash before closing quote parsing issue#3
Fix backslash before closing quote parsing issue#3chelog wants to merge 2 commits intop0358:masterfrom
Conversation
Fixes edge case with value ending with a backslash, even escaped:
```
"UserLocalConfigStore"
{
"friends"
{
"9734658" "Grocel"
"5318652" "/Hexalitos\\" <-- this one
"19358028" "put in"
}
}
```
```
SyntaxError: VDF.parse: invalid syntax on line 8:
"
```
As an additional bonus, adds strict comparison in this line where it's appropriate
|
Unfortunately in my tests this still breaks. Analogous to your example: gets parsed as Then pasting your exact example (minus the I did dig deeper into KeyValues syntax and parsing and found out it can be switched into two different parsing modes related to escape sequences, so sadly parsing this properly and consistently with Source will require a bigger and more thorough update*. I'll need to sit on this again and do it finally, maybe tomorrow... *which I tried to do some weeks ago, but put it away after a few hours when my head started aching xd |
|
Well these regex'es are pain in the ass agree haha. I rewrote the lib in TS so maybe there are some other changes that fixed as mine app works fine. I'll have a look later and update the PR |
|
@p0358 I just stumbled upon this old PR and gave a chance to retry the tests. I think you made a mistake and used JS string like that: Which is actually this for VDF: Obviously this fails to be parsed. And this fails for your |



Fixes edge case with value ending with a backslash, even escaped:
As an additional bonus, adds strict comparison in this line where it's appropriate