grncdr / js-shell-parse

parse bash, with javascript (UNMAINTAINED)
MIT License
90 stars 13 forks source link

Parse arithmetic #14

Open forivall opened 8 years ago

forivall commented 8 years ago

I feel like this is ready for initial PR review. There's still cleanup todo, there's still one failing arithmetic test case (but it's because it has to do with escaped newlines, which requires fixes elsewhere, to discuss), but otherwise, it works.

I also need feedback on the names of nodes; i roughly named them after estree, but the consistency changed later on as I reused existing rules.

It's also a lot looser than what zsh or bash allows, w.r.t. strings inside of arithmetic expressions -- i need to see what shellcheck bases these tests on, or if there's specific flags in bash/zsh to allow strings / concatenation in arithmetic expressions.

:tada: