diff --git a/collects/scribblings/framework/color.scrbl b/collects/scribblings/framework/color.scrbl index b796f2ee..c158f797 100644 --- a/collects/scribblings/framework/color.scrbl +++ b/collects/scribblings/framework/color.scrbl @@ -12,7 +12,7 @@ Starts tokenizing the buffer for coloring and parenthesis matching. - token-sym-style will be passed the first return symbol from get-token + @scheme[token-sym-style] will be passed the first return symbol from @scheme[get-token] and should return the style-name that the token should be colored. get-token takes an input port and returns the next token as 5 values: @@ -22,11 +22,11 @@ component of the token and may be used as such in the future.} @item{ A symbol describing the type of the token. This symbol is transformed - into a style-name via the token-sym->style argument. The symbols - 'white-space and 'comment have special meaning and should always be + into a style-name via the @scheme[token-sym->style] argument. The symbols + @scheme['white-space] and @scheme['comment] have special meaning and should always be returned for white space and comment tokens respectively. The symbol @scheme['no-color] can be used to indicate that although the token is not white - space, it should not be colored. The symbol 'eof must be used to + space, it should not be colored. The symbol @scheme['eof] must be used to indicate when all the tokens have been consumed.} @item{ A symbol indicating how the token should be treated by the paren @@ -36,7 +36,7 @@ @item{ The ending position of the token.}] - get-token will usually be implemented with a lexer using the + @scheme[get-token] will usually be implemented with a lexer using the @scheme[parser-tools/lex] library. get-token must obey the following invariants: @itemize[ @@ -44,7 +44,7 @@ Every position in the buffer must be accounted for in exactly one token.} @item{ - The token returned by get-token must rely only on the contents of the + The token returned by @scheme[get-token] must rely only on the contents of the input port argument. This means that the tokenization of some part of the input cannot depend on earlier parts of the input.} @item{ @@ -57,14 +57,14 @@ the buffer look like: @verbatim{" 1 2 3"} would result in a single string token modifying previous tokens. To - handle these situations, get-token must treat the first line as a + handle these situations, @scheme[get-token] must treat the first line as a single token.}] @scheme[pairs] is a list of different kinds of matching parens. The second value returned by get-token is compared to this list to see how the paren matcher should treat the token. An example: Suppose pairs is @scheme['((|(| |)|) (|[| |]|) (begin end))]. This means that there - are three kinds of parens. Any token which has 'begin as its second + are three kinds of parens. Any token which has @scheme['begin] as its second return value will act as an open for matching tokens with 'end. Similarly any token with @scheme['|]|] will act as a closing match for tokens with @scheme['|[|]. When trying to correct a mismatched @@ -75,7 +75,7 @@ Stops coloring and paren matching the buffer. - If clear-colors is true all the text in the buffer will have it's + If @scheme[clear-colors] is true all the text in the buffer will have its style set to Standard. } @defmethod*[(((force-stop-colorer (stop? boolean?)) void))]{ @@ -83,7 +83,7 @@ Intended for debugging purposes only. - stop? determines whether the system is being forced to stop or allowed + @scheme[stop?] determines whether the system is being forced to stop or allowed to wake back up. } @defmethod*[(((is-stopped?) boolean?))]{ @@ -96,13 +96,11 @@ and @method[color:text<%> thaw-colorer]. - } @defmethod*[(((freeze-colorer) void))]{ Keep the text tokenized and paren matched, but stop altering the colors. - - freeze-colorer will not return until the coloring/tokenization of the + @scheme[freeze-colorer] will not return until the coloring/tokenization of the entire text is brought up-to-date. It must not be called on a locked text. } @@ -110,13 +108,13 @@ Start coloring a frozen buffer again. - If recolor? is @scheme[#t], the text is re-colored. If it is - @scheme[#f] the text is not recolored. When recolor? is @scheme[#t], - retokenize? controls how the text is recolored. @scheme[#f] causes + If @scheme[recolor?] is @scheme[#t], the text is re-colored. If it is + @scheme[#f] the text is not recolored. When @scheme[recolor?] is @scheme[#t], + @scheme[retokenize?] controls how the text is recolored. @scheme[#f] causes the text to be entirely re-colored before thaw-colorer returns using the existing tokenization. @scheme[#t] causes the entire text to be retokenized and recolored from scratch. This will happen in the - background after the call to thaw-colorer returns. + background after the call to @scheme[thaw-colorer] returns. } @defmethod*[(((reset-region (start natural-number?) (end (union (quote end) natural-number?))) void))]{ @@ -134,19 +132,16 @@ @defmethod*[(((skip-whitespace (position natural-number?) (direction (symbols (quote forward) (quote backward))) (comments? boolean?)) natural-number?))]{ Returns the next non-whitespace character. - Starts from position and skips whitespace in the direction indicated - by direction. If comments? is true, comments are skipped as well as + by direction. If @scheme[comments?] is true, comments are skipped as well as whitespace. skip-whitespace determines whitespaces and comments by - comparing the token type to 'white-space and 'comment. + comparing the token type to @scheme['white-space] and @scheme['comment]. Must only be called while the tokenizer is started. } @defmethod*[(((backward-match (position natural-number?) (cutoff natural-number?)) (union natural-number? false?)))]{ - - - Skip all consecutive whitespaces and comments (using skip-whitespace) + Skip all consecutive whitespaces and comments (using @scheme[skip-whitespace]) immediately preceding the position. If the token at this position is a close, return the position of the matching open, or @scheme[#f] if there is none. If the token was an open, return @scheme[#f]. For any @@ -163,9 +158,7 @@ } @defmethod*[(((forward-match (position natural-number?) (cutoff natural-number?)) (union natural-number? false?)))]{ - - - Skip all consecutive whitespaces and comments (using skip-whitespace) + Skip all consecutive whitespaces and comments (using @scheme[skip-whitespace]) immediately following position. If the token at this position is an open, return the position of the matching close, or @scheme[#f] if there is none. For any other token, return the end of that token. @@ -174,12 +167,11 @@ } @defmethod*[(((insert-close-paren (position natural-number?) (char char?) (flash? boolean?) (fixup? boolean?)) void))]{ - Position is the place to put the parenthesis and char is the - parenthesis to be added. If fixup? is true, the right kind of closing + parenthesis to be added. If @scheme[fixup?] is true, the right kind of closing parenthesis will be chosen from the pairs list kept last passed to - start-colorer, otherwise char will be inserted, even if it is not the - right kind. If flash? is true the matching open parenthesis will be + @scheme[start-colorer], otherwise char will be inserted, even if it is not the + right kind. If @scheme[flash?] is true the matching open parenthesis will be flashed. } @defmethod*[(((classify-position (position natural-number?)) symbol?))]{ @@ -218,7 +210,7 @@ @defmixin[color:text-mode-mixin (mode:surrogate-text<%>) (color:text-mode<%>)]{ This mixin adds coloring functionality to the mode. - @defconstructor[((get-token lexer default-lexer) (token-sym->style (token $rightarrow$ string) |scheme(λ (x) "Standard"))|) (matches (listof (list/c symbol? symbol?)) null))]{ + @defconstructor[((get-token lexer default-lexer) (token-sym->style (token $rightarrow$ string) @scheme[(λ (x) "Standard")])|) (matches (listof (list/c symbol? symbol?)) null))]{ The arguments are passed to @method[color:text<%> start-colorer].