Document inclusion in schemas

This commit is contained in:
Tony Garnock-Jones 2021-05-25 20:13:18 +02:00
parent 460529e1c7
commit 3559cc679e
1 changed files with 9 additions and 1 deletions

View File

@ -114,10 +114,11 @@ A bundle of schema files is a directory tree containing `.prs` files.
### Clauses.
Clause = (Version / EmbeddedTypeName / Definition) "."
Clause = (Version / EmbeddedTypeName / Include / Definition) "."
Version = "version" "1"
EmbeddedTypeName = "embeddedType" ("#f" / Ref)
Include = "include" string
Definition = symbol "=" (OrPattern / AndPattern / Pattern)
**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
`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
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
*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: -->
## Notes