Closed ihh closed 6 years ago
This is a showstopper: https://github.com/mndrix/regex/issues/7
We can use http://www.swi-prolog.org/pldoc/doc_for?object=section(%27packages/pcre.html%27) as suggested in the ticket. This is now bundled by default in the stable 7.6.x series. Some users may need to upgrade their swi-prolog installation.
I'm being dense, I can't figure out how the regex test passes, if ^
doesn't work.. it looks like your PR introduces the dependency but doesn't actually extend the grammar, so the test passes by an accident of mis-parsing...?
The test passes because, I think, the prefix notation =~(TEXT,REGEX)
works but the infix notation TEXT =~ REGEX
doesn't, or maybe it's something about quoting the REGEX when it begins with a caret... not sure... anyway it's moot because I actually wanted to go with pcre (I tried it first and failed), I should have checked with a more recent build. I've now amended the PR to use pcre, see what you think.
Looks great
And doh, I was scanning the gnumake_parser code for =~
, but I forgot that the mndrix lib used infix and that {...}
executed prolog, all makes sense now
btw the modifications to queue.pl have nothing to do with the regex extension, they're about implementing the $(SHELL)
variable (see #54), I rolled them into this branch by accident...
for the record, the syntax is now (in line with PCRE)
test_$(ABC): { re_match(ABC,'^a') }
echo Fired rule for $@ >$@
Goodbye to the =~
operator...
Allows matching of Perl-style regexes in Prolog blocks, via https://github.com/mndrix/regex
This will fire for
test_apple
but nottest_cat
ortest_APPLE
.Introduces external dependency on https://github.com/mndrix/regex