ast: Add schema root name and ref

These are not hooked up to the root document name/ref collections yet
because the evaluator and compiler are not aware of them but they will
be useful as constants.

Signed-off-by: Torin Sandall <torinsandall@gmail.com>
This commit is contained in:
Torin Sandall
2021-03-31 11:12:20 -04:00
parent 3e3655bbaf
commit 686e81d00d
+13
View File
@@ -31,8 +31,14 @@ var DefaultRootDocument = VarTerm("data")
// InputRootDocument names the document containing query arguments.
var InputRootDocument = VarTerm("input")
// SchemaRootDocument names the document containing external data schemas.
var SchemaRootDocument = VarTerm("schema")
// RootDocumentNames contains the names of top-level documents that can be
// referred to in modules and queries.
//
// Note, the schema document is not currently implemented in the evaluator so it
// is not registered as a root document name (yet).
var RootDocumentNames = NewSet(
DefaultRootDocument,
InputRootDocument,
@@ -48,6 +54,13 @@ var DefaultRootRef = Ref{DefaultRootDocument}
// All refs to query arguments are prefixed with this ref.
var InputRootRef = Ref{InputRootDocument}
// SchemaRootRef is a reference to the root of the schema document.
//
// All refs to schema documents are prefixed with this ref. Note, the schema
// document is not currently implemented in the evaluator so it is not
// registered as a root document ref (yet).
var SchemaRootRef = Ref{SchemaRootDocument}
// RootDocumentRefs contains the prefixes of top-level documents that all
// non-local references start with.
var RootDocumentRefs = NewSet(