Skip to content

Commit

Permalink
documentation: use normal hyphen for symbols eligible for copy/paste.
Browse files Browse the repository at this point in the history
  • Loading branch information
eugeneia committed Oct 5, 2016
1 parent 92460b9 commit f442f2b
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 33 deletions.
8 changes: 4 additions & 4 deletions char.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*Exceptional Situations:*
If the next element is not a _character_ an _error_ of _type_ {typeerror}
If the next element is not a _character_ an _error_ of _type_ {type-error}
is signaled."
(if case-sensitive-p
(?test ('char= char))
Expand All @@ -37,7 +37,7 @@
*Exceptional Situations:*
If an element attempted to be matched is not a _character_ an _error_ of
_type_ {typeerror} is signaled."
_type_ {type-error} is signaled."
(apply '?seq (loop for char across string collect
(?char char case-sensitive-p))))

Expand All @@ -58,7 +58,7 @@
*Exceptional Situations:*
If the next element is not a _character_ an _error_ of _type_ {typeerror}
If the next element is not a _character_ an _error_ of _type_ {type-error}
is signaled."
(?test ('member *whitespace* :test 'char=)))

Expand Down Expand Up @@ -90,7 +90,7 @@
*Exceptional Situations:*
If an element attempted to be matched is not a _character_ an _error_ of
_type_ {typeerror} is signaled."
_type_ {type-error} is signaled."
(=destructure (line _)
(%or (=list (=subseq (%any (?not (?newline)))) (?newline))
(=list (=subseq (%some (?not (?end)))) (?end)))
Expand Down
10 changes: 5 additions & 5 deletions digit.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*Exceptional Situations:*
If the next element is not a _character_ an _error_ of _type_ {typeerror}
If the next element is not a _character_ an _error_ of _type_ {type-error}
is signaled."
(?test ('digit-char-p radix)))

Expand All @@ -24,7 +24,7 @@
*Description:*
{=naturalnumber} matches one or more digit _characters_ in the specified
{=natural-number} matches one or more digit _characters_ in the specified
_radix_ in sequence, and produces the natural _number_ represented by that
digit sequence as its result value.
Expand All @@ -38,7 +38,7 @@
*Exceptional Situations:*
If an element attempted to be matched is not a _character_ an _error_ of
_type_ {typeerror} is signaled."
_type_ {type-error} is signaled."
(=transform (=subseq (%some (?digit radix)))
(lambda (digits)
(parse-integer digits :radix radix))))
Expand All @@ -50,7 +50,7 @@
*Description:*
{=integernumber} matches one or more digit _characters_ in the specified
{=integer-number} matches one or more digit _characters_ in the specified
_radix_, optionally lead by a sign character, in sequence, and produces the
_integer_ represented by that sequence as its result value. The leading sign
can be {#\\\\+} and {#\\\\-} for positive and negative values respectively.
Expand All @@ -68,7 +68,7 @@
*Exceptional Situations:*
If an element attempted to be matched is not a _character_ an _error_ of
_type_ {typeerror} is signaled."
_type_ {type-error} is signaled."
(=destructure (sign number)
(=list (%maybe (%and (?test ('member '(#\+ #\-))) (=element)))
(=natural-number radix))
Expand Down
28 changes: 14 additions & 14 deletions interface.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -70,19 +70,19 @@
*Description:*
{getinputposition} returns the number of elements read from the input so
{get-input-position} returns the number of elements read from the input so
far. Additionally, _line_ and _column_ positions are returned if the input's
_element type_ is {character}. Lines are counted starting at one while
columns are counted starting from zero.
{getinputposition} may only be called from within the body of {?fail}, the
handlers of {%handlercase} or the restarts of {%restartcase}.
{get-input-position} may only be called from within the body of {?fail}, the
handlers of {%handler-case} or the restarts of {%restart-case}.
*Exceptional Situations:*
If {getinputposition} is not evaluated within the dynamic context of
{?fail}, {%handlercase} or {%restartcase} an _error_ of _type_
{simpleerror} is signaled."
If {get-input-position} is not evaluated within the dynamic context of
{?fail}, {%handler-case} or {%restart-case} an _error_ of _type_
{simple-error} is signaled."
(unless *input-fail*
(error "GET-INPUT-POSITION may only be called inside ?FAIL, %HANDLER-CASE
and %RESTART-CASE."))
Expand Down Expand Up @@ -126,9 +126,9 @@ and %RESTART-CASE."))
*Description:*
{%handlercase} executes _parser_ in a _dynamic environment_ where handlers
are active as if by {handlercase}. If a _condition_ is handled by
{%handlercase}, _parser‑form_ is evaluated and the resulting _parser_ is
{%handler-case} executes _parser_ in a _dynamic environment_ where handlers
are active as if by {handler-case}. If a _condition_ is handled by
{%handler-case}, _parser‑form_ is evaluated and the resulting _parser_ is
applied.
*Examples:*
Expand All @@ -152,7 +152,7 @@ and %RESTART-CASE."))
*See Also:*
{handlercase}."
{handler-case}."
`(let ((,parser-sym ,parser))
(lambda (,input-sym)
(let ((*input-fail* ,input-sym))
Expand Down Expand Up @@ -183,7 +183,7 @@ and %RESTART-CASE."))
_report‑expression_—a _string_, a _symbol_, or a _lambda expression_.
_test‑expression_—a _symbol or a _lambda expression_.
_test‑expression_—a _symbol_ or a _lambda expression_.
_declaration_—a {declare} _expression_; not evaluated.
Expand All @@ -193,8 +193,8 @@ and %RESTART-CASE."))
*Description:*
{%restartcase} executes _parser_ in a _dynamic environment_ where restarts
are active as if by {restartcase}. If control is transferred to a
{%restart-case} executes _parser_ in a _dynamic environment_ where restarts
are active as if by {restart-case}. If control is transferred to a
_restart‑clause_, _parser‑form_ is evaluated and the resulting _parser_ is
applied.
Expand Down Expand Up @@ -223,7 +223,7 @@ and %RESTART-CASE."))
*See Also:*
{restartcase}."
{restart-case}."
`(let ((,parser-sym ,parser))
(lambda (,input-sym)
(let ((*input-fail* ,input-sym))
Expand Down
8 changes: 4 additions & 4 deletions more.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
*Exceptional Situations:*
If _test_ accepts less arguments than the number of _arguments_ plus one an
_error_ of _type_ {programerror} is signaled.
_error_ of _type_ {program-error} is signaled.
*See also:*
Expand Down Expand Up @@ -139,7 +139,7 @@
*Description:*
{=destructure} matches _parser_ and destructures its result value as if by
{destructuringbind}. The {_} (underscore) symbol can occur in _lambda‑list_
{destructuring-bind}. The {_} (underscore) symbol can occur in _lambda‑list_
any number of times, and is substituted with a _fresh_, _uninterned symbol_
and declared {ignorable}. If _parser_ matches {=destructure} evaluates
_forms_ and produces the value of the last _form_ as its result value. If no
Expand All @@ -166,11 +166,11 @@
*Exceptional Situations:*
If the result value of _parser_ does not match the destructuring pattern, an
_error_ of _type_ {programerror} is signaled.
_error_ of _type_ {program-error} is signaled.
*See Also:*
{destructuringbind}"
{destructuring-bind}"
(let* ((ignorable-syms)
(lambda-list (loop for symbol in lambda-list collect
(if (string= "_" (symbol-name symbol))
Expand Down
12 changes: 6 additions & 6 deletions packages.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
First we define a parser for the valid characters in the _user_ and _host_
parts of an address. Just for this example, we choose these to be
alphanumeric characters and then some. {?addresscharacter} uses the {%or}
alphanumeric characters and then some. {?address-character} uses the {%or}
combinator to form the union of two instances of {?satisfies} that match
different sets of characters.
Expand All @@ -95,10 +95,10 @@
(member c '(#\\- #\\_ #\\. #\\+))))))
#
Then we use {?addresscharacter} to implement our address parser which
Then we use {?address-character} to implement our address parser which
matches two sequences of “address characters” separated by an {@}
character, and produces a list of user and host components as its result
value. We match {?addresscharacter} one or more times using {%some}, and
value. We match {?address-character} one or more times using {%some}, and
produce the matched subsequence as the result value using {=subseq}. Both
parts of the address separated by an _@_ character are matched in sequence
using {=list}, whose result value is finally transformed by
Expand All @@ -113,7 +113,7 @@
(list user host))))
#
We can now apply {=emailaddress} using {parse}:
We can now apply {=email-address} using {parse}:
#code#
(parse \"[email protected]\" (=email-address))
Expand Down Expand Up @@ -176,9 +176,9 @@
< Error Handling
+ {?fail} never matches and evaluates its body when it is called.
+ {%handlercase} and {%restartcase} allow you to set up _handlers_ and
+ {%handler-case} and {%restart-case} allow you to set up _handlers_ and
_restarts_ across parsers.
+ {getinputposition} can be called in error situations to retrieve the
+ {get-input-position} can be called in error situations to retrieve the
current position in the input.
>
Expand Down

0 comments on commit f442f2b

Please sign in to comment.