@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,43 +0,0 @@
|
|
|
1
|
-
import { type TokenDebugData } from '../utils';
|
|
2
|
-
import type { Token } from '../tokens';
|
|
3
|
-
export declare const commonSimpleTokenTypes: readonly ["LBrace", "LBracket", "LParen", "RBrace", "RBracket", "RParen"];
|
|
4
|
-
export declare const commomValueTokenTypes: readonly ["String", "RegexpShorthand"];
|
|
5
|
-
export type CommonSimpleTokenType = typeof commonSimpleTokenTypes[number];
|
|
6
|
-
export type CommonValueTokenType = typeof commomValueTokenTypes[number];
|
|
7
|
-
type GenericCommonSimpleToken<T extends CommonSimpleTokenType> = [T] | [T, TokenDebugData];
|
|
8
|
-
type GenericCommonValueToken<T extends CommonValueTokenType, V extends string = string> = [T, V] | [T, V, TokenDebugData];
|
|
9
|
-
export type LParenToken = GenericCommonSimpleToken<'LParen'>;
|
|
10
|
-
export type RParenToken = GenericCommonSimpleToken<'RParen'>;
|
|
11
|
-
export type LBracketToken = GenericCommonSimpleToken<'LBracket'>;
|
|
12
|
-
export type RBracketToken = GenericCommonSimpleToken<'RBracket'>;
|
|
13
|
-
export type LBraceToken = GenericCommonSimpleToken<'LBrace'>;
|
|
14
|
-
export type RBraceToken = GenericCommonSimpleToken<'RBrace'>;
|
|
15
|
-
export type StringToken = GenericCommonValueToken<'String'>;
|
|
16
|
-
export type RegexpShorthandToken = GenericCommonValueToken<'RegexpShorthand'>;
|
|
17
|
-
export type CommonSimpleToken = LParenToken | RParenToken | LBracketToken | RBracketToken | LBraceToken | RBraceToken;
|
|
18
|
-
export type CommonValueToken = StringToken | RegexpShorthandToken;
|
|
19
|
-
export declare function isLParenToken(token?: Token): token is LParenToken;
|
|
20
|
-
export declare function assertLParenToken(token?: Token): asserts token is LParenToken;
|
|
21
|
-
export declare function asLParenToken(token?: Token): LParenToken;
|
|
22
|
-
export declare function isRParenToken(token?: Token): token is RParenToken;
|
|
23
|
-
export declare function assertRParenToken(token?: Token): asserts token is RParenToken;
|
|
24
|
-
export declare function asRParenToken(token?: Token): RParenToken;
|
|
25
|
-
export declare function isLBracketToken(token?: Token): token is LBracketToken;
|
|
26
|
-
export declare function assertLBracketToken(token?: Token): asserts token is LBracketToken;
|
|
27
|
-
export declare function asLBracketToken(token?: Token): LBracketToken;
|
|
28
|
-
export declare function isRBracketToken(token?: Token): token is RBracketToken;
|
|
29
|
-
export declare function assertRBracketToken(token?: Token): asserts token is RBracketToken;
|
|
30
|
-
export declare function asRBracketToken(token?: Token): RBracketToken;
|
|
31
|
-
export declare function isLBraceToken(token?: Token): token is LBraceToken;
|
|
32
|
-
export declare function assertLBraceToken(token?: Token): asserts token is LBraceToken;
|
|
33
|
-
export declare function asLBraceToken(token?: Token): LBraceToken;
|
|
34
|
-
export declare function isRBraceToken(token?: Token): token is RBraceToken;
|
|
35
|
-
export declare function assertRBraceToken(token?: Token): asserts token is RBraceToken;
|
|
36
|
-
export declare function asRBraceToken(token?: Token): RBraceToken;
|
|
37
|
-
export declare function isStringToken(token?: Token): token is StringToken;
|
|
38
|
-
export declare function assertStringToken(token?: Token): asserts token is StringToken;
|
|
39
|
-
export declare function asStringToken(token?: Token): StringToken;
|
|
40
|
-
export declare function isRegexpShorthandToken(token?: Token): token is RegexpShorthandToken;
|
|
41
|
-
export declare function assertRegexpShorthandToken(token?: Token): asserts token is RegexpShorthandToken;
|
|
42
|
-
export declare function asRegexpShorthandToken(token?: Token): RegexpShorthandToken;
|
|
43
|
-
export {};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type { Token } from './tokens';
|
|
2
|
-
export interface SourceCodeInfo {
|
|
3
|
-
position?: {
|
|
4
|
-
line: number;
|
|
5
|
-
column: number;
|
|
6
|
-
};
|
|
7
|
-
code?: string;
|
|
8
|
-
filePath?: string;
|
|
9
|
-
}
|
|
10
|
-
export type TokenDescriptor<T extends Token> = [length: number, token?: T];
|
|
11
|
-
export type Tokenizer<T extends Token> = (input: string, position: number) => TokenDescriptor<T>;
|
|
12
|
-
export interface TokenStream {
|
|
13
|
-
tokens: Token[];
|
|
14
|
-
hasDebugData: boolean;
|
|
15
|
-
algebraic: boolean;
|
|
16
|
-
filePath?: string;
|
|
17
|
-
}
|
|
18
|
-
export interface TokenizeParams {
|
|
19
|
-
debug: boolean;
|
|
20
|
-
algebraic: boolean;
|
|
21
|
-
filePath?: string;
|
|
22
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { Any } from '../../interface';
|
|
2
|
-
export declare const polishReservedNamesRecord: Record<string, {
|
|
3
|
-
value: Any;
|
|
4
|
-
forbidden?: true;
|
|
5
|
-
}>;
|
|
6
|
-
export type PolishReservedName = keyof typeof polishReservedNamesRecord;
|
|
7
|
-
export declare const polishReservedNames: PolishReservedName[];
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { Tokenizer } from '../interface';
|
|
2
|
-
import type { P_CollectionAccessorToken, P_CommentToken, P_FnShorthandToken, P_ModifierToken, P_NumberToken, P_ReservedSymbolToken, P_StringShorthandToken, P_SymbolToken, P_WhitespaceToken } from './polishTokens';
|
|
3
|
-
export declare const tokenizeP_Comment: Tokenizer<P_CommentToken>;
|
|
4
|
-
export declare const tokenizeP_Whitespace: Tokenizer<P_WhitespaceToken>;
|
|
5
|
-
export declare const tokenizeP_Number: Tokenizer<P_NumberToken>;
|
|
6
|
-
export declare const P_symbolRegExp: RegExp;
|
|
7
|
-
export declare const P_symbolFirstCharacterRegExp: RegExp;
|
|
8
|
-
export declare const tokenizeP_Symbol: Tokenizer<P_SymbolToken>;
|
|
9
|
-
export declare const tokenizeP_FnShorthand: Tokenizer<P_FnShorthandToken>;
|
|
10
|
-
export declare const tokenizeP_ReservedSymbol: Tokenizer<P_ReservedSymbolToken>;
|
|
11
|
-
export declare const tokenizeP_Modifier: Tokenizer<P_ModifierToken>;
|
|
12
|
-
export declare const tokenizeP_CollectionAccessor: Tokenizer<P_CollectionAccessorToken>;
|
|
13
|
-
export declare const polishTokenizers: [Tokenizer<P_WhitespaceToken>, Tokenizer<P_CommentToken>, 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<P_StringShorthandToken>, Tokenizer<P_NumberToken>, Tokenizer<P_ReservedSymbolToken>, Tokenizer<P_ModifierToken>, Tokenizer<P_SymbolToken>, Tokenizer<P_FnShorthandToken>, Tokenizer<P_CollectionAccessorToken>];
|
|
@@ -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;
|