The previous logic would fail with multiple regexes as the parsing expression was too greedy. Simply making it ungreedy would then fail regular expressions that have a nested, escaped slash. Introducing a small Scanner class fixes this.
Also adds parse and eval subcommands to the binary travis-conditions (with eval being the only behaviour previously), so we can use it to inspect the resulting AST.
Should fix https://github.com/travis-ci/travis-conditions/issues/10
The previous logic would fail with multiple regexes as the parsing expression was too greedy. Simply making it ungreedy would then fail regular expressions that have a nested, escaped slash. Introducing a small Scanner class fixes this.
Also adds
parse
andeval
subcommands to the binarytravis-conditions
(witheval
being the only behaviour previously), so we can use it to inspect the resulting AST.