whateverable
whateverable copied to clipboard
More ways to trigger evalable
<seatek> say '123abcg' ~~ /<xdigit + [g]>+/
<seatek> m:say '123abcg' ~~ /<xdigit + [g]>+/
<seatek> m: say '123abcg' ~~ /<xdigit + [g]>+/
<camelia> rakudo-moar 906719: OUTPUT«5===SORRY!5=== Error while compiling <tmp>â€Quantifier quantifies nothingâ€at <tmp>:1â€------> 3say '123abcg' ~~ /<xdigit +7â5 [g]>+/â€Â»
m:
without a space should work. Also, perhaps it should be able to figure out that say âŠsomethingâŠ
should be executed as well. How often people start their sentences with âsayâ for other reasons? If there are any false positives, perhaps also check if the message has too many symbols or something.
I had another thought, anything that results in a "useless use of", also try the same thing with 'say ' in front and return both results.
This is exactly the reaction I was hoping for: https://irclog.perlgeek.de/perl6/2017-05-18#i_14599572
I think this can be closed. Would be great to have more tests though.
Maybe we should make it harder to trigger. Example: https://irclog.perlgeek.de/perl6/2017-09-05#i_15118238 The message in question actually looks like code. However, I've noticed that all times that we have evalable trigger on something we don't want to, it is always with non-zero exit code. So let's check the exit code before printing anything.
Leading space triggers both evalable and camelia: https://irclog.perlgeek.de/perl6/2018-02-03#i_15773390.
Somehow @jnthn++ is triggering evalable unintentionally, all the time.
<jnthn> m:g does multiple matches, and <( )> set the limits of the matching
<evalable6> jnthn, rakudo-moar 38afa2d6f: OUTPUT: «(exit code 1) ===SORRY!=== Error while compiling /tmp/O2Rtjzi3Toâ€Two terâŠÂ»
<evalable6> jnthn, Full output: https://gist.github.com/eea772e80efd46824cfd08cf7403a759
<jnthn> Oh, be quiet, evalable6
<jnthn> | sleep &
<evalable6> jnthn, rakudo-moar 890d628a2: OUTPUT: «Use of uninitialized value of type Callable in numeric context†in block <unit> at /tmp/TâŠÂ»
<evalable6> jnthn, Full output: https://gist.github.com/6233b79f46e6a3beb6420821bcce405a
These can be simply special-cased, I don't remember any other false positive.
I fixed it a little bit in https://github.com/perl6/whateverable/commit/a32bb6009c202cbdc1a26f00668798856d7450fd, but m:g
is still triggering, so that should be special-cased too.