Modules§
- textwrap
- Functions related to adding and removing indentation from lines of text.
Structs§
- Backwards
Tokenizer - Simple zero allocation backwards tokenizer for finding preceding tokens.
- Comment
Ranges - Stores the ranges of comments sorted by
TextRange::startin increasing order. No two ranges are overlapping. - Cursor
- A
Cursorover a string. - Simple
Token - Simple
Tokenizer - Simple zero allocation tokenizer handling most tokens.
Enums§
- Comment
Line Position - The position of a comment in the source text.
- Simple
Token Kind - Suppression
Kind
Constants§
Traits§
Functions§
- find_
only_ token_ in_ range - Returns the only non-trivia, non-closing parenthesis token in
range. - first_
non_ trivia_ token - Searches for the first non-trivia character after
offset. - has_
leading_ content - Return
trueif the node starting the givenTextSizehas leading content. - has_
trailing_ content - Return
trueif the node ending at the givenTextSizehas trailing content. - indentation_
at_ offset - Extract the leading indentation from a line.
- is_
pragma_ comment - Returns
trueif a comment appears to be a pragma comment. - is_
python_ whitespace - Returns
truefor whitespace characters. - leading_
indentation - Extract the leading indentation from a line.
- lines_
after - Counts the empty lines between
offsetand the first non-whitespace character. - lines_
after_ ignoring_ end_ of_ line_ trivia - Counts the empty lines after
offset, ignoring any trailing trivia on the same line asoffset. - lines_
after_ ignoring_ trivia - Counts the empty lines after
offset, ignoring any trailing trivia: end-of-line comments, own-line comments, and any intermediary newlines. - lines_
before - Returns the number of newlines between
offsetand the first non whitespace character in the source code.