@mojir/lits 2.0.15 → 2.0.16
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 +318 -1113
- package/dist/cli/reference/api.d.ts +2 -2
- package/dist/cli/src/analyze/index.d.ts +0 -2
- package/dist/cli/src/builtin/index.d.ts +3 -8
- package/dist/cli/src/builtin/specialExpressions/declared.d.ts +1 -1
- package/dist/cli/src/builtin/specialExpressions/try.d.ts +1 -1
- package/dist/{src/builtin/specialExpressions/if_not.d.ts → cli/src/builtin/specialExpressions/unless.d.ts} +2 -2
- package/dist/cli/src/evaluator/ContextStack.d.ts +2 -0
- package/dist/cli/src/parser/AlgebraicParser.d.ts +7 -2
- package/dist/cli/src/tokenizer/algebraic/algebraicReservedNames.d.ts +14 -26
- package/dist/cli/src/tokenizer/algebraic/algebraicTokens.d.ts +3 -3
- package/dist/index.esm.js +318 -1113
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +318 -1113
- package/dist/index.js.map +1 -1
- package/dist/lits.iife.js +318 -1113
- package/dist/lits.iife.js.map +1 -1
- package/dist/reference/api.d.ts +2 -2
- package/dist/src/analyze/index.d.ts +0 -2
- package/dist/src/builtin/index.d.ts +3 -8
- package/dist/src/builtin/specialExpressions/declared.d.ts +1 -1
- package/dist/src/builtin/specialExpressions/try.d.ts +1 -1
- package/dist/{cli/src/builtin/specialExpressions/if_not.d.ts → src/builtin/specialExpressions/unless.d.ts} +2 -2
- package/dist/src/evaluator/ContextStack.d.ts +2 -0
- package/dist/src/parser/AlgebraicParser.d.ts +7 -2
- package/dist/src/tokenizer/algebraic/algebraicReservedNames.d.ts +14 -26
- package/dist/src/tokenizer/algebraic/algebraicTokens.d.ts +3 -3
- package/dist/testFramework.esm.js +285 -937
- package/dist/testFramework.esm.js.map +1 -1
- package/dist/testFramework.js +285 -937
- package/dist/testFramework.js.map +1 -1
- package/package.json +1 -1
- package/dist/cli/src/analyze/calculateOutcomes/calculateAndOutcomes.d.ts +0 -3
- package/dist/cli/src/analyze/calculateOutcomes/calculateCommentOutcomes.d.ts +0 -3
- package/dist/cli/src/analyze/calculateOutcomes/calculateCondOutcomes.d.ts +0 -3
- package/dist/cli/src/analyze/calculateOutcomes/calculateDeclaredOutcomes.d.ts +0 -3
- package/dist/cli/src/analyze/calculateOutcomes/calculateDefOutcomes.d.ts +0 -3
- package/dist/cli/src/analyze/calculateOutcomes/calculateDefsOutcomes.d.ts +0 -3
- package/dist/cli/src/analyze/calculateOutcomes/calculateDoOutcomes.d.ts +0 -3
- package/dist/cli/src/analyze/calculateOutcomes/calculateFunctionOutcomes.d.ts +0 -5
- package/dist/cli/src/analyze/calculateOutcomes/calculateIfLetOutcomes.d.ts +0 -3
- package/dist/cli/src/analyze/calculateOutcomes/calculateIfNotOutcomes.d.ts +0 -3
- package/dist/cli/src/analyze/calculateOutcomes/calculateIfOutcomes.d.ts +0 -3
- package/dist/cli/src/analyze/calculateOutcomes/calculateLetOutcomes.d.ts +0 -3
- package/dist/cli/src/analyze/calculateOutcomes/calculateLoopOutcomes.d.ts +0 -3
- package/dist/cli/src/analyze/calculateOutcomes/calculateLoopsOutcomes.d.ts +0 -4
- package/dist/cli/src/analyze/calculateOutcomes/calculateOrOutcomes.d.ts +0 -3
- package/dist/cli/src/analyze/calculateOutcomes/calculateQqOutcomes.d.ts +0 -3
- package/dist/cli/src/analyze/calculateOutcomes/calculateRecurOutcomes.d.ts +0 -3
- package/dist/cli/src/analyze/calculateOutcomes/calculateSwitchOutcomes.d.ts +0 -3
- package/dist/cli/src/analyze/calculateOutcomes/calculateThrowOutcomes.d.ts +0 -3
- package/dist/cli/src/analyze/calculateOutcomes/calculateTryOutcomes.d.ts +0 -3
- package/dist/cli/src/analyze/calculateOutcomes/calculateWhenFirstOutcomes.d.ts +0 -3
- package/dist/cli/src/analyze/calculateOutcomes/calculateWhenLetOutcomes.d.ts +0 -3
- package/dist/cli/src/analyze/calculateOutcomes/calculateWhenNotOutcomes.d.ts +0 -3
- package/dist/cli/src/analyze/calculateOutcomes/calculateWhenOutcomes.d.ts +0 -3
- package/dist/cli/src/analyze/calculateOutcomes/index.d.ts +0 -18
- package/dist/cli/src/analyze/calculateOutcomes/specialExpressionCalculators.d.ts +0 -55
- package/dist/cli/src/builtin/specialExpressions/if_let.d.ts +0 -7
- package/dist/cli/src/builtin/specialExpressions/when.d.ts +0 -6
- package/dist/cli/src/builtin/specialExpressions/when_first.d.ts +0 -7
- package/dist/cli/src/builtin/specialExpressions/when_let.d.ts +0 -7
- package/dist/cli/src/builtin/specialExpressions/when_not.d.ts +0 -6
- package/dist/src/analyze/calculateOutcomes/calculateAndOutcomes.d.ts +0 -3
- package/dist/src/analyze/calculateOutcomes/calculateCommentOutcomes.d.ts +0 -3
- package/dist/src/analyze/calculateOutcomes/calculateCondOutcomes.d.ts +0 -3
- package/dist/src/analyze/calculateOutcomes/calculateDeclaredOutcomes.d.ts +0 -3
- package/dist/src/analyze/calculateOutcomes/calculateDefOutcomes.d.ts +0 -3
- package/dist/src/analyze/calculateOutcomes/calculateDefsOutcomes.d.ts +0 -3
- package/dist/src/analyze/calculateOutcomes/calculateDoOutcomes.d.ts +0 -3
- package/dist/src/analyze/calculateOutcomes/calculateFunctionOutcomes.d.ts +0 -5
- package/dist/src/analyze/calculateOutcomes/calculateIfLetOutcomes.d.ts +0 -3
- package/dist/src/analyze/calculateOutcomes/calculateIfNotOutcomes.d.ts +0 -3
- package/dist/src/analyze/calculateOutcomes/calculateIfOutcomes.d.ts +0 -3
- package/dist/src/analyze/calculateOutcomes/calculateLetOutcomes.d.ts +0 -3
- package/dist/src/analyze/calculateOutcomes/calculateLoopOutcomes.d.ts +0 -3
- package/dist/src/analyze/calculateOutcomes/calculateLoopsOutcomes.d.ts +0 -4
- package/dist/src/analyze/calculateOutcomes/calculateOrOutcomes.d.ts +0 -3
- package/dist/src/analyze/calculateOutcomes/calculateQqOutcomes.d.ts +0 -3
- package/dist/src/analyze/calculateOutcomes/calculateRecurOutcomes.d.ts +0 -3
- package/dist/src/analyze/calculateOutcomes/calculateSwitchOutcomes.d.ts +0 -3
- package/dist/src/analyze/calculateOutcomes/calculateThrowOutcomes.d.ts +0 -3
- package/dist/src/analyze/calculateOutcomes/calculateTryOutcomes.d.ts +0 -3
- package/dist/src/analyze/calculateOutcomes/calculateWhenFirstOutcomes.d.ts +0 -3
- package/dist/src/analyze/calculateOutcomes/calculateWhenLetOutcomes.d.ts +0 -3
- package/dist/src/analyze/calculateOutcomes/calculateWhenNotOutcomes.d.ts +0 -3
- package/dist/src/analyze/calculateOutcomes/calculateWhenOutcomes.d.ts +0 -3
- package/dist/src/analyze/calculateOutcomes/index.d.ts +0 -18
- package/dist/src/analyze/calculateOutcomes/specialExpressionCalculators.d.ts +0 -55
- package/dist/src/builtin/specialExpressions/if_let.d.ts +0 -7
- package/dist/src/builtin/specialExpressions/when.d.ts +0 -6
- package/dist/src/builtin/specialExpressions/when_first.d.ts +0 -7
- package/dist/src/builtin/specialExpressions/when_let.d.ts +0 -7
- package/dist/src/builtin/specialExpressions/when_not.d.ts +0 -6
|
@@ -8,7 +8,7 @@ export declare const api: {
|
|
|
8
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 ["&&", "||", "def", "defs", "let", "
|
|
11
|
+
readonly specialExpressions: readonly ["&&", "||", "def", "defs", "let", "fn", "defn", "defns", "try", "throw", "if", "unless", "cond", "switch", "comment", "do", "recur", "loop", "doseq", "for", "defined?", "??"];
|
|
12
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
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"];
|
|
@@ -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", "%", "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", "
|
|
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", "fn", "defn", "defns", "try", "throw", "if", "unless", "cond", "switch", "comment", "do", "recur", "loop", "doseq", "for", "defined?", "??", "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: {
|
|
@@ -8,10 +8,8 @@ export interface UnresolvedIdentifier {
|
|
|
8
8
|
token: Token | undefined;
|
|
9
9
|
}
|
|
10
10
|
export type UnresolvedIdentifiers = Set<UnresolvedIdentifier>;
|
|
11
|
-
export type Outcomes = unknown[];
|
|
12
11
|
export interface Analysis {
|
|
13
12
|
unresolvedIdentifiers: UnresolvedIdentifiers;
|
|
14
|
-
outcomes: Outcomes | null;
|
|
15
13
|
}
|
|
16
14
|
export type FindUnresolvedIdentifiers = (ast: Ast | AstNode[], contextStack: ContextStack, builtin: Builtin) => UnresolvedIdentifiers;
|
|
17
15
|
export declare function analyze(ast: Ast, params: LitsParams): Analysis;
|
|
@@ -13,23 +13,18 @@ declare const specialExpressions: {
|
|
|
13
13
|
readonly for: import("./interface").BuiltinSpecialExpression<import("../interface").Any, import("./specialExpressions/loops").ForNode>;
|
|
14
14
|
readonly fn: import("./interface").BuiltinSpecialExpression<import("..").LitsFunction, import("./specialExpressions/functions").FnNode>;
|
|
15
15
|
readonly if: import("./interface").BuiltinSpecialExpression<import("../interface").Any, import("./specialExpressions/if").IfNode>;
|
|
16
|
-
readonly
|
|
17
|
-
readonly if_not: import("./interface").BuiltinSpecialExpression<import("../interface").Any, import("./specialExpressions/if_not").IfNotNode>;
|
|
16
|
+
readonly unless: import("./interface").BuiltinSpecialExpression<import("../interface").Any, import("./specialExpressions/unless").UnlessNode>;
|
|
18
17
|
readonly let: import("./interface").BuiltinSpecialExpression<import("../interface").Any, import("./specialExpressions/let").LetNode>;
|
|
19
18
|
readonly loop: import("./interface").BuiltinSpecialExpression<import("../interface").Any, import("./specialExpressions/loop").LoopNode>;
|
|
20
19
|
readonly '||': import("./interface").BuiltinSpecialExpression<import("../interface").Any, import("./specialExpressions/or").OrNode>;
|
|
21
20
|
readonly recur: import("./interface").BuiltinSpecialExpression<null, import("./specialExpressions/recur").RecurNode>;
|
|
22
21
|
readonly throw: import("./interface").BuiltinSpecialExpression<null, import("./specialExpressions/throw").ThrowNode>;
|
|
23
22
|
readonly try: import("./interface").BuiltinSpecialExpression<import("../interface").Any, import("./specialExpressions/try").TryNode>;
|
|
24
|
-
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
|
-
readonly 'declared?': import("./interface").BuiltinSpecialExpression<boolean, import("./specialExpressions/declared").DeclaredNode>;
|
|
23
|
+
readonly 'defined?': import("./interface").BuiltinSpecialExpression<boolean, import("./specialExpressions/declared").DeclaredNode>;
|
|
29
24
|
readonly '??': import("./interface").BuiltinSpecialExpression<import("../interface").Any, import("./specialExpressions/qq").QqNode>;
|
|
30
25
|
};
|
|
31
26
|
export type SpecialExpressionName = keyof typeof specialExpressions;
|
|
32
|
-
export type CommonSpecialExpressionName = keyof Pick<typeof specialExpressions, '??' | '&&' | 'comment' | 'cond' | 'switch' | '
|
|
27
|
+
export type CommonSpecialExpressionName = keyof Pick<typeof specialExpressions, '??' | '&&' | 'comment' | 'cond' | 'switch' | 'defined?' | 'do' | 'if' | 'unless' | '||' | 'throw'>;
|
|
33
28
|
export type BuiltinSpecialExpressions = typeof specialExpressions;
|
|
34
29
|
export type BuiltinSpecialExpression = typeof specialExpressions[SpecialExpressionName];
|
|
35
30
|
export type BuiltinCommonSpecialExpression = typeof specialExpressions[CommonSpecialExpressionName];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { CommonSpecialExpressionNode } from '../../parser/interface';
|
|
2
2
|
import type { BuiltinSpecialExpression } from '../interface';
|
|
3
|
-
export interface DeclaredNode extends CommonSpecialExpressionNode<'
|
|
3
|
+
export interface DeclaredNode extends CommonSpecialExpressionNode<'defined?'> {
|
|
4
4
|
}
|
|
5
5
|
export declare const declaredSpecialExpression: BuiltinSpecialExpression<boolean, DeclaredNode>;
|
|
@@ -2,7 +2,7 @@ import type { Any } from '../../interface';
|
|
|
2
2
|
import type { AstNode, CommonSpecialExpressionNode, SymbolNode } from '../../parser/interface';
|
|
3
3
|
import type { BuiltinSpecialExpression } from '../interface';
|
|
4
4
|
export interface TryNode extends CommonSpecialExpressionNode<'try'> {
|
|
5
|
-
e: SymbolNode;
|
|
5
|
+
e: SymbolNode | undefined;
|
|
6
6
|
ce: AstNode;
|
|
7
7
|
}
|
|
8
8
|
export declare const trySpecialExpression: BuiltinSpecialExpression<Any, TryNode>;
|
|
@@ -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 UnlessNode extends CommonSpecialExpressionNode<'unless'> {
|
|
5
5
|
}
|
|
6
|
-
export declare const
|
|
6
|
+
export declare const unlessSpecialExpression: BuiltinSpecialExpression<Any, UnlessNode>;
|
|
@@ -16,6 +16,8 @@ export declare class ContextStackImpl {
|
|
|
16
16
|
nativeJsFunctions?: Record<string, NativeJsFunction>;
|
|
17
17
|
});
|
|
18
18
|
create(context: Context, extraData?: ExtraData): ContextStack;
|
|
19
|
+
exportValue(name: string, value: Any): void;
|
|
20
|
+
addValue(name: string, value: Any): void;
|
|
19
21
|
clone(): ContextStack;
|
|
20
22
|
getValue(name: string): unknown;
|
|
21
23
|
lookUp(node: SymbolNode): LookUpResult;
|
|
@@ -3,6 +3,7 @@ import type { DefNode } from '../builtin/specialExpressions/def';
|
|
|
3
3
|
import type { DefnNode } from '../builtin/specialExpressions/functions';
|
|
4
4
|
import type { IfNode } from '../builtin/specialExpressions/if';
|
|
5
5
|
import type { SwitchNode } from '../builtin/specialExpressions/switch';
|
|
6
|
+
import type { UnlessNode } from '../builtin/specialExpressions/unless';
|
|
6
7
|
import type { Arity, FunctionArguments } from '../builtin/utils';
|
|
7
8
|
import type { A_SymbolToken } from '../tokenizer/algebraic/algebraicTokens';
|
|
8
9
|
import type { TokenStream } from '../tokenizer/interface';
|
|
@@ -26,14 +27,18 @@ export declare class AlgebraicParser {
|
|
|
26
27
|
};
|
|
27
28
|
private parseShorthandLamdaFunction;
|
|
28
29
|
private parseLet;
|
|
29
|
-
private
|
|
30
|
+
private parseDo;
|
|
31
|
+
private parseLoop;
|
|
32
|
+
private parseTry;
|
|
33
|
+
private parseForOrDoseq;
|
|
30
34
|
private parseForLoopBinding;
|
|
31
35
|
private parseBinding;
|
|
32
|
-
|
|
36
|
+
parseIfOrUnless(token: A_SymbolToken): IfNode | UnlessNode;
|
|
33
37
|
parseCond(token: A_SymbolToken): CondNode;
|
|
34
38
|
parseSwitch(token: A_SymbolToken): SwitchNode;
|
|
35
39
|
parseDef(token: A_SymbolToken): DefNode;
|
|
36
40
|
parseDefn(token: A_SymbolToken): DefnNode;
|
|
37
41
|
private isAtEnd;
|
|
42
|
+
private isAtExpressionEnd;
|
|
38
43
|
private peek;
|
|
39
44
|
}
|
|
@@ -31,20 +31,16 @@ declare const validAlgebraicReservedNamesRecord: {
|
|
|
31
31
|
readonly value: null;
|
|
32
32
|
readonly forbidden: false;
|
|
33
33
|
};
|
|
34
|
-
|
|
35
|
-
export declare const algebraicReservedNamesRecord: {
|
|
36
|
-
readonly if_let: {
|
|
37
|
-
readonly value: null;
|
|
38
|
-
readonly forbidden: true;
|
|
39
|
-
};
|
|
40
|
-
readonly when_let: {
|
|
34
|
+
readonly when: {
|
|
41
35
|
readonly value: null;
|
|
42
|
-
readonly forbidden:
|
|
36
|
+
readonly forbidden: false;
|
|
43
37
|
};
|
|
44
|
-
readonly
|
|
38
|
+
readonly while: {
|
|
45
39
|
readonly value: null;
|
|
46
|
-
readonly forbidden:
|
|
40
|
+
readonly forbidden: false;
|
|
47
41
|
};
|
|
42
|
+
};
|
|
43
|
+
export declare const algebraicReservedNamesRecord: {
|
|
48
44
|
readonly fn: {
|
|
49
45
|
readonly value: null;
|
|
50
46
|
readonly forbidden: true;
|
|
@@ -53,22 +49,6 @@ export declare const algebraicReservedNamesRecord: {
|
|
|
53
49
|
readonly value: null;
|
|
54
50
|
readonly forbidden: true;
|
|
55
51
|
};
|
|
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
52
|
readonly true: {
|
|
73
53
|
readonly value: true;
|
|
74
54
|
readonly forbidden: false;
|
|
@@ -101,6 +81,14 @@ export declare const algebraicReservedNamesRecord: {
|
|
|
101
81
|
readonly value: null;
|
|
102
82
|
readonly forbidden: false;
|
|
103
83
|
};
|
|
84
|
+
readonly when: {
|
|
85
|
+
readonly value: null;
|
|
86
|
+
readonly forbidden: false;
|
|
87
|
+
};
|
|
88
|
+
readonly while: {
|
|
89
|
+
readonly value: null;
|
|
90
|
+
readonly forbidden: false;
|
|
91
|
+
};
|
|
104
92
|
};
|
|
105
93
|
export type ValidAlgebraicReservedName = keyof typeof validAlgebraicReservedNamesRecord;
|
|
106
94
|
export type AlgebraicReservedName = keyof typeof algebraicReservedNamesRecord;
|
|
@@ -36,9 +36,9 @@ export type A_SingleLineCommentToken = GenericAlgebraicValueToken<'A_SingleLineC
|
|
|
36
36
|
export type A_MultiLineCommentToken = GenericAlgebraicValueToken<'A_MultiLineComment'>;
|
|
37
37
|
export type AlgebraicOnlyValueToken = A_WhitespaceToken | A_NumberToken | A_BasePrefixedNumberToken | A_OperatorToken | A_SymbolToken | A_ReservedSymbolToken | A_SingleLineCommentToken | A_MultiLineCommentToken;
|
|
38
38
|
export type AlgebraicToken = AlgebraicOnlyValueToken | CommonSimpleToken | CommonValueToken;
|
|
39
|
-
export declare function isA_SymbolToken(token: Token | undefined): token is A_SymbolToken
|
|
40
|
-
export declare function assertA_SymbolToken(token: Token | undefined): asserts token is A_SymbolToken
|
|
41
|
-
export declare function asA_SymbolToken(token: Token | undefined): A_SymbolToken
|
|
39
|
+
export declare function isA_SymbolToken<T extends string>(token: Token | undefined, symbolName?: T): token is A_SymbolToken<T>;
|
|
40
|
+
export declare function assertA_SymbolToken<T extends string>(token: Token | undefined, symbolName?: T): asserts token is A_SymbolToken<T>;
|
|
41
|
+
export declare function asA_SymbolToken<T extends string>(token: Token | undefined, symbolName?: T): A_SymbolToken<T>;
|
|
42
42
|
export declare function isA_BinaryOperatorToken(token: Token | undefined): token is A_OperatorToken<SymbolicBinaryOperator>;
|
|
43
43
|
export declare function assertA_BinaryOperatorToken(token: Token | undefined): asserts token is A_OperatorToken<SymbolicBinaryOperator>;
|
|
44
44
|
export declare function asA_BinaryOperatorToken(token: Token | undefined): A_OperatorToken<SymbolicBinaryOperator>;
|