MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / LogicalLine

Class LogicalLine

scripts/code-verify.py:275–292  ·  view source on GitHub ↗

One or more physical lines that together form one logical unit.

Source from the content-addressed store, hash-verified

273
274@dataclass
275class LogicalLine:
276 """One or more physical lines that together form one logical unit."""
277
278 raws: list[str] = field(default_factory=list) # raw source lines (no newlines)
279 kind: str = (
280 "other" # "id" | "prop" | "blank" | "comment" | "open" | "close" | "handler" | "other"
281 )
282 start_idx: int = 0 # index of first physical line in the source
283
284 @property
285 def length(self) -> int:
286 """Total rendered length = first physical line's length (for sorting)."""
287 return len(self.raws[0]) if self.raws else 0
288
289 @property
290 def text(self) -> str:
291 """Concatenated stripped first-line text, mainly for classification."""
292 return self.raws[0].strip() if self.raws else ""
293
294
295def physical_kind(raw: str) -> str:

Callers 1

tokenizeFunction · 0.85

Calls 1

fieldFunction · 0.85

Tested by

no test coverage detected