Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/renaissance/syntax_tree/text_segment.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ class TextSegment(Protocol):
"""Protocol for anything that represents a text segment.

A text segment is a consecutive piece, a.k.a. a slice, within a text.
Instances include comments, whitespace (incl. empty lines), and syntax nodes.
Any consecutive piece of text qualifies;
it need not correspond to a single syntactic construct.
Instances include comments, whitespace (incl. empty lines), syntax nodes,
combinations thereof, such as a syntax node together with its associated trivia,
and even a regular expression match, which has no relation to a syntax tree at all.

Read-only access is enforced "as much as possible" by
exposing only @property getters in the protocol.
Expand Down
Loading