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

'\\' followed by '\"' incorrectly produces a parse error #17

Open
sysread opened this issue Dec 21, 2019 · 1 comment
Open

'\\' followed by '\"' incorrectly produces a parse error #17

sysread opened this issue Dec 21, 2019 · 1 comment

Comments

@sysread
Copy link

sysread commented Dec 21, 2019

Minimal test case:

my $parser = TOML::Parser->new;
chomp(my $toml = <DATA>);
my $data = $parser->parse($toml);
__DATA__
foo="bar=\\\"baz\\\""

This should produce a string value for foo of bar=\"baz\". The syntax is correct, with an escaped slash, \\, followed by an escaped quote, \".

Instead, TOML::Parser produces an error:

Syntax Error: line:1
foo="bar=\\"baz\\"" 
           ^

Separating the two slash-escaped characters avoids the spurious error:

__DATA__
foo="bar=\\ \"baz\\ \""
sysread pushed a commit to sysread/TOML-Parser that referenced this issue Dec 21, 2019
@sysread
Copy link
Author

sysread commented Dec 21, 2019

I have just sent a PR with a fix for this issue: #18

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

No branches or pull requests

1 participant