summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Konchin <andry.konchin@gmail.com>2024-01-17 20:11:09 +0200
committergit <svn-admin@ruby-lang.org>2024-01-17 19:35:14 +0000
commitb2c12bfddbe7a0efdb7e7087dc7d05f8ce345b35 (patch)
tree963f3c1f76a2b950be4b5890b8f8ec673d61f5fd
parentf43a919be494cf5b0f98f104da1024efda1abba5 (diff)
[ruby/prism] Document order of scopes in parsing options
https://github.com/ruby/prism/commit/908e92a695
-rw-r--r--prism/extension.c3
-rw-r--r--prism/options.h3
2 files changed, 4 insertions, 2 deletions
diff --git a/prism/extension.c b/prism/extension.c
index 28bea39c7f..b7c59e514e 100644
--- a/prism/extension.c
+++ b/prism/extension.c
@@ -651,7 +651,8 @@ parse_input(pm_string_t *input, const pm_options_t *options) {
* prism (which you can trigger with `nil` or `"latest"`). If you want to
* parse exactly as CRuby 3.3.0 would, then you can pass `"3.3.0"`.
* * `scopes` - the locals that are in scope surrounding the code that is being
- * parsed. This should be an array of arrays of symbols or nil.
+ * parsed. This should be an array of arrays of symbols or nil. Scopes are
+ * ordered from the outermost scope to the innermost one.
*/
static VALUE
parse(int argc, VALUE *argv, VALUE self) {
diff --git a/prism/options.h b/prism/options.h
index c3ca47b594..9ec3fba51e 100644
--- a/prism/options.h
+++ b/prism/options.h
@@ -64,7 +64,8 @@ typedef struct {
/**
* The scopes surrounding the code that is being parsed. For most parses
* this will be NULL, but for evals it will be the locals that are in scope
- * surrounding the eval.
+ * surrounding the eval. Scopes are ordered from the outermost scope to the
+ * innermost one.
*/
pm_options_scope_t *scopes;