bashcov icon indicating copy to clipboard operation
bashcov copied to clipboard

Use Bison for lexer?

Open infertux opened this issue 8 years ago • 2 comments

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...

infertux avatar Feb 08 '17 21:02 infertux

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 avatar Jan 09 '19 04:01 tomeon

@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...

infertux avatar Jan 10 '19 05:01 infertux