Expand description
Utility functions for text-based analysis.
Functions§
- count_
non_ comment_ matches - Count non-comment occurrences of a pattern in source content
- count_
non_ import_ matches - Count non-comment, non-import occurrences of a pattern in source content
- find_
line_ of_ str - Find the line number of a string literal in source content (skipping comments)
- find_
line_ of_ str_ non_ import - Find the line number of a string literal, skipping comments and import statements
- get_
position_ from_ content - Get (line, column) from a byte offset in source content.
- truncate
- Truncate a string to a maximum length, appending “…” if truncated.