mitnk / cicada

An old-school bash-like Unix shell written in Rust
https://hugo.wang/cicada/
MIT License
981 stars 50 forks source link

Line parse issue - escape quotes inside quotes #10

Closed mitnk closed 6 years ago

mitnk commented 6 years ago

Case 1:

expected (bash):

$ echo '{"q": "{\"size\": 12}"}'
{"q": "{\"size\": 12}"}

actual (cicada 0.7.2):

$ echo '{"q": "{\"size\": 12}"}'
{"q": "{"size": 12}"}

Case 2:

expected:

$ echo '{\"size\": 12}'
{\"size\": 12}
$ echo '{\"size\": 12}' | wc -c
15

actual:

$ echo '{\"size\": 12}'
{"size": 12}
$ echo '{\"size\": 12}' | wc -c
13
mitnk commented 6 years ago

fixed.