@azx-pbc/axiom-compiler 0.0.0-stage → 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +415 -2
- package/dist/article.d.ts +12 -0
- package/dist/article.d.ts.map +1 -0
- package/dist/article.js +16 -0
- package/dist/article.js.map +1 -0
- package/dist/cli/args.d.ts +101 -0
- package/dist/cli/args.d.ts.map +1 -0
- package/dist/cli/args.js +158 -0
- package/dist/cli/args.js.map +1 -0
- package/dist/cli/check.d.ts +2 -0
- package/dist/cli/check.d.ts.map +1 -0
- package/dist/cli/check.js +33 -0
- package/dist/cli/check.js.map +1 -0
- package/dist/cli/compile.d.ts +2 -0
- package/dist/cli/compile.d.ts.map +1 -0
- package/dist/cli/compile.js +43 -0
- package/dist/cli/compile.js.map +1 -0
- package/dist/cli/count.d.ts +15 -0
- package/dist/cli/count.d.ts.map +1 -0
- package/dist/cli/count.js +21 -0
- package/dist/cli/count.js.map +1 -0
- package/dist/cli/dataset.d.ts +28 -0
- package/dist/cli/dataset.d.ts.map +1 -0
- package/dist/cli/dataset.js +115 -0
- package/dist/cli/dataset.js.map +1 -0
- package/dist/cli/diff.d.ts +2 -0
- package/dist/cli/diff.d.ts.map +1 -0
- package/dist/cli/diff.js +297 -0
- package/dist/cli/diff.js.map +1 -0
- package/dist/cli/explain.d.ts +2 -0
- package/dist/cli/explain.d.ts.map +1 -0
- package/dist/cli/explain.js +95 -0
- package/dist/cli/explain.js.map +1 -0
- package/dist/cli/fields.d.ts +11 -0
- package/dist/cli/fields.d.ts.map +1 -0
- package/dist/cli/fields.js +13 -0
- package/dist/cli/fields.js.map +1 -0
- package/dist/cli/main.d.ts +2 -0
- package/dist/cli/main.d.ts.map +1 -0
- package/dist/cli/main.js +40 -0
- package/dist/cli/main.js.map +1 -0
- package/dist/cli/read.d.ts +56 -0
- package/dist/cli/read.d.ts.map +1 -0
- package/dist/cli/read.js +179 -0
- package/dist/cli/read.js.map +1 -0
- package/dist/cli/render.d.ts +58 -0
- package/dist/cli/render.d.ts.map +1 -0
- package/dist/cli/render.js +422 -0
- package/dist/cli/render.js.map +1 -0
- package/dist/cli/schema.d.ts +28 -0
- package/dist/cli/schema.d.ts.map +1 -0
- package/dist/cli/schema.js +46 -0
- package/dist/cli/schema.js.map +1 -0
- package/dist/cli/suite-report.d.ts +18 -0
- package/dist/cli/suite-report.d.ts.map +1 -0
- package/dist/cli/suite-report.js +58 -0
- package/dist/cli/suite-report.js.map +1 -0
- package/dist/cli/suites.d.ts +25 -0
- package/dist/cli/suites.d.ts.map +1 -0
- package/dist/cli/suites.js +67 -0
- package/dist/cli/suites.js.map +1 -0
- package/dist/cli/terminal.d.ts +45 -0
- package/dist/cli/terminal.d.ts.map +1 -0
- package/dist/cli/terminal.js +119 -0
- package/dist/cli/terminal.js.map +1 -0
- package/dist/cli/test.d.ts +12 -0
- package/dist/cli/test.d.ts.map +1 -0
- package/dist/cli/test.js +199 -0
- package/dist/cli/test.js.map +1 -0
- package/dist/cli/usage.d.ts +15 -0
- package/dist/cli/usage.d.ts.map +1 -0
- package/dist/cli/usage.js +95 -0
- package/dist/cli/usage.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +51 -0
- package/dist/cli.js.map +1 -0
- package/dist/compile/artifact-members.d.ts +57 -0
- package/dist/compile/artifact-members.d.ts.map +1 -0
- package/dist/compile/artifact-members.js +130 -0
- package/dist/compile/artifact-members.js.map +1 -0
- package/dist/compile/artifact.d.ts +20 -0
- package/dist/compile/artifact.d.ts.map +1 -0
- package/dist/compile/artifact.js +87 -0
- package/dist/compile/artifact.js.map +1 -0
- package/dist/compile/compilation.d.ts +46 -0
- package/dist/compile/compilation.d.ts.map +1 -0
- package/dist/compile/compilation.js +4 -0
- package/dist/compile/compilation.js.map +1 -0
- package/dist/compile/computed.d.ts +22 -0
- package/dist/compile/computed.d.ts.map +1 -0
- package/dist/compile/computed.js +245 -0
- package/dist/compile/computed.js.map +1 -0
- package/dist/compile/condition-warnings.d.ts +12 -0
- package/dist/compile/condition-warnings.d.ts.map +1 -0
- package/dist/compile/condition-warnings.js +26 -0
- package/dist/compile/condition-warnings.js.map +1 -0
- package/dist/compile/conditions.d.ts +18 -0
- package/dist/compile/conditions.d.ts.map +1 -0
- package/dist/compile/conditions.js +22 -0
- package/dist/compile/conditions.js.map +1 -0
- package/dist/compile/cross-checks.d.ts +67 -0
- package/dist/compile/cross-checks.d.ts.map +1 -0
- package/dist/compile/cross-checks.js +238 -0
- package/dist/compile/cross-checks.js.map +1 -0
- package/dist/compile/datasets.d.ts +52 -0
- package/dist/compile/datasets.d.ts.map +1 -0
- package/dist/compile/datasets.js +183 -0
- package/dist/compile/datasets.js.map +1 -0
- package/dist/compile/dead-weight.d.ts +26 -0
- package/dist/compile/dead-weight.d.ts.map +1 -0
- package/dist/compile/dead-weight.js +244 -0
- package/dist/compile/dead-weight.js.map +1 -0
- package/dist/compile/declaration-rules.d.ts +54 -0
- package/dist/compile/declaration-rules.d.ts.map +1 -0
- package/dist/compile/declaration-rules.js +510 -0
- package/dist/compile/declaration-rules.js.map +1 -0
- package/dist/compile/declarations.d.ts +44 -0
- package/dist/compile/declarations.d.ts.map +1 -0
- package/dist/compile/declarations.js +160 -0
- package/dist/compile/declarations.js.map +1 -0
- package/dist/compile/document.d.ts +4 -0
- package/dist/compile/document.d.ts.map +1 -0
- package/dist/compile/document.js +13 -0
- package/dist/compile/document.js.map +1 -0
- package/dist/compile/expression.d.ts +38 -0
- package/dist/compile/expression.d.ts.map +1 -0
- package/dist/compile/expression.js +288 -0
- package/dist/compile/expression.js.map +1 -0
- package/dist/compile/hashes.d.ts +26 -0
- package/dist/compile/hashes.d.ts.map +1 -0
- package/dist/compile/hashes.js +96 -0
- package/dist/compile/hashes.js.map +1 -0
- package/dist/compile/item-targets.d.ts +12 -0
- package/dist/compile/item-targets.d.ts.map +1 -0
- package/dist/compile/item-targets.js +287 -0
- package/dist/compile/item-targets.js.map +1 -0
- package/dist/compile/messages.d.ts +8 -0
- package/dist/compile/messages.d.ts.map +1 -0
- package/dist/compile/messages.js +62 -0
- package/dist/compile/messages.js.map +1 -0
- package/dist/compile/option-availability.d.ts +51 -0
- package/dist/compile/option-availability.d.ts.map +1 -0
- package/dist/compile/option-availability.js +171 -0
- package/dist/compile/option-availability.js.map +1 -0
- package/dist/compile/option-codes.d.ts +27 -0
- package/dist/compile/option-codes.d.ts.map +1 -0
- package/dist/compile/option-codes.js +212 -0
- package/dist/compile/option-codes.js.map +1 -0
- package/dist/compile/references.d.ts +14 -0
- package/dist/compile/references.d.ts.map +1 -0
- package/dist/compile/references.js +126 -0
- package/dist/compile/references.js.map +1 -0
- package/dist/compile/rows-from.d.ts +27 -0
- package/dist/compile/rows-from.d.ts.map +1 -0
- package/dist/compile/rows-from.js +164 -0
- package/dist/compile/rows-from.js.map +1 -0
- package/dist/compile/rules.d.ts +58 -0
- package/dist/compile/rules.d.ts.map +1 -0
- package/dist/compile/rules.js +327 -0
- package/dist/compile/rules.js.map +1 -0
- package/dist/compile/suggestions.d.ts +52 -0
- package/dist/compile/suggestions.d.ts.map +1 -0
- package/dist/compile/suggestions.js +633 -0
- package/dist/compile/suggestions.js.map +1 -0
- package/dist/compile/targets.d.ts +22 -0
- package/dist/compile/targets.d.ts.map +1 -0
- package/dist/compile/targets.js +125 -0
- package/dist/compile/targets.js.map +1 -0
- package/dist/compile/types.d.ts +84 -0
- package/dist/compile/types.d.ts.map +1 -0
- package/dist/compile/types.js +2 -0
- package/dist/compile/types.js.map +1 -0
- package/dist/compile/warning.d.ts +45 -0
- package/dist/compile/warning.d.ts.map +1 -0
- package/dist/compile/warning.js +2 -0
- package/dist/compile/warning.js.map +1 -0
- package/dist/compile-yaml.d.ts +23 -0
- package/dist/compile-yaml.d.ts.map +1 -0
- package/dist/compile-yaml.js +30 -0
- package/dist/compile-yaml.js.map +1 -0
- package/dist/compile.d.ts +78 -0
- package/dist/compile.d.ts.map +1 -0
- package/dist/compile.js +372 -0
- package/dist/compile.js.map +1 -0
- package/dist/csv/limits.d.ts +43 -0
- package/dist/csv/limits.d.ts.map +1 -0
- package/dist/csv/limits.js +51 -0
- package/dist/csv/limits.js.map +1 -0
- package/dist/csv/scalar.d.ts +33 -0
- package/dist/csv/scalar.d.ts.map +1 -0
- package/dist/csv/scalar.js +77 -0
- package/dist/csv/scalar.js.map +1 -0
- package/dist/datasets/csv.d.ts +46 -0
- package/dist/datasets/csv.d.ts.map +1 -0
- package/dist/datasets/csv.js +293 -0
- package/dist/datasets/csv.js.map +1 -0
- package/dist/datasets/declaration.d.ts +16 -0
- package/dist/datasets/declaration.d.ts.map +1 -0
- package/dist/datasets/declaration.js +104 -0
- package/dist/datasets/declaration.js.map +1 -0
- package/dist/datasets/diagnostics.d.ts +65 -0
- package/dist/datasets/diagnostics.d.ts.map +1 -0
- package/dist/datasets/diagnostics.js +2 -0
- package/dist/datasets/diagnostics.js.map +1 -0
- package/dist/datasets/diff.d.ts +46 -0
- package/dist/datasets/diff.d.ts.map +1 -0
- package/dist/datasets/diff.js +84 -0
- package/dist/datasets/diff.js.map +1 -0
- package/dist/datasets/document.d.ts +12 -0
- package/dist/datasets/document.d.ts.map +1 -0
- package/dist/datasets/document.js +382 -0
- package/dist/datasets/document.js.map +1 -0
- package/dist/datasets/index.d.ts +43 -0
- package/dist/datasets/index.d.ts.map +1 -0
- package/dist/datasets/index.js +68 -0
- package/dist/datasets/index.js.map +1 -0
- package/dist/datasets/repair.d.ts +26 -0
- package/dist/datasets/repair.d.ts.map +1 -0
- package/dist/datasets/repair.js +60 -0
- package/dist/datasets/repair.js.map +1 -0
- package/dist/document-path.d.ts +62 -0
- package/dist/document-path.d.ts.map +1 -0
- package/dist/document-path.js +200 -0
- package/dist/document-path.js.map +1 -0
- package/dist/expr/boundary.d.ts +8 -0
- package/dist/expr/boundary.d.ts.map +1 -0
- package/dist/expr/boundary.js +243 -0
- package/dist/expr/boundary.js.map +1 -0
- package/dist/expr/compile-expr.d.ts +35 -0
- package/dist/expr/compile-expr.d.ts.map +1 -0
- package/dist/expr/compile-expr.js +66 -0
- package/dist/expr/compile-expr.js.map +1 -0
- package/dist/expr/deprecation.d.ts +23 -0
- package/dist/expr/deprecation.d.ts.map +1 -0
- package/dist/expr/deprecation.js +28 -0
- package/dist/expr/deprecation.js.map +1 -0
- package/dist/expr/diagnostics.d.ts +31 -0
- package/dist/expr/diagnostics.d.ts.map +1 -0
- package/dist/expr/diagnostics.js +34 -0
- package/dist/expr/diagnostics.js.map +1 -0
- package/dist/expr/lexer.d.ts +49 -0
- package/dist/expr/lexer.d.ts.map +1 -0
- package/dist/expr/lexer.js +277 -0
- package/dist/expr/lexer.js.map +1 -0
- package/dist/expr/lint-warnings.d.ts +11 -0
- package/dist/expr/lint-warnings.d.ts.map +1 -0
- package/dist/expr/lint-warnings.js +20 -0
- package/dist/expr/lint-warnings.js.map +1 -0
- package/dist/expr/lint.d.ts +41 -0
- package/dist/expr/lint.d.ts.map +1 -0
- package/dist/expr/lint.js +1034 -0
- package/dist/expr/lint.js.map +1 -0
- package/dist/expr/parse/aggregates.d.ts +13 -0
- package/dist/expr/parse/aggregates.d.ts.map +1 -0
- package/dist/expr/parse/aggregates.js +48 -0
- package/dist/expr/parse/aggregates.js.map +1 -0
- package/dist/expr/parse/budget.d.ts +11 -0
- package/dist/expr/parse/budget.d.ts.map +1 -0
- package/dist/expr/parse/budget.js +57 -0
- package/dist/expr/parse/budget.js.map +1 -0
- package/dist/expr/parse/grammar.d.ts +9 -0
- package/dist/expr/parse/grammar.d.ts.map +1 -0
- package/dist/expr/parse/grammar.js +699 -0
- package/dist/expr/parse/grammar.js.map +1 -0
- package/dist/expr/parse/literals.d.ts +20 -0
- package/dist/expr/parse/literals.d.ts.map +1 -0
- package/dist/expr/parse/literals.js +132 -0
- package/dist/expr/parse/literals.js.map +1 -0
- package/dist/expr/parse/stream.d.ts +60 -0
- package/dist/expr/parse/stream.d.ts.map +1 -0
- package/dist/expr/parse/stream.js +151 -0
- package/dist/expr/parse/stream.js.map +1 -0
- package/dist/expr/parser.d.ts +45 -0
- package/dist/expr/parser.d.ts.map +1 -0
- package/dist/expr/parser.js +110 -0
- package/dist/expr/parser.js.map +1 -0
- package/dist/expr/print/spell.d.ts +78 -0
- package/dist/expr/print/spell.d.ts.map +1 -0
- package/dist/expr/print/spell.js +592 -0
- package/dist/expr/print/spell.js.map +1 -0
- package/dist/expr/print.d.ts +20 -0
- package/dist/expr/print.d.ts.map +1 -0
- package/dist/expr/print.js +102 -0
- package/dist/expr/print.js.map +1 -0
- package/dist/expr/suggest.d.ts +26 -0
- package/dist/expr/suggest.d.ts.map +1 -0
- package/dist/expr/suggest.js +77 -0
- package/dist/expr/suggest.js.map +1 -0
- package/dist/expr/typecheck/aggregates.d.ts +8 -0
- package/dist/expr/typecheck/aggregates.d.ts.map +1 -0
- package/dist/expr/typecheck/aggregates.js +334 -0
- package/dist/expr/typecheck/aggregates.js.map +1 -0
- package/dist/expr/typecheck/arithmetic.d.ts +6 -0
- package/dist/expr/typecheck/arithmetic.d.ts.map +1 -0
- package/dist/expr/typecheck/arithmetic.js +258 -0
- package/dist/expr/typecheck/arithmetic.js.map +1 -0
- package/dist/expr/typecheck/arity.d.ts +38 -0
- package/dist/expr/typecheck/arity.d.ts.map +1 -0
- package/dist/expr/typecheck/arity.js +173 -0
- package/dist/expr/typecheck/arity.js.map +1 -0
- package/dist/expr/typecheck/calls.d.ts +6 -0
- package/dist/expr/typecheck/calls.d.ts.map +1 -0
- package/dist/expr/typecheck/calls.js +137 -0
- package/dist/expr/typecheck/calls.js.map +1 -0
- package/dist/expr/typecheck/comparison.d.ts +13 -0
- package/dist/expr/typecheck/comparison.d.ts.map +1 -0
- package/dist/expr/typecheck/comparison.js +200 -0
- package/dist/expr/typecheck/comparison.js.map +1 -0
- package/dist/expr/typecheck/compound.d.ts +24 -0
- package/dist/expr/typecheck/compound.d.ts.map +1 -0
- package/dist/expr/typecheck/compound.js +175 -0
- package/dist/expr/typecheck/compound.js.map +1 -0
- package/dist/expr/typecheck/context.d.ts +44 -0
- package/dist/expr/typecheck/context.d.ts.map +1 -0
- package/dist/expr/typecheck/context.js +2 -0
- package/dist/expr/typecheck/context.js.map +1 -0
- package/dist/expr/typecheck/datasets.d.ts +17 -0
- package/dist/expr/typecheck/datasets.d.ts.map +1 -0
- package/dist/expr/typecheck/datasets.js +136 -0
- package/dist/expr/typecheck/datasets.js.map +1 -0
- package/dist/expr/typecheck/digest.d.ts +7 -0
- package/dist/expr/typecheck/digest.d.ts.map +1 -0
- package/dist/expr/typecheck/digest.js +44 -0
- package/dist/expr/typecheck/digest.js.map +1 -0
- package/dist/expr/typecheck/fold.d.ts +41 -0
- package/dist/expr/typecheck/fold.d.ts.map +1 -0
- package/dist/expr/typecheck/fold.js +71 -0
- package/dist/expr/typecheck/fold.js.map +1 -0
- package/dist/expr/typecheck/gate-folds.d.ts +22 -0
- package/dist/expr/typecheck/gate-folds.d.ts.map +1 -0
- package/dist/expr/typecheck/gate-folds.js +40 -0
- package/dist/expr/typecheck/gate-folds.js.map +1 -0
- package/dist/expr/typecheck/guards.d.ts +6 -0
- package/dist/expr/typecheck/guards.d.ts.map +1 -0
- package/dist/expr/typecheck/guards.js +38 -0
- package/dist/expr/typecheck/guards.js.map +1 -0
- package/dist/expr/typecheck/member.d.ts +17 -0
- package/dist/expr/typecheck/member.d.ts.map +1 -0
- package/dist/expr/typecheck/member.js +46 -0
- package/dist/expr/typecheck/member.js.map +1 -0
- package/dist/expr/typecheck/money.d.ts +8 -0
- package/dist/expr/typecheck/money.d.ts.map +1 -0
- package/dist/expr/typecheck/money.js +49 -0
- package/dist/expr/typecheck/money.js.map +1 -0
- package/dist/expr/typecheck/numeric.d.ts +8 -0
- package/dist/expr/typecheck/numeric.d.ts.map +1 -0
- package/dist/expr/typecheck/numeric.js +84 -0
- package/dist/expr/typecheck/numeric.js.map +1 -0
- package/dist/expr/typecheck/operands.d.ts +27 -0
- package/dist/expr/typecheck/operands.d.ts.map +1 -0
- package/dist/expr/typecheck/operands.js +106 -0
- package/dist/expr/typecheck/operands.js.map +1 -0
- package/dist/expr/typecheck/paths.d.ts +21 -0
- package/dist/expr/typecheck/paths.d.ts.map +1 -0
- package/dist/expr/typecheck/paths.js +321 -0
- package/dist/expr/typecheck/paths.js.map +1 -0
- package/dist/expr/typecheck/records.d.ts +24 -0
- package/dist/expr/typecheck/records.d.ts.map +1 -0
- package/dist/expr/typecheck/records.js +53 -0
- package/dist/expr/typecheck/records.js.map +1 -0
- package/dist/expr/typecheck/sequences.d.ts +15 -0
- package/dist/expr/typecheck/sequences.d.ts.map +1 -0
- package/dist/expr/typecheck/sequences.js +55 -0
- package/dist/expr/typecheck/sequences.js.map +1 -0
- package/dist/expr/typecheck/strings.d.ts +8 -0
- package/dist/expr/typecheck/strings.d.ts.map +1 -0
- package/dist/expr/typecheck/strings.js +188 -0
- package/dist/expr/typecheck/strings.js.map +1 -0
- package/dist/expr/typecheck/temporal.d.ts +7 -0
- package/dist/expr/typecheck/temporal.d.ts.map +1 -0
- package/dist/expr/typecheck/temporal.js +80 -0
- package/dist/expr/typecheck/temporal.js.map +1 -0
- package/dist/expr/typecheck/types.d.ts +163 -0
- package/dist/expr/typecheck/types.d.ts.map +1 -0
- package/dist/expr/typecheck/types.js +404 -0
- package/dist/expr/typecheck/types.js.map +1 -0
- package/dist/expr/typecheck.d.ts +75 -0
- package/dist/expr/typecheck.d.ts.map +1 -0
- package/dist/expr/typecheck.js +242 -0
- package/dist/expr/typecheck.js.map +1 -0
- package/dist/expr/undecided.d.ts +13 -0
- package/dist/expr/undecided.d.ts.map +1 -0
- package/dist/expr/undecided.js +58 -0
- package/dist/expr/undecided.js.map +1 -0
- package/dist/expr/values/code-points.d.ts +13 -0
- package/dist/expr/values/code-points.d.ts.map +1 -0
- package/dist/expr/values/code-points.js +25 -0
- package/dist/expr/values/code-points.js.map +1 -0
- package/dist/expr/values/inline.d.ts +77 -0
- package/dist/expr/values/inline.d.ts.map +1 -0
- package/dist/expr/values/inline.js +404 -0
- package/dist/expr/values/inline.js.map +1 -0
- package/dist/expr/values/interval.d.ts +19 -0
- package/dist/expr/values/interval.d.ts.map +1 -0
- package/dist/expr/values/interval.js +1180 -0
- package/dist/expr/values/interval.js.map +1 -0
- package/dist/index.d.ts +163 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +128 -0
- package/dist/index.js.map +1 -0
- package/dist/ingest/document.d.ts +58 -0
- package/dist/ingest/document.d.ts.map +1 -0
- package/dist/ingest/document.js +83 -0
- package/dist/ingest/document.js.map +1 -0
- package/dist/ingest/yaml-document.d.ts +15 -0
- package/dist/ingest/yaml-document.d.ts.map +1 -0
- package/dist/ingest/yaml-document.js +42 -0
- package/dist/ingest/yaml-document.js.map +1 -0
- package/dist/ingest/yaml.d.ts +51 -0
- package/dist/ingest/yaml.d.ts.map +1 -0
- package/dist/ingest/yaml.js +340 -0
- package/dist/ingest/yaml.js.map +1 -0
- package/dist/layout/compile.d.ts +6 -0
- package/dist/layout/compile.d.ts.map +1 -0
- package/dist/layout/compile.js +224 -0
- package/dist/layout/compile.js.map +1 -0
- package/dist/layout/context.d.ts +12 -0
- package/dist/layout/context.d.ts.map +1 -0
- package/dist/layout/context.js +26 -0
- package/dist/layout/context.js.map +1 -0
- package/dist/layout/grammar.d.ts +34 -0
- package/dist/layout/grammar.d.ts.map +1 -0
- package/dist/layout/grammar.js +171 -0
- package/dist/layout/grammar.js.map +1 -0
- package/dist/layout/read.d.ts +54 -0
- package/dist/layout/read.d.ts.map +1 -0
- package/dist/layout/read.js +101 -0
- package/dist/layout/read.js.map +1 -0
- package/dist/layout/shape.d.ts +34 -0
- package/dist/layout/shape.d.ts.map +1 -0
- package/dist/layout/shape.js +149 -0
- package/dist/layout/shape.js.map +1 -0
- package/dist/messages/compile.d.ts +47 -0
- package/dist/messages/compile.d.ts.map +1 -0
- package/dist/messages/compile.js +202 -0
- package/dist/messages/compile.js.map +1 -0
- package/dist/messages/locale.d.ts +18 -0
- package/dist/messages/locale.d.ts.map +1 -0
- package/dist/messages/locale.js +33 -0
- package/dist/messages/locale.js.map +1 -0
- package/dist/messages/slots.d.ts +54 -0
- package/dist/messages/slots.d.ts.map +1 -0
- package/dist/messages/slots.js +137 -0
- package/dist/messages/slots.js.map +1 -0
- package/dist/overlay/compile-overlay.d.ts +29 -0
- package/dist/overlay/compile-overlay.d.ts.map +1 -0
- package/dist/overlay/compile-overlay.js +120 -0
- package/dist/overlay/compile-overlay.js.map +1 -0
- package/dist/overlay/compose.d.ts +26 -0
- package/dist/overlay/compose.d.ts.map +1 -0
- package/dist/overlay/compose.js +674 -0
- package/dist/overlay/compose.js.map +1 -0
- package/dist/overlay/types.d.ts +41 -0
- package/dist/overlay/types.d.ts.map +1 -0
- package/dist/overlay/types.js +2 -0
- package/dist/overlay/types.js.map +1 -0
- package/dist/publish/classify.d.ts +50 -0
- package/dist/publish/classify.d.ts.map +1 -0
- package/dist/publish/classify.js +85 -0
- package/dist/publish/classify.js.map +1 -0
- package/dist/publish/environment.d.ts +15 -0
- package/dist/publish/environment.d.ts.map +1 -0
- package/dist/publish/environment.js +2 -0
- package/dist/publish/environment.js.map +1 -0
- package/dist/publish/migrations.d.ts +108 -0
- package/dist/publish/migrations.d.ts.map +1 -0
- package/dist/publish/migrations.js +166 -0
- package/dist/publish/migrations.js.map +1 -0
- package/dist/publish/observation.d.ts +29 -0
- package/dist/publish/observation.d.ts.map +1 -0
- package/dist/publish/observation.js +43 -0
- package/dist/publish/observation.js.map +1 -0
- package/dist/publish/readiness.d.ts +197 -0
- package/dist/publish/readiness.d.ts.map +1 -0
- package/dist/publish/readiness.js +239 -0
- package/dist/publish/readiness.js.map +1 -0
- package/dist/publish/vectors.d.ts +50 -0
- package/dist/publish/vectors.d.ts.map +1 -0
- package/dist/publish/vectors.js +306 -0
- package/dist/publish/vectors.js.map +1 -0
- package/dist/publish/verify.d.ts +146 -0
- package/dist/publish/verify.d.ts.map +1 -0
- package/dist/publish/verify.js +548 -0
- package/dist/publish/verify.js.map +1 -0
- package/dist/scenarios/branch.d.ts +36 -0
- package/dist/scenarios/branch.d.ts.map +1 -0
- package/dist/scenarios/branch.js +30 -0
- package/dist/scenarios/branch.js.map +1 -0
- package/dist/scenarios/capture.d.ts +89 -0
- package/dist/scenarios/capture.d.ts.map +1 -0
- package/dist/scenarios/capture.js +443 -0
- package/dist/scenarios/capture.js.map +1 -0
- package/dist/scenarios/classifier.d.ts +20 -0
- package/dist/scenarios/classifier.d.ts.map +1 -0
- package/dist/scenarios/classifier.js +88 -0
- package/dist/scenarios/classifier.js.map +1 -0
- package/dist/scenarios/credit.d.ts +33 -0
- package/dist/scenarios/credit.d.ts.map +1 -0
- package/dist/scenarios/credit.js +330 -0
- package/dist/scenarios/credit.js.map +1 -0
- package/dist/scenarios/csv.d.ts +34 -0
- package/dist/scenarios/csv.d.ts.map +1 -0
- package/dist/scenarios/csv.js +1047 -0
- package/dist/scenarios/csv.js.map +1 -0
- package/dist/scenarios/data-identity.d.ts +39 -0
- package/dist/scenarios/data-identity.d.ts.map +1 -0
- package/dist/scenarios/data-identity.js +28 -0
- package/dist/scenarios/data-identity.js.map +1 -0
- package/dist/scenarios/document.d.ts +148 -0
- package/dist/scenarios/document.d.ts.map +1 -0
- package/dist/scenarios/document.js +513 -0
- package/dist/scenarios/document.js.map +1 -0
- package/dist/scenarios/environment.d.ts +64 -0
- package/dist/scenarios/environment.d.ts.map +1 -0
- package/dist/scenarios/environment.js +106 -0
- package/dist/scenarios/environment.js.map +1 -0
- package/dist/scenarios/evidence.d.ts +128 -0
- package/dist/scenarios/evidence.d.ts.map +1 -0
- package/dist/scenarios/evidence.js +179 -0
- package/dist/scenarios/evidence.js.map +1 -0
- package/dist/scenarios/expectations.d.ts +63 -0
- package/dist/scenarios/expectations.d.ts.map +1 -0
- package/dist/scenarios/expectations.js +490 -0
- package/dist/scenarios/expectations.js.map +1 -0
- package/dist/scenarios/references.d.ts +15 -0
- package/dist/scenarios/references.d.ts.map +1 -0
- package/dist/scenarios/references.js +239 -0
- package/dist/scenarios/references.js.map +1 -0
- package/dist/scenarios/report.d.ts +216 -0
- package/dist/scenarios/report.d.ts.map +1 -0
- package/dist/scenarios/report.js +54 -0
- package/dist/scenarios/report.js.map +1 -0
- package/dist/scenarios/runner.d.ts +55 -0
- package/dist/scenarios/runner.d.ts.map +1 -0
- package/dist/scenarios/runner.js +205 -0
- package/dist/scenarios/runner.js.map +1 -0
- package/dist/scenarios/vocabulary.d.ts +19 -0
- package/dist/scenarios/vocabulary.d.ts.map +1 -0
- package/dist/scenarios/vocabulary.js +56 -0
- package/dist/scenarios/vocabulary.js.map +1 -0
- package/dist/schema/catalogue.d.ts +54 -0
- package/dist/schema/catalogue.d.ts.map +1 -0
- package/dist/schema/catalogue.js +221 -0
- package/dist/schema/catalogue.js.map +1 -0
- package/dist/schema/check.d.ts +22 -0
- package/dist/schema/check.d.ts.map +1 -0
- package/dist/schema/check.js +30 -0
- package/dist/schema/check.js.map +1 -0
- package/dist/schema/closed.d.ts +19 -0
- package/dist/schema/closed.d.ts.map +1 -0
- package/dist/schema/closed.js +33 -0
- package/dist/schema/closed.js.map +1 -0
- package/dist/schema/collapse.d.ts +27 -0
- package/dist/schema/collapse.d.ts.map +1 -0
- package/dist/schema/collapse.js +143 -0
- package/dist/schema/collapse.js.map +1 -0
- package/dist/schema/controls.d.ts +46 -0
- package/dist/schema/controls.d.ts.map +1 -0
- package/dist/schema/controls.js +75 -0
- package/dist/schema/controls.js.map +1 -0
- package/dist/schema/dataset-declaration.d.ts +11 -0
- package/dist/schema/dataset-declaration.d.ts.map +1 -0
- package/dist/schema/dataset-declaration.js +11 -0
- package/dist/schema/dataset-declaration.js.map +1 -0
- package/dist/schema/declaration-warnings.d.ts +14 -0
- package/dist/schema/declaration-warnings.d.ts.map +1 -0
- package/dist/schema/declaration-warnings.js +77 -0
- package/dist/schema/declaration-warnings.js.map +1 -0
- package/dist/schema/declarations.d.ts +41 -0
- package/dist/schema/declarations.d.ts.map +1 -0
- package/dist/schema/declarations.js +1299 -0
- package/dist/schema/declarations.js.map +1 -0
- package/dist/schema/diagnostic.d.ts +118 -0
- package/dist/schema/diagnostic.d.ts.map +1 -0
- package/dist/schema/diagnostic.js +39 -0
- package/dist/schema/diagnostic.js.map +1 -0
- package/dist/schema/document.d.ts +93 -0
- package/dist/schema/document.d.ts.map +1 -0
- package/dist/schema/document.js +507 -0
- package/dist/schema/document.js.map +1 -0
- package/dist/schema/fields.d.ts +11 -0
- package/dist/schema/fields.d.ts.map +1 -0
- package/dist/schema/fields.js +265 -0
- package/dist/schema/fields.js.map +1 -0
- package/dist/schema/gates.d.ts +4 -0
- package/dist/schema/gates.d.ts.map +1 -0
- package/dist/schema/gates.js +68 -0
- package/dist/schema/gates.js.map +1 -0
- package/dist/schema/located.d.ts +27 -0
- package/dist/schema/located.d.ts.map +1 -0
- package/dist/schema/located.js +56 -0
- package/dist/schema/located.js.map +1 -0
- package/dist/schema/measurement.d.ts +9 -0
- package/dist/schema/measurement.d.ts.map +1 -0
- package/dist/schema/measurement.js +38 -0
- package/dist/schema/measurement.js.map +1 -0
- package/dist/schema/member-wording.d.ts +35 -0
- package/dist/schema/member-wording.d.ts.map +1 -0
- package/dist/schema/member-wording.js +286 -0
- package/dist/schema/member-wording.js.map +1 -0
- package/dist/schema/metaschema.d.ts +20 -0
- package/dist/schema/metaschema.d.ts.map +1 -0
- package/dist/schema/metaschema.js +476 -0
- package/dist/schema/metaschema.js.map +1 -0
- package/dist/schema/pointer.d.ts +31 -0
- package/dist/schema/pointer.d.ts.map +1 -0
- package/dist/schema/pointer.js +73 -0
- package/dist/schema/pointer.js.map +1 -0
- package/dist/schema/primary.d.ts +29 -0
- package/dist/schema/primary.d.ts.map +1 -0
- package/dist/schema/primary.js +48 -0
- package/dist/schema/primary.js.map +1 -0
- package/dist/schema/publish-vector.d.ts +17 -0
- package/dist/schema/publish-vector.d.ts.map +1 -0
- package/dist/schema/publish-vector.js +34 -0
- package/dist/schema/publish-vector.js.map +1 -0
- package/dist/schema/repair.d.ts +34 -0
- package/dist/schema/repair.d.ts.map +1 -0
- package/dist/schema/repair.js +163 -0
- package/dist/schema/repair.js.map +1 -0
- package/dist/schema/schema-v1.generated.d.ts +14 -0
- package/dist/schema/schema-v1.generated.d.ts.map +1 -0
- package/dist/schema/schema-v1.generated.js +7089 -0
- package/dist/schema/schema-v1.generated.js.map +1 -0
- package/dist/schema/screens.d.ts +4 -0
- package/dist/schema/screens.d.ts.map +1 -0
- package/dist/schema/screens.js +28 -0
- package/dist/schema/screens.js.map +1 -0
- package/dist/schema/test-values.d.ts +12 -0
- package/dist/schema/test-values.d.ts.map +1 -0
- package/dist/schema/test-values.js +97 -0
- package/dist/schema/test-values.js.map +1 -0
- package/dist/schema/unions.d.ts +46 -0
- package/dist/schema/unions.d.ts.map +1 -0
- package/dist/schema/unions.js +131 -0
- package/dist/schema/unions.js.map +1 -0
- package/dist/schema/validate-yaml.d.ts +14 -0
- package/dist/schema/validate-yaml.d.ts.map +1 -0
- package/dist/schema/validate-yaml.js +17 -0
- package/dist/schema/validate-yaml.js.map +1 -0
- package/dist/schema/validate.d.ts +46 -0
- package/dist/schema/validate.d.ts.map +1 -0
- package/dist/schema/validate.js +186 -0
- package/dist/schema/validate.js.map +1 -0
- package/dist/testing.d.ts +21 -0
- package/dist/testing.d.ts.map +1 -0
- package/dist/testing.js +28 -0
- package/dist/testing.js.map +1 -0
- package/dist/vocabulary.d.ts +6 -0
- package/dist/vocabulary.d.ts.map +1 -0
- package/dist/vocabulary.js +26 -0
- package/dist/vocabulary.js.map +1 -0
- package/package.json +66 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grammar.js","sourceRoot":"","sources":["../../../src/expr/parse/grammar.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAEhF,O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EAClB,WAAW,CAAC,MAAM,EAClB,4FAA4F,CAC7F,CAAC;QACJ,CAAC;QACD,OAAO,MAAM,CAAC,IAAI,CAAC;YACjB,IAAI,EAAE,eAAe;YACrB,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;YACxB,MAAM;YACN,SAAS,EAAE,IAAI;YACf,GAAG,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC;SAClD,CAAC,CAAC;IACL,CAAC;YAAS,CAAC;QACT,MAAM,CAAC,SAAS,EAAE,CAAC;IACrB,CAAC;AACH,CAAC","sourcesContent":["import { BUILTIN_OPERATORS, DEPRECATED_BUILTINS } from '@azx-pbc/axiom-runtime';\nimport type { BuiltinOperator, ComparisonOperator, ExprNode } from '@azx-pbc/axiom-runtime';\nimport { ExpressionCompileError } from '../diagnostics.js';\nimport { spellStringLiteral, spellSource } from '../print/spell.js';\nimport { closestNames, spreadsheetSuggestions } from '../suggest.js';\nimport type { Token } from '../lexer.js';\nimport {\n COMPREHENSION_AGGREGATES,\n PROJECTION_AGGREGATES,\n PREDICATE_AGGREGATES,\n isAggregateBuiltin,\n} from './aggregates.js';\nimport { parseMoneyLiteral, parseMoneySpelling, typedScalarLiteral } from './literals.js';\nimport type { TokenStream } from './stream.js';\n\n/** The repair a comprehension outside an aggregate's argument list is refused with. */\nfunction comprehensionRepair(): string {\n return `a comprehension is only an argument of ${COMPREHENSION_AGGREGATES.map((name) => `\\`${name}\\``).join(', ')}; wrap it in one of those, or pass a plain list`;\n}\n\nconst BUILTIN_NAMES: ReadonlySet<string> = new Set<string>(BUILTIN_OPERATORS);\n\n/**\n * The names Expr v1 withdrew, and the spelling that replaced each.\n *\n * A stored document may still name one. The refusal is the migration: it names the operator or\n * function that carries the same answer, so an author repairs it without consulting a changelog.\n * `spec/release/expr-retention.json` records the same mapping as the release's retention policy.\n */\nconst REMOVED_BUILTINS: Readonly<Record<string, string>> = {\n div_round:\n '`round(a / b, places)` (or `round_even`, `round_up`, `round_down` for another rounding)',\n div_int: '`a // b`',\n mod_int: '`a % b`',\n sum0: '`sum(xs)`; an empty numeric list totals `0`',\n};\n\nfunction isBuiltinOperator(name: string): name is BuiltinOperator {\n return BUILTIN_NAMES.has(name);\n}\n\n/**\n * The closed set of host-language method names the parser reads as built-in calls.\n *\n * The receiver becomes the first operand: `s.trim()` is `trim(s)` and `s.startsWith(\"a\")` is\n * `starts_with(s, \"a\")`. The map is closed on purpose: a name outside it is not a method, and a\n * record member read keeps its path spelling. Property-style `.length` (without parentheses) is\n * disambiguated at typecheck time so a record member named `length` is not shadowed by `len`.\n */\nconst METHOD_ALIASES: ReadonlyMap<string, BuiltinOperator> = new Map<string, BuiltinOperator>([\n ['length', 'len'],\n ['trim', 'trim'],\n ['lower', 'lower'],\n ['toLowerCase', 'lower'],\n ['upper', 'upper'],\n ['toUpperCase', 'upper'],\n ['startsWith', 'starts_with'],\n ['endsWith', 'ends_with'],\n ['includes', 'contains'],\n ['slice', 'slice'],\n ['split', 'split'],\n ['join', 'join'],\n ['replace', 'replace'],\n ['indexOf', 'index_of'],\n]);\n\n/**\n * Whether a built-in's arguments may be comprehensions, `[EXPR-3.1.2]`. The parser owns which\n * names fold a comprehension, so an emitter asks this rather than restating the set.\n */\n\n/** The root production: one expression over the whole cursor. */\nexport function parseExpression(stream: TokenStream): ExprNode {\n return stream.nest(() => parseConditional(stream));\n}\n\n/** The ternary `condition ? then : else`; below `??`, and right-associative. */\nfunction parseConditional(stream: TokenStream): ExprNode {\n const condition = parseCoalesce(stream);\n if (!stream.eatPunctuation('?')) return condition;\n const thenNode = parseExpression(stream);\n stream.expectPunctuation(':');\n const elseNode = parseExpression(stream);\n return stream.node({ kind: 'if', args: [condition, thenNode, elseNode] });\n}\n\nfunction parseCoalesce(stream: TokenStream): ExprNode {\n const args: ExprNode[] = [parseDisjunction(stream)];\n while (stream.eatPunctuation('??')) args.push(parseDisjunction(stream));\n return args.length === 1 && args[0] !== undefined\n ? args[0]\n : stream.node({ kind: 'coalesce', args });\n}\n\nfunction parseDisjunction(stream: TokenStream): ExprNode {\n const args: ExprNode[] = [parseConjunction(stream)];\n for (;;) {\n if (stream.eatKeyword('or') || stream.eatPunctuation('||')) {\n args.push(parseConjunction(stream));\n continue;\n }\n return args.length === 1 && args[0] !== undefined ? args[0] : stream.node({ kind: 'or', args });\n }\n}\n\nfunction parseConjunction(stream: TokenStream): ExprNode {\n const args: ExprNode[] = [parseComparison(stream)];\n for (;;) {\n if (stream.eatKeyword('and') || stream.eatPunctuation('&&')) {\n args.push(parseComparison(stream));\n continue;\n }\n return args.length === 1 && args[0] !== undefined\n ? args[0]\n : stream.node({ kind: 'and', args });\n }\n}\n\nfunction parseComparison(stream: TokenStream): ExprNode {\n const operands: ExprNode[] = [parseAdditive(stream)];\n const ops: ComparisonOperator[] = [];\n const offsets: number[] = [];\n for (;;) {\n const op = comparisonOperator(stream.peek());\n if (op === undefined) break;\n offsets.push(stream.peek().offset);\n ops.push(op);\n stream.next();\n operands.push(parseAdditive(stream));\n }\n const first = ops[0];\n if (first === undefined) {\n const only = operands[0];\n if (only === undefined)\n throw new ExpressionCompileError('EXPR_PARSE_ERROR', 0, 'a comparison requires an operand');\n return only;\n }\n if (ops.length > 1) {\n // `1 < x < 5` states one relation per adjacent pair, exactly as `1 < x and x < 5` does.\n // The operands are pure and total, so writing the middle one once in source and twice in\n // the tree is unobservable. `in` states a membership, and a chain of memberships states\n // nothing, so it is refused with the explicit conjunction as the repair.\n if (ops.includes('in')) {\n const repair = chainedComparisonRepair(operands, ops);\n throw new ExpressionCompileError(\n 'EXPR_PARSE_ERROR',\n offsets[1] ?? offsets[0] ?? 0,\n repair === undefined\n ? '`in` does not chain; join the adjacent comparisons with `and`'\n : `\\`in\\` does not chain; write \\`${repair}\\``,\n );\n }\n const args: ExprNode[] = [];\n for (const [index, op] of ops.entries()) {\n const left = operands[index];\n const right = operands[index + 1];\n if (left === undefined || right === undefined) {\n throw new ExpressionCompileError(\n 'EXPR_PARSE_ERROR',\n 0,\n 'a comparison requires two operands',\n );\n }\n args.push(stream.node({ kind: 'compare', op, args: [left, right] }, offsets[index]));\n }\n return stream.node({ kind: 'and', args }, offsets[0]);\n }\n const [left, right] = operands;\n if (left === undefined || right === undefined) {\n throw new ExpressionCompileError('EXPR_PARSE_ERROR', 0, 'a comparison requires two operands');\n }\n return stream.node({ kind: 'compare', op: first, args: [left, right] });\n}\n\n/** The conjunction a chained comparison means: `a < b and b < c`. */\nfunction chainedComparisonRepair(\n operands: readonly ExprNode[],\n ops: readonly ComparisonOperator[],\n): string | undefined {\n const sources: string[] = [];\n for (const operand of operands) {\n const source = spellSource(operand);\n if (source === undefined) return undefined;\n sources.push(source);\n }\n const terms: string[] = [];\n for (const [index, op] of ops.entries()) {\n const left = sources[index];\n const right = sources[index + 1];\n if (left === undefined || right === undefined) return undefined;\n terms.push(`${left} ${op} ${right}`);\n }\n return terms.join(' and ');\n}\n\n/** The comparison operator at `token`, or `undefined`; `in` is infix-only. */\nfunction comparisonOperator(token: Token): ComparisonOperator | undefined {\n if (token.kind === 'punctuation') {\n switch (token.text) {\n case '==':\n case '=':\n return '==';\n case '!=':\n case '<>':\n return '!=';\n case '<':\n case '<=':\n case '>':\n case '>=':\n return token.text;\n default:\n return undefined;\n }\n }\n if (token.kind === 'keyword' && token.text === 'in') return 'in';\n return undefined;\n}\n\nfunction parseAdditive(stream: TokenStream): ExprNode {\n let left = parseMultiplicative(stream);\n for (;;) {\n if (stream.eatPunctuation('+')) {\n const args: ExprNode[] = [left, parseMultiplicative(stream)];\n while (stream.eatPunctuation('+')) args.push(parseMultiplicative(stream));\n left = stream.node({ kind: 'call', op: '+', args });\n continue;\n }\n if (stream.eatPunctuation('-')) {\n left = stream.node({\n kind: 'call',\n op: '-',\n args: [left, parseMultiplicative(stream)],\n });\n continue;\n }\n if (stream.atPunctuation('&')) throw ampersandRefusal(stream, left);\n return left;\n }\n}\n\n/**\n * The refusal for `&`, which BASIC and Excel spell as string concatenation.\n *\n * `concat` takes text, so the function is named only when one operand is a string literal: that\n * is the shape the author almost certainly wrote (`f_name & \" Ltd\"`). Two names or two numbers\n * are not certain enough to recommend a call that would then be refused for its operand types.\n */\nfunction ampersandRefusal(stream: TokenStream, left: ExprNode): ExpressionCompileError {\n const token = stream.next();\n const right = probeOperand(stream, parseMultiplicative);\n const leftSource = right === undefined ? undefined : spellSource(left);\n const rightSource = right === undefined ? undefined : spellSource(right);\n const textOperand =\n right !== undefined &&\n ((left.kind === 'literal' && left.domain === 'string') ||\n (right.kind === 'literal' && right.domain === 'string'));\n if (leftSource === undefined || rightSource === undefined || !textOperand) {\n return new ExpressionCompileError(\n 'EXPR_PARSE_ERROR',\n token.offset,\n '`&` is not an Expr v1 operator; string concatenation is written `concat(a, b)`',\n ['concat'],\n );\n }\n return new ExpressionCompileError(\n 'EXPR_PARSE_ERROR',\n token.offset,\n `\\`&\\` is not an Expr v1 operator; write \\`concat(${leftSource}, ${rightSource})\\``,\n ['concat'],\n );\n}\n\nfunction parseMultiplicative(stream: TokenStream): ExprNode {\n let left = parsePower(stream);\n for (;;) {\n if (stream.eatPunctuation('%')) {\n left = stream.node({ kind: 'call', op: '%', args: [left, parsePower(stream)] });\n continue;\n }\n if (stream.eatPunctuation('//')) {\n left = stream.node({ kind: 'call', op: '//', args: [left, parsePower(stream)] });\n continue;\n }\n if (stream.eatPunctuation('/')) {\n // `/` is binary and left-associative: `a / b / c` is `(a / b) / c`. It never folds a run\n // into one n-ary node, because division is not associative.\n left = stream.node({ kind: 'call', op: '/', args: [left, parsePower(stream)] });\n continue;\n }\n if (!stream.eatPunctuation('*')) return left;\n const args: ExprNode[] = [left, parsePower(stream)];\n while (stream.eatPunctuation('*')) args.push(parsePower(stream));\n left = stream.node({ kind: 'call', op: '*', args });\n }\n}\n\n/**\n * `**` and `^` are power, written `pow(a, b)`. The production is right-associative:\n * `2 ** 3 ** 2` is `2 ** (3 ** 2)`, as in Python, Ruby and ordinary mathematical notation.\n * `pow` is the canonical name, so the AST never carries the operator spelling.\n */\nfunction parsePower(stream: TokenStream): ExprNode {\n const left = parseUnary(stream);\n if (!stream.atPunctuation('**') && !stream.atPunctuation('^')) return left;\n const token = stream.next();\n const node = stream.node(\n { kind: 'call', op: 'pow', args: [left, parsePower(stream)] },\n token.offset,\n );\n stream.powerOperators.add(node);\n return node;\n}\n\n/**\n * Parses the operand after a refused infix spelling, or `undefined` when one does not parse.\n *\n * The operator is already the author's first problem: `15%` is a percentage reflex with no right\n * operand at all, and reporting the missing operand instead would bury the sentence that names\n * the operator. A defect still escapes; only the language's own refusal is absorbed.\n */\nfunction probeOperand(\n stream: TokenStream,\n parse: (stream: TokenStream) => ExprNode,\n): ExprNode | undefined {\n try {\n return parse(stream);\n } catch (error) {\n if (error instanceof ExpressionCompileError) return undefined;\n throw error;\n }\n}\n\nfunction parseUnary(stream: TokenStream): ExprNode {\n if (stream.eatKeyword('not') || stream.eatPunctuation('!')) {\n return stream.node({ kind: 'not', args: [stream.nest(() => parseUnary(stream))] });\n }\n if (stream.atPunctuation('-')) {\n const minus = stream.next();\n const token = stream.peek();\n if (token.kind === 'integer') {\n stream.next();\n const value = -token.value;\n if (value === 0) {\n throw new ExpressionCompileError(\n 'EXPR_PARSE_ERROR',\n minus.offset,\n '`-0` is not a canonical numeric literal; write `0`',\n );\n }\n if (!Number.isSafeInteger(value)) {\n throw new ExpressionCompileError(\n 'EXPR_PARSE_ERROR',\n minus.offset,\n `integer -${token.text} is outside the canonical range`,\n );\n }\n refuseNumericMember(stream);\n return stream.node({ kind: 'literal', domain: 'integer', value });\n }\n if (token.kind === 'decimal') {\n stream.next();\n if (token.value === '0') {\n throw new ExpressionCompileError(\n 'EXPR_PARSE_ERROR',\n minus.offset,\n '`-0` is not a canonical decimal literal; write `0`',\n );\n }\n refuseNumericMember(stream);\n return stream.node({ kind: 'literal', domain: 'decimal', value: `-${token.value}` });\n }\n return stream.node({ kind: 'call', op: '-', args: [stream.nest(() => parseUnary(stream))] });\n }\n return parsePrimary(stream);\n}\n\n/** Refuses `.name` immediately after an integer or decimal literal with an accurate diagnostic. */\nfunction refuseNumericMember(stream: TokenStream): void {\n if (!stream.atPunctuation('.')) return;\n const segment = stream.peek(1);\n if (segment.kind !== 'identifier') return;\n throw new ExpressionCompileError(\n 'EXPR_PARSE_ERROR',\n stream.peek().offset,\n `a numeric literal has no member or method \\`${segment.text}\\`; numbers are not records, strings or lists`,\n );\n}\n\nfunction parsePrimary(stream: TokenStream): ExprNode {\n const token = stream.peek();\n switch (token.kind) {\n case 'integer':\n stream.next();\n refuseNumericMember(stream);\n return stream.node({ kind: 'literal', domain: 'integer', value: token.value });\n case 'decimal':\n stream.next();\n refuseNumericMember(stream);\n return stream.node({ kind: 'literal', domain: 'decimal', value: token.value });\n case 'string':\n stream.next();\n return parseTrailingMembers(\n stream,\n stream.node({ kind: 'literal', domain: 'string', value: token.value }),\n );\n case 'punctuation':\n if (token.text === '(') {\n stream.next();\n const inner = parseExpression(stream);\n stream.expectPunctuation(')');\n return parseTrailingMembers(stream, inner);\n }\n if (token.text === '[') {\n stream.next();\n return parseTrailingMembers(\n stream,\n stream.node({ kind: 'list', items: parseListItems(stream) }),\n );\n }\n if (token.text === '$') {\n stream.next();\n const first = stream.expectIdentifier('an implicit binder name');\n const path = stream.node({ kind: 'path', path: `$${first}` }, token.offset);\n return parseTrailingMembers(stream, path, token.offset);\n }\n if (token.text === '=') {\n throw new ExpressionCompileError(\n 'EXPR_PARSE_ERROR',\n token.offset,\n stream.isAtStart()\n ? 'a leading `=` is a spreadsheet formula marker, not Expr v1; delete it, because Expr takes the expression itself'\n : '`=` is equality between two operands; write `f_a = 2`',\n stream.isAtStart() ? [] : ['=='],\n );\n }\n throw stream.unexpected('expected an expression');\n case 'keyword':\n return parseTrailingMembers(stream, parseKeywordPrimary(stream, token.text));\n case 'identifier':\n stream.next();\n if (stream.atPunctuation('(')) {\n return parseTrailingMembers(stream, parseCall(stream, token));\n }\n return parseTrailingMembers(\n stream,\n stream.node({ kind: 'path', path: token.text }, token.offset),\n token.offset,\n );\n default:\n throw stream.unexpected('expected an expression');\n }\n}\n\n/**\n * Trailing `.name` segments of an expression.\n *\n * `lookup(t, [k]).col` reads a member of a record an expression produced. The closed AST has\n * no member node, so the form lowers to `member(<expr>, \"col\")`, which is the same record read\n * a path performs and the type checker can prove against the declared output columns.\n *\n * A closed-set method name with `(` is a call with the receiver as its first operand: `s.trim()`\n * is `trim(s)`. Every bare `.name` (including `.length`) stays a path segment on a path and a\n * `member` read on any other expression; postfix `.length` is lowered to `len` at typecheck time\n * when the receiver is a string or list, so a genuine record member named `length` is never\n * shadowed.\n */\nfunction parseTrailingMembers(stream: TokenStream, base: ExprNode, pathOffset?: number): ExprNode {\n let node = base;\n for (;;) {\n if (!stream.atPunctuation('.')) return node;\n const segment = stream.peek(1);\n if (segment.kind !== 'identifier') return node;\n const builtin = METHOD_ALIASES.get(segment.text);\n const atCall = stream.peek(2).kind === 'punctuation' && stream.peek(2).text === '(';\n if (builtin !== undefined && atCall) {\n const dot = stream.next();\n stream.next();\n const args = parseArguments(stream, segment.text);\n node = stream.node({ kind: 'call', op: builtin, args: [node, ...args] }, dot.offset);\n continue;\n }\n if (atCall) {\n throw new ExpressionCompileError(\n 'UNKNOWN_IDENTIFIER',\n segment.offset,\n `\\`${segment.text}\\` is not a method in Expr v1; read a member with a dot, as \\`f_record.f_name\\``,\n closestNames(segment.text, [...METHOD_ALIASES.keys()]),\n );\n }\n const dot = stream.next();\n stream.next();\n if (node.kind === 'path') {\n node = stream.node(\n { kind: 'path', path: `${node.path}.${segment.text}` },\n pathOffset ?? dot.offset,\n );\n continue;\n }\n const memberNode = stream.node(\n {\n kind: 'call',\n op: 'member',\n args: [node, stream.node({ kind: 'literal', domain: 'string', value: segment.text })],\n },\n dot.offset,\n );\n if (segment.text === 'length') stream.lengthProperties.add(memberNode);\n node = memberNode;\n }\n}\n\nfunction parseKeywordPrimary(stream: TokenStream, keyword: string): ExprNode {\n if (keyword === 'true' || keyword === 'false') {\n stream.next();\n return stream.node({ kind: 'literal', domain: 'boolean', value: keyword === 'true' });\n }\n if (keyword === 'null' || keyword === 'None' || keyword === 'nil') {\n stream.next();\n return stream.node({ kind: 'literal', domain: 'null', value: null });\n }\n if (keyword === 'decimal' || keyword === 'date' || keyword === 'instant') {\n stream.next();\n const token = stream.next();\n if (token.kind !== 'string') {\n const repair = typedLiteralRepair(stream, keyword, token);\n throw new ExpressionCompileError(\n 'EXPR_PARSE_ERROR',\n token.offset,\n `\\`${keyword}\\` requires a quoted canonical spelling${repair === undefined ? '' : `; write \\`${repair}\\``}`,\n [],\n repair,\n );\n }\n return stream.node(typedScalarLiteral(keyword, token.value, token.offset));\n }\n if (keyword === 'money') {\n stream.next();\n // A parenthesised call is the spelling a host language's helper function has: name the two\n // literal forms rather than the `{` production the parser expected, because the author's\n // mistake is the whole shape, not the character here.\n if (stream.atPunctuation('(')) {\n const paren = stream.next();\n throw new ExpressionCompileError(\n 'EXPR_PARSE_ERROR',\n paren.offset,\n 'a money literal is `money \"35.00\" \"AUD\"`, or `money {\"minor\": \"3500\", \"currency\": \"AUD\", \"scale\": 2}`',\n );\n }\n // `money \"5000.00\" \"AUD\"` is the literal form; `money { ... }` is the wire object. The\n // first token after the keyword decides which production applies.\n return stream.peek().kind === 'string' ? parseMoneySpelling(stream) : parseMoneyLiteral(stream);\n }\n if (keyword === 'if') {\n const keywordToken = stream.next();\n // A bare `if` ends a comprehension's value projection and introduces its filter\n // so it is only the conditional form when a call follows.\n if (!stream.atPunctuation('(')) {\n throw new ExpressionCompileError(\n 'EXPR_PARSE_ERROR',\n keywordToken.offset,\n '`if` is the conditional form `if(condition, then, else)`',\n );\n }\n const args = parseArguments(stream, 'if');\n if (args.length !== 3) {\n throw new ExpressionCompileError(\n 'EXPR_PARSE_ERROR',\n keywordToken.offset,\n `\\`if\\` takes exactly three arguments, found ${String(args.length)}`,\n );\n }\n const [condition, thenNode, elseNode] = args;\n if (condition === undefined || thenNode === undefined || elseNode === undefined) {\n throw new ExpressionCompileError(\n 'EXPR_PARSE_ERROR',\n keywordToken.offset,\n '`if` takes exactly three arguments',\n );\n }\n return stream.node({ kind: 'if', args: [condition, thenNode, elseNode] });\n }\n if (keyword === 'in' && stream.peek(1).kind === 'punctuation' && stream.peek(1).text === '(') {\n throw new ExpressionCompileError(\n 'UNKNOWN_IDENTIFIER',\n stream.peek().offset,\n '`in` is an infix operator; write `x in xs`',\n [],\n );\n }\n throw stream.unexpected('expected an expression');\n}\n\n/**\n * The canonical spelling a typed literal most likely meant, when the shape is certain.\n *\n * `decimal 1.5` states the value without the quotes the grammar requires; `date(\"2026-01-01\")`\n * borrows a host language's call syntax. Both are repaired from tokens the parser already read,\n * so the sentence names the exact text to write rather than the shape alone. Any other following\n * token keeps the original refusal, because a wrong example is worse than none.\n */\nfunction typedLiteralRepair(\n stream: TokenStream,\n keyword: string,\n token: Token,\n): string | undefined {\n if (keyword === 'decimal') {\n if (token.kind === 'integer') return `decimal \"${token.text}\"`;\n if (token.kind === 'decimal') return `decimal \"${token.value}\"`;\n }\n if (token.kind === 'punctuation' && token.text === '(') {\n const value = stream.peek();\n const close = stream.peek(1);\n if (value.kind === 'string' && close.kind === 'punctuation' && close.text === ')') {\n return `${keyword} ${spellStringLiteral(value.value)}`;\n }\n }\n return undefined;\n}\n\nfunction parseArguments(stream: TokenStream, name: string): readonly ExprNode[] {\n stream.expectPunctuation('(');\n if (stream.eatPunctuation(')')) return [];\n const args: ExprNode[] = [];\n for (;;) {\n args.push(parseExpression(stream));\n if (stream.eatPunctuation(')')) return args;\n if (stream.atPunctuation(':')) {\n // A comprehension fed to a name outside the aggregate set would otherwise surface as\n // \"expected )\", which names the token rather than the form. Name both instead.\n const token = stream.peek();\n throw new ExpressionCompileError(\n 'EXPR_PARSE_ERROR',\n token.offset,\n `\\`${name}\\` takes no comprehension; ${comprehensionRepair()}`,\n );\n }\n stream.expectPunctuation(',');\n if (name === 'if' && args.length >= 3) {\n throw stream.unexpected('`if` takes exactly three arguments');\n }\n }\n}\n\nfunction parseListItems(stream: TokenStream): readonly ExprNode[] {\n if (stream.eatPunctuation(']')) return [];\n const items: ExprNode[] = [];\n for (;;) {\n items.push(parseExpression(stream));\n if (stream.eatPunctuation(']')) return items;\n stream.expectPunctuation(',');\n }\n}\n\nfunction parseCall(stream: TokenStream, token: Token & { kind: 'identifier' }): ExprNode {\n const name = token.text;\n const connective = CONNECTIVE_CALLS.get(name.toUpperCase());\n if (connective !== undefined) {\n const args = parseArguments(stream, name);\n const expected = connective === 'not' ? 1 : 2;\n if (args.length !== expected) {\n throw new ExpressionCompileError(\n 'EXPR_PARSE_ERROR',\n token.offset,\n `\\`${name}\\` takes ${String(expected)} argument${expected === 1 ? '' : 's'}, found ${String(args.length)}`,\n );\n }\n if (connective === 'not') {\n const [only] = args;\n if (only === undefined) {\n throw new ExpressionCompileError(\n 'EXPR_PARSE_ERROR',\n token.offset,\n '`NOT` requires one operand',\n );\n }\n return stream.node({ kind: 'not', args: [only] }, token.offset);\n }\n const [left, right] = args;\n if (left === undefined || right === undefined) {\n throw new ExpressionCompileError(\n 'EXPR_PARSE_ERROR',\n token.offset,\n `\\`${name}\\` takes two operands`,\n );\n }\n return stream.node({ kind: connective, args: [left, right] }, token.offset);\n }\n\n if (!isBuiltinOperator(name)) {\n const removed = REMOVED_BUILTINS[name];\n if (removed !== undefined) {\n throw new ExpressionCompileError(\n 'UNKNOWN_IDENTIFIER',\n token.offset,\n `\\`${name}\\` was removed from Expr v1; write ${removed}`,\n );\n }\n const familiar = familiarCallRefusal(stream, token);\n if (familiar !== undefined) throw familiar;\n throw new ExpressionCompileError(\n 'UNKNOWN_IDENTIFIER',\n token.offset,\n `\\`${name}\\` is not a built-in of Expr v1`,\n [...new Set([...closestNames(name, [...BUILTIN_NAMES]), ...spreadsheetSuggestions(name)])],\n );\n }\n // Only an authored call is recorded: `x.y` and `lookup(t, [k]).col` lower to the same AST op\n // without passing here, and those are the source forms the deprecation recommends.\n if (DEPRECATED_BUILTINS.some((entry) => entry.name === name)) {\n stream.noteDeprecated(name, token.offset);\n }\n if (isAggregateBuiltin(name)) {\n return stream.node(\n { kind: 'call', op: name, args: parseAggregateArguments(stream, name) },\n token.offset,\n );\n }\n return stream.node({ kind: 'call', op: name, args: parseArguments(stream, name) }, token.offset);\n}\n\n/** The spreadsheet connective calls and the node each one produces. */\nconst CONNECTIVE_CALLS: ReadonlyMap<string, 'and' | 'or' | 'not'> = new Map([\n ['AND', 'and'],\n ['OR', 'or'],\n ['NOT', 'not'],\n]);\n\n/**\n * The refusal for a call spelled the way Excel or Visual Basic spells an emptiness test.\n *\n * `AND`, `OR` and `NOT` are accepted as their connectives, so only `is_empty` remains: it names\n * `empty` and `absent`, because \"no content\" and \"was never captured\" are two different readings\n * and the author may mean either. `len(...) == 0` agrees with `empty` on text and lists.\n */\nfunction familiarCallRefusal(\n stream: TokenStream,\n token: Token & { kind: 'identifier' },\n): ExpressionCompileError | undefined {\n const name = token.text;\n if (name.toLowerCase() !== 'is_empty') return undefined;\n const args = parseArguments(stream, name);\n const [arg] = args;\n const source = args.length === 1 && arg !== undefined ? spellSource(arg) : undefined;\n if (source === undefined) return undefined;\n return new ExpressionCompileError(\n 'UNKNOWN_IDENTIFIER',\n token.offset,\n `\\`${name}\\` is not an Expr v1 built-in; write \\`empty(${source})\\` for \"no content\", or \\`absent(${source})\\` for \"was never captured\"`,\n );\n}\n\n/**\n * An aggregate's arguments are either ordinary expressions or one comprehension,\n * A comprehension is recognised by its binder and the `:` that fixes\n * its body, so `x in xs` without a body stays the comparison it looks like.\n */\nfunction parseAggregateArguments(stream: TokenStream, name: BuiltinOperator): readonly ExprNode[] {\n stream.expectPunctuation('(');\n if (stream.eatPunctuation(')')) return [];\n const args: ExprNode[] = [];\n for (;;) {\n args.push(atComprehension(stream) ? parseComprehension(stream, name) : parseExpression(stream));\n if (stream.eatPunctuation(')')) return args;\n stream.expectPunctuation(',');\n }\n}\n\nfunction atComprehension(stream: TokenStream): boolean {\n const binder = stream.peek();\n if (binder.kind !== 'identifier') return false;\n if (!stream.keywordAt(1, 'in')) return false;\n return hasTopLevelColon(stream);\n}\n\n/**\n * Whether a `:` follows before the argument ends, ignoring separators inside brackets and\n * colons that close a `?` in a ternary conditional.\n */\nfunction hasTopLevelColon(stream: TokenStream): boolean {\n let depth = 0;\n let ternaryDepth = 0;\n for (let offset = 0; ; offset += 1) {\n const token = stream.peek(offset);\n if (token.kind === 'eof') return false;\n if (token.kind === 'punctuation') {\n if (token.text === '(' || token.text === '[' || token.text === '{') depth += 1;\n else if (token.text === ')' || token.text === ']' || token.text === '}') {\n if (depth === 0) return false;\n depth -= 1;\n } else if (depth === 0) {\n if (token.text === ',') return false;\n if (token.text === '?') ternaryDepth += 1;\n else if (token.text === ':') {\n if (ternaryDepth === 0) return true;\n ternaryDepth -= 1;\n }\n }\n }\n }\n}\n\nfunction parseComprehension(stream: TokenStream, name: BuiltinOperator): ExprNode {\n const binderToken = stream.next();\n const binder = binderToken.text;\n if (stream.hasBinder(binder)) {\n throw new ExpressionCompileError(\n 'EXPR_PARSE_ERROR',\n binderToken.offset,\n `binder \\`${binder}\\` shadows an enclosing binder; give this one a different name`,\n );\n }\n stream.next();\n const source = parseExpression(stream);\n stream.expectPunctuation(':');\n stream.pushBinder(binder);\n try {\n const body = parseExpression(stream);\n const predicate = stream.eatKeyword('if') ? parseExpression(stream) : undefined;\n if (PREDICATE_AGGREGATES.has(name)) {\n if (predicate !== undefined) {\n throw new ExpressionCompileError(\n 'EXPR_PARSE_ERROR',\n binderToken.offset,\n `\\`${name}\\` already answers yes or no for each row, so its comprehension takes no \\`if\\` clause; write \\`${name}(r in xs: condition)\\``,\n );\n }\n return stream.node({\n kind: 'comprehension',\n binder: { name: binder },\n source,\n predicate: body,\n });\n }\n if (!PROJECTION_AGGREGATES.has(name)) {\n throw new ExpressionCompileError(\n 'EXPR_PARSE_ERROR',\n binderToken.offset,\n `a comprehension belongs only inside an aggregate call such as \\`sum(r in rows: r.amount)\\``,\n );\n }\n return stream.node({\n kind: 'comprehension',\n binder: { name: binder },\n source,\n valueExpr: body,\n ...(predicate === undefined ? {} : { predicate }),\n });\n } finally {\n stream.popBinder();\n }\n}\n"]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ExprNode, LiteralNode } from '@azx-pbc/axiom-runtime';
|
|
2
|
+
import type { TokenStream } from './stream.js';
|
|
3
|
+
/** A typed scalar literal: the spelling must already be canonical. */
|
|
4
|
+
export declare function typedScalarLiteral(keyword: 'decimal' | 'date' | 'instant', value: string, offset: number): LiteralNode;
|
|
5
|
+
/** The `money { "minor": ..., "currency": ..., "scale": ... }` literal. */
|
|
6
|
+
/**
|
|
7
|
+
* `money "5000.00" "AUD"`: an amount and a currency, the scale taken from the amount's own
|
|
8
|
+
* fraction digits.
|
|
9
|
+
*
|
|
10
|
+
* This is the literal form for a threshold an author writes by hand. The alternative — taking
|
|
11
|
+
* the scale from the value it is compared with — is unsound: the other side of a comparison is
|
|
12
|
+
* not always a declared field (it may be a literal, a computed `money_from_minor`, or a table
|
|
13
|
+
* column with no domain at all), and a literal whose type depended on its context would not be
|
|
14
|
+
* a literal. So the amount states the scale by its spelling, exactly as a money value states
|
|
15
|
+
* it on the wire: `"5000.00"` is `AUD/2` and `"5000"` is `AUD/0`. The trailing zeros are
|
|
16
|
+
* meaningful here, unlike canonical `decimal` text, because they are the declaration.
|
|
17
|
+
*/
|
|
18
|
+
export declare function parseMoneySpelling(stream: TokenStream): ExprNode;
|
|
19
|
+
export declare function parseMoneyLiteral(stream: TokenStream): ExprNode;
|
|
20
|
+
//# sourceMappingURL=literals.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"literals.d.ts","sourceRoot":"","sources":["../../../src/expr/parse/literals.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAa,MAAM,wBAAwB,CAAC;AAE/E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AA4B/C,sEAAsE;AACtE,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,SAAS,GAAG,MAAM,GAAG,SAAS,EACvC,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,GACb,WAAW,CA4Bb;AAED,2EAA2E;AAC3E;;;;;;;;;;;GAWG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,WAAW,GAAG,QAAQ,CA2ChE;AAED,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,WAAW,GAAG,QAAQ,CAoD/D"}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { asDecimalString, parseDecimal, parseInstant, parsePlainDate, toMoneyValue, tryDecimalString, } from '@azx-pbc/axiom-runtime';
|
|
2
|
+
import { ExpressionCompileError } from '../diagnostics.js';
|
|
3
|
+
/**
|
|
4
|
+
* The canonical spelling a non-canonical typed decimal most likely means.
|
|
5
|
+
*
|
|
6
|
+
* A typed literal states a value, not a wire spelling, so the same repair the untyped lexer
|
|
7
|
+
* applies to `1.50` — drop trailing fractional zeros, and write a whole value without its
|
|
8
|
+
* point — names what the author should have typed. Only a repair that is itself canonical
|
|
9
|
+
* text is offered: a leading zero, an exponent or a second point has no repair here, and the
|
|
10
|
+
* refusal keeps its original message. `-0` is repaired to `0` because the canonical-text
|
|
11
|
+
* contract forbids the signed zero.
|
|
12
|
+
*/
|
|
13
|
+
function repairedDecimal(value) {
|
|
14
|
+
const sign = value.startsWith('-') ? '-' : '';
|
|
15
|
+
const unsigned = value.slice(sign.length);
|
|
16
|
+
const dot = unsigned.indexOf('.');
|
|
17
|
+
if (dot === -1) {
|
|
18
|
+
const canonical = sign === '-' && unsigned === '0' ? '0' : undefined;
|
|
19
|
+
return canonical !== undefined && canonical !== value ? canonical : undefined;
|
|
20
|
+
}
|
|
21
|
+
const whole = unsigned.slice(0, dot);
|
|
22
|
+
const fraction = unsigned.slice(dot + 1).replace(/0+$/, '');
|
|
23
|
+
const text = fraction === '' ? `${sign}${whole}` : `${sign}${whole}.${fraction}`;
|
|
24
|
+
const canonical = text === '-0' ? '0' : text;
|
|
25
|
+
if (canonical === value)
|
|
26
|
+
return undefined;
|
|
27
|
+
return tryDecimalString(canonical) === undefined ? undefined : canonical;
|
|
28
|
+
}
|
|
29
|
+
/** A typed scalar literal: the spelling must already be canonical. */
|
|
30
|
+
export function typedScalarLiteral(keyword, value, offset) {
|
|
31
|
+
try {
|
|
32
|
+
// A typed decimal literal is held to the same 34-significant-digit bound as an untyped
|
|
33
|
+
// one: a literal the engine cannot carry must not
|
|
34
|
+
// reach an artifact as a value no comparison, rounding or arithmetic will accept.
|
|
35
|
+
if (keyword === 'decimal') {
|
|
36
|
+
const canonical = asDecimalString(value);
|
|
37
|
+
parseDecimal(canonical);
|
|
38
|
+
return { kind: 'literal', domain: 'decimal', value: canonical };
|
|
39
|
+
}
|
|
40
|
+
if (keyword === 'date') {
|
|
41
|
+
parsePlainDate(value);
|
|
42
|
+
return { kind: 'literal', domain: 'date', value };
|
|
43
|
+
}
|
|
44
|
+
parseInstant(value);
|
|
45
|
+
return { kind: 'literal', domain: 'instant', value };
|
|
46
|
+
}
|
|
47
|
+
catch (error) {
|
|
48
|
+
const refused = error instanceof Error ? error.message : `\`${keyword}\` literal is not canonical`;
|
|
49
|
+
const repair = keyword === 'decimal' ? repairedDecimal(value) : undefined;
|
|
50
|
+
throw new ExpressionCompileError('EXPR_PARSE_ERROR', offset, repair === undefined ? refused : `${refused}; write \`${repair}\``, [], repair);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
/** The `money { "minor": ..., "currency": ..., "scale": ... }` literal. */
|
|
54
|
+
/**
|
|
55
|
+
* `money "5000.00" "AUD"`: an amount and a currency, the scale taken from the amount's own
|
|
56
|
+
* fraction digits.
|
|
57
|
+
*
|
|
58
|
+
* This is the literal form for a threshold an author writes by hand. The alternative — taking
|
|
59
|
+
* the scale from the value it is compared with — is unsound: the other side of a comparison is
|
|
60
|
+
* not always a declared field (it may be a literal, a computed `money_from_minor`, or a table
|
|
61
|
+
* column with no domain at all), and a literal whose type depended on its context would not be
|
|
62
|
+
* a literal. So the amount states the scale by its spelling, exactly as a money value states
|
|
63
|
+
* it on the wire: `"5000.00"` is `AUD/2` and `"5000"` is `AUD/0`. The trailing zeros are
|
|
64
|
+
* meaningful here, unlike canonical `decimal` text, because they are the declaration.
|
|
65
|
+
*/
|
|
66
|
+
export function parseMoneySpelling(stream) {
|
|
67
|
+
const amount = stream.next();
|
|
68
|
+
if (amount.kind !== 'string') {
|
|
69
|
+
throw new ExpressionCompileError('EXPR_PARSE_ERROR', amount.offset, 'money requires a quoted amount, such as `money "5000.00" "AUD"`');
|
|
70
|
+
}
|
|
71
|
+
const currency = stream.next();
|
|
72
|
+
if (currency.kind !== 'string') {
|
|
73
|
+
throw new ExpressionCompileError('EXPR_PARSE_ERROR', currency.offset, 'money requires a quoted currency code after the amount, such as `money "5000.00" "AUD"`');
|
|
74
|
+
}
|
|
75
|
+
const match = /^(-?)(0|[1-9][0-9]*)(?:\.([0-9]{1,6}))?$/.exec(amount.value);
|
|
76
|
+
if (match === null) {
|
|
77
|
+
throw new ExpressionCompileError('EXPR_PARSE_ERROR', amount.offset, 'money amount must be decimal text with at most six fraction digits, such as `"5000.00"`');
|
|
78
|
+
}
|
|
79
|
+
if (!/^[A-Z]{3}$/.test(currency.value)) {
|
|
80
|
+
throw new ExpressionCompileError('EXPR_PARSE_ERROR', currency.offset, 'money currency must be three upper-case ASCII letters');
|
|
81
|
+
}
|
|
82
|
+
const [, sign = '', whole = '0', fraction = ''] = match;
|
|
83
|
+
const minor = BigInt(`${whole}${fraction}`).toString();
|
|
84
|
+
return stream.node({
|
|
85
|
+
kind: 'literal',
|
|
86
|
+
domain: 'money',
|
|
87
|
+
value: {
|
|
88
|
+
minor: sign === '-' && minor !== '0' ? `-${minor}` : minor,
|
|
89
|
+
currency: currency.value,
|
|
90
|
+
scale: fraction.length,
|
|
91
|
+
},
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
export function parseMoneyLiteral(stream) {
|
|
95
|
+
stream.expectPunctuation('{');
|
|
96
|
+
const members = {};
|
|
97
|
+
const expectKey = (key) => {
|
|
98
|
+
const token = stream.next();
|
|
99
|
+
if (token.kind !== 'string' || token.value !== key) {
|
|
100
|
+
throw new ExpressionCompileError('EXPR_PARSE_ERROR', token.offset, `a money literal declares \`"${key}"\` here`);
|
|
101
|
+
}
|
|
102
|
+
stream.expectPunctuation(':');
|
|
103
|
+
};
|
|
104
|
+
const readString = (what) => {
|
|
105
|
+
const token = stream.next();
|
|
106
|
+
if (token.kind !== 'string') {
|
|
107
|
+
throw new ExpressionCompileError('EXPR_PARSE_ERROR', token.offset, `money ${what} must be a quoted string`);
|
|
108
|
+
}
|
|
109
|
+
return token.value;
|
|
110
|
+
};
|
|
111
|
+
expectKey('minor');
|
|
112
|
+
members['minor'] = readString('minor');
|
|
113
|
+
stream.expectPunctuation(',');
|
|
114
|
+
expectKey('currency');
|
|
115
|
+
members['currency'] = readString('currency');
|
|
116
|
+
stream.expectPunctuation(',');
|
|
117
|
+
expectKey('scale');
|
|
118
|
+
const scale = stream.next();
|
|
119
|
+
if (scale.kind !== 'integer' || scale.value < 0) {
|
|
120
|
+
throw new ExpressionCompileError('EXPR_PARSE_ERROR', scale.offset, 'money scale must be a non-negative integer literal');
|
|
121
|
+
}
|
|
122
|
+
members['scale'] = scale.value;
|
|
123
|
+
stream.expectPunctuation('}');
|
|
124
|
+
try {
|
|
125
|
+
const money = toMoneyValue(members);
|
|
126
|
+
return stream.node({ kind: 'literal', domain: 'money', value: money });
|
|
127
|
+
}
|
|
128
|
+
catch (error) {
|
|
129
|
+
throw new ExpressionCompileError('EXPR_PARSE_ERROR', stream.peek().offset, error instanceof Error ? error.message : 'money literal is not canonical');
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
//# sourceMappingURL=literals.js.map
|
|
@@ -0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MoneyValue,\n tryDecimalString,\n} from '@azx-pbc/axiom-runtime';\nimport type { ExprNode, LiteralNode, WireValue } from '@azx-pbc/axiom-runtime';\nimport { ExpressionCompileError } from '../diagnostics.js';\nimport type { TokenStream } from './stream.js';\n\n/**\n * The canonical spelling a non-canonical typed decimal most likely means.\n *\n * A typed literal states a value, not a wire spelling, so the same repair the untyped lexer\n * applies to `1.50` — drop trailing fractional zeros, and write a whole value without its\n * point — names what the author should have typed. Only a repair that is itself canonical\n * text is offered: a leading zero, an exponent or a second point has no repair here, and the\n * refusal keeps its original message. `-0` is repaired to `0` because the canonical-text\n * contract forbids the signed zero.\n */\nfunction repairedDecimal(value: string): string | undefined {\n const sign = value.startsWith('-') ? '-' : '';\n const unsigned = value.slice(sign.length);\n const dot = unsigned.indexOf('.');\n if (dot === -1) {\n const canonical = sign === '-' && unsigned === '0' ? '0' : undefined;\n return canonical !== undefined && canonical !== value ? canonical : undefined;\n }\n const whole = unsigned.slice(0, dot);\n const fraction = unsigned.slice(dot + 1).replace(/0+$/, '');\n const text = fraction === '' ? `${sign}${whole}` : `${sign}${whole}.${fraction}`;\n const canonical = text === '-0' ? '0' : text;\n if (canonical === value) return undefined;\n return tryDecimalString(canonical) === undefined ? undefined : canonical;\n}\n\n/** A typed scalar literal: the spelling must already be canonical. */\nexport function typedScalarLiteral(\n keyword: 'decimal' | 'date' | 'instant',\n value: string,\n offset: number,\n): LiteralNode {\n try {\n // A typed decimal literal is held to the same 34-significant-digit bound as an untyped\n // one: a literal the engine cannot carry must not\n // reach an artifact as a value no comparison, rounding or arithmetic will accept.\n if (keyword === 'decimal') {\n const canonical = asDecimalString(value);\n parseDecimal(canonical);\n return { kind: 'literal', domain: 'decimal', value: canonical };\n }\n if (keyword === 'date') {\n parsePlainDate(value);\n return { kind: 'literal', domain: 'date', value };\n }\n parseInstant(value);\n return { kind: 'literal', domain: 'instant', value };\n } catch (error) {\n const refused =\n error instanceof Error ? error.message : `\\`${keyword}\\` literal is not canonical`;\n const repair = keyword === 'decimal' ? repairedDecimal(value) : undefined;\n throw new ExpressionCompileError(\n 'EXPR_PARSE_ERROR',\n offset,\n repair === undefined ? refused : `${refused}; write \\`${repair}\\``,\n [],\n repair,\n );\n }\n}\n\n/** The `money { \"minor\": ..., \"currency\": ..., \"scale\": ... }` literal. */\n/**\n * `money \"5000.00\" \"AUD\"`: an amount and a currency, the scale taken from the amount's own\n * fraction digits.\n *\n * This is the literal form for a threshold an author writes by hand. The alternative — taking\n * the scale from the value it is compared with — is unsound: the other side of a comparison is\n * not always a declared field (it may be a literal, a computed `money_from_minor`, or a table\n * column with no domain at all), and a literal whose type depended on its context would not be\n * a literal. So the amount states the scale by its spelling, exactly as a money value states\n * it on the wire: `\"5000.00\"` is `AUD/2` and `\"5000\"` is `AUD/0`. The trailing zeros are\n * meaningful here, unlike canonical `decimal` text, because they are the declaration.\n */\nexport function parseMoneySpelling(stream: TokenStream): ExprNode {\n const amount = stream.next();\n if (amount.kind !== 'string') {\n throw new ExpressionCompileError(\n 'EXPR_PARSE_ERROR',\n amount.offset,\n 'money requires a quoted amount, such as `money \"5000.00\" \"AUD\"`',\n );\n }\n const currency = stream.next();\n if (currency.kind !== 'string') {\n throw new ExpressionCompileError(\n 'EXPR_PARSE_ERROR',\n currency.offset,\n 'money requires a quoted currency code after the amount, such as `money \"5000.00\" \"AUD\"`',\n );\n }\n const match = /^(-?)(0|[1-9][0-9]*)(?:\\.([0-9]{1,6}))?$/.exec(amount.value);\n if (match === null) {\n throw new ExpressionCompileError(\n 'EXPR_PARSE_ERROR',\n amount.offset,\n 'money amount must be decimal text with at most six fraction digits, such as `\"5000.00\"`',\n );\n }\n if (!/^[A-Z]{3}$/.test(currency.value)) {\n throw new ExpressionCompileError(\n 'EXPR_PARSE_ERROR',\n currency.offset,\n 'money currency must be three upper-case ASCII letters',\n );\n }\n const [, sign = '', whole = '0', fraction = ''] = match;\n const minor = BigInt(`${whole}${fraction}`).toString();\n return stream.node({\n kind: 'literal',\n domain: 'money',\n value: {\n minor: sign === '-' && minor !== '0' ? `-${minor}` : minor,\n currency: currency.value,\n scale: fraction.length,\n },\n });\n}\n\nexport function parseMoneyLiteral(stream: TokenStream): ExprNode {\n stream.expectPunctuation('{');\n const members: Record<string, WireValue> = {};\n const expectKey = (key: string): void => {\n const token = stream.next();\n if (token.kind !== 'string' || token.value !== key) {\n throw new ExpressionCompileError(\n 'EXPR_PARSE_ERROR',\n token.offset,\n `a money literal declares \\`\"${key}\"\\` here`,\n );\n }\n stream.expectPunctuation(':');\n };\n const readString = (what: string): string => {\n const token = stream.next();\n if (token.kind !== 'string') {\n throw new ExpressionCompileError(\n 'EXPR_PARSE_ERROR',\n token.offset,\n `money ${what} must be a quoted string`,\n );\n }\n return token.value;\n };\n expectKey('minor');\n members['minor'] = readString('minor');\n stream.expectPunctuation(',');\n expectKey('currency');\n members['currency'] = readString('currency');\n stream.expectPunctuation(',');\n expectKey('scale');\n const scale = stream.next();\n if (scale.kind !== 'integer' || scale.value < 0) {\n throw new ExpressionCompileError(\n 'EXPR_PARSE_ERROR',\n scale.offset,\n 'money scale must be a non-negative integer literal',\n );\n }\n members['scale'] = scale.value;\n stream.expectPunctuation('}');\n try {\n const money = toMoneyValue(members);\n return stream.node({ kind: 'literal', domain: 'money', value: money });\n } catch (error) {\n throw new ExpressionCompileError(\n 'EXPR_PARSE_ERROR',\n stream.peek().offset,\n error instanceof Error ? error.message : 'money literal is not canonical',\n );\n }\n}\n"]}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type { BuiltinOperator, ExprNode } from '@azx-pbc/axiom-runtime';
|
|
2
|
+
import type { DeprecatedCall } from '../deprecation.js';
|
|
3
|
+
import { ExpressionCompileError } from '../diagnostics.js';
|
|
4
|
+
import type { Punctuation, Token } from '../lexer.js';
|
|
5
|
+
/** The refusal for `xs[0]`, naming the forms that replace indexing. */
|
|
6
|
+
export declare function indexingError(offset: number): ExpressionCompileError;
|
|
7
|
+
/**
|
|
8
|
+
* The cursor the descent reads and moves: lookahead and consumption over the token stream,
|
|
9
|
+
* plus the bookkeeping every production records — each node's source offset, the node and
|
|
10
|
+
* nesting budgets, and the binders currently in scope.
|
|
11
|
+
*/
|
|
12
|
+
export declare class TokenStream {
|
|
13
|
+
private readonly tokens;
|
|
14
|
+
private index;
|
|
15
|
+
private nodes;
|
|
16
|
+
/** Expression nesting the descent currently holds, refused past `MAX_PARSE_NESTING`. */
|
|
17
|
+
private nesting;
|
|
18
|
+
readonly offsets: WeakMap<ExprNode, number>;
|
|
19
|
+
/** The `pow` nodes the authored `**`/`^` spelling produced, so typing can keep its rule. */
|
|
20
|
+
readonly powerOperators: WeakSet<ExprNode>;
|
|
21
|
+
/** Postfix `.length` member-read calls that lower to `len` when the receiver is a string or list. */
|
|
22
|
+
readonly lengthProperties: WeakSet<ExprNode>;
|
|
23
|
+
/** Binder names in scope, so a nested binder cannot shadow an outer one. */
|
|
24
|
+
private readonly binders;
|
|
25
|
+
/** Authored calls to names the language has deprecated, in source order. */
|
|
26
|
+
private readonly deprecatedCalls;
|
|
27
|
+
constructor(tokens: readonly Token[]);
|
|
28
|
+
peek(offset?: number): Token;
|
|
29
|
+
next(): Token;
|
|
30
|
+
/**
|
|
31
|
+
* Records the token offset a node starts at. A caller that has consumed more than one
|
|
32
|
+
* token passes the first token's offset explicitly; otherwise the token just consumed is
|
|
33
|
+
* the node's own token.
|
|
34
|
+
*/
|
|
35
|
+
node<T extends ExprNode>(node: T, offset?: number): T;
|
|
36
|
+
/** Records one authored call to a deprecated name, at the call's source offset. */
|
|
37
|
+
noteDeprecated(name: BuiltinOperator, offset: number): void;
|
|
38
|
+
/** The authored deprecated calls seen so far, in source order. */
|
|
39
|
+
deprecations(): readonly DeprecatedCall[];
|
|
40
|
+
atPunctuation(text: Punctuation): boolean;
|
|
41
|
+
/** Whether the cursor is at the first token, used to name a leading spreadsheet `=`. */
|
|
42
|
+
isAtStart(): boolean;
|
|
43
|
+
atKeyword(text: string): boolean;
|
|
44
|
+
keywordAt(offset: number, keyword: string): boolean;
|
|
45
|
+
eatPunctuation(text: Punctuation): boolean;
|
|
46
|
+
eatKeyword(text: string): boolean;
|
|
47
|
+
expectPunctuation(text: Punctuation): Token;
|
|
48
|
+
expectIdentifier(what: string): string;
|
|
49
|
+
unexpected(detail: string): ExpressionCompileError;
|
|
50
|
+
/**
|
|
51
|
+
* Descends one level of expression nesting. A source of nested groups is
|
|
52
|
+
* bounded here rather than after parsing because the host stack gives out first, and a
|
|
53
|
+
* `RangeError` is not the refusal this compiler reports.
|
|
54
|
+
*/
|
|
55
|
+
nest<T>(parse: () => T): T;
|
|
56
|
+
hasBinder(name: string): boolean;
|
|
57
|
+
pushBinder(name: string): void;
|
|
58
|
+
popBinder(): void;
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=stream.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stream.d.ts","sourceRoot":"","sources":["../../../src/expr/parse/stream.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AACxE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAatD,uEAAuE;AACvE,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,sBAAsB,CAOpE;AAED;;;;GAIG;AACH,qBAAa,WAAW;IACtB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAmB;IAC1C,OAAO,CAAC,KAAK,CAAa;IAC1B,OAAO,CAAC,KAAK,CAAa;IAC1B,wFAAwF;IACxF,OAAO,CAAC,OAAO,CAAa;IAC5B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAiB;IAC5D,4FAA4F;IAC5F,Q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AAM,CAAC,GAAG,CAAC,CAczB;IAED,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAE/B;IAED,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAE7B;IAED,SAAS,IAAI,IAAI,CAEhB;CACF"}
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import { ExpressionCompileError } from '../diagnostics.js';
|
|
2
|
+
import { MAX_AST_NODES } from './budget.js';
|
|
3
|
+
/**
|
|
4
|
+
* Levels of expression nesting the recursive descent may descend. The depth budget above is
|
|
5
|
+
* measured on the finished tree, so it cannot see a parenthesised group (which builds no node)
|
|
6
|
+
* and it runs only after the descent has happened — a source inside the token budget can nest
|
|
7
|
+
* far enough to overflow the host stack before any tree exists. The bound doubles
|
|
8
|
+
* `MAX_AST_DEPTH`, which is what a legal expression needs, and stays an order of magnitude
|
|
9
|
+
* below the smallest stack this browser-safe compiler runs on.
|
|
10
|
+
*/
|
|
11
|
+
const MAX_PARSE_NESTING = 64;
|
|
12
|
+
/** The refusal for `xs[0]`, naming the forms that replace indexing. */
|
|
13
|
+
export function indexingError(offset) {
|
|
14
|
+
return new ExpressionCompileError('EXPR_PARSE_ERROR', offset, 'indexing is not part of Expr v1; use a comprehension binder ($it, $i, $prev, $next) for element access, or len and the aggregates for whole-list questions', ['$it', '$i', '$prev', '$next', 'len']);
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* The cursor the descent reads and moves: lookahead and consumption over the token stream,
|
|
18
|
+
* plus the bookkeeping every production records — each node's source offset, the node and
|
|
19
|
+
* nesting budgets, and the binders currently in scope.
|
|
20
|
+
*/
|
|
21
|
+
export class TokenStream {
|
|
22
|
+
tokens;
|
|
23
|
+
index = 0;
|
|
24
|
+
nodes = 0;
|
|
25
|
+
/** Expression nesting the descent currently holds, refused past `MAX_PARSE_NESTING`. */
|
|
26
|
+
nesting = 0;
|
|
27
|
+
offsets = new WeakMap();
|
|
28
|
+
/** The `pow` nodes the authored `**`/`^` spelling produced, so typing can keep its rule. */
|
|
29
|
+
powerOperators = new WeakSet();
|
|
30
|
+
/** Postfix `.length` member-read calls that lower to `len` when the receiver is a string or list. */
|
|
31
|
+
lengthProperties = new WeakSet();
|
|
32
|
+
/** Binder names in scope, so a nested binder cannot shadow an outer one. */
|
|
33
|
+
binders = [];
|
|
34
|
+
/** Authored calls to names the language has deprecated, in source order. */
|
|
35
|
+
deprecatedCalls = [];
|
|
36
|
+
constructor(tokens) {
|
|
37
|
+
this.tokens = tokens;
|
|
38
|
+
}
|
|
39
|
+
peek(offset = 0) {
|
|
40
|
+
return (this.tokens[Math.min(this.index + offset, this.tokens.length - 1)] ?? {
|
|
41
|
+
kind: 'eof',
|
|
42
|
+
text: '',
|
|
43
|
+
offset: 0,
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
next() {
|
|
47
|
+
const token = this.peek();
|
|
48
|
+
this.index += 1;
|
|
49
|
+
return token;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Records the token offset a node starts at. A caller that has consumed more than one
|
|
53
|
+
* token passes the first token's offset explicitly; otherwise the token just consumed is
|
|
54
|
+
* the node's own token.
|
|
55
|
+
*/
|
|
56
|
+
node(node, offset) {
|
|
57
|
+
const start = offset ?? this.tokens[Math.max(0, this.index - 1)]?.offset;
|
|
58
|
+
if (start !== undefined)
|
|
59
|
+
this.offsets.set(node, start);
|
|
60
|
+
this.nodes += 1;
|
|
61
|
+
if (this.nodes > MAX_AST_NODES) {
|
|
62
|
+
throw new ExpressionCompileError('COST_BUDGET_EXCEEDED', 0, `the expression exceeds the ${String(MAX_AST_NODES)}-node AST budget`);
|
|
63
|
+
}
|
|
64
|
+
return node;
|
|
65
|
+
}
|
|
66
|
+
/** Records one authored call to a deprecated name, at the call's source offset. */
|
|
67
|
+
noteDeprecated(name, offset) {
|
|
68
|
+
this.deprecatedCalls.push({ name, offset });
|
|
69
|
+
}
|
|
70
|
+
/** The authored deprecated calls seen so far, in source order. */
|
|
71
|
+
deprecations() {
|
|
72
|
+
return this.deprecatedCalls;
|
|
73
|
+
}
|
|
74
|
+
atPunctuation(text) {
|
|
75
|
+
const token = this.peek();
|
|
76
|
+
return token.kind === 'punctuation' && token.text === text;
|
|
77
|
+
}
|
|
78
|
+
/** Whether the cursor is at the first token, used to name a leading spreadsheet `=`. */
|
|
79
|
+
isAtStart() {
|
|
80
|
+
return this.index === 0;
|
|
81
|
+
}
|
|
82
|
+
atKeyword(text) {
|
|
83
|
+
const token = this.peek();
|
|
84
|
+
return token.kind === 'keyword' && token.text === text;
|
|
85
|
+
}
|
|
86
|
+
keywordAt(offset, keyword) {
|
|
87
|
+
const token = this.peek(offset);
|
|
88
|
+
return token.kind === 'keyword' && token.text === keyword;
|
|
89
|
+
}
|
|
90
|
+
eatPunctuation(text) {
|
|
91
|
+
if (!this.atPunctuation(text))
|
|
92
|
+
return false;
|
|
93
|
+
this.index += 1;
|
|
94
|
+
return true;
|
|
95
|
+
}
|
|
96
|
+
eatKeyword(text) {
|
|
97
|
+
if (!this.atKeyword(text))
|
|
98
|
+
return false;
|
|
99
|
+
this.index += 1;
|
|
100
|
+
return true;
|
|
101
|
+
}
|
|
102
|
+
expectPunctuation(text) {
|
|
103
|
+
if (!this.atPunctuation(text)) {
|
|
104
|
+
throw this.unexpected(`expected \`${text}\``);
|
|
105
|
+
}
|
|
106
|
+
return this.next();
|
|
107
|
+
}
|
|
108
|
+
expectIdentifier(what) {
|
|
109
|
+
const token = this.peek();
|
|
110
|
+
if (token.kind !== 'identifier')
|
|
111
|
+
throw this.unexpected(`expected ${what}`);
|
|
112
|
+
this.index += 1;
|
|
113
|
+
return token.text;
|
|
114
|
+
}
|
|
115
|
+
unexpected(detail) {
|
|
116
|
+
const token = this.peek();
|
|
117
|
+
// A `[` anywhere the grammar does not build a list is the indexing form of
|
|
118
|
+
// so it is reported with its alternatives rather than as a missing
|
|
119
|
+
// separator: `len(xs[0])` and `xs[0]` are the same authoring mistake.
|
|
120
|
+
if (token.kind === 'punctuation' && token.text === '[')
|
|
121
|
+
return indexingError(token.offset);
|
|
122
|
+
return new ExpressionCompileError('EXPR_PARSE_ERROR', token.offset, `${detail}, found \`${token.kind === 'eof' ? 'end of input' : token.text}\``);
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Descends one level of expression nesting. A source of nested groups is
|
|
126
|
+
* bounded here rather than after parsing because the host stack gives out first, and a
|
|
127
|
+
* `RangeError` is not the refusal this compiler reports.
|
|
128
|
+
*/
|
|
129
|
+
nest(parse) {
|
|
130
|
+
if (this.nesting >= MAX_PARSE_NESTING) {
|
|
131
|
+
throw new ExpressionCompileError('COST_BUDGET_EXCEEDED', this.peek().offset, `the expression nests more than ${String(MAX_PARSE_NESTING)} levels deep`);
|
|
132
|
+
}
|
|
133
|
+
this.nesting += 1;
|
|
134
|
+
try {
|
|
135
|
+
return parse();
|
|
136
|
+
}
|
|
137
|
+
finally {
|
|
138
|
+
this.nesting -= 1;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
hasBinder(name) {
|
|
142
|
+
return this.binders.includes(name);
|
|
143
|
+
}
|
|
144
|
+
pushBinder(name) {
|
|
145
|
+
this.binders.push(name);
|
|
146
|
+
}
|
|
147
|
+
popBinder() {
|
|
148
|
+
this.binders.pop();
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
//# sourceMappingURL=stream.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stream.js","sourceRoot":"","sources":["../../../src/expr/parse/stream.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAE3D,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C;;;;;;;GAOG;AACH,MAAM,iBAAiB,GAAG,EAAE,CAAC;AAE7B,uEAAuE;AACvE,MAAM,UAAU,aAAa,CAAC,MAAc;IAC1C,OAAO,IAAI,sBAAsB,CAC/B,kBAAkB,EAClB,MA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,KAAK,KAAK,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,IAAI,CAC7E,CAAC;IACJ,CAAC;IAED;;;;OAIG;IACH,IAAI,CAAI,KAAc;QACpB,IAAI,IAAI,CAAC,OAAO,IAAI,iBAAiB,EAAE,CAAC;YACtC,MAAM,IAAI,sBAAsB,CAC9B,sBAAsB,EACtB,IAAI,CAAC,IAAI,EAAE,CAAC,MAAM,EAClB,kCAAkC,MAAM,CAAC,iBAAiB,CAAC,cAAc,CAC1E,CAAC;QACJ,CAAC;QACD,IAAI,CAAC,OAAO,IAAI,CAAC,CAAC;QAClB,IAAI,CAAC;YACH,OAAO,KAAK,EAAE,CAAC;QACjB,CAAC;gBAAS,CAAC;YACT,IAAI,CAAC,OAAO,IAAI,CAAC,CAAC;QACpB,CAAC;IACH,CAAC;IAED,SAAS,CAAC,IAAY;QACpB,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IACrC,CAAC;IAED,UAAU,CAAC,IAAY;QACrB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;IAED,SAAS;QACP,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC;IACrB,CAAC;CACF","sourcesContent":["import type { BuiltinOperator, ExprNode } from '@azx-pbc/axiom-runtime';\nimport type { DeprecatedCall } from '../deprecation.js';\nimport { ExpressionCompileError } from '../diagnostics.js';\nimport type { Punctuation, Token } from '../lexer.js';\nimport { MAX_AST_NODES } from './budget.js';\n\n/**\n * Levels of expression nesting the recursive descent may descend. The depth budget above is\n * measured on the finished tree, so it cannot see a parenthesised group (which builds no node)\n * and it runs only after the descent has happened — a source inside the token budget can nest\n * far enough to overflow the host stack before any tree exists. The bound doubles\n * `MAX_AST_DEPTH`, which is what a legal expression needs, and stays an order of magnitude\n * below the smallest stack this browser-safe compiler runs on.\n */\nconst MAX_PARSE_NESTING = 64;\n\n/** The refusal for `xs[0]`, naming the forms that replace indexing. */\nexport function indexingError(offset: number): ExpressionCompileError {\n return new ExpressionCompileError(\n 'EXPR_PARSE_ERROR',\n offset,\n 'indexing is not part of Expr v1; use a comprehension binder ($it, $i, $prev, $next) for element access, or len and the aggregates for whole-list questions',\n ['$it', '$i', '$prev', '$next', 'len'],\n );\n}\n\n/**\n * The cursor the descent reads and moves: lookahead and consumption over the token stream,\n * plus the bookkeeping every production records — each node's source offset, the node and\n * nesting budgets, and the binders currently in scope.\n */\nexport class TokenStream {\n private readonly tokens: readonly Token[];\n private index: number = 0;\n private nodes: number = 0;\n /** Expression nesting the descent currently holds, refused past `MAX_PARSE_NESTING`. */\n private nesting: number = 0;\n readonly offsets: WeakMap<ExprNode, number> = new WeakMap();\n /** The `pow` nodes the authored `**`/`^` spelling produced, so typing can keep its rule. */\n readonly powerOperators: WeakSet<ExprNode> = new WeakSet();\n /** Postfix `.length` member-read calls that lower to `len` when the receiver is a string or list. */\n readonly lengthProperties: WeakSet<ExprNode> = new WeakSet();\n /** Binder names in scope, so a nested binder cannot shadow an outer one. */\n private readonly binders: string[] = [];\n /** Authored calls to names the language has deprecated, in source order. */\n private readonly deprecatedCalls: DeprecatedCall[] = [];\n\n constructor(tokens: readonly Token[]) {\n this.tokens = tokens;\n }\n\n peek(offset: number = 0): Token {\n return (\n this.tokens[Math.min(this.index + offset, this.tokens.length - 1)] ?? {\n kind: 'eof',\n text: '',\n offset: 0,\n }\n );\n }\n\n next(): Token {\n const token = this.peek();\n this.index += 1;\n return token;\n }\n\n /**\n * Records the token offset a node starts at. A caller that has consumed more than one\n * token passes the first token's offset explicitly; otherwise the token just consumed is\n * the node's own token.\n */\n node<T extends ExprNode>(node: T, offset?: number): T {\n const start = offset ?? this.tokens[Math.max(0, this.index - 1)]?.offset;\n if (start !== undefined) this.offsets.set(node, start);\n this.nodes += 1;\n if (this.nodes > MAX_AST_NODES) {\n throw new ExpressionCompileError(\n 'COST_BUDGET_EXCEEDED',\n 0,\n `the expression exceeds the ${String(MAX_AST_NODES)}-node AST budget`,\n );\n }\n return node;\n }\n\n /** Records one authored call to a deprecated name, at the call's source offset. */\n noteDeprecated(name: BuiltinOperator, offset: number): void {\n this.deprecatedCalls.push({ name, offset });\n }\n\n /** The authored deprecated calls seen so far, in source order. */\n deprecations(): readonly DeprecatedCall[] {\n return this.deprecatedCalls;\n }\n\n atPunctuation(text: Punctuation): boolean {\n const token = this.peek();\n return token.kind === 'punctuation' && token.text === text;\n }\n\n /** Whether the cursor is at the first token, used to name a leading spreadsheet `=`. */\n isAtStart(): boolean {\n return this.index === 0;\n }\n\n atKeyword(text: string): boolean {\n const token = this.peek();\n return token.kind === 'keyword' && token.text === text;\n }\n\n keywordAt(offset: number, keyword: string): boolean {\n const token = this.peek(offset);\n return token.kind === 'keyword' && token.text === keyword;\n }\n\n eatPunctuation(text: Punctuation): boolean {\n if (!this.atPunctuation(text)) return false;\n this.index += 1;\n return true;\n }\n\n eatKeyword(text: string): boolean {\n if (!this.atKeyword(text)) return false;\n this.index += 1;\n return true;\n }\n\n expectPunctuation(text: Punctuation): Token {\n if (!this.atPunctuation(text)) {\n throw this.unexpected(`expected \\`${text}\\``);\n }\n return this.next();\n }\n\n expectIdentifier(what: string): string {\n const token = this.peek();\n if (token.kind !== 'identifier') throw this.unexpected(`expected ${what}`);\n this.index += 1;\n return token.text;\n }\n\n unexpected(detail: string): ExpressionCompileError {\n const token = this.peek();\n // A `[` anywhere the grammar does not build a list is the indexing form of\n // so it is reported with its alternatives rather than as a missing\n // separator: `len(xs[0])` and `xs[0]` are the same authoring mistake.\n if (token.kind === 'punctuation' && token.text === '[') return indexingError(token.offset);\n return new ExpressionCompileError(\n 'EXPR_PARSE_ERROR',\n token.offset,\n `${detail}, found \\`${token.kind === 'eof' ? 'end of input' : token.text}\\``,\n );\n }\n\n /**\n * Descends one level of expression nesting. A source of nested groups is\n * bounded here rather than after parsing because the host stack gives out first, and a\n * `RangeError` is not the refusal this compiler reports.\n */\n nest<T>(parse: () => T): T {\n if (this.nesting >= MAX_PARSE_NESTING) {\n throw new ExpressionCompileError(\n 'COST_BUDGET_EXCEEDED',\n this.peek().offset,\n `the expression nests more than ${String(MAX_PARSE_NESTING)} levels deep`,\n );\n }\n this.nesting += 1;\n try {\n return parse();\n } finally {\n this.nesting -= 1;\n }\n }\n\n hasBinder(name: string): boolean {\n return this.binders.includes(name);\n }\n\n pushBinder(name: string): void {\n this.binders.push(name);\n }\n\n popBinder(): void {\n this.binders.pop();\n }\n}\n"]}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { ExprNode } from '@azx-pbc/axiom-runtime';
|
|
2
|
+
import type { DeprecatedCall } from './deprecation.js';
|
|
3
|
+
import type { ExprDiagnostic } from './diagnostics.js';
|
|
4
|
+
import type { Token } from './lexer.js';
|
|
5
|
+
/** The AST budget of a finished tree; also the parser's public entry for a compiled node. */
|
|
6
|
+
export { checkExpressionBudget } from './parse/budget.js';
|
|
7
|
+
/**
|
|
8
|
+
* Tokenizes and parses Expr v1 source, or raises the diagnostic that refused it.
|
|
9
|
+
*
|
|
10
|
+
* The result carries the authored deprecated calls beside the tree. A caller that only wants the
|
|
11
|
+
* AST reads `node`; a compiler reports the warnings and never refuses on them (`EXPR-7.1.6`).
|
|
12
|
+
*/
|
|
13
|
+
export declare function parseExpression(source: string): {
|
|
14
|
+
readonly node: ExprNode;
|
|
15
|
+
readonly offsets: WeakMap<ExprNode, number>;
|
|
16
|
+
readonly powerOperators: WeakSet<ExprNode>;
|
|
17
|
+
readonly lengthProperties: WeakSet<ExprNode>;
|
|
18
|
+
readonly deprecations: readonly DeprecatedCall[];
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* The outcome of parsing one expression that may still be a draft: the closed AST, or the
|
|
22
|
+
* diagnostic that refused it. Unlike `parseExpression` it never raises a refusal, so a
|
|
23
|
+
* caller that reads expressions the author is still typing — a visual rule builder
|
|
24
|
+
* recognizing a subset, impact analysis over an incomplete rule — gets a value it can
|
|
25
|
+
* render instead of an exception it has to catch. The parse is the same one `compileExpr`
|
|
26
|
+
* runs; it deliberately skips static typing, so it never rejects a string `compileExpr`
|
|
27
|
+
* would accept, while a type error the compiler reports may still parse here.
|
|
28
|
+
*/
|
|
29
|
+
export type ParseExprResult = {
|
|
30
|
+
readonly ok: true;
|
|
31
|
+
readonly node: ExprNode;
|
|
32
|
+
} | {
|
|
33
|
+
readonly ok: false;
|
|
34
|
+
readonly diagnostics: readonly ExprDiagnostic[];
|
|
35
|
+
};
|
|
36
|
+
export declare function parseExpr(source: string): ParseExprResult;
|
|
37
|
+
/**
|
|
38
|
+
* The same outcome as `parseExpr` for text the caller has already tokenized.
|
|
39
|
+
*
|
|
40
|
+
* The printer measures the source it wrote with the lexer, then reads the very tokens it measured
|
|
41
|
+
* back rather than tokenizing the same text twice; the token budget has already been enforced by
|
|
42
|
+
* `tokenize`, so this entry never re-lexes and never accepts a wider stream than `parseExpr`.
|
|
43
|
+
*/
|
|
44
|
+
export declare function parseTokenizedExpr(tokens: readonly Token[]): ParseExprResult;
|
|
45
|
+
//# sourceMappingURL=parser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../../src/expr/parser.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEvD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEvD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAMxC,6FAA6F;AAC7F,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AA6E1D;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG;IAC/C,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IACxB,QAAQ,CA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