Skip to content

Commit db4cc96

Browse files
authored
Fix call-seq return values (#207)
Some `call-seq` comments did not match the actual return values (documentation only, no behavior change): * `match?` returns the match size, not a position * `skip` was missing the `->` arrow * `scan_full` can also return a length * `scan_byte` can return `nil` at end of string
1 parent 32cc239 commit db4cc96

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

ext/strscan/strscan.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -822,7 +822,7 @@ strscan_scan(VALUE self, VALUE re)
822822
* :include: strscan/link_refs.txt
823823
*
824824
* call-seq:
825-
* match?(pattern) -> updated_position or nil
825+
* match?(pattern) -> match_size or nil
826826
*
827827
* Attempts to [match][17] the given `pattern`
828828
* at the beginning of the [target substring][3];
@@ -882,7 +882,7 @@ strscan_match_p(VALUE self, VALUE re)
882882
/*
883883
* :markup: markdown
884884
* call-seq:
885-
* skip(pattern) match_size or nil
885+
* skip(pattern) -> match_size or nil
886886
*
887887
* :include: strscan/link_refs.txt
888888
* :include: strscan/methods/skip.md
@@ -956,7 +956,7 @@ strscan_check(VALUE self, VALUE re)
956956

957957
/*
958958
* call-seq:
959-
* scan_full(pattern, advance_pointer_p, return_string_p) -> matched_substring or nil
959+
* scan_full(pattern, advance_pointer_p, return_string_p) -> matched_substring or length or nil
960960
*
961961
* Equivalent to one of the following:
962962
*
@@ -1202,7 +1202,7 @@ strscan_getch(VALUE self)
12021202

12031203
/*
12041204
* call-seq:
1205-
* scan_byte -> integer_byte
1205+
* scan_byte -> integer_byte or nil
12061206
*
12071207
* Scans one byte and returns it as an integer.
12081208
* This method is not multibyte character sensitive.

0 commit comments

Comments
 (0)