Skip to content

Instantly share code, notes, and snippets.

@MasterDuke17
Created August 31, 2017 22:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MasterDuke17/c9512590df63bd530b640464ad04103f to your computer and use it in GitHub Desktop.
Save MasterDuke17/c9512590df63bd530b640464ad04103f to your computer and use it in GitHub Desktop.
diff --git a/src/core/Match.pm b/src/core/Match.pm
index f8792197f..5b814c9eb 100644
--- a/src/core/Match.pm
+++ b/src/core/Match.pm
@@ -326,7 +326,15 @@ my class Match is Capture is Cool does NQPMatchRole {
# no modifier, match literally
elsif $nomod {
- $match = nqp::eqat($tgt, $topic_str, $pos);
+ my int $index = nqp::index($tgt, $topic_str, $pos);
+ if $index >= 0 {
+ nqp::bindattr_i($cur, $?CLASS, '$!from', $index);
+ $pos = $index;
+ $match = 1;
+ }
+ else {
+ $match = 0;
+ }
}
# ignoremark+ignorecase
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment