public slice(line as String) as String
Extracts the substring covered by this span from line.
| Parameter | Description |
|---|---|
line | Source line from which the span was produced. |
Extracted token text, or "" if out of bounds.
import klyn.code
span = TokenSpan(4, 7, TokenKind.IDENTIFIER)
assert span.slice("def run():") == "run"