bashcov
bashcov copied to clipboard
Use Bison for lexer?
We're currently parsing multiline strings using horrible regexpes. I'd like to keep lexer.rb simple but it might be worth using Bison and the BNF definition of the Bash grammar next time we run into a regexp issue...
Been playing around with FFI and https://github.com/mvdan/sh -- nothing beats Bash for parsing Bash, but mvdan/sh has a pretty slick interface that makes it easy to take a parse tree and turn it into a mapping of lineno => relevant?. Will update again if/when I make any promising progress.
@tomeon https://github.com/mvdan/sh looks neat indeed. Perhaps Bashcov should be rewritten in Go and leverage it without FFI! Just (half) joking. Personally, I've been moving away from Ruby as you might have noticed, especially since I got addicted to Elm...