Manual:Line-Aware Parsing and the Offside Rule:Lines and Continuations

まんま

>>> from lepl import *
>>> words = Token(Word(Lower()))[:] > list
>>> line = Line(words)
>>> parser = line.string_parser(LineAwareConfiguration(tabsize=4))
>>> parser('\tabc def')
[['abc', 'def']]
>>> words = Token(Word(Lower()))[:] > list
>>> CLine = ContinuedLineFactory(r'\+')
>>> line = CLine(words)
>>> parser = line.string_parser(LineAwareConfiguration())
>>> parser('''abc def +
... ghi'''
...
... )
[['abc', 'def', 'ghi']]

マニュアルでは最後の「)」が抜けていた