summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
authorJeremy Evans <code@jeremyevans.net>2019-09-03 11:32:02 -0700
committerGitHub <noreply@github.com>2019-09-03 11:32:02 -0700
commit39c3252cd175074581855e5f9681cc723c15ff72 (patch)
treed10d0915b8611efeb9dd231542c20b6bc60609a4 /eval.c
parentf702cd6ace7e134714d42ffb1606c25b5ded24c7 (diff)
Merge pull request #2422 from jeremyevans/rb_keyword_given_p
Add rb_keyword_given_p to the C-API
Notes
Notes: Merged-By: jeremyevans <code@jeremyevans.net>
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/eval.c b/eval.c
index 30d4ea5..eb34c35 100644
--- a/eval.c
+++ b/eval.c
@@ -899,6 +899,14 @@ rb_block_given_p(void)
}
}
+int rb_vm_cframe_keyword_p(const rb_control_frame_t *cfp);
+
+int
+rb_keyword_given_p(void)
+{
+ return rb_vm_cframe_keyword_p(GET_EC()->cfp);
+}
+
VALUE rb_eThreadError;
/*! Declares that the current method needs a block.