X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/chopwood/blobdiff_plain/77bef10fa6bce063445df4feb9ac5f678b71cb99..fb306d6efd803bb855c8a84b750c400a668e332b:/format.py diff --git a/format.py b/format.py index d6eb896..2b90cb9 100644 --- a/format.py +++ b/format.py @@ -296,7 +296,7 @@ class NextArg (BaseArg): else: return None NEXTARG = NextArg() -## Because a `NextArg' collectors are used so commonly, and they're all the +## Because `NextArg' collectors are used so commonly, and they're all the ## same, we make a distinguished one and try to use that instead. Nothing ## goes badly wrong if you don't use this, but you'll use more memory than ## strictly necessary. @@ -528,7 +528,7 @@ VARNEXT = VariableParameter(NEXTARG) ## whether the `@' and `:' modifiers were set in the control string. ## GETARG is the collector for the operation's argument(s). The PARAMS ## are a list of parameter collectors. Finally, CHAR is the directive -## character (so directives with siilar behaviour can use the same +## character (so directives with similar behaviour can use the same ## class). class FormatLiteral (object): @@ -798,7 +798,7 @@ def compile(control): PARAMS ::= PARAM [`,' PARAMS] - PARAM ::= EMPTY | INT | `'' CHAR | `v' | `!' ARG + PARAM ::= EMPTY | INT | `#' | `'' CHAR | `v' | `!' ARG FLAGS ::= [[ `@' | `:' ]]* @@ -806,11 +806,11 @@ def compile(control): items drawn from the listed alternatives, each appearing at most once. See the function `parse_arg' for the syntax of ARG.) - An empty PARAM is equivalent to omitting the parameter; `!ARG' reads the - parameter value from the argument; `v' is equivalent to `!+', as a - convenient abbreviation and for Common Lisp compatibility. The `=ARG' - notation indicates which argument(s) should be processed by the operation: - the default is `=+'. + An empty PARAM is equivalent to omitting the parameter; `#' is the number + of remaining positional arguments; `!ARG' reads the parameter value from + the argument; `v' is equivalent to `!+', as a convenient abbreviation and + for Common Lisp compatibility. The `=ARG' notation indicates which + argument(s) should be processed by the operation: the default is `=+' """ if not isinstance(control, basestring): return control pp = []