@mojir/lits 2.0.23 → 2.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +392 -109
- package/dist/cli/cli/src/cliDocumentation/getCliType.d.ts +1 -1
- package/dist/cli/cli.js +7212 -9389
- package/dist/cli/reference/api.d.ts +21 -18
- package/dist/cli/reference/categories/array.d.ts +2 -2
- package/dist/cli/reference/categories/assert.d.ts +2 -2
- package/dist/cli/reference/categories/bitwise.d.ts +2 -2
- package/dist/cli/reference/categories/collection.d.ts +2 -2
- package/dist/cli/reference/categories/functional.d.ts +2 -2
- package/dist/cli/reference/categories/math.d.ts +1 -1
- package/dist/cli/reference/categories/misc.d.ts +1 -1
- package/dist/cli/reference/categories/object.d.ts +1 -1
- package/dist/cli/reference/categories/regularExpression.d.ts +1 -1
- package/dist/cli/reference/categories/sequence.d.ts +1 -1
- package/dist/cli/reference/categories/specialExpressions.d.ts +3 -3
- package/dist/cli/reference/categories/string.d.ts +1 -1
- package/dist/cli/reference/index.d.ts +225 -16
- package/dist/cli/src/Lits/Cache.d.ts +1 -1
- package/dist/cli/src/Lits/Lits.d.ts +15 -15
- package/dist/cli/src/builtin/bindingNode.d.ts +4 -0
- package/dist/cli/src/builtin/index.d.ts +10 -30
- package/dist/cli/src/builtin/interface.d.ts +19 -26
- package/dist/cli/src/builtin/normalExpressions/index.d.ts +4 -1
- package/dist/cli/src/builtin/specialExpressionTypes.d.ts +27 -0
- package/dist/cli/src/builtin/specialExpressions/and.d.ts +3 -3
- package/dist/cli/src/builtin/specialExpressions/array.d.ts +6 -0
- package/dist/cli/src/builtin/specialExpressions/cond.d.ts +3 -3
- package/dist/cli/src/builtin/specialExpressions/def.d.ts +3 -3
- package/dist/cli/src/builtin/specialExpressions/defined.d.ts +5 -0
- package/dist/cli/src/builtin/specialExpressions/do.d.ts +3 -3
- package/dist/cli/src/builtin/specialExpressions/functions.d.ts +7 -10
- package/dist/cli/src/builtin/specialExpressions/if.d.ts +3 -3
- package/dist/cli/src/builtin/specialExpressions/let.d.ts +3 -4
- package/dist/cli/src/builtin/specialExpressions/loop.d.ts +3 -4
- package/dist/cli/src/builtin/specialExpressions/loops.d.ts +5 -14
- package/dist/cli/src/builtin/specialExpressions/object.d.ts +6 -0
- package/dist/cli/src/builtin/specialExpressions/or.d.ts +3 -3
- package/dist/cli/src/builtin/specialExpressions/qq.d.ts +3 -3
- package/dist/cli/src/builtin/specialExpressions/recur.d.ts +3 -3
- package/dist/cli/src/builtin/specialExpressions/switch.d.ts +3 -3
- package/dist/cli/src/builtin/specialExpressions/throw.d.ts +3 -3
- package/dist/cli/src/builtin/specialExpressions/try.d.ts +3 -5
- package/dist/cli/src/builtin/specialExpressions/unless.d.ts +3 -3
- package/dist/cli/src/builtin/utils.d.ts +3 -15
- package/dist/cli/src/cliDocumentation/getCliType.d.ts +1 -1
- package/dist/cli/src/constants/constants.d.ts +18 -29
- package/dist/cli/src/errors.d.ts +1 -1
- package/dist/cli/src/evaluator/ContextStack.d.ts +9 -9
- package/dist/cli/src/evaluator/functionExecutors.d.ts +4 -4
- package/dist/cli/src/evaluator/index.d.ts +2 -2
- package/dist/cli/src/evaluator/interface.d.ts +4 -4
- package/dist/cli/src/getUndefinedSymbols/index.d.ts +7 -0
- package/dist/cli/src/interface.d.ts +1 -2
- package/dist/cli/src/parser/Parser.d.ts +49 -0
- package/dist/cli/src/parser/types.d.ts +111 -0
- package/dist/cli/src/symbolPatterns.d.ts +2 -0
- package/dist/cli/src/tokenizer/minifyTokenStream.d.ts +1 -1
- package/dist/cli/src/tokenizer/operators.d.ts +12 -0
- package/dist/cli/src/tokenizer/reservedNames.d.ts +115 -0
- package/dist/cli/src/tokenizer/token.d.ts +85 -0
- package/dist/cli/src/tokenizer/tokenize.d.ts +8 -0
- package/dist/cli/src/tokenizer/tokenizers.d.ts +12 -0
- package/dist/cli/src/transformer/index.d.ts +2 -2
- package/dist/cli/src/typeGuards/array.d.ts +1 -1
- package/dist/cli/src/typeGuards/astNode.d.ts +25 -17
- package/dist/cli/src/typeGuards/index.d.ts +4 -3
- package/dist/cli/src/typeGuards/lits.d.ts +2 -2
- package/dist/cli/src/typeGuards/litsFunction.d.ts +3 -3
- package/dist/cli/src/typeGuards/number.d.ts +1 -1
- package/dist/cli/src/typeGuards/string.d.ts +1 -1
- package/dist/cli/src/untokenizer/index.d.ts +1 -1
- package/dist/cli/src/utils/debug/getCodeMarker.d.ts +1 -1
- package/dist/cli/src/utils/debug/getSourceCodeInfo.d.ts +2 -2
- package/dist/cli/src/utils/getAssertionError.d.ts +1 -1
- package/dist/cli/src/utils/index.d.ts +5 -4
- package/dist/index.esm.js +7428 -9599
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +7427 -9604
- package/dist/index.js.map +1 -1
- package/dist/lits.iife.js +7427 -9604
- package/dist/lits.iife.js.map +1 -1
- package/dist/reference/api.d.ts +21 -18
- package/dist/reference/categories/array.d.ts +2 -2
- package/dist/reference/categories/assert.d.ts +2 -2
- package/dist/reference/categories/bitwise.d.ts +2 -2
- package/dist/reference/categories/collection.d.ts +2 -2
- package/dist/reference/categories/functional.d.ts +2 -2
- package/dist/reference/categories/math.d.ts +1 -1
- package/dist/reference/categories/misc.d.ts +1 -1
- package/dist/reference/categories/object.d.ts +1 -1
- package/dist/reference/categories/regularExpression.d.ts +1 -1
- package/dist/reference/categories/sequence.d.ts +1 -1
- package/dist/reference/categories/specialExpressions.d.ts +3 -3
- package/dist/reference/categories/string.d.ts +1 -1
- package/dist/reference/index.d.ts +225 -16
- package/dist/src/Lits/Cache.d.ts +1 -1
- package/dist/src/Lits/Lits.d.ts +15 -15
- package/dist/src/builtin/bindingNode.d.ts +4 -0
- package/dist/src/builtin/index.d.ts +10 -30
- package/dist/src/builtin/interface.d.ts +19 -26
- package/dist/src/builtin/normalExpressions/index.d.ts +4 -1
- package/dist/src/builtin/specialExpressionTypes.d.ts +27 -0
- package/dist/src/builtin/specialExpressions/and.d.ts +3 -3
- package/dist/src/builtin/specialExpressions/array.d.ts +6 -0
- package/dist/src/builtin/specialExpressions/cond.d.ts +3 -3
- package/dist/src/builtin/specialExpressions/def.d.ts +3 -3
- package/dist/src/builtin/specialExpressions/defined.d.ts +5 -0
- package/dist/src/builtin/specialExpressions/do.d.ts +3 -3
- package/dist/src/builtin/specialExpressions/functions.d.ts +7 -10
- package/dist/src/builtin/specialExpressions/if.d.ts +3 -3
- package/dist/src/builtin/specialExpressions/let.d.ts +3 -4
- package/dist/src/builtin/specialExpressions/loop.d.ts +3 -4
- package/dist/src/builtin/specialExpressions/loops.d.ts +5 -14
- package/dist/src/builtin/specialExpressions/object.d.ts +6 -0
- package/dist/src/builtin/specialExpressions/or.d.ts +3 -3
- package/dist/src/builtin/specialExpressions/qq.d.ts +3 -3
- package/dist/src/builtin/specialExpressions/recur.d.ts +3 -3
- package/dist/src/builtin/specialExpressions/switch.d.ts +3 -3
- package/dist/src/builtin/specialExpressions/throw.d.ts +3 -3
- package/dist/src/builtin/specialExpressions/try.d.ts +3 -5
- package/dist/src/builtin/specialExpressions/unless.d.ts +3 -3
- package/dist/src/builtin/utils.d.ts +3 -15
- package/dist/src/constants/constants.d.ts +18 -29
- package/dist/src/errors.d.ts +1 -1
- package/dist/src/evaluator/ContextStack.d.ts +9 -9
- package/dist/src/evaluator/functionExecutors.d.ts +4 -4
- package/dist/src/evaluator/index.d.ts +2 -2
- package/dist/src/evaluator/interface.d.ts +4 -4
- package/dist/src/getUndefinedSymbols/index.d.ts +7 -0
- package/dist/src/index.d.ts +6 -9
- package/dist/src/interface.d.ts +1 -2
- package/dist/src/parser/Parser.d.ts +49 -0
- package/dist/src/parser/types.d.ts +111 -0
- package/dist/src/symbolPatterns.d.ts +2 -0
- package/dist/src/tokenizer/minifyTokenStream.d.ts +1 -1
- package/dist/src/tokenizer/operators.d.ts +12 -0
- package/dist/src/tokenizer/reservedNames.d.ts +115 -0
- package/dist/src/tokenizer/token.d.ts +85 -0
- package/dist/src/tokenizer/tokenize.d.ts +8 -0
- package/dist/src/tokenizer/tokenizers.d.ts +12 -0
- package/dist/src/transformer/index.d.ts +2 -2
- package/dist/src/typeGuards/array.d.ts +1 -1
- package/dist/src/typeGuards/astNode.d.ts +25 -17
- package/dist/src/typeGuards/index.d.ts +4 -3
- package/dist/src/typeGuards/lits.d.ts +2 -2
- package/dist/src/typeGuards/litsFunction.d.ts +3 -3
- package/dist/src/typeGuards/number.d.ts +1 -1
- package/dist/src/typeGuards/string.d.ts +1 -1
- package/dist/src/untokenizer/index.d.ts +1 -1
- package/dist/src/utils/debug/getCodeMarker.d.ts +1 -1
- package/dist/src/utils/debug/getSourceCodeInfo.d.ts +2 -2
- package/dist/src/utils/getAssertionError.d.ts +1 -1
- package/dist/src/utils/index.d.ts +5 -4
- package/dist/testFramework.esm.js +3103 -4362
- package/dist/testFramework.esm.js.map +1 -1
- package/dist/testFramework.js +3103 -4362
- package/dist/testFramework.js.map +1 -1
- package/package.json +2 -2
- package/dist/cli/common/clojureDocs.d.ts +0 -1
- package/dist/cli/src/analyze/findUnresolvedIdentifiers.d.ts +0 -2
- package/dist/cli/src/analyze/index.d.ts +0 -15
- package/dist/cli/src/analyze/utils.d.ts +0 -4
- package/dist/cli/src/builtin/specialExpressions/comment.d.ts +0 -5
- package/dist/cli/src/builtin/specialExpressions/commonParser.d.ts +0 -4
- package/dist/cli/src/builtin/specialExpressions/declared.d.ts +0 -5
- package/dist/cli/src/identifier.d.ts +0 -4
- package/dist/cli/src/index.d.ts +0 -18
- package/dist/cli/src/parser/AlgebraicParser.d.ts +0 -44
- package/dist/cli/src/parser/PolishTokenParsers.d.ts +0 -3
- package/dist/cli/src/parser/commonTokenParsers.d.ts +0 -7
- package/dist/cli/src/parser/index.d.ts +0 -3
- package/dist/cli/src/parser/interface.d.ts +0 -160
- package/dist/cli/src/removeCommentNodes/index.d.ts +0 -11
- package/dist/cli/src/removeCommentNodes/removeCommentNodesFromSpecialExpression.d.ts +0 -3
- package/dist/cli/src/tokenizer/algebraic/algebraicReservedNames.d.ts +0 -107
- package/dist/cli/src/tokenizer/algebraic/algebraicTokenizers.d.ts +0 -11
- package/dist/cli/src/tokenizer/algebraic/algebraicTokens.d.ts +0 -66
- package/dist/cli/src/tokenizer/common/commonTokenizers.d.ts +0 -9
- package/dist/cli/src/tokenizer/common/commonTokens.d.ts +0 -43
- package/dist/cli/src/tokenizer/index.d.ts +0 -2
- package/dist/cli/src/tokenizer/interface.d.ts +0 -22
- package/dist/cli/src/tokenizer/polish/polishReservedNames.d.ts +0 -7
- package/dist/cli/src/tokenizer/polish/polishTokenizers.d.ts +0 -13
- package/dist/cli/src/tokenizer/polish/polishTokens.d.ts +0 -55
- package/dist/cli/src/tokenizer/sugar/applyCollectionAccessor.d.ts +0 -2
- package/dist/cli/src/tokenizer/sugar/index.d.ts +0 -3
- package/dist/cli/src/tokenizer/tokens.d.ts +0 -20
- package/dist/cli/src/tokenizer/utils.d.ts +0 -9
- package/dist/common/clojureDocs.d.ts +0 -1
- package/dist/src/analyze/findUnresolvedIdentifiers.d.ts +0 -2
- package/dist/src/analyze/index.d.ts +0 -15
- package/dist/src/analyze/utils.d.ts +0 -4
- package/dist/src/builtin/specialExpressions/comment.d.ts +0 -5
- package/dist/src/builtin/specialExpressions/commonParser.d.ts +0 -4
- package/dist/src/builtin/specialExpressions/declared.d.ts +0 -5
- package/dist/src/identifier.d.ts +0 -4
- package/dist/src/parser/AlgebraicParser.d.ts +0 -44
- package/dist/src/parser/PolishTokenParsers.d.ts +0 -3
- package/dist/src/parser/commonTokenParsers.d.ts +0 -7
- package/dist/src/parser/index.d.ts +0 -3
- package/dist/src/parser/interface.d.ts +0 -160
- package/dist/src/removeCommentNodes/index.d.ts +0 -11
- package/dist/src/removeCommentNodes/removeCommentNodesFromSpecialExpression.d.ts +0 -3
- package/dist/src/tokenizer/algebraic/algebraicReservedNames.d.ts +0 -107
- package/dist/src/tokenizer/algebraic/algebraicTokenizers.d.ts +0 -11
- package/dist/src/tokenizer/algebraic/algebraicTokens.d.ts +0 -66
- package/dist/src/tokenizer/common/commonTokenizers.d.ts +0 -9
- package/dist/src/tokenizer/common/commonTokens.d.ts +0 -43
- package/dist/src/tokenizer/index.d.ts +0 -2
- package/dist/src/tokenizer/interface.d.ts +0 -22
- package/dist/src/tokenizer/polish/polishReservedNames.d.ts +0 -7
- package/dist/src/tokenizer/polish/polishTokenizers.d.ts +0 -13
- package/dist/src/tokenizer/polish/polishTokens.d.ts +0 -55
- package/dist/src/tokenizer/sugar/applyCollectionAccessor.d.ts +0 -2
- package/dist/src/tokenizer/sugar/index.d.ts +0 -3
- package/dist/src/tokenizer/tokens.d.ts +0 -20
- package/dist/src/tokenizer/utils.d.ts +0 -9
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import type { CommonSimpleToken, CommonSimpleTokenType, CommonValueToken, CommonValueTokenType } from '../common/commonTokens';
|
|
2
|
-
import type { Token } from '../tokens';
|
|
3
|
-
import { type TokenDebugData } from '../utils';
|
|
4
|
-
export declare const modifierNames: readonly ["&rest", "&let", "&when", "&while"];
|
|
5
|
-
export type ModifierName = typeof modifierNames[number];
|
|
6
|
-
export declare const polishOnlySimpleTokenTypes: ["P_FnShorthand"];
|
|
7
|
-
export declare const polishSimpleTokenTypes: readonly ["LBrace", "LBracket", "LParen", "RBrace", "RBracket", "RParen", "P_FnShorthand"];
|
|
8
|
-
export declare const polishOnlyValueTokenTypes: ["P_Modifier", "P_StringShorthand", "P_Symbol", "P_ReservedSymbol", "P_CollectionAccessor", "P_Comment", "P_Whitespace", "P_Number"];
|
|
9
|
-
export declare const polishValueTokenTypes: readonly ["String", "RegexpShorthand", "P_Modifier", "P_StringShorthand", "P_Symbol", "P_ReservedSymbol", "P_CollectionAccessor", "P_Comment", "P_Whitespace", "P_Number"];
|
|
10
|
-
export declare const polishTokenTypes: readonly ["LBrace", "LBracket", "LParen", "RBrace", "RBracket", "RParen", "P_FnShorthand", "String", "RegexpShorthand", "P_Modifier", "P_StringShorthand", "P_Symbol", "P_ReservedSymbol", "P_CollectionAccessor", "P_Comment", "P_Whitespace", "P_Number"];
|
|
11
|
-
export type PolishSimpleTokenType = typeof polishSimpleTokenTypes[number];
|
|
12
|
-
export type PolishValueTokenType = typeof polishValueTokenTypes[number];
|
|
13
|
-
export type PolishTokenType = typeof polishTokenTypes[number];
|
|
14
|
-
type GenericPolishSimpleToken<T extends Exclude<PolishSimpleTokenType, CommonSimpleTokenType>> = [T] | [T, TokenDebugData];
|
|
15
|
-
type GenericPolishValueToken<T extends Exclude<PolishValueTokenType, CommonValueTokenType>, V extends string = string> = [T, V] | [T, V, TokenDebugData];
|
|
16
|
-
export type P_FnShorthandToken = GenericPolishSimpleToken<'P_FnShorthand'>;
|
|
17
|
-
export type P_ModifierToken = GenericPolishValueToken<'P_Modifier', ModifierName>;
|
|
18
|
-
export type P_StringShorthandToken = GenericPolishValueToken<'P_StringShorthand'>;
|
|
19
|
-
export type P_SymbolToken = GenericPolishValueToken<'P_Symbol'>;
|
|
20
|
-
export type P_ReservedSymbolToken = GenericPolishValueToken<'P_ReservedSymbol'>;
|
|
21
|
-
export type P_CollectionAccessorToken = GenericPolishValueToken<'P_CollectionAccessor', '.' | '#'>;
|
|
22
|
-
export type P_CommentToken = GenericPolishValueToken<'P_Comment'>;
|
|
23
|
-
export type P_WhitespaceToken = GenericPolishValueToken<'P_Whitespace'>;
|
|
24
|
-
export type P_NumberToken = GenericPolishValueToken<'P_Number'>;
|
|
25
|
-
export type PolishOnlySimpleToken = P_FnShorthandToken;
|
|
26
|
-
export type PolishOnlyValueToken = P_ModifierToken | P_StringShorthandToken | P_SymbolToken | P_ReservedSymbolToken | P_CollectionAccessorToken | P_CommentToken | P_WhitespaceToken | P_NumberToken;
|
|
27
|
-
export type PolishToken = PolishOnlySimpleToken | PolishOnlyValueToken | CommonSimpleToken | CommonValueToken;
|
|
28
|
-
export declare function isP_StringShorthandToken(token?: Token): token is P_StringShorthandToken;
|
|
29
|
-
export declare function assertP_StringShorthandToken(token?: Token): asserts token is P_StringShorthandToken;
|
|
30
|
-
export declare function asP_StringShorthandToken(token?: Token): P_StringShorthandToken;
|
|
31
|
-
export declare function isP_SymbolToken(token?: Token): token is P_SymbolToken;
|
|
32
|
-
export declare function assertP_SymbolToken(token?: Token): asserts token is P_SymbolToken;
|
|
33
|
-
export declare function asP_SymbolToken(token?: Token): P_SymbolToken;
|
|
34
|
-
export declare function isP_ReservedSymbolToken(token?: Token): token is P_ReservedSymbolToken;
|
|
35
|
-
export declare function assertP_ReservedSymbolToken(token?: Token): asserts token is P_ReservedSymbolToken;
|
|
36
|
-
export declare function asP_ReservedSymbolToken(token?: Token): P_ReservedSymbolToken;
|
|
37
|
-
export declare function isP_ModifierToken(token?: Token): token is P_ModifierToken;
|
|
38
|
-
export declare function assertP_ModifierToken(token?: Token): asserts token is P_ModifierToken;
|
|
39
|
-
export declare function asP_ModifierToken(token?: Token): P_ModifierToken;
|
|
40
|
-
export declare function isP_FnShorthandToken(token?: Token): token is P_FnShorthandToken;
|
|
41
|
-
export declare function assertP_FnShorthandToken(token?: Token): asserts token is P_FnShorthandToken;
|
|
42
|
-
export declare function asP_FnShorthandToken(token?: Token): P_FnShorthandToken;
|
|
43
|
-
export declare function isP_CollectionAccessorToken(token?: Token): token is P_CollectionAccessorToken;
|
|
44
|
-
export declare function assertP_CollectionAccessorToken(token?: Token): asserts token is P_CollectionAccessorToken;
|
|
45
|
-
export declare function asP_CollectionAccessorToken(token?: Token): P_CollectionAccessorToken;
|
|
46
|
-
export declare function isP_CommentToken(token?: Token): token is P_CommentToken;
|
|
47
|
-
export declare function assertP_CommentToken(token?: Token): asserts token is P_CommentToken;
|
|
48
|
-
export declare function asP_CommentToken(token?: Token): P_CommentToken;
|
|
49
|
-
export declare function isP_WhitespaceToken(token?: Token): token is P_WhitespaceToken;
|
|
50
|
-
export declare function assertP_WhitespaceToken(token?: Token): asserts token is P_WhitespaceToken;
|
|
51
|
-
export declare function asP_WhitespaceToken(token?: Token): P_WhitespaceToken;
|
|
52
|
-
export declare function isP_NumberToken(token?: Token): token is P_NumberToken;
|
|
53
|
-
export declare function assertP_NumberToken(token?: Token): asserts token is P_NumberToken;
|
|
54
|
-
export declare function asP_NumberToken(token?: Token): P_NumberToken;
|
|
55
|
-
export {};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { CommonSimpleToken, CommonValueToken } from './common/commonTokens';
|
|
2
|
-
import type { AlgebraicOnlyValueToken } from './algebraic/algebraicTokens';
|
|
3
|
-
import type { PolishOnlySimpleToken, PolishOnlyValueToken } from './polish/polishTokens';
|
|
4
|
-
export declare const simpleTokenTypes: readonly ["LBrace", "LBracket", "LParen", "RBrace", "RBracket", "RParen", "P_FnShorthand"];
|
|
5
|
-
export declare const valueTokenTypes: readonly ["String", "RegexpShorthand", "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_CollectionAccessor", "P_Comment", "P_Whitespace", "P_Number"];
|
|
6
|
-
export declare const tokenTypes: readonly ["LBrace", "LBracket", "LParen", "RBrace", "RBracket", "RParen", "P_FnShorthand", "String", "RegexpShorthand", "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_CollectionAccessor", "P_Comment", "P_Whitespace", "P_Number"];
|
|
7
|
-
export type TokenType = typeof tokenTypes[number];
|
|
8
|
-
export type SimpleToken = CommonSimpleToken | PolishOnlySimpleToken;
|
|
9
|
-
export type ValueToken = CommonValueToken | AlgebraicOnlyValueToken | PolishOnlyValueToken;
|
|
10
|
-
export type Token = SimpleToken | ValueToken;
|
|
11
|
-
export declare function isTokenType(type: string): type is TokenType;
|
|
12
|
-
export declare function isToken(token?: Token): token is Token;
|
|
13
|
-
export declare function assertToken(token?: Token): asserts token is Token;
|
|
14
|
-
export declare function asToken(token?: Token): Token;
|
|
15
|
-
export declare function isSimpleToken(token?: Token): token is SimpleToken;
|
|
16
|
-
export declare function assertSimpleToken(token?: Token): asserts token is SimpleToken;
|
|
17
|
-
export declare function asSimpleToken(token?: Token): SimpleToken;
|
|
18
|
-
export declare function isValueToken(token?: Token): token is ValueToken;
|
|
19
|
-
export declare function assertValueToken(token?: Token): asserts token is ValueToken;
|
|
20
|
-
export declare function asValueToken(token?: Token): ValueToken;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { SourceCodeInfo } from './interface';
|
|
2
|
-
import type { Token, TokenType } from './tokens';
|
|
3
|
-
export type TokenDebugData = {
|
|
4
|
-
sourceCodeInfo: SourceCodeInfo;
|
|
5
|
-
};
|
|
6
|
-
export declare function getTokenDebugData(token?: Token): TokenDebugData | undefined;
|
|
7
|
-
export declare function hasTokenDebugData(token?: Token): boolean;
|
|
8
|
-
export declare function addTokenDebugData(token: Token, debugData: TokenDebugData): void;
|
|
9
|
-
export declare function throwUnexpectedToken(expected: TokenType, expectedValue: string | undefined, actual?: Token): never;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function getClojureDocsLink(functionName: string, clojureDocs?: string | null): string | null;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { LitsParams } from '../Lits/Lits';
|
|
2
|
-
import type { Builtin } from '../builtin/interface';
|
|
3
|
-
import { type ContextStack } from '../evaluator/ContextStack';
|
|
4
|
-
import type { Ast, AstNode } from '../parser/interface';
|
|
5
|
-
import type { Token } from '../tokenizer/tokens';
|
|
6
|
-
export interface UnresolvedIdentifier {
|
|
7
|
-
symbol: string;
|
|
8
|
-
token: Token | undefined;
|
|
9
|
-
}
|
|
10
|
-
export type UnresolvedIdentifiers = Set<UnresolvedIdentifier>;
|
|
11
|
-
export interface Analysis {
|
|
12
|
-
unresolvedIdentifiers: UnresolvedIdentifiers;
|
|
13
|
-
}
|
|
14
|
-
export type FindUnresolvedIdentifiers = (ast: Ast | AstNode[], contextStack: ContextStack, builtin: Builtin) => UnresolvedIdentifiers;
|
|
15
|
-
export declare function analyze(ast: Ast, params: LitsParams): Analysis;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { UnresolvedIdentifiers } from '.';
|
|
2
|
-
export declare function joinAnalyzeResults(...results: UnresolvedIdentifiers[]): UnresolvedIdentifiers;
|
|
3
|
-
export declare function addAnalyzeResults(target: UnresolvedIdentifiers, source: UnresolvedIdentifiers): void;
|
|
4
|
-
export declare function combinate<T>(arrays: T[][]): T[][];
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { CommonSpecialExpressionNode } from '../../parser/interface';
|
|
2
|
-
import type { BuiltinSpecialExpression } from '../interface';
|
|
3
|
-
export interface CommentExpressionNode extends CommonSpecialExpressionNode<'comment'> {
|
|
4
|
-
}
|
|
5
|
-
export declare const commentSpecialExpression: BuiltinSpecialExpression<null, CommentExpressionNode>;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { CommonSpecialExpressionName, GenericCommonSpecialExpressionNode } from '..';
|
|
2
|
-
import type { Any } from '../../interface';
|
|
3
|
-
import type { BuiltinSpecialExpression } from '../interface';
|
|
4
|
-
export declare function getCommonPolishSpecialExpressionParser<T extends CommonSpecialExpressionName>(name: T): BuiltinSpecialExpression<Any, GenericCommonSpecialExpressionNode<T>>['polishParse'];
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { CommonSpecialExpressionNode } from '../../parser/interface';
|
|
2
|
-
import type { BuiltinSpecialExpression } from '../interface';
|
|
3
|
-
export interface DeclaredNode extends CommonSpecialExpressionNode<'defined?'> {
|
|
4
|
-
}
|
|
5
|
-
export declare const declaredSpecialExpression: BuiltinSpecialExpression<boolean, DeclaredNode>;
|
package/dist/src/identifier.d.ts
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export declare const polishIdentifierCharacterClass = "[\\w@%^?=!$<>+*/:&|~-]";
|
|
2
|
-
export declare const polishIdentifierFirstCharacterClass = "[a-zA-Z_@%^?=!$<>+*/&|~-]";
|
|
3
|
-
export declare const algebraicIdentifierCharacterClass = "[\\w$:!?]";
|
|
4
|
-
export declare const algebraicIdentifierFirstCharacterClass = "[a-zA-Z_$]";
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import type { CondNode } from '../builtin/specialExpressions/cond';
|
|
2
|
-
import type { IfNode } from '../builtin/specialExpressions/if';
|
|
3
|
-
import type { LetNode } from '../builtin/specialExpressions/let';
|
|
4
|
-
import type { SwitchNode } from '../builtin/specialExpressions/switch';
|
|
5
|
-
import type { UnlessNode } from '../builtin/specialExpressions/unless';
|
|
6
|
-
import type { Arity, FunctionArguments } from '../builtin/utils';
|
|
7
|
-
import type { A_ReservedSymbolToken, A_SymbolToken } from '../tokenizer/algebraic/algebraicTokens';
|
|
8
|
-
import type { TokenStream } from '../tokenizer/interface';
|
|
9
|
-
import type { AstNode, ParseState } from './interface';
|
|
10
|
-
export declare class AlgebraicParser {
|
|
11
|
-
private readonly tokenStream;
|
|
12
|
-
private parseState;
|
|
13
|
-
constructor(tokenStream: TokenStream, parseState: ParseState);
|
|
14
|
-
private peek;
|
|
15
|
-
private peekAhead;
|
|
16
|
-
private advance;
|
|
17
|
-
parse(): AstNode[];
|
|
18
|
-
private parseExpression;
|
|
19
|
-
private parseOperand;
|
|
20
|
-
private parseOperandPart;
|
|
21
|
-
private parseObject;
|
|
22
|
-
private parseArray;
|
|
23
|
-
private parseFunctionCall;
|
|
24
|
-
parseLambdaFunction(): AstNode | null;
|
|
25
|
-
parseFunctionArguments(): {
|
|
26
|
-
functionArguments: FunctionArguments;
|
|
27
|
-
arity: Arity;
|
|
28
|
-
};
|
|
29
|
-
private parseShorthandLamdaFunction;
|
|
30
|
-
private parseLet;
|
|
31
|
-
private parseDo;
|
|
32
|
-
private parseLoop;
|
|
33
|
-
private parseTry;
|
|
34
|
-
private parseForOrDoseq;
|
|
35
|
-
private parseForLoopBinding;
|
|
36
|
-
private parseBinding;
|
|
37
|
-
parseIfOrUnless(token: A_SymbolToken): IfNode | UnlessNode;
|
|
38
|
-
parseCond(token: A_SymbolToken): CondNode;
|
|
39
|
-
parseSwitch(token: A_SymbolToken): SwitchNode;
|
|
40
|
-
parseFunction(token: A_ReservedSymbolToken<'function'>): LetNode;
|
|
41
|
-
private isAtEnd;
|
|
42
|
-
private isAtExpressionEnd;
|
|
43
|
-
private parseExport;
|
|
44
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { TokenStream } from '../tokenizer/interface';
|
|
2
|
-
import type { NormalExpressionNodeWithName, NumberNode, ParseState, ReservedSymbolNode, StringNode, SymbolNode } from './interface';
|
|
3
|
-
export declare function parseSymbol(tokenStream: TokenStream, parseState: ParseState): SymbolNode;
|
|
4
|
-
export declare function parseReservedSymbol(tokenStream: TokenStream, parseState: ParseState): ReservedSymbolNode;
|
|
5
|
-
export declare function parseNumber(tokenStream: TokenStream, parseState: ParseState): NumberNode;
|
|
6
|
-
export declare function parseString(tokenStream: TokenStream, parseState: ParseState): StringNode;
|
|
7
|
-
export declare function parseRegexpShorthand(tokenStream: TokenStream, parseState: ParseState): NormalExpressionNodeWithName;
|
|
@@ -1,160 +0,0 @@
|
|
|
1
|
-
import type { JsFunction, LazyValue } from '../Lits/Lits';
|
|
2
|
-
import type { SpecialExpressionName, SpecialExpressionNode } from '../builtin';
|
|
3
|
-
import type { Arity } from '../builtin/utils';
|
|
4
|
-
import type { AstNodeType, FunctionType } from '../constants/constants';
|
|
5
|
-
import type { Context } from '../evaluator/interface';
|
|
6
|
-
import type { Any, Arr } from '../interface';
|
|
7
|
-
import type { PolishReservedName } from '../tokenizer/polish/polishReservedNames';
|
|
8
|
-
import type { SourceCodeInfo, TokenStream } from '../tokenizer/interface';
|
|
9
|
-
import type { FUNCTION_SYMBOL, REGEXP_SYMBOL } from '../utils/symbols';
|
|
10
|
-
import type { Token } from '../tokenizer/tokens';
|
|
11
|
-
import type { ModifierName } from '../tokenizer/polish/polishTokens';
|
|
12
|
-
export interface ParseState {
|
|
13
|
-
position: number;
|
|
14
|
-
parseToken: ParseToken;
|
|
15
|
-
}
|
|
16
|
-
export interface EvaluatedFunctionArguments {
|
|
17
|
-
mandatoryArguments: string[];
|
|
18
|
-
restArgument?: string;
|
|
19
|
-
}
|
|
20
|
-
export interface EvaluatedFunctionOverload {
|
|
21
|
-
as: EvaluatedFunctionArguments;
|
|
22
|
-
b: AstNode[];
|
|
23
|
-
a: Arity;
|
|
24
|
-
f: Context;
|
|
25
|
-
}
|
|
26
|
-
export type ExtraData = Record<string, LazyValue>;
|
|
27
|
-
interface GenericLitsFunction {
|
|
28
|
-
[FUNCTION_SYMBOL]: true;
|
|
29
|
-
sourceCodeInfo?: SourceCodeInfo;
|
|
30
|
-
t: FunctionType;
|
|
31
|
-
}
|
|
32
|
-
export interface RegularExpression {
|
|
33
|
-
[REGEXP_SYMBOL]: true;
|
|
34
|
-
sourceCodeInfo?: SourceCodeInfo;
|
|
35
|
-
s: string;
|
|
36
|
-
f: string;
|
|
37
|
-
}
|
|
38
|
-
export interface NativeJsFunction extends GenericLitsFunction {
|
|
39
|
-
t: FunctionType.NativeJsFunction;
|
|
40
|
-
n: string | undefined;
|
|
41
|
-
f: JsFunction;
|
|
42
|
-
}
|
|
43
|
-
export interface UserDefinedFunction extends GenericLitsFunction {
|
|
44
|
-
t: FunctionType.UserDefined;
|
|
45
|
-
n: string | undefined;
|
|
46
|
-
o: EvaluatedFunctionOverload[];
|
|
47
|
-
x?: ExtraData;
|
|
48
|
-
}
|
|
49
|
-
export interface PartialFunction extends GenericLitsFunction {
|
|
50
|
-
t: FunctionType.Partial;
|
|
51
|
-
f: Any;
|
|
52
|
-
p: Arr;
|
|
53
|
-
}
|
|
54
|
-
export interface CompFunction extends GenericLitsFunction {
|
|
55
|
-
t: FunctionType.Comp;
|
|
56
|
-
f: Arr;
|
|
57
|
-
}
|
|
58
|
-
export interface ConstantlyFunction extends GenericLitsFunction {
|
|
59
|
-
t: FunctionType.Constantly;
|
|
60
|
-
v: Any;
|
|
61
|
-
}
|
|
62
|
-
export interface JuxtFunction extends GenericLitsFunction {
|
|
63
|
-
t: FunctionType.Juxt;
|
|
64
|
-
f: Arr;
|
|
65
|
-
}
|
|
66
|
-
export interface ComplementFunction extends GenericLitsFunction {
|
|
67
|
-
t: FunctionType.Complement;
|
|
68
|
-
f: Any;
|
|
69
|
-
}
|
|
70
|
-
export interface EveryPredFunction extends GenericLitsFunction {
|
|
71
|
-
t: FunctionType.EveryPred;
|
|
72
|
-
f: Arr;
|
|
73
|
-
}
|
|
74
|
-
export interface SomePredFunction extends GenericLitsFunction {
|
|
75
|
-
t: FunctionType.SomePred;
|
|
76
|
-
f: Arr;
|
|
77
|
-
}
|
|
78
|
-
export interface FNilFunction extends GenericLitsFunction {
|
|
79
|
-
t: FunctionType.Fnil;
|
|
80
|
-
f: Any;
|
|
81
|
-
p: Arr;
|
|
82
|
-
}
|
|
83
|
-
export interface BuiltinFunction extends GenericLitsFunction {
|
|
84
|
-
t: FunctionType.Builtin;
|
|
85
|
-
n: string;
|
|
86
|
-
}
|
|
87
|
-
export type LitsFunction = NativeJsFunction | UserDefinedFunction | BuiltinFunction | PartialFunction | CompFunction | ConstantlyFunction | JuxtFunction | ComplementFunction | EveryPredFunction | SomePredFunction | FNilFunction;
|
|
88
|
-
export type LitsFunctionType = LitsFunction['t'];
|
|
89
|
-
export type DebugData = {
|
|
90
|
-
token: Token;
|
|
91
|
-
nameToken?: Token;
|
|
92
|
-
};
|
|
93
|
-
export interface GenericNode {
|
|
94
|
-
t: AstNodeType;
|
|
95
|
-
p: AstNode[];
|
|
96
|
-
n: string | undefined;
|
|
97
|
-
token: Token | undefined;
|
|
98
|
-
}
|
|
99
|
-
export type ExpressionNode = NormalExpressionNode | SpecialExpressionNode | NumberNode | StringNode;
|
|
100
|
-
export type ParseBinding = (tokens: TokenStream, parseState: ParseState) => BindingNode;
|
|
101
|
-
export type ParseBindings = (tokens: TokenStream, parseState: ParseState) => BindingNode[];
|
|
102
|
-
export type ParseArgument = (tokens: TokenStream, parseState: ParseState) => ArgumentNode | ModifierNode;
|
|
103
|
-
export type ParseExpression = (tokens: TokenStream, parseState: ParseState) => ExpressionNode;
|
|
104
|
-
export type ParseTokensUntilClosingBracket = (tokens: TokenStream, parseState: ParseState) => AstNode[];
|
|
105
|
-
export type ParseToken = (tokens: TokenStream, parseState: ParseState) => AstNode;
|
|
106
|
-
export interface NumberNode extends GenericNode {
|
|
107
|
-
t: AstNodeType.Number;
|
|
108
|
-
v: number;
|
|
109
|
-
}
|
|
110
|
-
export interface StringNode extends GenericNode {
|
|
111
|
-
t: AstNodeType.String;
|
|
112
|
-
v: string;
|
|
113
|
-
}
|
|
114
|
-
export interface SymbolNode extends GenericNode {
|
|
115
|
-
t: AstNodeType.Symbol;
|
|
116
|
-
v: string;
|
|
117
|
-
}
|
|
118
|
-
export interface ModifierNode extends GenericNode {
|
|
119
|
-
t: AstNodeType.Modifier;
|
|
120
|
-
v: ModifierName;
|
|
121
|
-
}
|
|
122
|
-
export interface ReservedSymbolNode extends GenericNode {
|
|
123
|
-
t: AstNodeType.ReservedSymbol;
|
|
124
|
-
v: PolishReservedName;
|
|
125
|
-
}
|
|
126
|
-
interface CommonNormalExpressionNode extends GenericNode {
|
|
127
|
-
t: AstNodeType.NormalExpression;
|
|
128
|
-
}
|
|
129
|
-
export interface CommonSpecialExpressionNode<T extends SpecialExpressionName> extends GenericNode {
|
|
130
|
-
t: AstNodeType.SpecialExpression;
|
|
131
|
-
n: T;
|
|
132
|
-
}
|
|
133
|
-
export interface NormalExpressionNodeWithName extends CommonNormalExpressionNode {
|
|
134
|
-
n: string;
|
|
135
|
-
}
|
|
136
|
-
interface NormalExpressionNodeExpression extends CommonNormalExpressionNode {
|
|
137
|
-
n: undefined;
|
|
138
|
-
}
|
|
139
|
-
export type NormalExpressionNode = NormalExpressionNodeWithName | NormalExpressionNodeExpression;
|
|
140
|
-
export interface BindingNode extends GenericNode {
|
|
141
|
-
t: AstNodeType.Binding;
|
|
142
|
-
n: string;
|
|
143
|
-
v: AstNode;
|
|
144
|
-
}
|
|
145
|
-
export interface ArgumentNode extends GenericNode {
|
|
146
|
-
t: AstNodeType.Argument;
|
|
147
|
-
n: string;
|
|
148
|
-
d?: AstNode;
|
|
149
|
-
}
|
|
150
|
-
export interface CommentNode extends GenericNode {
|
|
151
|
-
t: AstNodeType.Comment;
|
|
152
|
-
v: string;
|
|
153
|
-
}
|
|
154
|
-
export type AstNode = NumberNode | StringNode | ReservedSymbolNode | SymbolNode | CommentNode | NormalExpressionNode | ModifierNode | SpecialExpressionNode;
|
|
155
|
-
type AstBody = AstNode[];
|
|
156
|
-
export interface Ast {
|
|
157
|
-
b: AstBody;
|
|
158
|
-
hasDebugData: boolean;
|
|
159
|
-
}
|
|
160
|
-
export {};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { Ast, AstNode } from '../parser/interface';
|
|
2
|
-
declare const removeOptions: {
|
|
3
|
-
readonly recursivelyRemoveCommentNodes: typeof recursivelyRemoveCommentNodes;
|
|
4
|
-
readonly removeCommenNodesFromArray: typeof removeCommenNodesFromArray;
|
|
5
|
-
};
|
|
6
|
-
export type RemoveOptions = typeof removeOptions;
|
|
7
|
-
export declare function removeCommenNodes(ast: Ast): void;
|
|
8
|
-
declare function recursivelyRemoveCommentNodes(astNode: AstNode): void;
|
|
9
|
-
declare function removeCommenNodesFromArray(astNodes: AstNode[]): void;
|
|
10
|
-
export declare function withoutCommentNodes(astNodes: AstNode[]): (import("../parser/interface").NumberNode | import("../parser/interface").StringNode | import("../parser/interface").ReservedSymbolNode | import("../parser/interface").SymbolNode | import("../parser/interface").NormalExpressionNode | import("../parser/interface").ModifierNode | import("../builtin").SpecialExpressionNode)[];
|
|
11
|
-
export {};
|
|
@@ -1,107 +0,0 @@
|
|
|
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
|
-
readonly when: {
|
|
35
|
-
readonly value: null;
|
|
36
|
-
readonly forbidden: false;
|
|
37
|
-
};
|
|
38
|
-
readonly while: {
|
|
39
|
-
readonly value: null;
|
|
40
|
-
readonly forbidden: false;
|
|
41
|
-
};
|
|
42
|
-
readonly function: {
|
|
43
|
-
readonly value: null;
|
|
44
|
-
readonly forbidden: false;
|
|
45
|
-
};
|
|
46
|
-
readonly export: {
|
|
47
|
-
readonly value: null;
|
|
48
|
-
readonly forbidden: false;
|
|
49
|
-
};
|
|
50
|
-
};
|
|
51
|
-
export declare const algebraicReservedNamesRecord: {
|
|
52
|
-
readonly fn: {
|
|
53
|
-
readonly value: null;
|
|
54
|
-
readonly forbidden: true;
|
|
55
|
-
};
|
|
56
|
-
readonly true: {
|
|
57
|
-
readonly value: true;
|
|
58
|
-
readonly forbidden: false;
|
|
59
|
-
};
|
|
60
|
-
readonly false: {
|
|
61
|
-
readonly value: false;
|
|
62
|
-
readonly forbidden: false;
|
|
63
|
-
};
|
|
64
|
-
readonly nil: {
|
|
65
|
-
readonly value: null;
|
|
66
|
-
readonly forbidden: false;
|
|
67
|
-
};
|
|
68
|
-
readonly null: {
|
|
69
|
-
readonly value: null;
|
|
70
|
-
readonly forbidden: false;
|
|
71
|
-
};
|
|
72
|
-
readonly then: {
|
|
73
|
-
readonly value: null;
|
|
74
|
-
readonly forbidden: false;
|
|
75
|
-
};
|
|
76
|
-
readonly else: {
|
|
77
|
-
readonly value: null;
|
|
78
|
-
readonly forbidden: false;
|
|
79
|
-
};
|
|
80
|
-
readonly end: {
|
|
81
|
-
readonly value: null;
|
|
82
|
-
readonly forbidden: false;
|
|
83
|
-
};
|
|
84
|
-
readonly case: {
|
|
85
|
-
readonly value: null;
|
|
86
|
-
readonly forbidden: false;
|
|
87
|
-
};
|
|
88
|
-
readonly when: {
|
|
89
|
-
readonly value: null;
|
|
90
|
-
readonly forbidden: false;
|
|
91
|
-
};
|
|
92
|
-
readonly while: {
|
|
93
|
-
readonly value: null;
|
|
94
|
-
readonly forbidden: false;
|
|
95
|
-
};
|
|
96
|
-
readonly function: {
|
|
97
|
-
readonly value: null;
|
|
98
|
-
readonly forbidden: false;
|
|
99
|
-
};
|
|
100
|
-
readonly export: {
|
|
101
|
-
readonly value: null;
|
|
102
|
-
readonly forbidden: false;
|
|
103
|
-
};
|
|
104
|
-
};
|
|
105
|
-
export type ValidAlgebraicReservedName = keyof typeof validAlgebraicReservedNamesRecord;
|
|
106
|
-
export type AlgebraicReservedName = keyof typeof algebraicReservedNamesRecord;
|
|
107
|
-
export {};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { Tokenizer } from '../interface';
|
|
2
|
-
import type { A_BasePrefixedNumberToken, A_MultiLineCommentToken, A_NumberToken, A_OperatorToken, A_ReservedSymbolToken, A_SingleLineCommentToken, A_SymbolToken, A_WhitespaceToken } from './algebraicTokens';
|
|
3
|
-
export declare const tokenizeA_Whitespace: Tokenizer<A_WhitespaceToken>;
|
|
4
|
-
export declare const tokenizeA_Number: Tokenizer<A_NumberToken>;
|
|
5
|
-
export declare const tokenizeA_BasePrefixedNumber: Tokenizer<A_BasePrefixedNumberToken>;
|
|
6
|
-
export declare const tokenizeA_Symbol: Tokenizer<A_SymbolToken>;
|
|
7
|
-
export declare const tokenizeA_ReservedSymbolToken: Tokenizer<A_ReservedSymbolToken>;
|
|
8
|
-
export declare const tokenizeA_Operator: Tokenizer<A_OperatorToken>;
|
|
9
|
-
export declare const tokenizeA_MultiLineComment: Tokenizer<A_MultiLineCommentToken>;
|
|
10
|
-
export declare const tokenizeA_SingleLineComment: Tokenizer<A_SingleLineCommentToken>;
|
|
11
|
-
export declare const algebraicTokenizers: [Tokenizer<A_WhitespaceToken>, Tokenizer<A_MultiLineCommentToken>, Tokenizer<A_SingleLineCommentToken>, 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<import("../common/commonTokens").RegexpShorthandToken>, Tokenizer<A_BasePrefixedNumberToken>, Tokenizer<A_NumberToken>, Tokenizer<A_OperatorToken>, Tokenizer<A_ReservedSymbolToken>, Tokenizer<A_SymbolToken>];
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import type { CommonSimpleToken, CommonValueToken, CommonValueTokenType } from '../common/commonTokens';
|
|
2
|
-
import type { Token } from '../tokens';
|
|
3
|
-
import { type TokenDebugData } from '../utils';
|
|
4
|
-
import type { ValidAlgebraicReservedName } from './algebraicReservedNames';
|
|
5
|
-
export declare const algebraicSimpleTokenTypes: readonly ["LBrace", "LBracket", "LParen", "RBrace", "RBracket", "RParen"];
|
|
6
|
-
export declare const algebraicOnlyValueTokenTypes: ["A_Whitespace", "A_Operator", "A_Symbol", "A_ReservedSymbol", "A_SingleLineComment", "A_MultiLineComment", "A_Number", "A_BasePrefixedNumber"];
|
|
7
|
-
export declare const algebraicValueTokenTypes: readonly ["String", "RegexpShorthand", "A_Whitespace", "A_Operator", "A_Symbol", "A_ReservedSymbol", "A_SingleLineComment", "A_MultiLineComment", "A_Number", "A_BasePrefixedNumber"];
|
|
8
|
-
export declare const algebraicTokenTypes: readonly ["LBrace", "LBracket", "LParen", "RBrace", "RBracket", "RParen", "String", "RegexpShorthand", "A_Whitespace", "A_Operator", "A_Symbol", "A_ReservedSymbol", "A_SingleLineComment", "A_MultiLineComment", "A_Number", "A_BasePrefixedNumber"];
|
|
9
|
-
declare const symbolicUnaryOperators: readonly ["!", "~", "+", "-"];
|
|
10
|
-
declare const symbolicBinaryOperators: readonly ["**", "*", "/", "%", "+", "-", "<<", ">>", ">>>", "++", "<", "<=", ">", ">=", "==", "!=", "&", "^", "|", "&&", "||", "??"];
|
|
11
|
-
declare const symbolicOperators: readonly ["!", "~", "+", "-", "**", "*", "/", "%", "+", "-", "<<", ">>", ">>>", "++", "<", "<=", ">", ">=", "==", "!=", "&", "^", "|", "&&", "||", "??", "=>", "...", ".", ",", "=", ";"];
|
|
12
|
-
export declare function isFunctionOperator(operator: string): boolean;
|
|
13
|
-
export type SymbolicUnaryOperator = typeof symbolicUnaryOperators[number];
|
|
14
|
-
export type SymbolicBinaryOperator = typeof symbolicBinaryOperators[number];
|
|
15
|
-
export type SymbolicOperator = typeof symbolicOperators[number];
|
|
16
|
-
export declare function isSymbolicUnaryOperator(operator: string): operator is SymbolicUnaryOperator;
|
|
17
|
-
export declare function assertSymbolicUnaryOperator(operator: string): asserts operator is SymbolicUnaryOperator;
|
|
18
|
-
export declare function asSymbolicUnaryOperator(operator: string): SymbolicUnaryOperator;
|
|
19
|
-
export declare function isSymbolicBinaryOperator(operator: string): operator is SymbolicBinaryOperator;
|
|
20
|
-
export declare function assertSymbolicBinaryOperator(operator: string): asserts operator is SymbolicBinaryOperator;
|
|
21
|
-
export declare function asSymbolicBinaryOperator(operator: string): SymbolicBinaryOperator;
|
|
22
|
-
export declare function isSymbolicOperator(operator: string): operator is SymbolicOperator;
|
|
23
|
-
export declare function assertSymbolicOperator(operator: string): asserts operator is SymbolicOperator;
|
|
24
|
-
export declare function asSymbolicOperator(operator: string): SymbolicOperator;
|
|
25
|
-
export type AlgebraicSimpleTokenType = typeof algebraicSimpleTokenTypes[number];
|
|
26
|
-
export type AlgebraicValueTokenType = typeof algebraicValueTokenTypes[number];
|
|
27
|
-
export type AlgebraicTokenType = typeof algebraicTokenTypes[number];
|
|
28
|
-
type GenericAlgebraicValueToken<T extends Exclude<AlgebraicValueTokenType, CommonValueTokenType>, V extends string = string> = [T, V] | [T, V, TokenDebugData];
|
|
29
|
-
export type A_WhitespaceToken = GenericAlgebraicValueToken<'A_Whitespace'>;
|
|
30
|
-
export type A_NumberToken = GenericAlgebraicValueToken<'A_Number'>;
|
|
31
|
-
export type A_BasePrefixedNumberToken = GenericAlgebraicValueToken<'A_BasePrefixedNumber'>;
|
|
32
|
-
export type A_OperatorToken<T extends SymbolicOperator = SymbolicOperator> = GenericAlgebraicValueToken<'A_Operator', T>;
|
|
33
|
-
export type A_SymbolToken<T extends string = string> = GenericAlgebraicValueToken<'A_Symbol', T>;
|
|
34
|
-
export type A_ReservedSymbolToken<T extends ValidAlgebraicReservedName = ValidAlgebraicReservedName> = GenericAlgebraicValueToken<'A_ReservedSymbol', T>;
|
|
35
|
-
export type A_SingleLineCommentToken = GenericAlgebraicValueToken<'A_SingleLineComment'>;
|
|
36
|
-
export type A_MultiLineCommentToken = GenericAlgebraicValueToken<'A_MultiLineComment'>;
|
|
37
|
-
export type AlgebraicOnlyValueToken = A_WhitespaceToken | A_NumberToken | A_BasePrefixedNumberToken | A_OperatorToken | A_SymbolToken | A_ReservedSymbolToken | A_SingleLineCommentToken | A_MultiLineCommentToken;
|
|
38
|
-
export type AlgebraicToken = AlgebraicOnlyValueToken | CommonSimpleToken | CommonValueToken;
|
|
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
|
-
export declare function isA_BinaryOperatorToken(token: Token | undefined): token is A_OperatorToken<SymbolicBinaryOperator>;
|
|
43
|
-
export declare function assertA_BinaryOperatorToken(token: Token | undefined): asserts token is A_OperatorToken<SymbolicBinaryOperator>;
|
|
44
|
-
export declare function asA_BinaryOperatorToken(token: Token | undefined): A_OperatorToken<SymbolicBinaryOperator>;
|
|
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>;
|
|
48
|
-
export declare function isA_CommentToken(token: Token | undefined): token is A_SingleLineCommentToken;
|
|
49
|
-
export declare function assertA_CommentToken(token: Token | undefined): asserts token is A_SingleLineCommentToken;
|
|
50
|
-
export declare function asA_CommentToken(token: Token | undefined): A_SingleLineCommentToken;
|
|
51
|
-
export declare function isA_MultiLineCommentToken(token: Token | undefined): token is A_MultiLineCommentToken;
|
|
52
|
-
export declare function assertA_MultiLineCommentToken(token: Token | undefined): asserts token is A_MultiLineCommentToken;
|
|
53
|
-
export declare function asA_MultiLineCommentToken(token: Token | undefined): A_MultiLineCommentToken;
|
|
54
|
-
export declare function isA_OperatorToken<T extends SymbolicOperator>(token: Token | undefined, operatorName?: T): token is A_OperatorToken<T>;
|
|
55
|
-
export declare function assertA_OperatorToken<T extends SymbolicOperator>(token: Token | undefined, operatorName?: T): asserts token is A_OperatorToken<T>;
|
|
56
|
-
export declare function asA_OperatorToken<T extends SymbolicOperator>(token: Token | undefined, operatorName?: T): A_OperatorToken<T>;
|
|
57
|
-
export declare function isA_WhitespaceToken(token: Token | undefined): token is A_WhitespaceToken;
|
|
58
|
-
export declare function assertA_WhitespaceToken(token: Token | undefined): asserts token is A_WhitespaceToken;
|
|
59
|
-
export declare function asA_WhitespaceToken(token: Token | undefined): A_WhitespaceToken;
|
|
60
|
-
export declare function isA_NumberToken(token: Token | undefined): token is A_NumberToken;
|
|
61
|
-
export declare function assertA_NumberToken(token: Token | undefined): asserts token is A_NumberToken;
|
|
62
|
-
export declare function asA_NumberToken(token: Token | undefined): A_NumberToken;
|
|
63
|
-
export declare function isA_BasePrefixedNumberToken(token: Token | undefined): token is A_BasePrefixedNumberToken;
|
|
64
|
-
export declare function assertA_BasePrefixedNumberToken(token: Token | undefined): asserts token is A_BasePrefixedNumberToken;
|
|
65
|
-
export declare function asA_BasePrefixedNumberToken(token: Token | undefined): A_BasePrefixedNumberToken;
|
|
66
|
-
export {};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { TokenDescriptor, Tokenizer } from '../interface';
|
|
2
|
-
import type { SimpleToken } from '../tokens';
|
|
3
|
-
import type { LBraceToken, LBracketToken, LParenToken, RBraceToken, RBracketToken, RParenToken, RegexpShorthandToken, StringToken } from './commonTokens';
|
|
4
|
-
export declare const NO_MATCH: TokenDescriptor<never>;
|
|
5
|
-
export declare function isNoMatch(tokenDescriptor: TokenDescriptor<any>): tokenDescriptor is TokenDescriptor<never>;
|
|
6
|
-
export declare const tokenizeString: Tokenizer<StringToken>;
|
|
7
|
-
export declare const tokenizeRegexpShorthand: Tokenizer<RegexpShorthandToken>;
|
|
8
|
-
export declare function tokenizeSimpleToken<T extends SimpleToken>(type: T[0], value: string, input: string, position: number): TokenDescriptor<T>;
|
|
9
|
-
export declare const commonTokenizers: readonly [Tokenizer<LParenToken>, Tokenizer<RParenToken>, Tokenizer<LBracketToken>, Tokenizer<RBracketToken>, Tokenizer<LBraceToken>, Tokenizer<RBraceToken>, Tokenizer<StringToken>, Tokenizer<RegexpShorthandToken>];
|