Repository navigation
What's New
RIDDL has always required every value to be typed. 2.4.0 enforces that rule for the two values
whose spelling carries no type of their own: empty/none and prompt(…). A bare empty takes
the type of its position. Where nothing supplies a type, you write empty T, and T is a
type NAME, never a type expression. Declare type MaybeRecipe is Recipe? and write empty MaybeRecipe. See the Computational Model §0.3, ruling 6.
Features
-
emptyis checked at every position that types it. A bareemptyis now held to the
minimum-cardinality rule at every position that supplies a type:set,append/removeandlet- constructor,
call,initiateandterminatearguments put,return,require … withstore/upsertandupdate … set- comparison operands
Fields typed inline (
note: String?) are checked too. Before this release only four of those
positions checked anything, and the rest acceptedemptyagainst types that cannot be empty. -
x == empty.emptycan now be a comparison operand. The operand opposite it supplies its
type. -
EmptyValue.typeRefandPromptValue.typeRef. A value's ascription is carried as the
TypeRefit names. New non-deprecated readers:ascribedTypeandexpressionAscription.
A bare predefined type (Real,Boolean,TimeStamp) counts as a name; a parameterized one
(String(1,30)) does not. -
Three new Errors:
value-ascription-not-a-name:empty String?orprompt(…) as T*. The 2.0 spelling was
admitted by mistake; it still parses, so the message names the fix.value-empty-untyped: a bareemptywhere nothing supplies a type, such as an untyped
let,log emptyorempty == empty.value-empty-ascription-contradicts: an ascription that is not, syntactically, the
position's declared type. A field typed inline takes a bareempty.
Bug Fixes
update T set f = empty where …failed to parse.empty's optional ascription read the
next word as a type name.put empty to …,append empty to …andstore empty in …failed
the same way. The guard afteremptyis now a word category rather than a list, and the EBNF
carries the same rule.emptywith an alias type was refused.empty MaybeNotewithtype MaybeNote is String?
reported "requires at least one value", and so did a bareemptyfor any alias-typed
constructor field. The cardinality check now reads through type names, including alias chains,
and is safe on cyclic ones.riddlc dump --jsonmisreported alias-typed fields.cardinalityandacceptsEmptycame
back asexactly-oneandfalsefor a field whose alias names an optional or a collection.- Prettify dropped the keyword from
empty record R, so the output re-parsed as a different
AST. Messages.justWarningsreturned advisories. It filtered by severity band, andAdvisory
sits inside that band while reportingisWarning = false.RiddlLib.ValidateResult(as a
trailing defaulted field) and the JS facade both gain anadvisoriesbucket. Before this, an
advisory reached consumers only insideall. Blocking behaviour (--fail-on) was never
affected.PromptValuehad no JS export. Its@JSExportTopLevelannotation was attached to
EmptyValue.
Deprecations
EmptyValue.typeExandPromptValue.typeExare deprecated in favour oftypeRefand
ascribedType. Both still parse and are still populated, so existing readers see no change.
Internal
- BAST and JSON wire formats are unchanged;
typeRefis derived on read, so files written by
2.3.x load to the same AST the parser builds. EbnfReservedWordsTestkeeps the grammar's hand-kept word lists in step with the parser.- A corpus walk in the test suite prunes
target/instead of filtering it afterwards. - Corpus check: all 191 riddl-models entry points validate with 0 errors, as they did on 2.3.1.