summaryrefslogtreecommitdiff
path: root/ext/strscan/strscan.c
diff options
context:
space:
mode:
authorgsinclair <gsinclair@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-02-19 12:32:09 +0000
committergsinclair <gsinclair@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-02-19 12:32:09 +0000
commita077e7cec404cf9588ed846a1f8b5cbfb9f8f4bb (patch)
tree75570d92395eba9aa98794317408a9b0c9bd1fb5 /ext/strscan/strscan.c
parentea5679c9794da8c807462fcc1f31c9763efcfb61 (diff)
* ext/strscan/strscan.c: improved documentation
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5781 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/strscan/strscan.c')
-rw-r--r--ext/strscan/strscan.c65
1 files changed, 35 insertions, 30 deletions
diff --git a/ext/strscan/strscan.c b/ext/strscan/strscan.c
index e33f610..227ed92 100644
--- a/ext/strscan/strscan.c
+++ b/ext/strscan/strscan.c
@@ -1169,6 +1169,8 @@ inspect2(p)
======================================================================= */
/*
+ * Document-class: StringScanner
+ *
* StringScanner provides for lexical scanning operations on a String. Here is
* an example of its usage:
*
@@ -1194,8 +1196,9 @@ inspect2(p)
* p s.scan(/\w+/) # -> nil
*
* Scanning a string means remembering the position of a <i>scan pointer</i>,
- * which is just an index. The scan pointer effectively points _between_
- * characters. (XXX: get this right - is it between or not?)
+ * which is just an index. The point of scanning is to move forward a bit at
+ * a time, so matches are sought after the scan pointer; usually immediately
+ * after it.
*
* Given the string "test string", here are the pertinent scan pointer
* positions:
@@ -1220,49 +1223,51 @@ inspect2(p)
*
* === Advancing the Scan Pointer
*
- * getch
- * getbyte
- * scan
- * scan_until
- * skip
- * skip_until
+ * - #getch
+ * - #getbyte
+ * - #scan
+ * - #scan_until
+ * - #skip
+ * - #skip_until
*
* === Looking Ahead
*
- * check
- * check_until
- * exist?
- * match?
- * peek
+ * - #check
+ * - #check_until
+ * - #exist?
+ * - #match?
+ * - #peek
*
* === Finding Where we Are
*
- * bol?
- * eos?
- * pos
+ * - #bol?
+ * - #eos?
+ * - #rest?
+ * - #rest_size
+ * - #pos
*
* === Setting Where we Are
*
- * reset
- * terminate
- * pos=
+ * - #reset
+ * - #terminate
+ * - #pos=
*
* === Match Data
*
- * matched
- * matched?
- * matched_size
- * []
- * pre_match
- * post_match
+ * - #matched
+ * - #matched?
+ * - #matched_size
+ * - []
+ * - #pre_match
+ * - #post_match
*
* === Miscellaneous
*
- * <<
- * concat
- * string
- * string=
- * unscan
+ * - <<
+ * - #concat
+ * - #string
+ * - #string=
+ * - #unscan
*
* There are aliases to several of the methods.
*/