forked from syndicate-lang/preserves
Document inclusion in schemas
This commit is contained in:
parent
460529e1c7
commit
3559cc679e
|
@ -114,10 +114,11 @@ A bundle of schema files is a directory tree containing `.prs` files.
|
||||||
|
|
||||||
### Clauses.
|
### Clauses.
|
||||||
|
|
||||||
Clause = (Version / EmbeddedTypeName / Definition) "."
|
Clause = (Version / EmbeddedTypeName / Include / Definition) "."
|
||||||
|
|
||||||
Version = "version" "1"
|
Version = "version" "1"
|
||||||
EmbeddedTypeName = "embeddedType" ("#f" / Ref)
|
EmbeddedTypeName = "embeddedType" ("#f" / Ref)
|
||||||
|
Include = "include" string
|
||||||
Definition = symbol "=" (OrPattern / AndPattern / Pattern)
|
Definition = symbol "=" (OrPattern / AndPattern / Pattern)
|
||||||
|
|
||||||
**Version specification.** Mandatory. Names the version of the schema
|
**Version specification.** Mandatory. Names the version of the schema
|
||||||
|
@ -130,6 +131,10 @@ declares that values parsed by the schema do not contain embedded
|
||||||
definition in this or a neighbouring schema, it declares that embedded
|
definition in this or a neighbouring schema, it declares that embedded
|
||||||
`Value`s must themselves conform to the named definition.
|
`Value`s must themselves conform to the named definition.
|
||||||
|
|
||||||
|
**Include.** *Experimental.* Includes the contents of a neighbouring
|
||||||
|
file as if it were textually inserted in place of this clause. The
|
||||||
|
file path may be relative to the current file, or absolute.
|
||||||
|
|
||||||
**Definition.** Each definition clause implicitly connects a pattern
|
**Definition.** Each definition clause implicitly connects a pattern
|
||||||
with a type name and a set of associated functions.
|
with a type name and a set of associated functions.
|
||||||
|
|
||||||
|
@ -695,5 +700,8 @@ definitions for the metaschema.
|
||||||
challenge in doing so is the way schemas are required to be
|
challenge in doing so is the way schemas are required to be
|
||||||
*reversible* at present.
|
*reversible* at present.
|
||||||
|
|
||||||
|
- Should `include` accept URLs, to be able to retrieve schema from
|
||||||
|
the web?
|
||||||
|
|
||||||
<!-- Heading to visually offset the footnotes from the main document: -->
|
<!-- Heading to visually offset the footnotes from the main document: -->
|
||||||
## Notes
|
## Notes
|
||||||
|
|
Loading…
Reference in New Issue