type Suppress
source code
object --+
|
ParserElement --+
|
ParseElementEnhance --+
|
TokenConverter --+
|
Suppress
Converter for ignoring the results of a parsed expression.
Example:
source = "a, b, c,d"
wd = Word(alphas)
wd_list1 = wd + ZeroOrMore(',' + wd)
print(wd_list1.parseString(source))
# often, delimiters that are useful during parsing are just in the
# way afterward - use Suppress to keep them out of the parsed output
wd_list2 = wd + ZeroOrMore(Suppress(',') + wd)
print(wd_list2.parseString(source))
prints:
['a', ',', 'b', ',', 'c', ',', 'd']
['a', 'b', 'c', 'd']
(See also delimitedList.)
|
|
|
suppress(self)
Suppresses the output of this ParserElement ; useful to
keep punctuation from cluttering up returned output. |
source code
|
|
Inherited from TokenConverter :
__init__
Inherited from ParseElementEnhance :
__str__ ,
checkRecursion ,
ignore ,
leaveWhitespace ,
parseImpl ,
streamline ,
validate
Inherited from ParserElement :
__add__ ,
__and__ ,
__call__ ,
__eq__ ,
__hash__ ,
__invert__ ,
__mul__ ,
__ne__ ,
__or__ ,
__radd__ ,
__rand__ ,
__repr__ ,
__req__ ,
__rmul__ ,
__rne__ ,
__ror__ ,
__rsub__ ,
__rxor__ ,
__sub__ ,
__xor__ ,
addCondition ,
addParseAction ,
canParseNext ,
copy ,
matches ,
parseFile ,
parseString ,
parseWithTabs ,
preParse ,
runTests ,
scanString ,
searchString ,
setBreak ,
setDebug ,
setDebugActions ,
setFailAction ,
setName ,
setParseAction ,
setResultsName ,
setWhitespaceChars ,
split ,
transformString ,
tryParse
|
Suppresses the output of this ParserElement ; useful to
keep punctuation from cluttering up returned output.
- Overrides:
ParserElement.suppress
- (inherited documentation)
|