@mojir/lits 2.0.10 → 2.0.13
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 +1792 -1693
- package/dist/cli/reference/api.d.ts +10 -10
- package/dist/cli/reference/index.d.ts +2 -2
- package/dist/cli/src/builtin/index.d.ts +2 -2
- package/dist/cli/src/builtin/interface.d.ts +1 -1
- package/dist/cli/src/builtin/normalExpressions/categories/sequence.d.ts +1 -3
- package/dist/cli/src/builtin/specialExpressions/commonParser.d.ts +1 -1
- package/dist/cli/src/parser/AlgebraicParser.d.ts +6 -0
- package/dist/cli/src/tokenizer/algebraic/algebraicTokenizers.d.ts +3 -2
- package/dist/cli/src/tokenizer/algebraic/algebraicTokens.d.ts +50 -32
- package/dist/cli/src/tokenizer/polish/polishTokenizers.d.ts +1 -0
- package/dist/cli/src/tokenizer/tokens.d.ts +2 -2
- package/dist/index.esm.js +1791 -1692
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +1791 -1692
- package/dist/index.js.map +1 -1
- package/dist/lits.iife.js +1791 -1692
- package/dist/lits.iife.js.map +1 -1
- package/dist/reference/api.d.ts +10 -10
- package/dist/reference/index.d.ts +2 -2
- package/dist/src/builtin/index.d.ts +2 -2
- package/dist/src/builtin/interface.d.ts +1 -1
- package/dist/src/builtin/normalExpressions/categories/sequence.d.ts +1 -3
- package/dist/src/builtin/specialExpressions/commonParser.d.ts +1 -1
- package/dist/src/parser/AlgebraicParser.d.ts +6 -0
- package/dist/src/tokenizer/algebraic/algebraicTokenizers.d.ts +3 -2
- package/dist/src/tokenizer/algebraic/algebraicTokens.d.ts +50 -32
- package/dist/src/tokenizer/polish/polishTokenizers.d.ts +1 -0
- package/dist/src/tokenizer/tokens.d.ts +2 -2
- package/dist/testFramework.esm.js +1022 -825
- package/dist/testFramework.esm.js.map +1 -1
- package/dist/testFramework.js +1022 -825
- package/dist/testFramework.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
export declare const api: {
|
|
2
|
-
readonly collection: readonly ["count", "get", "
|
|
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
|
-
readonly sequence: readonly ["nth", "push", "pop", "unshift", "shift", "slice", "reductions", "reduce", "
|
|
5
|
-
readonly math: readonly ["+", "-", "*", "/", "mod", "rem", "quot", "inc", "dec", "sqrt", "cbrt", "pow", "exp", "round", "trunc", "floor", "ceil", "min", "max", "abs", "sign", "
|
|
6
|
-
readonly functional: readonly ["apply", "identity", "partial", "comp", "constantly", "juxt", "complement", "
|
|
7
|
-
readonly misc: readonly ["
|
|
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", "rem", "quot", "inc", "dec", "sqrt", "cbrt", "pow", "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
|
+
readonly functional: readonly ["apply", "identity", "partial", "comp", "constantly", "juxt", "complement", "every_pred", "some_pred", "fnil"];
|
|
7
|
+
readonly misc: readonly ["!=", "=", "<", ">", "<=", ">=", "not", "write!", "inst-ms!", "iso-date-time->inst-ms", "inst-ms->iso-date-time", "boolean", "compare", "lits-version!", "uuid!", "equal?", "json-parse", "json-stringify"];
|
|
8
8
|
readonly object: readonly ["dissoc", "object", "keys", "vals", "entries", "find", "merge", "merge-with", "zipmap", "select-keys"];
|
|
9
|
-
readonly predicate: readonly ["boolean?", "nil?", "number?", "string?", "function?", "integer?", "array?", "object?", "coll?", "seq?", "regexp?", "zero?", "pos?", "neg?", "even?", "odd?", "finite?", "nan?", "
|
|
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
11
|
readonly specialExpressions: readonly ["and", "or", "def", "defs", "let", "if-let", "when-let", "when-first", "fn", "defn", "defns", "try", "throw", "if", "if-not", "cond", "when", "when-not", "comment", "do", "recur", "loop", "time!", "doseq", "for", "declared?", "??"];
|
|
12
12
|
readonly string: readonly ["subs", "string-repeat", "str", "number", "number-to-string", "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-shift-left", "bit-shift-right", "unsigned-bit-shift-right", "bit-not", "bit-and", "bit-and-not", "bit-or", "bit-xor", "bit-flip", "bit-clear", "bit-set", "bit-test"];
|
|
14
|
-
readonly assert: readonly ["assert", "assert=", "assert
|
|
15
|
-
readonly shorthand: ["
|
|
16
|
-
readonly datatype: ["
|
|
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
|
+
readonly shorthand: ["-short-regexp", "-short-fn", "-short-string", "-short-dot", "-short-hash"];
|
|
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"];
|
|
17
17
|
};
|
|
18
18
|
export type CollectionApiName = typeof api.collection[number];
|
|
19
19
|
export type ArrayApiName = typeof api.array[number];
|
|
@@ -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", "
|
|
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", "rem", "quot", "inc", "dec", "sqrt", "cbrt", "pow", "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", "!=", "=", "<", ">", "<=", ">=", "not", "write!", "inst-ms!", "iso-date-time->inst-ms", "inst-ms->iso-date-time", "boolean", "compare", "lits-version!", "uuid!", "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", "and", "or", "def", "defs", "let", "if-let", "when-let", "when-first", "fn", "defn", "defns", "try", "throw", "if", "if-not", "cond", "when", "when-not", "comment", "do", "recur", "loop", "time!", "doseq", "for", "declared?", "??", "subs", "string-repeat", "str", "number", "number-to-string", "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-shift-left", "bit-shift-right", "unsigned-bit-shift-right", "bit-not", "bit-and", "bit-and-not", "bit-or", "bit-xor", "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: {
|
|
@@ -36,11 +36,11 @@ export interface FunctionReference<T extends Category = Category> extends Common
|
|
|
36
36
|
}
|
|
37
37
|
export interface ShorthandReference extends CommonReference<'Shorthand'> {
|
|
38
38
|
shorthand: true;
|
|
39
|
-
linkName:
|
|
39
|
+
linkName: `-short-${string}`;
|
|
40
40
|
}
|
|
41
41
|
export interface DatatypeReference extends CommonReference<'Datatype'> {
|
|
42
42
|
datatype: true;
|
|
43
|
-
linkName:
|
|
43
|
+
linkName: `-type-${string}`;
|
|
44
44
|
}
|
|
45
45
|
export type Reference<T extends Category = Category> = FunctionReference<T> | ShorthandReference | DatatypeReference;
|
|
46
46
|
export declare function isFunctionReference<T extends Category>(ref: Reference<T>): ref is FunctionReference<T>;
|
|
@@ -33,8 +33,8 @@ export type CommonSpecialExpressionName = keyof Pick<typeof specialExpressions,
|
|
|
33
33
|
export type BuiltinSpecialExpressions = typeof specialExpressions;
|
|
34
34
|
export type BuiltinSpecialExpression = typeof specialExpressions[SpecialExpressionName];
|
|
35
35
|
export type BuiltinCommonSpecialExpression = typeof specialExpressions[CommonSpecialExpressionName];
|
|
36
|
-
export type GenericCommonSpecialExpressionNode<T extends CommonSpecialExpressionName> = ReturnType<typeof specialExpressions[T]['
|
|
37
|
-
export type SpecialExpressionNode = ReturnType<typeof specialExpressions[SpecialExpressionName]['
|
|
36
|
+
export type GenericCommonSpecialExpressionNode<T extends CommonSpecialExpressionName> = ReturnType<typeof specialExpressions[T]['polishParse']>;
|
|
37
|
+
export type SpecialExpressionNode = ReturnType<typeof specialExpressions[SpecialExpressionName]['polishParse']>;
|
|
38
38
|
export declare const builtin: Builtin;
|
|
39
39
|
export declare const normalExpressionKeys: string[];
|
|
40
40
|
export declare const specialExpressionKeys: string[];
|
|
@@ -29,7 +29,7 @@ interface EvaluateHelpers {
|
|
|
29
29
|
builtin: Builtin;
|
|
30
30
|
}
|
|
31
31
|
export interface BuiltinSpecialExpression<T, N extends SpecialExpressionNode> {
|
|
32
|
-
|
|
32
|
+
polishParse: (tokenStream: TokenStream, parseState: ParseState, firstToken: Token, parsers: ParserHelpers) => N;
|
|
33
33
|
evaluate: (node: N, contextStack: ContextStack, helpers: EvaluateHelpers) => T;
|
|
34
34
|
validateParameterCount: ValidateSpecialExpressionNode;
|
|
35
35
|
findUnresolvedIdentifiers: (node: N, contextStack: ContextStack, params: {
|
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { BuiltinNormalExpressions, NormalExpressionEvaluator } from '../../interface';
|
|
3
|
-
export declare const evaluateMap: NormalExpressionEvaluator<Arr | string>;
|
|
1
|
+
import type { BuiltinNormalExpressions } from '../../interface';
|
|
4
2
|
export declare const sequenceNormalExpression: BuiltinNormalExpressions;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { CommonSpecialExpressionName, GenericCommonSpecialExpressionNode } from '..';
|
|
2
2
|
import type { Any } from '../../interface';
|
|
3
3
|
import type { BuiltinSpecialExpression } from '../interface';
|
|
4
|
-
export declare function
|
|
4
|
+
export declare function getCommonPolishSpecialExpressionParser<T extends CommonSpecialExpressionName>(name: T): BuiltinSpecialExpression<Any, GenericCommonSpecialExpressionNode<T>>['polishParse'];
|
|
@@ -8,11 +8,17 @@ export declare class AlgebraicParser {
|
|
|
8
8
|
parse(): AstNode;
|
|
9
9
|
private parseExpression;
|
|
10
10
|
private parseOperand;
|
|
11
|
+
private parseOperandPart;
|
|
11
12
|
private parseObject;
|
|
12
13
|
private parseArray;
|
|
13
14
|
private parseFunctionCall;
|
|
14
15
|
parseLambdaFunction(): AstNode | null;
|
|
15
16
|
private parseShorthandLamdaFunction;
|
|
17
|
+
private parseLet;
|
|
18
|
+
private parseFor;
|
|
19
|
+
private parseForLoopBinding;
|
|
20
|
+
private parseBinding;
|
|
16
21
|
private isAtEnd;
|
|
17
22
|
private peek;
|
|
23
|
+
private peekAhead;
|
|
18
24
|
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import type { Tokenizer } from '../interface';
|
|
2
|
-
import type { A_MultiLineCommentToken, A_NumberToken, A_OperatorToken, A_ReservedSymbolToken, A_SingleLineCommentToken, A_SymbolToken, A_WhitespaceToken } from './algebraicTokens';
|
|
2
|
+
import type { A_BasePrefixedNumberToken, A_MultiLineCommentToken, A_NumberToken, A_OperatorToken, A_ReservedSymbolToken, A_SingleLineCommentToken, A_SymbolToken, A_WhitespaceToken } from './algebraicTokens';
|
|
3
3
|
export declare const tokenizeA_Whitespace: Tokenizer<A_WhitespaceToken>;
|
|
4
4
|
export declare const tokenizeA_Number: Tokenizer<A_NumberToken>;
|
|
5
|
+
export declare const tokenizeA_BasePrefixedNumber: Tokenizer<A_BasePrefixedNumberToken>;
|
|
5
6
|
export declare const tokenizeA_ReservedSymbolToken: Tokenizer<A_ReservedSymbolToken>;
|
|
6
7
|
export declare const tokenizeA_Symbol: Tokenizer<A_SymbolToken>;
|
|
7
8
|
export declare const tokenizeA_Operator: Tokenizer<A_OperatorToken>;
|
|
8
9
|
export declare const tokenizeA_MultiLineComment: Tokenizer<A_MultiLineCommentToken>;
|
|
9
10
|
export declare const tokenizeA_SingleLineComment: Tokenizer<A_SingleLineCommentToken>;
|
|
10
|
-
export declare const algebraicTokenizers: [Tokenizer<A_WhitespaceToken>, Tokenizer<A_MultiLineCommentToken>, Tokenizer<A_SingleLineCommentToken>, 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<A_NumberToken>, Tokenizer<A_OperatorToken>, Tokenizer<A_ReservedSymbolToken>, Tokenizer<A_SymbolToken>];
|
|
11
|
+
export declare const algebraicTokenizers: [Tokenizer<A_WhitespaceToken>, Tokenizer<A_MultiLineCommentToken>, Tokenizer<A_SingleLineCommentToken>, 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<A_BasePrefixedNumberToken>, Tokenizer<A_NumberToken>, Tokenizer<A_OperatorToken>, Tokenizer<A_ReservedSymbolToken>, Tokenizer<A_SymbolToken>];
|
|
@@ -2,46 +2,64 @@ import type { CommonSimpleToken, CommonValueToken, CommonValueTokenType } from '
|
|
|
2
2
|
import type { Token } from '../tokens';
|
|
3
3
|
import { type TokenDebugData } from '../utils';
|
|
4
4
|
export declare const algebraicSimpleTokenTypes: readonly ["LBrace", "LBracket", "LParen", "RBrace", "RBracket", "RParen", "AlgNotation", "PolNotation", "EndNotation"];
|
|
5
|
-
export declare const algebraicOnlyValueTokenTypes: ["A_Whitespace", "A_Operator", "A_Symbol", "A_ReservedSymbol", "A_SingleLineComment", "A_MultiLineComment", "A_Number"];
|
|
6
|
-
export declare const algebraicValueTokenTypes: readonly ["String", "A_Whitespace", "A_Operator", "A_Symbol", "A_ReservedSymbol", "A_SingleLineComment", "A_MultiLineComment", "A_Number"];
|
|
7
|
-
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"];
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
export declare function
|
|
12
|
-
export
|
|
5
|
+
export declare const algebraicOnlyValueTokenTypes: ["A_Whitespace", "A_Operator", "A_Symbol", "A_ReservedSymbol", "A_SingleLineComment", "A_MultiLineComment", "A_Number", "A_BasePrefixedNumber"];
|
|
6
|
+
export declare const algebraicValueTokenTypes: readonly ["String", "A_Whitespace", "A_Operator", "A_Symbol", "A_ReservedSymbol", "A_SingleLineComment", "A_MultiLineComment", "A_Number", "A_BasePrefixedNumber"];
|
|
7
|
+
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
|
+
declare const symbolicUnaryOperators: readonly ["!", "~", "+", "-"];
|
|
9
|
+
declare const symbolicBinaryOperators: readonly ["**", "*", "/", "%", "+", "-", "<<", ">>", ">>>", "++", "<", "<=", ">", ">=", "==", "!=", "&", "^", "|", "&&", "||", "??"];
|
|
10
|
+
declare const symbolicOperators: readonly ["!", "~", "+", "-", "**", "*", "/", "%", "+", "-", "<<", ">>", ">>>", "++", "<", "<=", ">", ">=", "==", "!=", "&", "^", "|", "&&", "||", "??", "=>", "...", ".", ",", "="];
|
|
11
|
+
export declare function isFunctionOperator(operator: string): boolean;
|
|
12
|
+
export type SymbolicUnaryOperator = typeof symbolicUnaryOperators[number];
|
|
13
|
+
export type SymbolicBinaryOperator = typeof symbolicBinaryOperators[number];
|
|
14
|
+
export type SymbolicOperator = typeof symbolicOperators[number];
|
|
15
|
+
export declare function isSymbolicUnaryOperator(operator: string): operator is SymbolicUnaryOperator;
|
|
16
|
+
export declare function assertSymbolicUnaryOperator(operator: string): asserts operator is SymbolicUnaryOperator;
|
|
17
|
+
export declare function asSymbolicUnaryOperator(operator: string): SymbolicUnaryOperator;
|
|
18
|
+
export declare function isSymbolicBinaryOperator(operator: string): operator is SymbolicBinaryOperator;
|
|
19
|
+
export declare function assertSymbolicBinaryOperator(operator: string): asserts operator is SymbolicBinaryOperator;
|
|
20
|
+
export declare function asSymbolicBinaryOperator(operator: string): SymbolicBinaryOperator;
|
|
21
|
+
export declare function isSymbolicOperator(operator: string): operator is SymbolicOperator;
|
|
22
|
+
export declare function assertSymbolicOperator(operator: string): asserts operator is SymbolicOperator;
|
|
23
|
+
export declare function asSymbolicOperator(operator: string): SymbolicOperator;
|
|
13
24
|
export type AlgebraicSimpleTokenType = typeof algebraicSimpleTokenTypes[number];
|
|
14
25
|
export type AlgebraicValueTokenType = typeof algebraicValueTokenTypes[number];
|
|
15
26
|
export type AlgebraicTokenType = typeof algebraicTokenTypes[number];
|
|
16
27
|
type GenericAlgebraicValueToken<T extends Exclude<AlgebraicValueTokenType, CommonValueTokenType>, V extends string = string> = [T, V] | [T, V, TokenDebugData];
|
|
17
28
|
export type A_WhitespaceToken = GenericAlgebraicValueToken<'A_Whitespace'>;
|
|
18
29
|
export type A_NumberToken = GenericAlgebraicValueToken<'A_Number'>;
|
|
19
|
-
export type
|
|
20
|
-
export type
|
|
30
|
+
export type A_BasePrefixedNumberToken = GenericAlgebraicValueToken<'A_BasePrefixedNumber'>;
|
|
31
|
+
export type A_OperatorToken<T extends SymbolicOperator = SymbolicOperator> = GenericAlgebraicValueToken<'A_Operator', T>;
|
|
32
|
+
export type A_SymbolToken<T extends string = string> = GenericAlgebraicValueToken<'A_Symbol', T>;
|
|
21
33
|
export type A_ReservedSymbolToken = GenericAlgebraicValueToken<'A_ReservedSymbol'>;
|
|
22
34
|
export type A_SingleLineCommentToken = GenericAlgebraicValueToken<'A_SingleLineComment'>;
|
|
23
35
|
export type A_MultiLineCommentToken = GenericAlgebraicValueToken<'A_MultiLineComment'>;
|
|
24
|
-
export type AlgebraicOnlyValueToken = A_WhitespaceToken | A_NumberToken | A_OperatorToken | A_SymbolToken | A_ReservedSymbolToken | A_SingleLineCommentToken | A_MultiLineCommentToken;
|
|
36
|
+
export type AlgebraicOnlyValueToken = A_WhitespaceToken | A_NumberToken | A_BasePrefixedNumberToken | A_OperatorToken | A_SymbolToken | A_ReservedSymbolToken | A_SingleLineCommentToken | A_MultiLineCommentToken;
|
|
25
37
|
export type AlgebraicToken = AlgebraicOnlyValueToken | CommonSimpleToken | CommonValueToken;
|
|
26
|
-
export declare function isA_SymbolToken(token
|
|
27
|
-
export declare function assertA_SymbolToken(token
|
|
28
|
-
export declare function asA_SymbolToken(token
|
|
29
|
-
export declare function
|
|
30
|
-
export declare function
|
|
31
|
-
export declare function
|
|
32
|
-
export declare function
|
|
33
|
-
export declare function
|
|
34
|
-
export declare function
|
|
35
|
-
export declare function
|
|
36
|
-
export declare function
|
|
37
|
-
export declare function
|
|
38
|
-
export declare function
|
|
39
|
-
export declare function
|
|
40
|
-
export declare function
|
|
41
|
-
export declare function
|
|
42
|
-
export declare function
|
|
43
|
-
export declare function
|
|
44
|
-
export declare function
|
|
45
|
-
export declare function
|
|
46
|
-
export declare function
|
|
38
|
+
export declare function isA_SymbolToken(token: Token | undefined): token is A_SymbolToken;
|
|
39
|
+
export declare function assertA_SymbolToken(token: Token | undefined): asserts token is A_SymbolToken;
|
|
40
|
+
export declare function asA_SymbolToken(token: Token | undefined): A_SymbolToken;
|
|
41
|
+
export declare function isA_BinaryOperatorToken(token: Token | undefined): token is A_OperatorToken<SymbolicBinaryOperator>;
|
|
42
|
+
export declare function assertA_BinaryOperatorToken(token: Token | undefined): asserts token is A_OperatorToken<SymbolicBinaryOperator>;
|
|
43
|
+
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;
|
|
47
|
+
export declare function isA_CommentToken(token: Token | undefined): token is A_SingleLineCommentToken;
|
|
48
|
+
export declare function assertA_CommentToken(token: Token | undefined): asserts token is A_SingleLineCommentToken;
|
|
49
|
+
export declare function asA_CommentToken(token: Token | undefined): A_SingleLineCommentToken;
|
|
50
|
+
export declare function isA_MultiLineCommentToken(token: Token | undefined): token is A_MultiLineCommentToken;
|
|
51
|
+
export declare function assertA_MultiLineCommentToken(token: Token | undefined): asserts token is A_MultiLineCommentToken;
|
|
52
|
+
export declare function asA_MultiLineCommentToken(token: Token | undefined): A_MultiLineCommentToken;
|
|
53
|
+
export declare function isA_OperatorToken<T extends SymbolicOperator>(token: Token | undefined, operatorName?: T): token is A_OperatorToken<T>;
|
|
54
|
+
export declare function assertA_OperatorToken<T extends SymbolicOperator>(token: Token | undefined, operatorName?: T): asserts token is A_OperatorToken<T>;
|
|
55
|
+
export declare function asA_OperatorToken<T extends SymbolicOperator>(token: Token | undefined, operatorName?: T): A_OperatorToken<T>;
|
|
56
|
+
export declare function isA_WhitespaceToken(token: Token | undefined): token is A_WhitespaceToken;
|
|
57
|
+
export declare function assertA_WhitespaceToken(token: Token | undefined): asserts token is A_WhitespaceToken;
|
|
58
|
+
export declare function asA_WhitespaceToken(token: Token | undefined): A_WhitespaceToken;
|
|
59
|
+
export declare function isA_NumberToken(token: Token | undefined): token is A_NumberToken;
|
|
60
|
+
export declare function assertA_NumberToken(token: Token | undefined): asserts token is A_NumberToken;
|
|
61
|
+
export declare function asA_NumberToken(token: Token | undefined): A_NumberToken;
|
|
62
|
+
export declare function isA_BasePrefixedNumberToken(token: Token | undefined): token is A_BasePrefixedNumberToken;
|
|
63
|
+
export declare function assertA_BasePrefixedNumberToken(token: Token | undefined): asserts token is A_BasePrefixedNumberToken;
|
|
64
|
+
export declare function asA_BasePrefixedNumberToken(token: Token | undefined): A_BasePrefixedNumberToken;
|
|
47
65
|
export {};
|
|
@@ -4,6 +4,7 @@ export declare const tokenizeP_Comment: Tokenizer<P_CommentToken>;
|
|
|
4
4
|
export declare const tokenizeP_Whitespace: Tokenizer<P_WhitespaceToken>;
|
|
5
5
|
export declare const tokenizeP_Number: Tokenizer<P_NumberToken>;
|
|
6
6
|
export declare const P_symbolRegExp: RegExp;
|
|
7
|
+
export declare const P_symbolFirstCharacterRegExp: RegExp;
|
|
7
8
|
export declare const tokenizeP_Symbol: Tokenizer<P_SymbolToken>;
|
|
8
9
|
export declare const tokenizeP_FnShorthand: Tokenizer<P_FnShorthandToken>;
|
|
9
10
|
export declare const tokenizeP_ReservedSymbol: Tokenizer<P_ReservedSymbolToken>;
|
|
@@ -2,8 +2,8 @@ import type { CommonSimpleToken, CommonValueToken } from './common/commonTokens'
|
|
|
2
2
|
import type { AlgebraicOnlyValueToken } from './algebraic/algebraicTokens';
|
|
3
3
|
import type { PolishOnlySimpleToken, PolishOnlyValueToken } from './polish/polishTokens';
|
|
4
4
|
export declare const simpleTokenTypes: readonly ["LBrace", "LBracket", "LParen", "RBrace", "RBracket", "RParen", "AlgNotation", "PolNotation", "EndNotation", "P_FnShorthand"];
|
|
5
|
-
export declare const valueTokenTypes: readonly ["String", "A_Whitespace", "A_Operator", "A_Symbol", "A_ReservedSymbol", "A_SingleLineComment", "A_MultiLineComment", "A_Number", "P_Modifier", "P_StringShorthand", "P_Symbol", "P_ReservedSymbol", "P_RegexpShorthand", "P_CollectionAccessor", "P_Comment", "P_Whitespace", "P_Number"];
|
|
6
|
-
export declare const tokenTypes: readonly ["LBrace", "LBracket", "LParen", "RBrace", "RBracket", "RParen", "AlgNotation", "PolNotation", "EndNotation", "P_FnShorthand", "String", "A_Whitespace", "A_Operator", "A_Symbol", "A_ReservedSymbol", "A_SingleLineComment", "A_MultiLineComment", "A_Number", "P_Modifier", "P_StringShorthand", "P_Symbol", "P_ReservedSymbol", "P_RegexpShorthand", "P_CollectionAccessor", "P_Comment", "P_Whitespace", "P_Number"];
|
|
5
|
+
export declare const valueTokenTypes: readonly ["String", "A_Whitespace", "A_Operator", "A_Symbol", "A_ReservedSymbol", "A_SingleLineComment", "A_MultiLineComment", "A_Number", "A_BasePrefixedNumber", "P_Modifier", "P_StringShorthand", "P_Symbol", "P_ReservedSymbol", "P_RegexpShorthand", "P_CollectionAccessor", "P_Comment", "P_Whitespace", "P_Number"];
|
|
6
|
+
export declare const tokenTypes: readonly ["LBrace", "LBracket", "LParen", "RBrace", "RBracket", "RParen", "AlgNotation", "PolNotation", "EndNotation", "P_FnShorthand", "String", "A_Whitespace", "A_Operator", "A_Symbol", "A_ReservedSymbol", "A_SingleLineComment", "A_MultiLineComment", "A_Number", "A_BasePrefixedNumber", "P_Modifier", "P_StringShorthand", "P_Symbol", "P_ReservedSymbol", "P_RegexpShorthand", "P_CollectionAccessor", "P_Comment", "P_Whitespace", "P_Number"];
|
|
7
7
|
export type TokenType = typeof tokenTypes[number];
|
|
8
8
|
export type SimpleToken = CommonSimpleToken | PolishOnlySimpleToken;
|
|
9
9
|
export type ValueToken = CommonValueToken | AlgebraicOnlyValueToken | PolishOnlyValueToken;
|