-
Notifications
You must be signed in to change notification settings - Fork 39
Description
Hey, awesome job on bash-parser. I'm finding this extremely useful in my own work.
I've run into an issue when parsing ) and $ characters in quoted strings. Let me give an example to help explain.
Consider the following line:
command="$(echo "$input" | sed -e "s/^[ \t]*\([^ \t]*\)[ \t]*.*$/\1/g")"
This line is a part of a larger, more complex bash script I'm analyzing. There are actually two (2) issues here.
- At column 64, the
$causes an error. - At column 55, the
)causes an error.
Removing the $ leads the parser to believe the ) at column 55 is the closing parentheses rather than a string literal.
Both issues boil down to line 50 in double-quoting.js, where reducers is undefined.
I understand this is a strange case since the issue here exists in parsing a string pattern. I'm honestly not too sure how to go about addressing this yet. If I come up with anything I'll make sure to comment here. Also, if you have any ideas please share them, I'd be happy to work on a fix as soon as I think of the best way to handle these cases.