idank / bashlex

Python parser for bash
GNU General Public License v3.0
552 stars 94 forks source link

Fix bashlex to parse whole test file #5

Closed Jurisak closed 7 years ago

Jurisak commented 8 years ago

Hi, i have problems to parse whole test file. The problems are that bashlex hates empty lines and comments. Could you please fix it? I really would like to use it. Thanks

idank commented 8 years ago

Can you give an example? Thanks.

Jurisak commented 8 years ago

if test -e /etc/passwd; then echo "Alright man..." >&2 else echo "Yuck! Where is it??" >&2 exit 1 fi

if test -e /etc/passwd; then echo "Alright man..." >&2 else echo "Yuck! Where is it??" >&2 exit 1 fi

For example empty space between two conditions. Same result will be with comment.

Jurisak commented 8 years ago

And also fails on first line which in most cases is shebang...

thmo commented 7 years ago

This is a duplicate of #1 (comments) and #2 (empty lines), I think.

idank commented 7 years ago

Yeah, looks like it. Thanks.