@mojir/lits 2.0.22 → 2.1.0
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/src/cliDocumentation/getCliType.d.ts +1 -1
- package/dist/cli/cli.js +7146 -9278
- 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 +43 -23
- package/dist/cli/src/builtin/interface.d.ts +11 -11
- package/dist/cli/src/builtin/specialExpressions/and.d.ts +1 -1
- package/dist/cli/src/builtin/specialExpressions/array.d.ts +6 -0
- package/dist/cli/src/builtin/specialExpressions/cond.d.ts +1 -1
- package/dist/cli/src/builtin/specialExpressions/declared.d.ts +1 -1
- package/dist/cli/src/builtin/specialExpressions/def.d.ts +5 -2
- package/dist/cli/src/builtin/specialExpressions/do.d.ts +1 -1
- package/dist/cli/src/builtin/specialExpressions/functions.d.ts +11 -6
- package/dist/cli/src/builtin/specialExpressions/if.d.ts +1 -1
- package/dist/cli/src/builtin/specialExpressions/let.d.ts +5 -3
- package/dist/cli/src/builtin/specialExpressions/loop.d.ts +2 -2
- package/dist/cli/src/builtin/specialExpressions/loops.d.ts +1 -1
- package/dist/cli/src/builtin/specialExpressions/object.d.ts +6 -0
- package/dist/cli/src/builtin/specialExpressions/or.d.ts +1 -1
- package/dist/cli/src/builtin/specialExpressions/qq.d.ts +1 -1
- package/dist/cli/src/builtin/specialExpressions/recur.d.ts +1 -1
- package/dist/cli/src/builtin/specialExpressions/switch.d.ts +1 -1
- package/dist/cli/src/builtin/specialExpressions/throw.d.ts +1 -1
- package/dist/cli/src/builtin/specialExpressions/try.d.ts +1 -1
- package/dist/cli/src/builtin/specialExpressions/unless.d.ts +1 -1
- package/dist/cli/src/builtin/utils.d.ts +5 -14
- package/dist/cli/src/cliDocumentation/getCliType.d.ts +1 -1
- package/dist/cli/src/constants/constants.d.ts +5 -28
- package/dist/cli/src/errors.d.ts +1 -1
- package/dist/cli/src/evaluator/ContextStack.d.ts +7 -7
- package/dist/cli/src/evaluator/functionExecutors.d.ts +3 -3
- package/dist/cli/src/evaluator/index.d.ts +1 -1
- package/dist/cli/src/evaluator/interface.d.ts +3 -3
- package/dist/cli/src/getUndefinedSymbols/index.d.ts +7 -0
- package/dist/cli/src/interface.d.ts +1 -2
- package/dist/cli/src/parser/{AlgebraicParser.d.ts → Parser.d.ts} +17 -14
- package/dist/cli/src/parser/{interface.d.ts → types.d.ts} +90 -76
- 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 +2 -2
- package/dist/cli/src/typeGuards/index.d.ts +7 -3
- package/dist/cli/src/typeGuards/lits.d.ts +2 -2
- package/dist/cli/src/typeGuards/litsFunction.d.ts +2 -2
- 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 -3
- package/dist/index.esm.js +7293 -9419
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +7292 -9424
- package/dist/index.js.map +1 -1
- package/dist/lits.iife.js +7292 -9424
- 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 +43 -23
- package/dist/src/builtin/interface.d.ts +11 -11
- package/dist/src/builtin/specialExpressions/and.d.ts +1 -1
- package/dist/src/builtin/specialExpressions/array.d.ts +6 -0
- package/dist/src/builtin/specialExpressions/cond.d.ts +1 -1
- package/dist/src/builtin/specialExpressions/declared.d.ts +1 -1
- package/dist/src/builtin/specialExpressions/def.d.ts +5 -2
- package/dist/src/builtin/specialExpressions/do.d.ts +1 -1
- package/dist/src/builtin/specialExpressions/functions.d.ts +11 -6
- package/dist/src/builtin/specialExpressions/if.d.ts +1 -1
- package/dist/src/builtin/specialExpressions/let.d.ts +5 -3
- package/dist/src/builtin/specialExpressions/loop.d.ts +2 -2
- package/dist/src/builtin/specialExpressions/loops.d.ts +1 -1
- package/dist/src/builtin/specialExpressions/object.d.ts +6 -0
- package/dist/src/builtin/specialExpressions/or.d.ts +1 -1
- package/dist/src/builtin/specialExpressions/qq.d.ts +1 -1
- package/dist/src/builtin/specialExpressions/recur.d.ts +1 -1
- package/dist/src/builtin/specialExpressions/switch.d.ts +1 -1
- package/dist/src/builtin/specialExpressions/throw.d.ts +1 -1
- package/dist/src/builtin/specialExpressions/try.d.ts +1 -1
- package/dist/src/builtin/specialExpressions/unless.d.ts +1 -1
- package/dist/src/builtin/utils.d.ts +5 -14
- package/dist/src/constants/constants.d.ts +5 -28
- package/dist/src/errors.d.ts +1 -1
- package/dist/src/evaluator/ContextStack.d.ts +7 -7
- package/dist/src/evaluator/functionExecutors.d.ts +3 -3
- package/dist/src/evaluator/index.d.ts +1 -1
- package/dist/src/evaluator/interface.d.ts +3 -3
- 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/{AlgebraicParser.d.ts → Parser.d.ts} +17 -14
- package/dist/src/parser/{interface.d.ts → types.d.ts} +90 -76
- 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 +2 -2
- package/dist/src/typeGuards/index.d.ts +7 -3
- package/dist/src/typeGuards/lits.d.ts +2 -2
- package/dist/src/typeGuards/litsFunction.d.ts +2 -2
- 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 -3
- package/dist/testFramework.esm.js +3102 -4317
- package/dist/testFramework.esm.js.map +1 -1
- package/dist/testFramework.js +3102 -4317
- 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/identifier.d.ts +0 -4
- package/dist/cli/src/index.d.ts +0 -18
- 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/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/identifier.d.ts +0 -4
- 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/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
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mojir/lits",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "Lits is a Lisp dialect implemented in TypeScript",
|
|
5
5
|
"author": "Albert Mojir",
|
|
6
6
|
"license": "MIT",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"lint": "eslint . --fix",
|
|
37
37
|
"lint:no-fix": "eslint .",
|
|
38
38
|
"typecheck": "tsc -p ./tsconfig.compile.json --noEmit",
|
|
39
|
-
"check": "npm run lint && npm run typecheck && npm run test",
|
|
39
|
+
"check": "npm run lint && npm run typecheck && npm run test && npm run build",
|
|
40
40
|
"check:no-fix": "npm run lint:no-fix && npm run typecheck && npm run test",
|
|
41
41
|
"clean": "npm run clean-lits && npm run clean-playground",
|
|
42
42
|
"clean-lits": "rm -rf dist build",
|
|
@@ -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,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_$]";
|
package/dist/cli/src/index.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export { AstNodeType, FunctionType } from './constants/constants';
|
|
2
|
-
export { isBuiltinFunction, isLitsFunction, asLitsFunction, assertLitsFunction, isUserDefinedFunction, asUserDefinedFunction, assertUserDefinedFunction, isNativeJsFunction, asNativeJsFunction, assertNativeJsFunction, } from './typeGuards/litsFunction';
|
|
3
|
-
export { type LitsFunction, type NativeJsFunction, type ExtraData } from './parser/interface';
|
|
4
|
-
export type { Context } from './evaluator/interface';
|
|
5
|
-
export type { Ast } from './parser/interface';
|
|
6
|
-
export type { SourceCodeInfo } from './tokenizer/interface';
|
|
7
|
-
export type { Token } from './tokenizer/tokens';
|
|
8
|
-
export { normalExpressionKeys, specialExpressionKeys } from './builtin';
|
|
9
|
-
export { polishReservedNames } from './tokenizer/polish/polishReservedNames';
|
|
10
|
-
export { Lits } from './Lits/Lits';
|
|
11
|
-
export { type LitsError, isLitsError } from './errors';
|
|
12
|
-
export type { LitsParams, LitsRuntimeInfo, LazyValue, JsFunction } from './Lits/Lits';
|
|
13
|
-
export { createNativeJsFunction } from './utils';
|
|
14
|
-
export { apiReference, isDatatypeReference, isFunctionReference, isNormalExpressionArgument, isShorthandReference, isSpecialExpressionArgument, isTypedValue } from '../reference';
|
|
15
|
-
export type { Argument, CommonReference, DatatypeReference, FunctionReference, Reference, ShorthandReference } from '../reference';
|
|
16
|
-
export type { ApiName, FunctionName, ShorthandName, DatatypeName } from '../reference/api';
|
|
17
|
-
export { isApiName, isDataType } from '../reference/api';
|
|
18
|
-
export { polishIdentifierCharacterClass as identifierCharacterClass, polishIdentifierFirstCharacterClass as identifierFirstCharacterClass } from './identifier';
|
|
@@ -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,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>];
|
|
@@ -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;
|
|
@@ -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'];
|
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,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,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 {};
|