summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKoichi ITO <[email protected]>2024-07-30 14:52:48 +0900
committergit <[email protected]>2024-08-10 08:42:36 +0000
commitad23bbe5743c73b00b9305dfad42f374efad3905 (patch)
tree4fb4753746d2e794fea57182a6f539ca41d96502
parent6ee9a08d32800974c596a01e9190cc8e778a6ee5 (diff)
[ruby/prism] [Doc] Tweak the docs for lex APIs
`Prism.lex` and `Prism.lex_file` return `ParseLexResult` instead of `Array`. `Prism::parse_lex` and `Prism::parse_lex_file` return `ParseLexResult` instead of `ParseResult`. This PR updates the documentation to reflect these return values. https://github.com/ruby/prism/commit/ee331941c0
-rw-r--r--prism/extension.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/prism/extension.c b/prism/extension.c
index 64affd4001..00a0ce4957 100644
--- a/prism/extension.c
+++ b/prism/extension.c
@@ -653,9 +653,9 @@ parse_lex_input(pm_string_t *input, const pm_options_t *options, bool return_nod
/**
* call-seq:
- * Prism::lex(source, **options) -> Array
+ * Prism::lex(source, **options) -> ParseLexResult
*
- * Return an array of Token instances corresponding to the given string. For
+ * Return a ParseLexResult instance that contains an array of Token instances corresponding to the given string. For
* supported options, see Prism::parse.
*/
static VALUE
@@ -673,9 +673,9 @@ lex(int argc, VALUE *argv, VALUE self) {
/**
* call-seq:
- * Prism::lex_file(filepath, **options) -> Array
+ * Prism::lex_file(filepath, **options) -> ParseLexResult
*
- * Return an array of Token instances corresponding to the given file. For
+ * Return a ParseLexResult instance that contains an array of Token instances corresponding to the given file. For
* supported options, see Prism::parse.
*/
static VALUE
@@ -961,9 +961,9 @@ parse_file_comments(int argc, VALUE *argv, VALUE self) {
/**
* call-seq:
- * Prism::parse_lex(source, **options) -> ParseResult
+ * Prism::parse_lex(source, **options) -> ParseLexResult
*
- * Parse the given string and return a ParseResult instance that contains a
+ * Parse the given string and return a ParseLexResult instance that contains a
* 2-element array, where the first element is the AST and the second element is
* an array of Token instances.
*
@@ -988,9 +988,9 @@ parse_lex(int argc, VALUE *argv, VALUE self) {
/**
* call-seq:
- * Prism::parse_lex_file(filepath, **options) -> ParseResult
+ * Prism::parse_lex_file(filepath, **options) -> ParseLexResult
*
- * Parse the given file and return a ParseResult instance that contains a
+ * Parse the given file and return a ParseLexResult instance that contains a
* 2-element array, where the first element is the AST and the second element is
* an array of Token instances.
*