diff --git a/preserves-schema.md b/preserves-schema.md index c616533..234e84a 100644 --- a/preserves-schema.md +++ b/preserves-schema.md @@ -4,7 +4,7 @@ title: "Preserves Schema" --- Tony Garnock-Jones -October 2023. Version 0.3.4. +December 2023. Version 0.3.5. [abnf]: https://tools.ietf.org/html/rfc7405 [identifierlike]: #sufficiently-identifierlike-values @@ -470,7 +470,7 @@ The host-language types corresponding to a metaschema instance can themselves be described according to a grammar. The definitions in this section should be understood as being part of a -module named `host`, in a bundle alongside a module named `schema` +module named [`host`](schema/host.prs), in a bundle alongside a module named `schema` corresponding to the metaschema in the appendix below. #### Abstract host language types @@ -555,7 +555,8 @@ patterns, **product**{:.pseudocode} yields `unit` type itself. > **gather** `` = **gather** *f`1`* ⧺ ⋯ ⧺ **gather** *f`n`* > **gather** `` = **gather** *f`1`* ⧺ ⋯ ⧺ **gather** *f`n`* ⧺ **gather** *f`repeated`* > **gather** `` = **gather** *f`1`′* ⧺ ⋯ ⧺ **gather** *f`n`′*, -> where (*f`1`′ ⋯ f`n`′*) are (*f`1` ⋯ f`n`*) sorted according to [Preserves term order](./preserves.html#total-order). +> where (*f`1`′ ⋯ f`n`′*) are the *f`i`* sorted by [Preserves term order](./preserves.html#total-order) of the corresponding *v`i`*. +> **gather** *s* = `[]`, when *s* ∈ `schema.SimplePattern`. ## Appendix: Metaschema diff --git a/schema/Makefile b/schema/Makefile index a7076d9..3d07cd4 100644 --- a/schema/Makefile +++ b/schema/Makefile @@ -1,8 +1,8 @@ -all: schema.bin +all: schema.bin host.bin -schema.bin: schema.prs - ../implementations/javascript/packages/schema-cli/bin/preserves-schemac.js --no-bundle .:schema.prs > $@.tmp || (rm -f $@.tmp; false) +%.bin: %.prs + ../implementations/javascript/packages/schema-cli/bin/preserves-schemac.js --no-bundle .:$< > $@.tmp || (rm -f $@.tmp; false) mv $@.tmp $@ clean: - rm -f schema.bin + rm -f schema.bin host.bin diff --git a/schema/host.bin b/schema/host.bin new file mode 100644 index 0000000..9d9f823 --- /dev/null +++ b/schema/host.bin @@ -0,0 +1,4 @@ +´³schema·³version°³ definitions·³Field´³orµµ±unit´³lit³unit„„µ±any´³lit³any„„µ±embedded´³lit³embedded„„µ±array´³rec´³lit³array„´³tupleµ´³named³element´³refµ„³Field„„„„„„µ±set´³rec´³lit³set„´³tupleµ´³named³element´³refµ„³Field„„„„„„µ±map´³rec´³lit³map„´³tupleµ´³named³key´³refµ„³Field„„´³named³value´³refµ„³Field„„„„„„µ±ref´³rec´³lit³ref„´³tupleµ´³named³name´³refµ³schema„³Ref„„„„„„µ±AtomKind´³refµ³schema„³AtomKind„„„„³Record´³rec´³lit³rec„´³tupleµ´³named³fields´³seqof´³refµ„³ +NamedField„„„„„„³Simple´³orµµ±Field´³refµ„³Field„„µ±Record´³refµ„³Record„„„„³Variant´³tupleµ´³named³label´³atom³Symbol„„´³named³type´³refµ„³Simple„„„„³ +Definition´³orµµ±union´³rec´³lit³union„´³tupleµ´³named³variants´³seqof´³refµ„³Variant„„„„„„„µ±Simple´³refµ„³Simple„„„„³ +NamedField´³tupleµ´³named³name´³atom³Symbol„„´³named³type´³refµ„³Field„„„„„³ embeddedType€„„ \ No newline at end of file diff --git a/schema/host.prs b/schema/host.prs new file mode 100644 index 0000000..373d726 --- /dev/null +++ b/schema/host.prs @@ -0,0 +1,19 @@ +version 1 . + +Definition = / Simple . +Variant = [@label symbol @type Simple] . + +Simple = Field / Record . +Record = . +NamedField = [@name symbol @type Field] . + +Field = +/ =unit +/ =any +/ =embedded +/ +/ +/ +/ +/ schema.AtomKind +.