[DOC] fix typos in strscans documentation (#8885)

This commit is contained in:
Vindaar 2018-09-05 14:57:36 +02:00 • committed by Andreas Rumpf
commit d34233b501

View file

@ -10,7 +10,7 @@
##[ ##[
This module contains a `scanf`:idx: macro that can be used for extracting This module contains a `scanf`:idx: macro that can be used for extracting
substrings from an input string. This is often easier than regular expressions. substrings from an input string. This is often easier than regular expressions.
Some examples as an apetizer: Some examples as an appetizer:
.. code-block:: nim .. code-block:: nim
# check if input string matches a triple of integers: # check if input string matches a triple of integers:
@ -308,7 +308,7 @@ proc buildUserCall(x: string; args: varargs[NimNode]): NimNode =
for i in 1..<y.len: result.add y[i] for i in 1..<y.len: result.add y[i]
macro scanf*(input: string; pattern: static[string]; results: varargs[typed]): bool = macro scanf*(input: string; pattern: static[string]; results: varargs[typed]): bool =
## See top level documentation of his module of how ``scanf`` works. ## See top level documentation of this module about how ``scanf`` works.
template matchBind(parser) {.dirty.} = template matchBind(parser) {.dirty.} =
var resLen = genSym(nskLet, "resLen") var resLen = genSym(nskLet, "resLen")
conds.add newLetStmt(resLen, newCall(bindSym(parser), inp, results[i], idx)) conds.add newLetStmt(resLen, newCall(bindSym(parser), inp, results[i], idx))
@ -469,7 +469,7 @@ template success*(x: int): bool = x != 0
template nxt*(input: string; idx, step: int = 1) = inc(idx, step) template nxt*(input: string; idx, step: int = 1) = inc(idx, step)
macro scanp*(input, idx: typed; pattern: varargs[untyped]): bool = macro scanp*(input, idx: typed; pattern: varargs[untyped]): bool =
## See top level documentation of his module of how ``scanf`` works. ## See top level documentation of this module about how ``scanp`` works.
type StmtTriple = tuple[init, cond, action: NimNode] type StmtTriple = tuple[init, cond, action: NimNode]
template interf(x): untyped = bindSym(x, brForceOpen) template interf(x): untyped = bindSym(x, brForceOpen)