Class PythonFoldParser
- java.lang.Object
-
- org.fife.ui.rsyntaxtextarea.folding.PythonFoldParser
-
- All Implemented Interfaces:
FoldParser
public class PythonFoldParser extends java.lang.Object implements FoldParser
A fold parser for Python. Analyzes indentation to determine foldable regions. Lines containing only comments and/or whitespace are ignored.- Version:
- 1.0
-
-
Constructor Summary
Constructors Constructor Description PythonFoldParser()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<Fold>
getFolds(RSyntaxTextArea textArea)
Returns a list of all folds in the text area.private static int
getLeadingWhiteSpaceCount(Token t, int tabSize)
private static boolean
tokenHasLineContinuation(Token t)
-
-
-
Method Detail
-
getFolds
public java.util.List<Fold> getFolds(RSyntaxTextArea textArea)
Description copied from interface:FoldParser
Returns a list of all folds in the text area.- Specified by:
getFolds
in interfaceFoldParser
- Parameters:
textArea
- The text area whose contents should be analyzed.- Returns:
- The list of folds. If this method returns
null
, it is treated as if no folds were found.
-
tokenHasLineContinuation
private static boolean tokenHasLineContinuation(Token t)
-
getLeadingWhiteSpaceCount
private static int getLeadingWhiteSpaceCount(Token t, int tabSize)
-
-