X-Git-Url: https://git.distorted.org.uk/~mdw/sod/blobdiff_plain/acaf88ad7dda1e7709729a8fd9c44417b78fe3a3..3e166443f7ed632f0a8b3d0e680c2afcc265d56f:/doc/parsing.tex diff --git a/doc/parsing.tex b/doc/parsing.tex index faa7a22..20ade82 100644 --- a/doc/parsing.tex +++ b/doc/parsing.tex @@ -89,30 +89,30 @@ consumed any input items. \begin{describe*} {\quad\=\quad\=\kill \dhead{cls} - {error-with-location (condition-with-location error) \\ \> + {error-with-location (condition-with-location error) \\ \> \&key :location} \dhead{cls} {warning-with-location (condition-with-location warning) \\ \> \&key :location} \dhead{cls} {enclosing-error-with-location - (enclosing-error-with-location error) \\ \> + (enclosing-error-with-location error) \\ \> \&key :condition :location} \dhead{cls} {enclosing-warning-with-location - (enclosing-condition-with-location warning) \\ \> + (enclosing-condition-with-location warning) \\ \> \&key :condition :location} \dhead{cls} {simple-condition-with-location - (condition-with-location simple-condition) \\ \> + (condition-with-location simple-condition) \\ \> \&key :format-control :format-arguments :location} \dhead{cls} {simple-error-with-location - (error-with-location simple-error) \\ \> + (error-with-location simple-error) \\ \> \&key :format-control :format-arguments :location} \dhead{cls} {simple-warning-with-location - (warning-with-location simple-warning) \\ \> + (warning-with-location simple-warning) \\ \> \&key :format-control :format-arguments :location}} \end{describe*} @@ -219,10 +219,10 @@ the scanner and read that data again. Therefore it's possible to \begin{describe}{mac} {with-scanner-place (@ @) @^* @
^* @> @^*} - Capture the @'s current position as a place, evaluate the - @s as an implicit progn with the variable @ bound to the captured - place. When control leaves the @s, the place is released. The return - values are the values of the final @. + Capture the @'s current position as a place, evaluate the @s + as an implicit progn with the variable @ bound to the captured + place. When control leaves the @s, the place is released. The + return values are the values of the final @. \end{describe} \subsection{Scanner file-location protocol} \label{sec:parsing.scanner.floc} @@ -377,8 +377,8 @@ file-location protocols. characters from a scanner in bulk. The function @ is invoked repeatedly, as if by \begin{prog} - (multiple-value-bind (@ @) \\ \ind\ind - (funcall @ @ @ @) \- \\ + (multiple-value-bind (@ @) \\ \ind\ind + (funcall @ @ @ @) \-\\ \textrm\ldots) \end{prog} The argument @ is a simple string; @ and @ are two @@ -394,8 +394,8 @@ file-location protocols. fails: the @ function is called with no arguments, and is expected to return two values. If omitted, @ defaults to \begin{prog} - (lambda () \\ \ind - (values nil nil))% + (lambda () \\ \ind + (values nil nil)) \end{prog} The @|charbuf-scanner-map| function returns three values. The first value @@ -454,18 +454,18 @@ file-location protocols. \begin{describe}{mac} {defparse @ (@[[ :context (@ @) @]] - @^*) \\ \ind - @[[ @^* @! @ @]] \\ - @^* \- - \nlret @} + @^*) \\ \ind + @[[ @^* @! @ @]] \\ + @^* + \-\nlret @} \end{describe} \begin{describe}{mac} {with-parser-context - (@ @{ @ @ @}^*) \\ \ind - @^* \\ - @^* \- - \nlret @^*} + (@ @{ @ @ @}^*) \\ \ind + @^* \\ + @^* + \-\nlret @^*} \end{describe} \begin{describe}{lmac} @@ -490,26 +490,26 @@ file-location protocols. \begin{describe}{mac} {if-parse (@[[ \=:result @ @! - :expected @ @! \+ \\ - :consumedp @ @]]) \- \\ \ind\ind - @ \- \\ - @ \\ - @[@@] \- - \nlret @^*} + :expected @ @! \+\\ + :consumedp @ @]]) \-\\ \ind\ind + @ \-\\ + @ \\ + @[@@] + \-\nlret @^*} \end{describe} \begin{describe}{mac} - {when-parse (@[@@]) @ \\ \ind - @^* \- - \nlret @^*} + {when-parse (@[@@]) @ \\ \ind + @^* + \-\nlret @^*} \end{describe} \begin{describe}{mac} {cond-parse (@[[ \=:result @ @! - :expected @ @! \+ \\ - :consumedp @ @]]) \- \\ \ind - @{ (@ @^*) @}^* \- - \nlret @^*} + :expected @ @! \+\\ + :consumedp @ @]]) \-\\ \ind + @{ (@ @^*) @}^* + \-\nlret @^*} \end{describe} \begin{describe}{parse}{:eof} @@ -537,8 +537,9 @@ file-location protocols. \end{describe} \begin{describe}{parseform} - {seq (@{ @ @! (@[@@] @) @}^*) \\ \ind - @^*} + {seq (@{ @ @! + (@[@@] @) @}^*) \\ \ind + @^*} \end{describe} \begin{describe}{parseform}{and @^*} @@ -551,22 +552,22 @@ file-location protocols. \end{describe} \begin{describe}{parseform} - {many (\=@ @ @ \+ \\ - @[[ \=:new @ @! :final @ @! \+ \\ - :min @ @! :max @ @! \\ - :commitp @ @]]) \-\- \\ \ind + {many (\=@ @ @ \+\\ + @[[ \=:new @ @! :final @ @! \+\\ + :min @ @! :max @ @! \\ + :commitp @ @]]) \-\-\\ \ind @ @[@@]} \end{describe} \begin{describe}{parseform} {list (@[[ :min @ @! :max @ @! - :commitp @ @]])\\ \ind + :commitp @ @]]) \\ \ind @ @[@@]} \end{describe} \begin{describe}{parseform} {skip-many (@[[ :min @ @! :max @ @! - :commitp @ @]])\\ \ind + :commitp @ @]]) \\ \ind @ @[@@]} \end{describe} @@ -692,7 +693,7 @@ file-location protocols. \end{describe} \begin{describe}{parseform} - {expr \=(@[[ :nestedp @ @]]) \+ \\ + {expr \=(@[[ :nestedp @ @]]) \+\\ @ @ @ @} \end{describe} @@ -718,12 +719,13 @@ file-location protocols. \begin{describe*} {\quad\=\kill - \dhead{cls}{simple-binary-operator (simple-operator) \\ \> - \&key :name :function :lprec :rprec :associativity} + \dhead{cls}{simple-binary-operator (simple-operator) \\ \> + \&key :name :function + :lprec :rprec :associativity} \dhead{cls}{simple-postfix-operator (simple-unary-operator) \\ \> \&key :name :function :lprec :rprec} \dhead{cls}{simple-prefix-operator - (prefix-operator simple-unary-operator) \\ \> + (prefix-operator simple-unary-operator) \\ \> \&key :name :function :rprec}} \end{describe*} @@ -773,7 +775,9 @@ file-location protocols. {skip-until (@[[ :keep-end @ @]]) @^*} \end{describe} -\begin{describe}{parseform}{error () @ @} +\begin{describe}{parseform} + {error (@[[ :ignore-unconsumed @ @]]) \\ \ind + @ @} \end{describe} \begin{describe}{fun}