diff options
author | Paul McGuire <ptmcg@austin.rr.com> | 2016-08-05 18:53:07 +0000 |
---|---|---|
committer | Paul McGuire <ptmcg@austin.rr.com> | 2016-08-05 18:53:07 +0000 |
commit | d17a58f510447b626e5cfcffcca71203513ccebc (patch) | |
tree | 9e220c6b07a87255f1584d745a093d5dd46b784e /src/pyparsing.py | |
parent | fe1970abef54adfa76c12e244e15a510e4a6bf3d (diff) | |
download | pyparsing-git-d17a58f510447b626e5cfcffcca71203513ccebc.tar.gz |
Add inline examples to docstrings, so that reference docs will show sample code along with arg and usage descriptions - hopefully this will make them generally more useful, or at least a little less dry.
Diffstat (limited to 'src/pyparsing.py')
-rw-r--r-- | src/pyparsing.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/pyparsing.py b/src/pyparsing.py index 0f658b0..29c9d14 100644 --- a/src/pyparsing.py +++ b/src/pyparsing.py @@ -3685,14 +3685,14 @@ def srange(s): srange("[a-z$_]") -> "abcdefghijklmnopqrstuvwxyz$_"
The input string must be enclosed in []'s, and the returned string is the expanded
character set joined into a single string.
- The values enclosed in the []'s may be::
- a single character
- an escaped character with a leading backslash (such as \- or \])
- an escaped hex character with a leading '\x' (\x21, which is a '!' character)
- (\0x## is also supported for backwards compatibility)
- an escaped octal character with a leading '\0' (\041, which is a '!' character)
- a range of any of the above, separated by a dash ('a-z', etc.)
- any combination of the above ('aeiouy', 'a-zA-Z0-9_$', etc.)
+ The values enclosed in the []'s may be:
+ - a single character
+ - an escaped character with a leading backslash (such as C{\-} or C{\]})
+ - an escaped hex character with a leading C{'\x'} (C{\x21}, which is a C{'!'} character)
+ (C{\0x##} is also supported for backwards compatibility)
+ - an escaped octal character with a leading C{'\0'} (C{\041}, which is a C{'!'} character)
+ - a range of any of the above, separated by a dash (C{'a-z'}, etc.)
+ - any combination of the above (C{'aeiouy'}, C{'a-zA-Z0-9_$'}, etc.)
"""
_expanded = lambda p: p if not isinstance(p,ParseResults) else ''.join(unichr(c) for c in range(ord(p[0]),ord(p[1])+1))
try:
|