Expand description
The line grammar the Hardware-mode specs share — pigeons: 6, registers: 3, tmp: 1-5,
and each line’s # … comment — read one way by their parsers and by the editor, so what the
editor paints as a comment is exactly what the parsers skip.
Constants§
- FIELDS
- Every field a Hardware spec names before its value.
- PIGEONS
- The pigeonhole spec’s one field: how many pigeons go into one fewer holes.
- PIGEONS_
RANGE - How many pigeons a spec may ask for: one pigeon with no hole is degenerate, and past twenty the picture stops being legible.
- REGISTERS
- The register-allocation spec’s budget: how many physical registers there are.
Functions§
- comment_
start - Where
line’s comment starts: the first run of#thatopens_comment. - content
- A spec line without its comment, trimmed.
- field_
value - The value after
field:on a spec line, trimmed and without the line’s comment, when the line names that field. - hover
- What the editor’s hover says about the word at byte
offsetof a spec: the field it names, or the live range it reads. Markdown, as the language server’s hovers are. - is_
field - Whether
wordnamesfieldthe way the parsers accept it: lowercase, or capitalised. - opens_
comment - Whether a run of
#whose next character isafteropens a comment: it does when a space or the end of the line follows (# note,## Title). Verilog’s#5and#(10)delays are code. - problems
- What is wrong in a spec, placed under the value at fault: a field its parser would refuse, a live range that never starts or ends. A spec that names no field has nothing to check here.