Malli schemas for PebbleScript directives.
Three layers:
param-registry — one Malli schema per parameter type.directives — one entry per directive: its type, accepted syntax,
requires/excludes and an argument schema written as a
Malli sequence schema (:cat, :+, :*, :?).parsed-directive — a :multi schema validating a parsed directive of the
form {:directive :from, :syntax :paren, :args ["Accounts"]}.Markers (Malli properties):
:pebblestream/ambiguous A string explaining what is unclear. Wherever the
source was unclear the accepted type defaults to
:string. Run ambiguities to list every marker.
:pebblestream/unique-class Parameters sharing a class number are believed to
require distinct values (from the source's
:classes {:unique n}). Not enforced by Malli.
:pebblestream/sheet-ref The column belongs to the sheet named by the
parameter at this index (from the source's
:tags {:sheet-id n}). Not enforced by Malli.
:pebblestream/source :supplied-spec for directives taken from the
editor's specs; :not-in-supplied-spec for
directives known to exist but absent from them.
Syntax:
A directive whose source :style is :colon accepts both forms, pebblestream:name:a:b (:colon, deprecated; colons separate arguments) pebblestream:name(a, b) (:paren) A directive whose source :style is :paren accepts only :paren.
Any directive that takes no arguments, or whose arguments are all optional, may also be written bare: pebblestream:unique (:bare, not deprecated) pebblestream:unique() (:paren) pebblestream:expand (:bare) The bare form is valid only with no arguments.
Quoting: a quoted string is accepted for every string argument. A worksheet or column name that contains no space may also be written unquoted. Parsed arguments are the same either way; JSON Notation renders every string quoted. Inside quotes, a quote is written doubled ("") or escaped ("), and a backslash escapes the next character, so a literal backslash is doubled. A backslash before any other character is removed and draws an :ambiguous-backslash warning (see pebblestream.parse-str).
Exclusions are written on both directives: if A excludes B, B excludes A.
excludes-errors reports any one-way pair.
Malli schemas for PebbleScript directives.
Three layers:
1. `param-registry` — one Malli schema per parameter type.
2. `directives` — one entry per directive: its type, accepted syntax,
requires/excludes and an argument schema written as a
Malli sequence schema (:cat, :+, :*, :?).
3. `parsed-directive` — a :multi schema validating a parsed directive of the
form {:directive :from, :syntax :paren, :args ["Accounts"]}.
Markers (Malli properties):
:pebblestream/ambiguous A string explaining what is unclear. Wherever the
source was unclear the accepted type defaults to
:string. Run `ambiguities` to list every marker.
:pebblestream/unique-class Parameters sharing a class number are believed to
require distinct values (from the source's
:classes {:unique n}). Not enforced by Malli.
:pebblestream/sheet-ref The column belongs to the sheet named by the
parameter at this index (from the source's
:tags {:sheet-id n}). Not enforced by Malli.
:pebblestream/source :supplied-spec for directives taken from the
editor's specs; :not-in-supplied-spec for
directives known to exist but absent from them.
Syntax:
A directive whose source :style is :colon accepts both forms,
pebblestream:name:a:b (:colon, deprecated; colons separate arguments)
pebblestream:name(a, b) (:paren)
A directive whose source :style is :paren accepts only :paren.
Any directive that takes no arguments, or whose arguments are all optional,
may also be written bare:
pebblestream:unique (:bare, not deprecated)
pebblestream:unique() (:paren)
pebblestream:expand (:bare)
The bare form is valid only with no arguments.
Quoting: a quoted string is accepted for every string argument. A worksheet
or column name that contains no space may also be written unquoted. Parsed
arguments are the same either way; JSON Notation renders every string quoted.
Inside quotes, a quote is written doubled ("") or escaped (\"), and a
backslash escapes the next character, so a literal backslash is doubled. A
backslash before any other character is removed and draws an
:ambiguous-backslash warning (see pebblestream.parse-str).
Exclusions are written on both directives: if A excludes B, B excludes A.
`excludes-errors` reports any one-way pair.(ambiguities)Every :pebblestream/ambiguous marker, in parameter types and directives.
Every :pebblestream/ambiguous marker, in parameter types and directives.
(asymmetric-excludes)Pairs where A excludes B but B does not exclude A.
Pairs where A excludes B but B does not exclude A.
(column-roles {:keys [directive args]})The header arguments of one directive, by role: :source headers that must exist in the worksheet's sources :joined [sheet header] pairs that must exist on the joined worksheet :target headers the directive writes, which must be declared here Cell references and literal values are left out.
The header arguments of one directive, by role: :source headers that must exist in the worksheet's sources :joined [sheet header] pairs that must exist on the joined worksheet :target headers the directive writes, which must be declared here Cell references and literal values are left out.
Directives that apply to the column they annotate and may appear on more than one column of a worksheet.
Directives that apply to the column they annotate and may appear on more than one column of a worksheet.
(deprecated-directive? d)True when a parsed directive names a deprecated directive.
True when a parsed directive names a deprecated directive.
(deprecated-replacement {:keys [directive args]})The replacement text for a deprecated group directive, or nil.
The replacement text for a deprecated group directive, or nil.
(deprecated-syntax? d)True when a parsed directive uses the deprecated colon form.
True when a parsed directive uses the deprecated colon form.
(directive-phase k)When a directive runs relative to the worksheet's computation: {:phase :transformation :step n}, {:phase :value-check}, {:phase :unordered}, or nil when not yet known.
When a directive runs relative to the worksheet's computation:
{:phase :transformation :step n}, {:phase :value-check},
{:phase :unordered}, or nil when not yet known.Directive keyword -> entry. :syntax is the set of accepted surface forms; :colon is accepted only for backward compatibility and is deprecated.
Directive keyword -> entry. :syntax is the set of accepted surface forms; :colon is accepted only for backward compatibility and is deprecated.
(excludes-closure)Directive -> excludes, made symmetric.
Directive -> excludes, made symmetric.
(excludes-errors)Every exclusion must be written on both directives. Returns the one-way pairs as errors; empty when the registry is consistent.
Every exclusion must be written on both directives. Returns the one-way pairs as errors; empty when the registry is consistent.
PebbleScript is declarative: where a directive is written, and in what order, does not affect when it runs. Transformative directives on a worksheet run in this fixed order. Each step is a directive, or a directive with the directives that run as part of it (:within). The order among the :within directives does not matter.
All transformative directives run before the worksheet's formulas. After them, formula columns are filled down to the transformed rows and calculated; value-checking annotative directives then run on the completed worksheet. So prune, which runs last, can test columns the transformation produced (such as a group's total) but not formula columns.
PebbleScript is declarative: where a directive is written, and in what order, does not affect when it runs. Transformative directives on a worksheet run in this fixed order. Each step is a directive, or a directive with the directives that run as part of it (:within). The order among the :within directives does not matter. All transformative directives run before the worksheet's formulas. After them, formula columns are filled down to the transformed rows and calculated; value-checking annotative directives then run on the completed worksheet. So prune, which runs last, can test columns the transformation produced (such as a group's total) but not formula columns.
(execution-step k)The step number at which a directive runs, or nil when it is not placed.
The step number at which a directive runs, or nil when it is not placed.
(explain d)Human-readable errors for a parsed directive, or nil when it is valid.
Human-readable errors for a parsed directive, or nil when it is valid.
Directives evaluated on the formula cells of the column they annotate, after the formulas are filled down to the transformed rows. They never check cells produced directly by a transformative directive; to check such a value, test it in a formula column and annotate that column.
Directives evaluated on the formula cells of the column they annotate, after the formulas are filled down to the transformed rows. They never check cells produced directly by a transformative directive; to check such a value, test it in a formula column and annotate that column.
(group-write-conflicts worksheet-directives)Given the parsed directives on one worksheet, the columns written by more than one directive within the group step. Directives within the group step may read the same column but may not write to the same column.
Given the parsed directives on one worksheet, the columns written by more than one directive within the group step. Directives within the group step may read the same column but may not write to the same column.
Directives documented or described as existing but absent from the supplied spec. Each accepts any strings until its signature is confirmed.
Directives documented or described as existing but absent from the supplied spec. Each accepts any strings until its signature is confirmed.
Annotative directives that do not check cell values. Their order does not matter.
Annotative directives that do not check cell values. Their order does not matter.
Directives that may appear on only one worksheet of a spreadsheet. Each may appear once, except workflow-group, which annotates every column of the group key on that one worksheet.
Directives that may appear on only one worksheet of a spreadsheet. Each may appear once, except workflow-group, which annotates every column of the group key on that one worksheet.
(once-per-spreadsheet-errors sheets->directives)Given a map of worksheet name to that worksheet's parsed directives, an error for each directive that may appear on only one worksheet but appears on several, or that appears more than once where only once is allowed.
Given a map of worksheet name to that worksheet's parsed directives, an error for each directive that may appear on only one worksheet but appears on several, or that appears more than once where only once is allowed.
Directives that may appear at most once on a worksheet: the transformative directives that work with from, and the connector verbs, since a connector sheet has exactly one verb. Directives that write a column (the group sub-directives and paths-operation) may repeat, as long as each writes a different column; see write-conflicts.
Directives that may appear at most once on a worksheet: the transformative directives that work with from, and the connector verbs, since a connector sheet has exactly one verb. Directives that write a column (the group sub-directives and paths-operation) may repeat, as long as each writes a different column; see write-conflicts.
(once-per-worksheet-errors worksheet-directives)Given the parsed directives on one worksheet, an error for each directive that may appear only once but appears more often.
Given the parsed directives on one worksheet, an error for each directive that may appear only once but appears more often.
Validates {:directive k, :syntax :colon|:paren|:bare, :args [...]}. :args holds the parsed parameter values in order.
Validates {:directive k, :syntax :colon|:paren|:bare, :args [...]}.
:args holds the parsed parameter values in order.(pivot-conflicts worksheet-directives)Given the parsed directives on one worksheet, an error for each category column that pivot directives pull from more than one value column. Several pivots may share a category column only if they share its value column.
Given the parsed directives on one worksheet, an error for each category column that pivot directives pull from more than one value column. Several pivots may share a category column only if they share its value column.
(registry-errors)Entries that do not match directive-entry.
Entries that do not match `directive-entry`.
(scope k)The directive's scope, :column or :sheet, or nil when not yet confirmed.
The directive's scope, :column or :sheet, or nil when not yet confirmed.
Directives that apply to the whole worksheet. By convention they are written in the first column's annotation, though the compiler accepts any.
Directives that apply to the whole worksheet. By convention they are written in the first column's annotation, though the compiler accepts any.
(spreadsheet-errors {:keys [sheets]})Every worksheet-rule error and warning in a spreadsheet: {:errors [...] :warnings [...]}.
Every worksheet-rule error and warning in a spreadsheet:
{:errors [...] :warnings [...]}.Ambiguities about surface syntax that no single schema can carry.
Ambiguities about surface syntax that no single schema can carry.
The columns a time-series pull fills. A worksheet may have any of them, in any order.
The columns a time-series pull fills. A worksheet may have any of them, in any order.
(unclassified-annotative entries)Annotative directives not yet classified as value-checking or not.
Annotative directives not yet classified as value-checking or not.
(undeclared-targets headers worksheet-directives)The worksheet's headers determine which columns appear after its transformation: a source column not declared as a header is left out of the result. A column a transformative directive writes to must be declared. Given the worksheet's headers and parsed directives, the target columns that are not declared.
The worksheet's headers determine which columns appear after its transformation: a source column not declared as a header is left out of the result. A column a transformative directive writes to must be declared. Given the worksheet's headers and parsed directives, the target columns that are not declared.
(undefined-references)Directives named in :requires or :excludes that are not defined.
Directives named in :requires or :excludes that are not defined.
(unplaced-transformative entries)Transformative directives with no place in execution-order yet.
Transformative directives with no place in `execution-order` yet.
(unscoped entries)Directives in the supplied spec whose scope is not yet confirmed.
Directives in the supplied spec whose scope is not yet confirmed.
Annotative directives that check cell values. They run on the completed worksheet, after its transformative directives, so they see the result rows.
Annotative directives that check cell values. They run on the completed worksheet, after its transformative directives, so they see the result rows.
(write-conflicts worksheet-directives)Given the parsed directives on one worksheet, the columns written by more than one directive. A directive that writes a column (a group sub-directive or paths-operation) may repeat, as long as each writes a different column.
Given the parsed directives on one worksheet, the columns written by more than one directive. A directive that writes a column (a group sub-directive or paths-operation) may repeat, as long as each writes a different column.
(write-targets {:keys [directive args]})The columns a transformative directive writes to. A directive with an optional new column writes there when given, otherwise to its source column. Cell references are skipped, since their values are unknown until the worksheet is compiled.
The columns a transformative directive writes to. A directive with an optional new column writes there when given, otherwise to its source column. Cell references are skipped, since their values are unknown until the worksheet is compiled.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |