@malloydata/malloy 0.0.24-dev230217173859 → 0.0.24-dev230217181455
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/dist/lang/ast/ast-utils.d.ts +1 -1
- package/dist/lang/ast/ast-utils.js +1 -1
- package/dist/lang/ast/expressions/utils.d.ts +1 -1
- package/dist/lang/ast/expressions/utils.js +1 -1
- package/dist/lang/ast/types/expression-def.d.ts +5 -5
- package/dist/lang/ast/types/expression-def.js +6 -6
- package/dist/lang/malloy-to-ast.d.ts +1 -1
- package/dist/lang/malloy-to-ast.js +1 -1
- package/dist/lang/translate-response.d.ts +1 -1
- package/dist/lang/zone.d.ts +1 -1
- package/dist/lang/zone.js +1 -1
- package/dist/malloy.d.ts +92 -80
- package/dist/malloy.js +110 -76
- package/dist/runtime_types.d.ts +5 -5
- package/package.json +1 -1
|
@@ -5,6 +5,6 @@ import { ExprValue } from "./types/expr-value";
|
|
|
5
5
|
* generated SQL will have a reference to an impossible variable name
|
|
6
6
|
* with the reason embedded in it.
|
|
7
7
|
* @param reason very short phrase, only read by implementers
|
|
8
|
-
* @
|
|
8
|
+
* @return Fragment[] which a debugging humnan will regognize
|
|
9
9
|
*/
|
|
10
10
|
export declare function errorFor(reason: string): ExprValue;
|
|
@@ -29,7 +29,7 @@ exports.errorFor = void 0;
|
|
|
29
29
|
* generated SQL will have a reference to an impossible variable name
|
|
30
30
|
* with the reason embedded in it.
|
|
31
31
|
* @param reason very short phrase, only read by implementers
|
|
32
|
-
* @
|
|
32
|
+
* @return Fragment[] which a debugging humnan will regognize
|
|
33
33
|
*/
|
|
34
34
|
function errorFor(reason) {
|
|
35
35
|
return {
|
|
@@ -5,7 +5,7 @@ import { Equality } from "../types/equality";
|
|
|
5
5
|
* @param left
|
|
6
6
|
* @param op
|
|
7
7
|
* @param right
|
|
8
|
-
* @
|
|
8
|
+
* @return Fragment list of the composed expression
|
|
9
9
|
*/
|
|
10
10
|
export declare function compose(left: Fragment[], op: string, right: Fragment[]): Fragment[];
|
|
11
11
|
export declare function compressExpr(expr: Expr): Expr;
|
|
@@ -45,7 +45,7 @@ function term(f) {
|
|
|
45
45
|
* @param left
|
|
46
46
|
* @param op
|
|
47
47
|
* @param right
|
|
48
|
-
* @
|
|
48
|
+
* @return Fragment list of the composed expression
|
|
49
49
|
*/
|
|
50
50
|
function compose(left, op, right) {
|
|
51
51
|
const opAlpha = op.match(/^[A-Za-z]/);
|
|
@@ -13,7 +13,7 @@ export declare abstract class ExpressionDef extends MalloyElement {
|
|
|
13
13
|
granular(): boolean;
|
|
14
14
|
/**
|
|
15
15
|
* Returns the "translation" or template for SQL generation. When asking
|
|
16
|
-
* for a
|
|
16
|
+
* for a translation you may pass the types you can accept, allowing
|
|
17
17
|
* the translation code a chance to convert to match your expectations
|
|
18
18
|
* @param space Namespace for looking up field references
|
|
19
19
|
*/
|
|
@@ -24,7 +24,7 @@ export declare abstract class ExpressionDef extends MalloyElement {
|
|
|
24
24
|
* rewrite itself. This requests a translation for a rewrite,
|
|
25
25
|
* or returns undefined if that request should be denied.
|
|
26
26
|
* @param fs FieldSpace
|
|
27
|
-
* @
|
|
27
|
+
* @return Translated expression or undefined
|
|
28
28
|
*/
|
|
29
29
|
requestExpression(fs: FieldSpace): ExprValue | undefined;
|
|
30
30
|
defaultFieldName(): string | undefined;
|
|
@@ -36,13 +36,13 @@ export declare abstract class ExpressionDef extends MalloyElement {
|
|
|
36
36
|
typeCheck(eNode: ExpressionDef, eVal: ExprValue): boolean;
|
|
37
37
|
/**
|
|
38
38
|
* This is the operation which makes partial comparison and value trees work
|
|
39
|
-
* The default
|
|
39
|
+
* The default implementation merely constructs LEFT OP RIGHT, but specialized
|
|
40
40
|
* nodes like alternation trees or or partial comparison can control how
|
|
41
41
|
* the appplication gets generated
|
|
42
42
|
* @param fs The symbol table
|
|
43
43
|
* @param op The operator being applied
|
|
44
44
|
* @param expr The "other" (besdies 'this') value
|
|
45
|
-
* @
|
|
45
|
+
* @return The translated expression
|
|
46
46
|
*/
|
|
47
47
|
apply(fs: FieldSpace, op: string, left: ExpressionDef): ExprValue;
|
|
48
48
|
}
|
|
@@ -64,6 +64,6 @@ export declare class ExprDuration extends ExpressionDef {
|
|
|
64
64
|
* @param left Left value
|
|
65
65
|
* @param op The operator
|
|
66
66
|
* @param right Right Value
|
|
67
|
-
* @
|
|
67
|
+
* @return ExprValue of the expression
|
|
68
68
|
*/
|
|
69
69
|
export declare function applyBinary(fs: FieldSpace, left: ExpressionDef, op: string, right: ExpressionDef): ExprValue;
|
|
@@ -53,7 +53,7 @@ class ExpressionDef extends malloy_element_1.MalloyElement {
|
|
|
53
53
|
* rewrite itself. This requests a translation for a rewrite,
|
|
54
54
|
* or returns undefined if that request should be denied.
|
|
55
55
|
* @param fs FieldSpace
|
|
56
|
-
* @
|
|
56
|
+
* @return Translated expression or undefined
|
|
57
57
|
*/
|
|
58
58
|
requestExpression(fs) {
|
|
59
59
|
return this.getExpression(fs);
|
|
@@ -75,13 +75,13 @@ class ExpressionDef extends malloy_element_1.MalloyElement {
|
|
|
75
75
|
}
|
|
76
76
|
/**
|
|
77
77
|
* This is the operation which makes partial comparison and value trees work
|
|
78
|
-
* The default
|
|
78
|
+
* The default implementation merely constructs LEFT OP RIGHT, but specialized
|
|
79
79
|
* nodes like alternation trees or or partial comparison can control how
|
|
80
80
|
* the appplication gets generated
|
|
81
81
|
* @param fs The symbol table
|
|
82
82
|
* @param op The operator being applied
|
|
83
83
|
* @param expr The "other" (besdies 'this') value
|
|
84
|
-
* @
|
|
84
|
+
* @return The translated expression
|
|
85
85
|
*/
|
|
86
86
|
apply(fs, op, left) {
|
|
87
87
|
return applyBinary(fs, left, op, this);
|
|
@@ -324,7 +324,7 @@ function delta(fs, left, op, right) {
|
|
|
324
324
|
* @param left Left value
|
|
325
325
|
* @param op The operator
|
|
326
326
|
* @param right Right Value
|
|
327
|
-
* @
|
|
327
|
+
* @return ExprValue of the expression
|
|
328
328
|
*/
|
|
329
329
|
function applyBinary(fs, left, op, right) {
|
|
330
330
|
if ((0, equality_1.isEquality)(op)) {
|
|
@@ -368,12 +368,12 @@ function applyBinary(fs, left, op, right) {
|
|
|
368
368
|
}
|
|
369
369
|
return (0, ast_utils_1.errorFor)("divide type mismatch");
|
|
370
370
|
}
|
|
371
|
-
left.log(`
|
|
371
|
+
left.log(`Cannot use ${op} operator here`);
|
|
372
372
|
return (0, ast_utils_1.errorFor)("applybinary bad operator");
|
|
373
373
|
}
|
|
374
374
|
exports.applyBinary = applyBinary;
|
|
375
375
|
/**
|
|
376
|
-
* Return an error if
|
|
376
|
+
* Return an error if a binary operation includes unsupported types.
|
|
377
377
|
*/
|
|
378
378
|
function unsupportError(l, lhs, r, rhs) {
|
|
379
379
|
const ret = {
|
|
@@ -20,7 +20,7 @@ export declare class MalloyToAST extends AbstractParseTreeVisitor<ast.MalloyElem
|
|
|
20
20
|
* apparently has changed and now an unexpected element type has appeared.
|
|
21
21
|
* This is a non recoverable error, since the parser and the grammar
|
|
22
22
|
* are not compatible.
|
|
23
|
-
* @
|
|
23
|
+
* @return an error object to throw.
|
|
24
24
|
*/
|
|
25
25
|
protected internalError(cx: ParserRuleContext, msg: string): Error;
|
|
26
26
|
/**
|
|
@@ -65,7 +65,7 @@ class MalloyToAST extends AbstractParseTreeVisitor_1.AbstractParseTreeVisitor {
|
|
|
65
65
|
* apparently has changed and now an unexpected element type has appeared.
|
|
66
66
|
* This is a non recoverable error, since the parser and the grammar
|
|
67
67
|
* are not compatible.
|
|
68
|
-
* @
|
|
68
|
+
* @return an error object to throw.
|
|
69
69
|
*/
|
|
70
70
|
internalError(cx, msg) {
|
|
71
71
|
const tmsg = `Internal Translator Error: ${msg}`;
|
|
@@ -6,7 +6,7 @@ import { DocumentHighlight } from "./parse-tree-walkers/document-highlight-walke
|
|
|
6
6
|
import { DocumentCompletion } from "./parse-tree-walkers/document-completion-walker";
|
|
7
7
|
import { DocumentHelpContext } from "./parse-tree-walkers/document-help-context-walker";
|
|
8
8
|
/**
|
|
9
|
-
* The translation interface is essentially a request/
|
|
9
|
+
* The translation interface is essentially a request/response protocol, and
|
|
10
10
|
* this is the list of all the "protocol" messages.
|
|
11
11
|
*/
|
|
12
12
|
export interface FinalResponse {
|
package/dist/lang/zone.d.ts
CHANGED
|
@@ -44,7 +44,7 @@ export declare class Zone<TValue> {
|
|
|
44
44
|
*/
|
|
45
45
|
reference(str: string, loc: DocumentLocation): void;
|
|
46
46
|
/**
|
|
47
|
-
* @
|
|
47
|
+
* @return A list of all symbols which have references but not definitions
|
|
48
48
|
*/
|
|
49
49
|
getUndefined(): string[] | undefined;
|
|
50
50
|
/**
|
package/dist/lang/zone.js
CHANGED