Package lepl :: Package lexer :: Package lines :: Module matchers
[hide private]
[frames] | no frames]

Module matchers

source code

Classes [hide private]
  LineStart
  LineEnd
  Block
Set a new indent level for the enclosed matchers (typically BLine and Block instances).
Functions [hide private]
 
Line(matcher, indent=True)
Match the matcher within a line.
source code
 
ContinuedLineFactory(matcher)
Create a replacement for Line() that can match multiple lines if they end in the given character/matcher.
source code
 
Extend(matcher)
Apply the given matcher to a token stream that ignores line endings and starts (so it matches over multiple lines).
source code
 
constant_indent(n_spaces)
Construct a simple policy for Block that increments the indent by some fixed number of spaces.
source code
 
explicit(_current, indent)
Another simple policy that matches whatever indent is used.
source code
 
to_right(current, indent)
This allows new blocks to be used without any introduction (eg no colon on the preceding line).
source code
Variables [hide private]
  NO_BLOCKS = object()
Magic initial value for block_offset to disable indentation checks.
  DEFAULT_TABSIZE = 8
The default number of spaces for a tab.
  DEFAULT_POLICY = constant_indent(DEFAULT_TABSIZE)
By default, expect an indent equivalent to a tab.
Function Details [hide private]

to_right(current, indent)

source code 
This allows new blocks to be used without any introduction (eg no colon on the preceding line). See the "closed_bug" test for more details.