lawref.term_sugar
Independent reference lowering for the term sugar (SPEC §86.1).
This is intentionally a small handwritten parser. It does not import, invoke,
or otherwise reuse lawc: the point of the module is to give the byte-level
differential gate a genuinely independent implementation of DECISION-0101.
Only the closed §86.1 surface is accepted; unsupported syntax fails loudly.
Classes
Functions
| Name | Description |
|---|---|
lower_terms | Parse and lower all top-level §86.1 term declarations in source. |
Callclassdataclass#
class Call(name: str, args: tuple[object, ...])Caseclassdataclass#
class Case(name: str, when: tuple[Call, ...], duration: object, labels: tuple[Label, ...])Cursorclass#
class Cursor(tokens: list[Token], at: int = 0, end: int | None = None)atattributeinstance attribute#
at = atendattributeinstance attribute#
end = len(tokens) if end is None else endtokensattributeinstance attribute#
tokens = tokensLabelclassdataclass#
class Label(language: str, status: str, text: str, forms: tuple[tuple[str, str], ...] = ())Quantityclassdataclass#
class Quantity(value: str, unit: str)TermDeclclassdataclass#
class TermDecl(name: str, binders: tuple[tuple[str, str], ...], from_: tuple[Call, ...], due: Call, effective: dict | None, default: object, default_labels: tuple[Label, ...], cases: tuple[Case, ...], anchors: tuple[str, ...], public: bool)anchorsattributeinstance attribute#
anchors: tuple[str, ...]bindersattributeinstance attribute#
binders: tuple[tuple[str, str], ...]casesattributeinstance attribute#
cases: tuple[Case, ...]defaultattributeinstance attribute#
default: objectdefault_labelsattributeinstance attribute#
default_labels: tuple[Label, ...]dueattributeinstance attribute#
due: Calleffectiveattributeinstance attribute#
effective: dict | Nonefrom_attributeinstance attribute#
from_: tuple[Call, ...]nameattributeinstance attribute#
name: strpublicattributeinstance attribute#
public: boolTermSyntaxErrorclass#
class TermSyntaxError(ValueError)Bases: ValueError
The source is not in the deliberately narrow §86.1 subset.
Tokenclassdataclass#
class Token(kind: str, text: str, value: str, offset: int)Documentation for Arxo. Writings — blog.arxo.io.
Anonymous visit counts on stats.arxo.io, no cookies.