Hello,
When i parse a .vdf file with a string that begin with "[{" and end with "]" i got a NoValidToken error.
I created a reproducer (provided bellow).
This bug occurs when i want to ignore some fields, "foo1" and "foo2" in my example.
When only "foo2" is ignored everything work, but when "foo1" is ignore i got the NoValidToken error.
I observe the same thing with "foo1" "[{bar1]".
The bug don't occur when the field "foo1" is parsed as a string.
Error
called `Result::unwrap()` on an `Err` value: NoValidToken(NoValidTokenError { err_span: SourceSpan { offset: SourceOffset(38), length: 1 }, expected: [Item, QuotedItem, Statement, QuotedStatement, GroupEnd], src: "\n \"foo\" \"bar\"\n \"foo1\" \"[{]\"\n \"foo2\" \"bar2\"\n " })
Reproducer
useserde::Deserialize;usevdf_reader::from_str;#[derive(Debug, Deserialize)]#[allow(dead_code)]struct Test{foo: String,// foo1: String, /* NOTE: comment this line to produce the bug */
}fn main(){letfile_content=r#"
"foo" "bar"
"foo1" "[{]"
"foo2" "bar2"
"#;letoutput: Test=from_str(&file_content).unwrap();println!("label: {}",output.foo);}
Hello,
When i parse a `.vdf` file with a string that begin with "[{" and end with "]" i got a NoValidToken error.
I created a reproducer (provided bellow).
This bug occurs when i want to ignore some fields, `"foo1"` and `"foo2"` in my example.
When only `"foo2"` is ignored everything work, but when `"foo1"` is ignore i got the NoValidToken error.
I observe the same thing with `"foo1" "[{bar1]"`.
The bug don't occur when the field `"foo1"` is parsed as a string.
## Error
```txt
called `Result::unwrap()` on an `Err` value: NoValidToken(NoValidTokenError { err_span: SourceSpan { offset: SourceOffset(38), length: 1 }, expected: [Item, QuotedItem, Statement, QuotedStatement, GroupEnd], src: "\n \"foo\" \"bar\"\n \"foo1\" \"[{]\"\n \"foo2\" \"bar2\"\n " })
```
## Reproducer
```rs
use serde::Deserialize;
use vdf_reader::from_str;
#[derive(Debug, Deserialize)]
#[allow(dead_code)]
struct Test {
foo: String,
// foo1: String, /* NOTE: comment this line to produce the bug */
}
fn main() {
let file_content = r#"
"foo" "bar"
"foo1" "[{]"
"foo2" "bar2"
"#;
let output: Test = from_str(&file_content).unwrap();
println!("label: {}", output.foo);
}
```