lines

linesNode

A chunk of literal code lines inside a canvas.code environment — the unit cues wrap and the unit everything else addresses. Chunks rather than line numbers, because choreography shifts line numbers: the moment a cue inserts three lines, every number below it points at the wrong line. Common indentation is stripped, so the chalk source can be indented normally.

#Attributes

indentImplicit
Also written: indent-levelIndentation levels (four spaces each) restored on assembly — the compiler dedents every literal body to its own margin, so a chunk continuing a block states its depth.Can be written as shorthand: lines:value
Default0
highlightAnimatable
The continuous highlight: these lines carry a wash for as long as they are shown. For a momentary one, wrap the chunk in a cue.highlight.
Defaultfalse
error-lines
Also written: error-line, errorsLines to flag with the gutter’s error marker — 1-based within THIS chunk.
error-message
Also written: diagnostic, error-noteThe diagnostic the interpreter would give — rendered inline at the end of the chunk's first error line, the way an IDE annotates a broken line.
added-lines
Also written: added-line, addedDiff wash: these lines carry the green added treatment — 1-based within THIS chunk.
removed-lines
Also written: removed-line, removedDiff wash: these lines carry the red removed treatment — 1-based within THIS chunk.
hiddenAnimatable
Declared but not assembled.
Defaultfalse
setup
The chunk never displays and always executes — prepended to a run in source order, outside cue gating and hidden.
Defaultfalse
Also written: lockedReserved for editable-environment rules.
Defaultfalse

#Allowed content

Body { }Literal code lines, kept verbatim.

#Allowed in

#Examples

lines{
def f(x):
    return x * 2
}
lines{
    return x * 2
}(
    highlight: true
)
lines{
def f(x):
    return undefined_name
}(
    error-lines: 2
    error-message: NameError: name 'undefined_name' is not defined
)
lines{
    return total / len(values)
}(
    indent: 1
    added-lines: 1
)