@mojir/lits 2.0.13 → 2.0.15
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/cli/cli.js +978 -819
- package/dist/cli/reference/api.d.ts +8 -8
- package/dist/cli/src/analyze/calculateOutcomes/calculateIfLetOutcomes.d.ts +1 -1
- package/dist/cli/src/analyze/calculateOutcomes/calculateIfNotOutcomes.d.ts +1 -1
- package/dist/cli/src/analyze/calculateOutcomes/calculateSwitchOutcomes.d.ts +3 -0
- package/dist/cli/src/analyze/calculateOutcomes/calculateWhenFirstOutcomes.d.ts +1 -1
- package/dist/cli/src/analyze/calculateOutcomes/calculateWhenLetOutcomes.d.ts +1 -1
- package/dist/cli/src/analyze/calculateOutcomes/calculateWhenNotOutcomes.d.ts +1 -1
- package/dist/cli/src/analyze/calculateOutcomes/specialExpressionCalculators.d.ts +14 -14
- package/dist/cli/src/builtin/index.d.ts +9 -9
- package/dist/cli/src/builtin/specialExpressions/and.d.ts +1 -1
- package/dist/cli/src/builtin/specialExpressions/{if-let.d.ts → if_let.d.ts} +1 -1
- package/dist/{src/builtin/specialExpressions/if-not.d.ts → cli/src/builtin/specialExpressions/if_not.d.ts} +1 -1
- package/dist/cli/src/builtin/specialExpressions/or.d.ts +1 -1
- package/dist/{src/builtin/specialExpressions/time.d.ts → cli/src/builtin/specialExpressions/switch.d.ts} +2 -2
- package/dist/cli/src/builtin/specialExpressions/{when-first.d.ts → when_first.d.ts} +1 -1
- package/dist/{src/builtin/specialExpressions/when-let.d.ts → cli/src/builtin/specialExpressions/when_let.d.ts} +1 -1
- package/dist/cli/src/builtin/specialExpressions/{when-not.d.ts → when_not.d.ts} +1 -1
- package/dist/cli/src/identifier.d.ts +2 -2
- package/dist/cli/src/parser/AlgebraicParser.d.ts +17 -2
- package/dist/cli/src/tokenizer/algebraic/algebraicReservedNames.d.ts +106 -7
- package/dist/cli/src/tokenizer/algebraic/algebraicTokenizers.d.ts +1 -1
- package/dist/cli/src/tokenizer/algebraic/algebraicTokens.d.ts +6 -5
- package/dist/cli/src/tokenizer/polish/polishTokenizers.d.ts +1 -1
- package/dist/cli/src/tokenizer/polish/polishTokens.d.ts +1 -1
- package/dist/cli/src/tokenizer/utils.d.ts +1 -1
- package/dist/cli/src/typeGuards/index.d.ts +1 -0
- package/dist/index.esm.js +978 -821
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +978 -821
- package/dist/index.js.map +1 -1
- package/dist/lits.iife.js +978 -821
- package/dist/lits.iife.js.map +1 -1
- package/dist/reference/api.d.ts +8 -8
- package/dist/src/analyze/calculateOutcomes/calculateIfLetOutcomes.d.ts +1 -1
- package/dist/src/analyze/calculateOutcomes/calculateIfNotOutcomes.d.ts +1 -1
- package/dist/src/analyze/calculateOutcomes/calculateSwitchOutcomes.d.ts +3 -0
- package/dist/src/analyze/calculateOutcomes/calculateWhenFirstOutcomes.d.ts +1 -1
- package/dist/src/analyze/calculateOutcomes/calculateWhenLetOutcomes.d.ts +1 -1
- package/dist/src/analyze/calculateOutcomes/calculateWhenNotOutcomes.d.ts +1 -1
- package/dist/src/analyze/calculateOutcomes/specialExpressionCalculators.d.ts +14 -14
- package/dist/src/builtin/index.d.ts +9 -9
- package/dist/src/builtin/specialExpressions/and.d.ts +1 -1
- package/dist/src/builtin/specialExpressions/{if-let.d.ts → if_let.d.ts} +1 -1
- package/dist/{cli/src/builtin/specialExpressions/if-not.d.ts → src/builtin/specialExpressions/if_not.d.ts} +1 -1
- package/dist/src/builtin/specialExpressions/or.d.ts +1 -1
- package/dist/{cli/src/builtin/specialExpressions/time.d.ts → src/builtin/specialExpressions/switch.d.ts} +2 -2
- package/dist/src/builtin/specialExpressions/{when-first.d.ts → when_first.d.ts} +1 -1
- package/dist/{cli/src/builtin/specialExpressions/when-let.d.ts → src/builtin/specialExpressions/when_let.d.ts} +1 -1
- package/dist/src/builtin/specialExpressions/{when-not.d.ts → when_not.d.ts} +1 -1
- package/dist/src/identifier.d.ts +2 -2
- package/dist/src/parser/AlgebraicParser.d.ts +17 -2
- package/dist/src/tokenizer/algebraic/algebraicReservedNames.d.ts +106 -7
- package/dist/src/tokenizer/algebraic/algebraicTokenizers.d.ts +1 -1
- package/dist/src/tokenizer/algebraic/algebraicTokens.d.ts +6 -5
- package/dist/src/tokenizer/polish/polishTokenizers.d.ts +1 -1
- package/dist/src/tokenizer/polish/polishTokens.d.ts +1 -1
- package/dist/src/tokenizer/utils.d.ts +1 -1
- package/dist/src/typeGuards/index.d.ts +1 -0
- package/dist/testFramework.esm.js +595 -405
- package/dist/testFramework.esm.js.map +1 -1
- package/dist/testFramework.js +595 -405
- package/dist/testFramework.js.map +1 -1
- package/package.json +1 -1
- package/dist/cli/src/analyze/calculateOutcomes/calculateTimeOutcomes.d.ts +0 -3
- package/dist/src/analyze/calculateOutcomes/calculateTimeOutcomes.d.ts +0 -3
|
@@ -2,15 +2,15 @@ export declare const api: {
|
|
|
2
2
|
readonly collection: readonly ["count", "get", "get_in", "contains?", "has?", "has_some?", "has_every?", "assoc", "assoc_in", "concat", "not_empty", "every?", "not_every?", "any?", "not_any?", "update", "update_in"];
|
|
3
3
|
readonly array: readonly ["array", "range", "repeat", "flatten", "mapcat"];
|
|
4
4
|
readonly sequence: readonly ["nth", "push", "pop", "unshift", "shift", "slice", "reductions", "reduce", "reduce_right", "map", "filter", "position", "index_of", "some", "reverse", "first", "second", "last", "rest", "nthrest", "next", "nthnext", "take", "take_last", "take_while", "drop", "drop_last", "drop_while", "sort", "sort_by", "distinct", "remove", "remove_at", "split_at", "split_with", "frequencies", "group_by", "partition", "partition_all", "partition_by"];
|
|
5
|
-
readonly math: readonly ["+", "-", "*", "/", "mod", "
|
|
5
|
+
readonly math: readonly ["+", "-", "*", "/", "mod", "%", "quot", "inc", "dec", "sqrt", "cbrt", "**", "exp", "round", "trunc", "floor", "ceil", "min", "max", "abs", "sign", "positive_infinity", "negative_infinity", "max_safe_integer", "min_safe_integer", "max_value", "min_value", "epsilon", "nan", "e", "pi", "log", "log2", "log10", "sin", "cos", "tan", "asin", "acos", "atan", "sinh", "cosh", "tanh", "asinh", "acosh", "atanh"];
|
|
6
6
|
readonly functional: readonly ["apply", "identity", "partial", "comp", "constantly", "juxt", "complement", "every_pred", "some_pred", "fnil"];
|
|
7
|
-
readonly misc: readonly ["!=", "
|
|
8
|
-
readonly object: readonly ["dissoc", "object", "keys", "vals", "entries", "find", "merge", "
|
|
7
|
+
readonly misc: readonly ["!=", "==", "<", ">", "<=", ">=", "!", "write!", "iso_date>epoch", "epoch>iso_date", "boolean", "compare", "equal?", "json_parse", "json_stringify"];
|
|
8
|
+
readonly object: readonly ["dissoc", "object", "keys", "vals", "entries", "find", "merge", "merge_with", "zipmap", "select_keys"];
|
|
9
9
|
readonly predicate: readonly ["boolean?", "nil?", "number?", "string?", "function?", "integer?", "array?", "object?", "coll?", "seq?", "regexp?", "zero?", "pos?", "neg?", "even?", "odd?", "finite?", "nan?", "negative_infinity?", "positive_infinity?", "false?", "true?", "empty?", "not_empty?"];
|
|
10
10
|
readonly regularExpression: readonly ["regexp", "match", "replace"];
|
|
11
|
-
readonly specialExpressions: readonly ["
|
|
12
|
-
readonly string: readonly ["subs", "
|
|
13
|
-
readonly bitwise: readonly ["
|
|
11
|
+
readonly specialExpressions: readonly ["&&", "||", "def", "defs", "let", "if_let", "when_let", "when_first", "fn", "defn", "defns", "try", "throw", "if", "if_not", "cond", "switch", "when", "when_not", "comment", "do", "recur", "loop", "doseq", "for", "declared?", "??"];
|
|
12
|
+
readonly string: readonly ["subs", "string_repeat", "str", "number", "lower_case", "upper_case", "trim", "trim_left", "trim_right", "pad_left", "pad_right", "split", "template", "to_char_code", "from_char_code", "encode_base64", "decode_base64", "encode_uri_component", "decode_uri_component", "join", "++"];
|
|
13
|
+
readonly bitwise: readonly ["<<", ">>", ">>>", "~", "&", "&!", "|", "^", "bit_flip", "bit_clear", "bit_set", "bit_test"];
|
|
14
14
|
readonly assert: readonly ["assert", "assert=", "assert!=", "assert_equal", "assert_not_equal", "assert_gt", "assert_lt", "assert_gte", "assert_lte", "assert_true", "assert_false", "assert_truthy", "assert_falsy", "assert_null", "assert_throws", "assert_throws_error", "assert_not_throws"];
|
|
15
15
|
readonly shorthand: ["-short-regexp", "-short-fn", "-short-string", "-short-dot", "-short-hash"];
|
|
16
16
|
readonly datatype: ["-type-number", "-type-string", "-type-object", "-type-array", "-type-boolean", "-type-function", "-type-integer", "-type-any", "-type-nil", "-type-collection", "-type-sequence", "-type-regexp", "-type-never"];
|
|
@@ -31,7 +31,7 @@ export type AssertApiName = typeof api.assert[number];
|
|
|
31
31
|
export type FunctionName = CollectionApiName | ArrayApiName | SequenceApiName | MathApiName | FunctionalApiName | MiscApiName | ObjectApiName | PredicateApiName | RegularExpressionApiName | SpecialExpressionsApiName | StringApiName | BitwiseApiName | AssertApiName;
|
|
32
32
|
export type ShorthandName = typeof api.shorthand[number];
|
|
33
33
|
export type DatatypeName = typeof api.datatype[number];
|
|
34
|
-
declare const apiNames: readonly ["count", "get", "get_in", "contains?", "has?", "has_some?", "has_every?", "assoc", "assoc_in", "concat", "not_empty", "every?", "not_every?", "any?", "not_any?", "update", "update_in", "array", "range", "repeat", "flatten", "mapcat", "nth", "push", "pop", "unshift", "shift", "slice", "reductions", "reduce", "reduce_right", "map", "filter", "position", "index_of", "some", "reverse", "first", "second", "last", "rest", "nthrest", "next", "nthnext", "take", "take_last", "take_while", "drop", "drop_last", "drop_while", "sort", "sort_by", "distinct", "remove", "remove_at", "split_at", "split_with", "frequencies", "group_by", "partition", "partition_all", "partition_by", "+", "-", "*", "/", "mod", "
|
|
34
|
+
declare const apiNames: readonly ["count", "get", "get_in", "contains?", "has?", "has_some?", "has_every?", "assoc", "assoc_in", "concat", "not_empty", "every?", "not_every?", "any?", "not_any?", "update", "update_in", "array", "range", "repeat", "flatten", "mapcat", "nth", "push", "pop", "unshift", "shift", "slice", "reductions", "reduce", "reduce_right", "map", "filter", "position", "index_of", "some", "reverse", "first", "second", "last", "rest", "nthrest", "next", "nthnext", "take", "take_last", "take_while", "drop", "drop_last", "drop_while", "sort", "sort_by", "distinct", "remove", "remove_at", "split_at", "split_with", "frequencies", "group_by", "partition", "partition_all", "partition_by", "+", "-", "*", "/", "mod", "%", "quot", "inc", "dec", "sqrt", "cbrt", "**", "exp", "round", "trunc", "floor", "ceil", "min", "max", "abs", "sign", "positive_infinity", "negative_infinity", "max_safe_integer", "min_safe_integer", "max_value", "min_value", "epsilon", "nan", "e", "pi", "log", "log2", "log10", "sin", "cos", "tan", "asin", "acos", "atan", "sinh", "cosh", "tanh", "asinh", "acosh", "atanh", "apply", "identity", "partial", "comp", "constantly", "juxt", "complement", "every_pred", "some_pred", "fnil", "!=", "==", "<", ">", "<=", ">=", "!", "write!", "iso_date>epoch", "epoch>iso_date", "boolean", "compare", "equal?", "json_parse", "json_stringify", "dissoc", "object", "keys", "vals", "entries", "find", "merge", "merge_with", "zipmap", "select_keys", "boolean?", "nil?", "number?", "string?", "function?", "integer?", "array?", "object?", "coll?", "seq?", "regexp?", "zero?", "pos?", "neg?", "even?", "odd?", "finite?", "nan?", "negative_infinity?", "positive_infinity?", "false?", "true?", "empty?", "not_empty?", "regexp", "match", "replace", "&&", "||", "def", "defs", "let", "if_let", "when_let", "when_first", "fn", "defn", "defns", "try", "throw", "if", "if_not", "cond", "switch", "when", "when_not", "comment", "do", "recur", "loop", "doseq", "for", "declared?", "??", "subs", "string_repeat", "str", "number", "lower_case", "upper_case", "trim", "trim_left", "trim_right", "pad_left", "pad_right", "split", "template", "to_char_code", "from_char_code", "encode_base64", "decode_base64", "encode_uri_component", "decode_uri_component", "join", "++", "<<", ">>", ">>>", "~", "&", "&!", "|", "^", "bit_flip", "bit_clear", "bit_set", "bit_test", "assert", "assert=", "assert!=", "assert_equal", "assert_not_equal", "assert_gt", "assert_lt", "assert_gte", "assert_lte", "assert_true", "assert_false", "assert_truthy", "assert_falsy", "assert_null", "assert_throws", "assert_throws_error", "assert_not_throws", "-short-regexp", "-short-fn", "-short-string", "-short-dot", "-short-hash", "-type-number", "-type-string", "-type-object", "-type-array", "-type-boolean", "-type-function", "-type-integer", "-type-any", "-type-nil", "-type-collection", "-type-sequence", "-type-regexp", "-type-never"];
|
|
35
35
|
export type ApiName = typeof apiNames[number];
|
|
36
36
|
export declare function isApiName(arg: string): arg is ApiName;
|
|
37
37
|
export declare const categoryRecord: {
|
|
@@ -53,7 +53,7 @@ export declare const categoryRecord: {
|
|
|
53
53
|
};
|
|
54
54
|
export type Category = keyof typeof categoryRecord;
|
|
55
55
|
export declare const categories: Category[];
|
|
56
|
-
declare const dataTypes: readonly ["number", "string", "object", "array", "boolean", "function", "integer", "any", "
|
|
56
|
+
declare const dataTypes: readonly ["number", "string", "object", "array", "boolean", "function", "integer", "any", "null", "collection", "sequence", "regexp", "never"];
|
|
57
57
|
export type DataType = typeof dataTypes[number];
|
|
58
58
|
export declare function isDataType(arg: string): arg is DataType;
|
|
59
59
|
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { IfLetNode } from '../../builtin/specialExpressions/
|
|
1
|
+
import type { IfLetNode } from '../../builtin/specialExpressions/if_let';
|
|
2
2
|
import type { CalculatePossibleAstNodesHelper } from '.';
|
|
3
3
|
export declare const calculateIfLetOutcomes: CalculatePossibleAstNodesHelper<IfLetNode>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { IfNotNode } from '../../builtin/specialExpressions/
|
|
1
|
+
import type { IfNotNode } from '../../builtin/specialExpressions/if_not';
|
|
2
2
|
import type { CalculatePossibleAstNodesHelper } from '.';
|
|
3
3
|
export declare const calculateIfNotOutcomes: CalculatePossibleAstNodesHelper<IfNotNode>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { WhenFirstNode } from '../../builtin/specialExpressions/
|
|
1
|
+
import type { WhenFirstNode } from '../../builtin/specialExpressions/when_first';
|
|
2
2
|
import type { CalculatePossibleAstNodesHelper } from '.';
|
|
3
3
|
export declare const calculateWhenFirstOutcomes: CalculatePossibleAstNodesHelper<WhenFirstNode>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { WhenLetNode } from '../../builtin/specialExpressions/
|
|
1
|
+
import type { WhenLetNode } from '../../builtin/specialExpressions/when_let';
|
|
2
2
|
import type { CalculatePossibleAstNodesHelper } from '.';
|
|
3
3
|
export declare const calculateWhenLetOutcomes: CalculatePossibleAstNodesHelper<WhenLetNode>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { WhenNotNode } from '../../builtin/specialExpressions/
|
|
1
|
+
import type { WhenNotNode } from '../../builtin/specialExpressions/when_not';
|
|
2
2
|
import type { CalculatePossibleAstNodesHelper } from '.';
|
|
3
3
|
export declare const calculateWhenNotOutcomes: CalculatePossibleAstNodesHelper<WhenNotNode>;
|
|
@@ -7,8 +7,8 @@ import type { DefsNode } from '../../builtin/specialExpressions/defs';
|
|
|
7
7
|
import type { DoNode } from '../../builtin/specialExpressions/do';
|
|
8
8
|
import type { DefnNode, DefnsNode, FnNode } from '../../builtin/specialExpressions/functions';
|
|
9
9
|
import type { IfNode } from '../../builtin/specialExpressions/if';
|
|
10
|
-
import type { IfLetNode } from '../../builtin/specialExpressions/
|
|
11
|
-
import type { IfNotNode } from '../../builtin/specialExpressions/
|
|
10
|
+
import type { IfLetNode } from '../../builtin/specialExpressions/if_let';
|
|
11
|
+
import type { IfNotNode } from '../../builtin/specialExpressions/if_not';
|
|
12
12
|
import type { LetNode } from '../../builtin/specialExpressions/let';
|
|
13
13
|
import type { LoopNode } from '../../builtin/specialExpressions/loop';
|
|
14
14
|
import type { DoSeqNode, ForNode } from '../../builtin/specialExpressions/loops';
|
|
@@ -16,18 +16,19 @@ import type { OrNode } from '../../builtin/specialExpressions/or';
|
|
|
16
16
|
import type { QqNode } from '../../builtin/specialExpressions/qq';
|
|
17
17
|
import type { RecurNode } from '../../builtin/specialExpressions/recur';
|
|
18
18
|
import type { ThrowNode } from '../../builtin/specialExpressions/throw';
|
|
19
|
-
import type { TimeNode } from '../../builtin/specialExpressions/time';
|
|
20
19
|
import type { TryNode } from '../../builtin/specialExpressions/try';
|
|
21
20
|
import type { WhenNode } from '../../builtin/specialExpressions/when';
|
|
22
|
-
import type { WhenFirstNode } from '../../builtin/specialExpressions/
|
|
23
|
-
import type { WhenLetNode } from '../../builtin/specialExpressions/
|
|
24
|
-
import type { WhenNotNode } from '../../builtin/specialExpressions/
|
|
21
|
+
import type { WhenFirstNode } from '../../builtin/specialExpressions/when_first';
|
|
22
|
+
import type { WhenLetNode } from '../../builtin/specialExpressions/when_let';
|
|
23
|
+
import type { WhenNotNode } from '../../builtin/specialExpressions/when_not';
|
|
25
24
|
import type { AstNode } from '../../parser/interface';
|
|
25
|
+
import type { SwitchNode } from '../../builtin/specialExpressions/switch';
|
|
26
26
|
import type { CalculatePossibleAstNodesHelperOptions } from '.';
|
|
27
27
|
export declare const specialExpressionCalculator: {
|
|
28
|
-
|
|
28
|
+
'&&': (astNode: AndNode, helperOptions: Omit<CalculatePossibleAstNodesHelperOptions<AstNode>, "astNode">) => AstNode[];
|
|
29
29
|
comment: (astNode: CommentExpressionNode, helperOptions: Omit<CalculatePossibleAstNodesHelperOptions<AstNode>, "astNode">) => AstNode[];
|
|
30
30
|
cond: (astNode: CondNode, helperOptions: Omit<CalculatePossibleAstNodesHelperOptions<AstNode>, "astNode">) => AstNode[];
|
|
31
|
+
switch: (astNode: SwitchNode, helperOptions: Omit<CalculatePossibleAstNodesHelperOptions<AstNode>, "astNode">) => AstNode[];
|
|
31
32
|
'declared?': (astNode: DeclaredNode, helperOptions: Omit<CalculatePossibleAstNodesHelperOptions<AstNode>, "astNode">) => AstNode[];
|
|
32
33
|
defn: (astNode: DefnNode, helperOptions: Omit<CalculatePossibleAstNodesHelperOptions<AstNode>, "astNode">) => AstNode[];
|
|
33
34
|
def: (astNode: DefNode, helperOptions: Omit<CalculatePossibleAstNodesHelperOptions<AstNode>, "astNode">) => AstNode[];
|
|
@@ -37,19 +38,18 @@ export declare const specialExpressionCalculator: {
|
|
|
37
38
|
doseq: (astNode: DoSeqNode, helperOptions: Omit<CalculatePossibleAstNodesHelperOptions<AstNode>, "astNode">) => AstNode[];
|
|
38
39
|
fn: (astNode: FnNode, helperOptions: Omit<CalculatePossibleAstNodesHelperOptions<AstNode>, "astNode">) => AstNode[];
|
|
39
40
|
for: (astNode: ForNode, helperOptions: Omit<CalculatePossibleAstNodesHelperOptions<AstNode>, "astNode">) => AstNode[];
|
|
40
|
-
|
|
41
|
+
if_let: (astNode: IfLetNode, helperOptions: Omit<CalculatePossibleAstNodesHelperOptions<AstNode>, "astNode">) => AstNode[];
|
|
41
42
|
if: (astNode: IfNode, helperOptions: Omit<CalculatePossibleAstNodesHelperOptions<AstNode>, "astNode">) => AstNode[];
|
|
42
|
-
|
|
43
|
+
if_not: (astNode: IfNotNode, helperOptions: Omit<CalculatePossibleAstNodesHelperOptions<AstNode>, "astNode">) => AstNode[];
|
|
43
44
|
let: (astNode: LetNode, helperOptions: Omit<CalculatePossibleAstNodesHelperOptions<AstNode>, "astNode">) => AstNode[];
|
|
44
45
|
loop: (astNode: LoopNode, helperOptions: Omit<CalculatePossibleAstNodesHelperOptions<AstNode>, "astNode">) => AstNode[];
|
|
45
|
-
|
|
46
|
+
'||': (astNode: OrNode, helperOptions: Omit<CalculatePossibleAstNodesHelperOptions<AstNode>, "astNode">) => AstNode[];
|
|
46
47
|
'??': (astNode: QqNode, helperOptions: Omit<CalculatePossibleAstNodesHelperOptions<AstNode>, "astNode">) => AstNode[];
|
|
47
48
|
recur: (astNode: RecurNode, helperOptions: Omit<CalculatePossibleAstNodesHelperOptions<AstNode>, "astNode">) => AstNode[];
|
|
48
|
-
'time!': (astNode: TimeNode, helperOptions: Omit<CalculatePossibleAstNodesHelperOptions<AstNode>, "astNode">) => AstNode[];
|
|
49
49
|
throw: (astNode: ThrowNode, helperOptions: Omit<CalculatePossibleAstNodesHelperOptions<AstNode>, "astNode">) => AstNode[];
|
|
50
50
|
try: (astNode: TryNode, helperOptions: Omit<CalculatePossibleAstNodesHelperOptions<AstNode>, "astNode">) => AstNode[];
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
when_first: (astNode: WhenFirstNode, helperOptions: Omit<CalculatePossibleAstNodesHelperOptions<AstNode>, "astNode">) => AstNode[];
|
|
52
|
+
when_let: (astNode: WhenLetNode, helperOptions: Omit<CalculatePossibleAstNodesHelperOptions<AstNode>, "astNode">) => AstNode[];
|
|
53
53
|
when: (astNode: WhenNode, helperOptions: Omit<CalculatePossibleAstNodesHelperOptions<AstNode>, "astNode">) => AstNode[];
|
|
54
|
-
|
|
54
|
+
when_not: (astNode: WhenNotNode, helperOptions: Omit<CalculatePossibleAstNodesHelperOptions<AstNode>, "astNode">) => AstNode[];
|
|
55
55
|
};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { Builtin } from './interface';
|
|
2
2
|
declare const specialExpressions: {
|
|
3
|
-
readonly
|
|
3
|
+
readonly '&&': import("./interface").BuiltinSpecialExpression<import("../interface").Any, import("./specialExpressions/and").AndNode>;
|
|
4
4
|
readonly comment: import("./interface").BuiltinSpecialExpression<null, import("./specialExpressions/comment").CommentExpressionNode>;
|
|
5
5
|
readonly cond: import("./interface").BuiltinSpecialExpression<import("../interface").Any, import("./specialExpressions/cond").CondNode>;
|
|
6
|
+
readonly switch: import("./interface").BuiltinSpecialExpression<import("../interface").Any, import("./specialExpressions/switch").SwitchNode>;
|
|
6
7
|
readonly def: import("./interface").BuiltinSpecialExpression<null, import("./specialExpressions/def").DefNode>;
|
|
7
8
|
readonly defn: import("./interface").BuiltinSpecialExpression<null, import("./specialExpressions/functions").DefnNode>;
|
|
8
9
|
readonly defns: import("./interface").BuiltinSpecialExpression<null, import("./specialExpressions/functions").DefnsNode>;
|
|
@@ -12,24 +13,23 @@ declare const specialExpressions: {
|
|
|
12
13
|
readonly for: import("./interface").BuiltinSpecialExpression<import("../interface").Any, import("./specialExpressions/loops").ForNode>;
|
|
13
14
|
readonly fn: import("./interface").BuiltinSpecialExpression<import("..").LitsFunction, import("./specialExpressions/functions").FnNode>;
|
|
14
15
|
readonly if: import("./interface").BuiltinSpecialExpression<import("../interface").Any, import("./specialExpressions/if").IfNode>;
|
|
15
|
-
readonly
|
|
16
|
-
readonly
|
|
16
|
+
readonly if_let: import("./interface").BuiltinSpecialExpression<import("../interface").Any, import("./specialExpressions/if_let").IfLetNode>;
|
|
17
|
+
readonly if_not: import("./interface").BuiltinSpecialExpression<import("../interface").Any, import("./specialExpressions/if_not").IfNotNode>;
|
|
17
18
|
readonly let: import("./interface").BuiltinSpecialExpression<import("../interface").Any, import("./specialExpressions/let").LetNode>;
|
|
18
19
|
readonly loop: import("./interface").BuiltinSpecialExpression<import("../interface").Any, import("./specialExpressions/loop").LoopNode>;
|
|
19
|
-
readonly
|
|
20
|
+
readonly '||': import("./interface").BuiltinSpecialExpression<import("../interface").Any, import("./specialExpressions/or").OrNode>;
|
|
20
21
|
readonly recur: import("./interface").BuiltinSpecialExpression<null, import("./specialExpressions/recur").RecurNode>;
|
|
21
22
|
readonly throw: import("./interface").BuiltinSpecialExpression<null, import("./specialExpressions/throw").ThrowNode>;
|
|
22
|
-
readonly 'time!': import("./interface").BuiltinSpecialExpression<import("../interface").Any, import("./specialExpressions/time").TimeNode>;
|
|
23
23
|
readonly try: import("./interface").BuiltinSpecialExpression<import("../interface").Any, import("./specialExpressions/try").TryNode>;
|
|
24
24
|
readonly when: import("./interface").BuiltinSpecialExpression<import("../interface").Any, import("./specialExpressions/when").WhenNode>;
|
|
25
|
-
readonly
|
|
26
|
-
readonly
|
|
27
|
-
readonly
|
|
25
|
+
readonly when_first: import("./interface").BuiltinSpecialExpression<import("../interface").Any, import("./specialExpressions/when_first").WhenFirstNode>;
|
|
26
|
+
readonly when_let: import("./interface").BuiltinSpecialExpression<import("../interface").Any, import("./specialExpressions/when_let").WhenLetNode>;
|
|
27
|
+
readonly when_not: import("./interface").BuiltinSpecialExpression<import("../interface").Any, import("./specialExpressions/when_not").WhenNotNode>;
|
|
28
28
|
readonly 'declared?': import("./interface").BuiltinSpecialExpression<boolean, import("./specialExpressions/declared").DeclaredNode>;
|
|
29
29
|
readonly '??': import("./interface").BuiltinSpecialExpression<import("../interface").Any, import("./specialExpressions/qq").QqNode>;
|
|
30
30
|
};
|
|
31
31
|
export type SpecialExpressionName = keyof typeof specialExpressions;
|
|
32
|
-
export type CommonSpecialExpressionName = keyof Pick<typeof specialExpressions, '??' | '
|
|
32
|
+
export type CommonSpecialExpressionName = keyof Pick<typeof specialExpressions, '??' | '&&' | 'comment' | 'cond' | 'switch' | 'declared?' | 'do' | 'if' | 'if_not' | '||' | 'when' | 'when_not' | 'throw'>;
|
|
33
33
|
export type BuiltinSpecialExpressions = typeof specialExpressions;
|
|
34
34
|
export type BuiltinSpecialExpression = typeof specialExpressions[SpecialExpressionName];
|
|
35
35
|
export type BuiltinCommonSpecialExpression = typeof specialExpressions[CommonSpecialExpressionName];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Any } from '../../interface';
|
|
2
2
|
import type { CommonSpecialExpressionNode } from '../../parser/interface';
|
|
3
3
|
import type { BuiltinSpecialExpression } from '../interface';
|
|
4
|
-
export interface AndNode extends CommonSpecialExpressionNode<'
|
|
4
|
+
export interface AndNode extends CommonSpecialExpressionNode<'&&'> {
|
|
5
5
|
}
|
|
6
6
|
export declare const andSpecialExpression: BuiltinSpecialExpression<Any, AndNode>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Any } from '../../interface';
|
|
2
2
|
import type { BindingNode, CommonSpecialExpressionNode } from '../../parser/interface';
|
|
3
3
|
import type { BuiltinSpecialExpression } from '../interface';
|
|
4
|
-
export interface IfLetNode extends CommonSpecialExpressionNode<'
|
|
4
|
+
export interface IfLetNode extends CommonSpecialExpressionNode<'if_let'> {
|
|
5
5
|
b: BindingNode;
|
|
6
6
|
}
|
|
7
7
|
export declare const ifLetSpecialExpression: BuiltinSpecialExpression<Any, IfLetNode>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Any } from '../../interface';
|
|
2
2
|
import type { CommonSpecialExpressionNode } from '../../parser/interface';
|
|
3
3
|
import type { BuiltinSpecialExpression } from '../interface';
|
|
4
|
-
export interface IfNotNode extends CommonSpecialExpressionNode<'
|
|
4
|
+
export interface IfNotNode extends CommonSpecialExpressionNode<'if_not'> {
|
|
5
5
|
}
|
|
6
6
|
export declare const ifNotSpecialExpression: BuiltinSpecialExpression<Any, IfNotNode>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Any } from '../../interface';
|
|
2
2
|
import type { CommonSpecialExpressionNode } from '../../parser/interface';
|
|
3
3
|
import type { BuiltinSpecialExpression } from '../interface';
|
|
4
|
-
export interface OrNode extends CommonSpecialExpressionNode<'
|
|
4
|
+
export interface OrNode extends CommonSpecialExpressionNode<'||'> {
|
|
5
5
|
}
|
|
6
6
|
export declare const orSpecialExpression: BuiltinSpecialExpression<Any, OrNode>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Any } from '../../interface';
|
|
2
2
|
import type { CommonSpecialExpressionNode } from '../../parser/interface';
|
|
3
3
|
import type { BuiltinSpecialExpression } from '../interface';
|
|
4
|
-
export interface
|
|
4
|
+
export interface SwitchNode extends CommonSpecialExpressionNode<'switch'> {
|
|
5
5
|
}
|
|
6
|
-
export declare const
|
|
6
|
+
export declare const switchSpecialExpression: BuiltinSpecialExpression<Any, SwitchNode>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Any } from '../../interface';
|
|
2
2
|
import type { BindingNode, CommonSpecialExpressionNode } from '../../parser/interface';
|
|
3
3
|
import type { BuiltinSpecialExpression } from '../interface';
|
|
4
|
-
export interface WhenFirstNode extends CommonSpecialExpressionNode<'
|
|
4
|
+
export interface WhenFirstNode extends CommonSpecialExpressionNode<'when_first'> {
|
|
5
5
|
b: BindingNode;
|
|
6
6
|
}
|
|
7
7
|
export declare const whenFirstSpecialExpression: BuiltinSpecialExpression<Any, WhenFirstNode>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Any } from '../../interface';
|
|
2
2
|
import type { BindingNode, CommonSpecialExpressionNode } from '../../parser/interface';
|
|
3
3
|
import type { BuiltinSpecialExpression } from '../interface';
|
|
4
|
-
export interface WhenLetNode extends CommonSpecialExpressionNode<'
|
|
4
|
+
export interface WhenLetNode extends CommonSpecialExpressionNode<'when_let'> {
|
|
5
5
|
b: BindingNode;
|
|
6
6
|
}
|
|
7
7
|
export declare const whenLetSpecialExpression: BuiltinSpecialExpression<Any, WhenLetNode>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Any } from '../../interface';
|
|
2
2
|
import type { CommonSpecialExpressionNode } from '../../parser/interface';
|
|
3
3
|
import type { BuiltinSpecialExpression } from '../interface';
|
|
4
|
-
export interface WhenNotNode extends CommonSpecialExpressionNode<'
|
|
4
|
+
export interface WhenNotNode extends CommonSpecialExpressionNode<'when_not'> {
|
|
5
5
|
}
|
|
6
6
|
export declare const whenNotSpecialExpression: BuiltinSpecialExpression<Any, WhenNotNode>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const polishIdentifierCharacterClass = "[\\w
|
|
2
|
-
export declare const polishIdentifierFirstCharacterClass = "[a-zA-Z_
|
|
1
|
+
export declare const polishIdentifierCharacterClass = "[\\w@%^?=!$<>+*/:&|~-]";
|
|
2
|
+
export declare const polishIdentifierFirstCharacterClass = "[a-zA-Z_@%^?=!$<>+*/&|~-]";
|
|
3
3
|
export declare const algebraicIdentifierCharacterClass = "[\\w$:!?]";
|
|
4
4
|
export declare const algebraicIdentifierFirstCharacterClass = "[a-zA-Z_$]";
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
import type { CondNode } from '../builtin/specialExpressions/cond';
|
|
2
|
+
import type { DefNode } from '../builtin/specialExpressions/def';
|
|
3
|
+
import type { DefnNode } from '../builtin/specialExpressions/functions';
|
|
4
|
+
import type { IfNode } from '../builtin/specialExpressions/if';
|
|
5
|
+
import type { SwitchNode } from '../builtin/specialExpressions/switch';
|
|
6
|
+
import type { Arity, FunctionArguments } from '../builtin/utils';
|
|
7
|
+
import type { A_SymbolToken } from '../tokenizer/algebraic/algebraicTokens';
|
|
1
8
|
import type { TokenStream } from '../tokenizer/interface';
|
|
2
9
|
import type { AstNode, ParseState } from './interface';
|
|
3
10
|
export declare class AlgebraicParser {
|
|
@@ -5,7 +12,7 @@ export declare class AlgebraicParser {
|
|
|
5
12
|
private parseState;
|
|
6
13
|
constructor(tokenStream: TokenStream, parseState: ParseState);
|
|
7
14
|
private advance;
|
|
8
|
-
parse(): AstNode;
|
|
15
|
+
parse(): AstNode[];
|
|
9
16
|
private parseExpression;
|
|
10
17
|
private parseOperand;
|
|
11
18
|
private parseOperandPart;
|
|
@@ -13,12 +20,20 @@ export declare class AlgebraicParser {
|
|
|
13
20
|
private parseArray;
|
|
14
21
|
private parseFunctionCall;
|
|
15
22
|
parseLambdaFunction(): AstNode | null;
|
|
23
|
+
parseFunctionArguments(): {
|
|
24
|
+
functionArguments: FunctionArguments;
|
|
25
|
+
arity: Arity;
|
|
26
|
+
};
|
|
16
27
|
private parseShorthandLamdaFunction;
|
|
17
28
|
private parseLet;
|
|
18
29
|
private parseFor;
|
|
19
30
|
private parseForLoopBinding;
|
|
20
31
|
private parseBinding;
|
|
32
|
+
parseIf(token: A_SymbolToken): IfNode;
|
|
33
|
+
parseCond(token: A_SymbolToken): CondNode;
|
|
34
|
+
parseSwitch(token: A_SymbolToken): SwitchNode;
|
|
35
|
+
parseDef(token: A_SymbolToken): DefNode;
|
|
36
|
+
parseDefn(token: A_SymbolToken): DefnNode;
|
|
21
37
|
private isAtEnd;
|
|
22
38
|
private peek;
|
|
23
|
-
private peekAhead;
|
|
24
39
|
}
|
|
@@ -1,8 +1,107 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
declare const validAlgebraicReservedNamesRecord: {
|
|
2
|
+
readonly true: {
|
|
3
|
+
readonly value: true;
|
|
4
|
+
readonly forbidden: false;
|
|
5
|
+
};
|
|
6
|
+
readonly false: {
|
|
7
|
+
readonly value: false;
|
|
8
|
+
readonly forbidden: false;
|
|
9
|
+
};
|
|
10
|
+
readonly nil: {
|
|
11
|
+
readonly value: null;
|
|
12
|
+
readonly forbidden: false;
|
|
13
|
+
};
|
|
14
|
+
readonly null: {
|
|
15
|
+
readonly value: null;
|
|
16
|
+
readonly forbidden: false;
|
|
17
|
+
};
|
|
18
|
+
readonly then: {
|
|
19
|
+
readonly value: null;
|
|
20
|
+
readonly forbidden: false;
|
|
21
|
+
};
|
|
22
|
+
readonly else: {
|
|
23
|
+
readonly value: null;
|
|
24
|
+
readonly forbidden: false;
|
|
25
|
+
};
|
|
26
|
+
readonly end: {
|
|
27
|
+
readonly value: null;
|
|
28
|
+
readonly forbidden: false;
|
|
29
|
+
};
|
|
30
|
+
readonly case: {
|
|
31
|
+
readonly value: null;
|
|
32
|
+
readonly forbidden: false;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
export declare const algebraicReservedNamesRecord: {
|
|
36
|
+
readonly if_let: {
|
|
37
|
+
readonly value: null;
|
|
38
|
+
readonly forbidden: true;
|
|
39
|
+
};
|
|
40
|
+
readonly when_let: {
|
|
41
|
+
readonly value: null;
|
|
42
|
+
readonly forbidden: true;
|
|
43
|
+
};
|
|
44
|
+
readonly when_first: {
|
|
45
|
+
readonly value: null;
|
|
46
|
+
readonly forbidden: true;
|
|
47
|
+
};
|
|
48
|
+
readonly fn: {
|
|
49
|
+
readonly value: null;
|
|
50
|
+
readonly forbidden: true;
|
|
51
|
+
};
|
|
52
|
+
readonly defns: {
|
|
53
|
+
readonly value: null;
|
|
54
|
+
readonly forbidden: true;
|
|
55
|
+
};
|
|
56
|
+
readonly try: {
|
|
57
|
+
readonly value: null;
|
|
58
|
+
readonly forbidden: true;
|
|
59
|
+
};
|
|
60
|
+
readonly recur: {
|
|
61
|
+
readonly value: null;
|
|
62
|
+
readonly forbidden: true;
|
|
63
|
+
};
|
|
64
|
+
readonly loop: {
|
|
65
|
+
readonly value: null;
|
|
66
|
+
readonly forbidden: true;
|
|
67
|
+
};
|
|
68
|
+
readonly doseq: {
|
|
69
|
+
readonly value: null;
|
|
70
|
+
readonly forbidden: true;
|
|
71
|
+
};
|
|
72
|
+
readonly true: {
|
|
73
|
+
readonly value: true;
|
|
74
|
+
readonly forbidden: false;
|
|
75
|
+
};
|
|
76
|
+
readonly false: {
|
|
77
|
+
readonly value: false;
|
|
78
|
+
readonly forbidden: false;
|
|
79
|
+
};
|
|
80
|
+
readonly nil: {
|
|
81
|
+
readonly value: null;
|
|
82
|
+
readonly forbidden: false;
|
|
83
|
+
};
|
|
84
|
+
readonly null: {
|
|
85
|
+
readonly value: null;
|
|
86
|
+
readonly forbidden: false;
|
|
87
|
+
};
|
|
88
|
+
readonly then: {
|
|
89
|
+
readonly value: null;
|
|
90
|
+
readonly forbidden: false;
|
|
91
|
+
};
|
|
92
|
+
readonly else: {
|
|
93
|
+
readonly value: null;
|
|
94
|
+
readonly forbidden: false;
|
|
95
|
+
};
|
|
96
|
+
readonly end: {
|
|
97
|
+
readonly value: null;
|
|
98
|
+
readonly forbidden: false;
|
|
99
|
+
};
|
|
100
|
+
readonly case: {
|
|
101
|
+
readonly value: null;
|
|
102
|
+
readonly forbidden: false;
|
|
103
|
+
};
|
|
104
|
+
};
|
|
105
|
+
export type ValidAlgebraicReservedName = keyof typeof validAlgebraicReservedNamesRecord;
|
|
106
|
+
export type AlgebraicReservedName = keyof typeof algebraicReservedNamesRecord;
|
|
8
107
|
export {};
|
|
@@ -3,8 +3,8 @@ import type { A_BasePrefixedNumberToken, A_MultiLineCommentToken, A_NumberToken,
|
|
|
3
3
|
export declare const tokenizeA_Whitespace: Tokenizer<A_WhitespaceToken>;
|
|
4
4
|
export declare const tokenizeA_Number: Tokenizer<A_NumberToken>;
|
|
5
5
|
export declare const tokenizeA_BasePrefixedNumber: Tokenizer<A_BasePrefixedNumberToken>;
|
|
6
|
-
export declare const tokenizeA_ReservedSymbolToken: Tokenizer<A_ReservedSymbolToken>;
|
|
7
6
|
export declare const tokenizeA_Symbol: Tokenizer<A_SymbolToken>;
|
|
7
|
+
export declare const tokenizeA_ReservedSymbolToken: Tokenizer<A_ReservedSymbolToken>;
|
|
8
8
|
export declare const tokenizeA_Operator: Tokenizer<A_OperatorToken>;
|
|
9
9
|
export declare const tokenizeA_MultiLineComment: Tokenizer<A_MultiLineCommentToken>;
|
|
10
10
|
export declare const tokenizeA_SingleLineComment: Tokenizer<A_SingleLineCommentToken>;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import type { CommonSimpleToken, CommonValueToken, CommonValueTokenType } from '../common/commonTokens';
|
|
2
2
|
import type { Token } from '../tokens';
|
|
3
3
|
import { type TokenDebugData } from '../utils';
|
|
4
|
+
import type { ValidAlgebraicReservedName } from './algebraicReservedNames';
|
|
4
5
|
export declare const algebraicSimpleTokenTypes: readonly ["LBrace", "LBracket", "LParen", "RBrace", "RBracket", "RParen", "AlgNotation", "PolNotation", "EndNotation"];
|
|
5
6
|
export declare const algebraicOnlyValueTokenTypes: ["A_Whitespace", "A_Operator", "A_Symbol", "A_ReservedSymbol", "A_SingleLineComment", "A_MultiLineComment", "A_Number", "A_BasePrefixedNumber"];
|
|
6
7
|
export declare const algebraicValueTokenTypes: readonly ["String", "A_Whitespace", "A_Operator", "A_Symbol", "A_ReservedSymbol", "A_SingleLineComment", "A_MultiLineComment", "A_Number", "A_BasePrefixedNumber"];
|
|
7
8
|
export declare const algebraicTokenTypes: readonly ["LBrace", "LBracket", "LParen", "RBrace", "RBracket", "RParen", "AlgNotation", "PolNotation", "EndNotation", "String", "A_Whitespace", "A_Operator", "A_Symbol", "A_ReservedSymbol", "A_SingleLineComment", "A_MultiLineComment", "A_Number", "A_BasePrefixedNumber"];
|
|
8
9
|
declare const symbolicUnaryOperators: readonly ["!", "~", "+", "-"];
|
|
9
10
|
declare const symbolicBinaryOperators: readonly ["**", "*", "/", "%", "+", "-", "<<", ">>", ">>>", "++", "<", "<=", ">", ">=", "==", "!=", "&", "^", "|", "&&", "||", "??"];
|
|
10
|
-
declare const symbolicOperators: readonly ["!", "~", "+", "-", "**", "*", "/", "%", "+", "-", "<<", ">>", ">>>", "++", "<", "<=", ">", ">=", "==", "!=", "&", "^", "|", "&&", "||", "??", "=>", "...", ".", ",", "="];
|
|
11
|
+
declare const symbolicOperators: readonly ["!", "~", "+", "-", "**", "*", "/", "%", "+", "-", "<<", ">>", ">>>", "++", "<", "<=", ">", ">=", "==", "!=", "&", "^", "|", "&&", "||", "??", "=>", "...", ".", ",", "=", ";"];
|
|
11
12
|
export declare function isFunctionOperator(operator: string): boolean;
|
|
12
13
|
export type SymbolicUnaryOperator = typeof symbolicUnaryOperators[number];
|
|
13
14
|
export type SymbolicBinaryOperator = typeof symbolicBinaryOperators[number];
|
|
@@ -30,7 +31,7 @@ export type A_NumberToken = GenericAlgebraicValueToken<'A_Number'>;
|
|
|
30
31
|
export type A_BasePrefixedNumberToken = GenericAlgebraicValueToken<'A_BasePrefixedNumber'>;
|
|
31
32
|
export type A_OperatorToken<T extends SymbolicOperator = SymbolicOperator> = GenericAlgebraicValueToken<'A_Operator', T>;
|
|
32
33
|
export type A_SymbolToken<T extends string = string> = GenericAlgebraicValueToken<'A_Symbol', T>;
|
|
33
|
-
export type A_ReservedSymbolToken = GenericAlgebraicValueToken<'A_ReservedSymbol'>;
|
|
34
|
+
export type A_ReservedSymbolToken<T extends ValidAlgebraicReservedName = ValidAlgebraicReservedName> = GenericAlgebraicValueToken<'A_ReservedSymbol', T>;
|
|
34
35
|
export type A_SingleLineCommentToken = GenericAlgebraicValueToken<'A_SingleLineComment'>;
|
|
35
36
|
export type A_MultiLineCommentToken = GenericAlgebraicValueToken<'A_MultiLineComment'>;
|
|
36
37
|
export type AlgebraicOnlyValueToken = A_WhitespaceToken | A_NumberToken | A_BasePrefixedNumberToken | A_OperatorToken | A_SymbolToken | A_ReservedSymbolToken | A_SingleLineCommentToken | A_MultiLineCommentToken;
|
|
@@ -41,9 +42,9 @@ export declare function asA_SymbolToken(token: Token | undefined): A_SymbolToken
|
|
|
41
42
|
export declare function isA_BinaryOperatorToken(token: Token | undefined): token is A_OperatorToken<SymbolicBinaryOperator>;
|
|
42
43
|
export declare function assertA_BinaryOperatorToken(token: Token | undefined): asserts token is A_OperatorToken<SymbolicBinaryOperator>;
|
|
43
44
|
export declare function asA_BinaryOperatorToken(token: Token | undefined): A_OperatorToken<SymbolicBinaryOperator>;
|
|
44
|
-
export declare function isA_ReservedSymbolToken(token: Token | undefined): token is A_ReservedSymbolToken
|
|
45
|
-
export declare function assertA_ReservedSymbolToken(token: Token | undefined): asserts token is A_ReservedSymbolToken
|
|
46
|
-
export declare function asA_ReservedSymbolToken(token: Token | undefined): A_ReservedSymbolToken
|
|
45
|
+
export declare function isA_ReservedSymbolToken<T extends ValidAlgebraicReservedName>(token: Token | undefined, symbolName?: T): token is A_ReservedSymbolToken<T>;
|
|
46
|
+
export declare function assertA_ReservedSymbolToken<T extends ValidAlgebraicReservedName>(token: Token | undefined, symbolName?: T): asserts token is A_ReservedSymbolToken<T>;
|
|
47
|
+
export declare function asA_ReservedSymbolToken<T extends ValidAlgebraicReservedName>(token: Token | undefined, symbolName?: T): A_ReservedSymbolToken<T>;
|
|
47
48
|
export declare function isA_CommentToken(token: Token | undefined): token is A_SingleLineCommentToken;
|
|
48
49
|
export declare function assertA_CommentToken(token: Token | undefined): asserts token is A_SingleLineCommentToken;
|
|
49
50
|
export declare function asA_CommentToken(token: Token | undefined): A_SingleLineCommentToken;
|
|
@@ -11,4 +11,4 @@ export declare const tokenizeP_ReservedSymbol: Tokenizer<P_ReservedSymbolToken>;
|
|
|
11
11
|
export declare const tokenizeP_Modifier: Tokenizer<P_ModifierToken>;
|
|
12
12
|
export declare const tokenizeP_CollectionAccessor: Tokenizer<P_CollectionAccessorToken>;
|
|
13
13
|
export declare const tokenizeP_RegexpShorthand: Tokenizer<P_RegexpShorthandToken>;
|
|
14
|
-
export declare const polishTokenizers: [Tokenizer<P_WhitespaceToken>, Tokenizer<P_CommentToken>, Tokenizer<import("../common/commonTokens").PolishNotationToken>, Tokenizer<import("../common/commonTokens").AlgebraicNotationToken>, Tokenizer<import("../common/commonTokens").EndNotationToken>, Tokenizer<import("../common/commonTokens").LParenToken>, Tokenizer<import("../common/commonTokens").RParenToken>, Tokenizer<import("../common/commonTokens").LBracketToken>, Tokenizer<import("../common/commonTokens").RBracketToken>, Tokenizer<import("../common/commonTokens").LBraceToken>, Tokenizer<import("../common/commonTokens").RBraceToken>, Tokenizer<import("../common/commonTokens").StringToken>, Tokenizer<P_StringShorthandToken>, Tokenizer<P_NumberToken>, Tokenizer<P_ReservedSymbolToken>, Tokenizer<
|
|
14
|
+
export declare const polishTokenizers: [Tokenizer<P_WhitespaceToken>, Tokenizer<P_CommentToken>, Tokenizer<import("../common/commonTokens").PolishNotationToken>, Tokenizer<import("../common/commonTokens").AlgebraicNotationToken>, Tokenizer<import("../common/commonTokens").EndNotationToken>, Tokenizer<import("../common/commonTokens").LParenToken>, Tokenizer<import("../common/commonTokens").RParenToken>, Tokenizer<import("../common/commonTokens").LBracketToken>, Tokenizer<import("../common/commonTokens").RBracketToken>, Tokenizer<import("../common/commonTokens").LBraceToken>, Tokenizer<import("../common/commonTokens").RBraceToken>, Tokenizer<import("../common/commonTokens").StringToken>, Tokenizer<P_StringShorthandToken>, Tokenizer<P_NumberToken>, Tokenizer<P_ReservedSymbolToken>, Tokenizer<P_ModifierToken>, Tokenizer<P_SymbolToken>, Tokenizer<P_RegexpShorthandToken>, Tokenizer<P_FnShorthandToken>, Tokenizer<P_CollectionAccessorToken>];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { CommonSimpleToken, CommonSimpleTokenType, CommonValueToken, CommonValueTokenType } from '../common/commonTokens';
|
|
2
2
|
import type { Token } from '../tokens';
|
|
3
3
|
import { type TokenDebugData } from '../utils';
|
|
4
|
-
export declare const modifierNames: readonly ["&", "&let", "&when", "&while"];
|
|
4
|
+
export declare const modifierNames: readonly ["&rest", "&let", "&when", "&while"];
|
|
5
5
|
export type ModifierName = typeof modifierNames[number];
|
|
6
6
|
export declare const polishOnlySimpleTokenTypes: ["P_FnShorthand"];
|
|
7
7
|
export declare const polishSimpleTokenTypes: readonly ["LBrace", "LBracket", "LParen", "RBrace", "RBracket", "RParen", "AlgNotation", "PolNotation", "EndNotation", "P_FnShorthand"];
|
|
@@ -6,4 +6,4 @@ export type TokenDebugData = {
|
|
|
6
6
|
export declare function getTokenDebugData(token?: Token): TokenDebugData | undefined;
|
|
7
7
|
export declare function hasTokenDebugData(token?: Token): boolean;
|
|
8
8
|
export declare function addTokenDebugData(token: Token, debugData: TokenDebugData): void;
|
|
9
|
-
export declare function throwUnexpectedToken(expected: TokenType, actual?: Token): never;
|
|
9
|
+
export declare function throwUnexpectedToken(expected: TokenType, expectedValue: string | undefined, actual?: Token): never;
|
|
@@ -6,6 +6,7 @@ type Count = number | {
|
|
|
6
6
|
max?: number;
|
|
7
7
|
};
|
|
8
8
|
export declare function assertEvenNumberOfParams(node: GenericNode): void;
|
|
9
|
+
export declare function assertOddNumberOfParams(node: GenericNode): void;
|
|
9
10
|
export declare function assertNumberOfParams(count: Count, node: GenericNode): void;
|
|
10
11
|
export declare function isNonUndefined<T>(value: T | undefined): value is T;
|
|
11
12
|
export declare function asNonUndefined<T>(value: T | undefined, sourceCodeInfo?: SourceCodeInfo): T;
|