From 3559cc679ea452eabaa7d73dffb3732105be80b2 Mon Sep 17 00:00:00 2001 From: Tony Garnock-Jones Date: Tue, 25 May 2021 20:13:18 +0200 Subject: [PATCH] Document inclusion in schemas --- preserves-schema.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/preserves-schema.md b/preserves-schema.md index 7eb34b8..fdc86a4 100644 --- a/preserves-schema.md +++ b/preserves-schema.md @@ -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? + ## Notes