v1.0.0
Description
-
Implemented a full tree-walking interpreter (
engine/interpreter/): Value/Environment
model, Python-style function-level scoping with explicitchange x to globalbridging,
1-based indexing/slicing with negative-index support, collections (add/remove/replace/
indexedchange, insertion-ordered maps), functions (returnable/asyncin any
combination),or_elseerror recovery, anduse/from/DLC:*module loading. -
Implemented CuffScript's custom pattern-matching engine from scratch (
engine/regex/):
a dedicated compiler + backtracking matcher for the fulldocs/REGEX.mddialect
(character classes, presets,[one:...], named/numbered captures, quantifiers including
N~Mranges and lazy variants, anchors, flags), wired intois/IS,match ... from,
find ... from,replace ... in ... to,split ... by, andcount ... in— including a
step-count + time-limit safety guard against catastrophic backtracking. -
Introduced a systematic, extensible error hierarchy (
engine/common/ErrorCodes.h,
engine/common/CuffError.h): every error carries a stable numeric code, category,
location, message, and optional hint, and is marked recoverable/non-recoverable so
or_elsecatches exactly the right things. -
./cuffc program.cuffnow runs the program by default;--astreproduces the previous
tokens/AST-dump behavior for engine development. -
Fixed several defects that prevented the previously-committed engine from compiling or
running at all (broken relative includes, a use-before-complete-type cycle between the
statement/expression sub-parsers, a real dangling-copy bug inawaitparsing, a missing
-Wunused-variable), added single-quoted string literals (needed for map/match key access
inside f-strings perdocs/REGEX.md), fixed f-string{{/}}escaping and nested-brace
handling, and corrected!to bind looser than comparison (!lvl is MAX_LEVELnow means
!(lvl is MAX_LEVEL), matching the spec's own examples). -
Added
docs/IMPLEMENTATION_NOTES.mddocumenting every place the language spec leaves
runtime behavior unspecified and the choice this engine makes there (async model, DLC
function list, module-merge semantics, etc.), anddocs/EXTENDING.mdas a guide for
adding new builtins/DLC libraries/statements/expressions.