* ext/strscan/strscan.c: improved documentation

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5781 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
gsinclair 2004-02-19 12:32:09 +00:00
parent ea5679c979
commit a077e7cec4
2 changed files with 39 additions and 30 deletions

View File

@ -1,3 +1,7 @@
Thu Feb 19 18:08:18 2004 Gavin Sinclair <gsinclair@soyabean.com.au>
* ext/strscan/strscan.c: improved documentation
Thu Feb 19 18:08:18 2004 Nobuyoshi Nakada <nobu@ruby-lang.org> Thu Feb 19 18:08:18 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
* win32/win32.c, win32/win32.h: fixed prototypes. * win32/win32.c, win32/win32.h: fixed prototypes.

View File

@ -1169,6 +1169,8 @@ inspect2(p)
======================================================================= */ ======================================================================= */
/* /*
* Document-class: StringScanner
*
* StringScanner provides for lexical scanning operations on a String. Here is * StringScanner provides for lexical scanning operations on a String. Here is
* an example of its usage: * an example of its usage:
* *
@ -1194,8 +1196,9 @@ inspect2(p)
* p s.scan(/\w+/) # -> nil * p s.scan(/\w+/) # -> nil
* *
* Scanning a string means remembering the position of a <i>scan pointer</i>, * Scanning a string means remembering the position of a <i>scan pointer</i>,
* which is just an index. The scan pointer effectively points _between_ * which is just an index. The point of scanning is to move forward a bit at
* characters. (XXX: get this right - is it between or not?) * 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 * Given the string "test string", here are the pertinent scan pointer
* positions: * positions:
@ -1220,49 +1223,51 @@ inspect2(p)
* *
* === Advancing the Scan Pointer * === Advancing the Scan Pointer
* *
* getch * - #getch
* getbyte * - #getbyte
* scan * - #scan
* scan_until * - #scan_until
* skip * - #skip
* skip_until * - #skip_until
* *
* === Looking Ahead * === Looking Ahead
* *
* check * - #check
* check_until * - #check_until
* exist? * - #exist?
* match? * - #match?
* peek * - #peek
* *
* === Finding Where we Are * === Finding Where we Are
* *
* bol? * - #bol?
* eos? * - #eos?
* pos * - #rest?
* - #rest_size
* - #pos
* *
* === Setting Where we Are * === Setting Where we Are
* *
* reset * - #reset
* terminate * - #terminate
* pos= * - #pos=
* *
* === Match Data * === Match Data
* *
* matched * - #matched
* matched? * - #matched?
* matched_size * - #matched_size
* [] * - []
* pre_match * - #pre_match
* post_match * - #post_match
* *
* === Miscellaneous * === Miscellaneous
* *
* << * - <<
* concat * - #concat
* string * - #string
* string= * - #string=
* unscan * - #unscan
* *
* There are aliases to several of the methods. * There are aliases to several of the methods.
*/ */