@mojir/lits 2.0.16 → 2.0.18

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.
Files changed (40) hide show
  1. package/dist/cli/cli.js +667 -380
  2. package/dist/cli/reference/api.d.ts +5 -5
  3. package/dist/cli/src/builtin/index.d.ts +0 -2
  4. package/dist/cli/src/builtin/specialExpressions/functions.d.ts +0 -5
  5. package/dist/cli/src/parser/AlgebraicParser.d.ts +6 -6
  6. package/dist/cli/src/parser/commonTokenParsers.d.ts +2 -1
  7. package/dist/cli/src/tokenizer/algebraic/algebraicReservedNames.d.ts +16 -4
  8. package/dist/cli/src/tokenizer/algebraic/algebraicTokenizers.d.ts +1 -1
  9. package/dist/cli/src/tokenizer/algebraic/algebraicTokens.d.ts +2 -2
  10. package/dist/cli/src/tokenizer/common/commonTokenizers.d.ts +3 -2
  11. package/dist/cli/src/tokenizer/common/commonTokens.d.ts +6 -2
  12. package/dist/cli/src/tokenizer/polish/polishTokenizers.d.ts +2 -3
  13. package/dist/cli/src/tokenizer/polish/polishTokens.d.ts +4 -8
  14. package/dist/cli/src/tokenizer/tokens.d.ts +2 -2
  15. package/dist/index.esm.js +663 -378
  16. package/dist/index.esm.js.map +1 -1
  17. package/dist/index.js +663 -378
  18. package/dist/index.js.map +1 -1
  19. package/dist/lits.iife.js +663 -378
  20. package/dist/lits.iife.js.map +1 -1
  21. package/dist/reference/api.d.ts +5 -5
  22. package/dist/src/builtin/index.d.ts +0 -2
  23. package/dist/src/builtin/specialExpressions/functions.d.ts +0 -5
  24. package/dist/src/parser/AlgebraicParser.d.ts +6 -6
  25. package/dist/src/parser/commonTokenParsers.d.ts +2 -1
  26. package/dist/src/tokenizer/algebraic/algebraicReservedNames.d.ts +16 -4
  27. package/dist/src/tokenizer/algebraic/algebraicTokenizers.d.ts +1 -1
  28. package/dist/src/tokenizer/algebraic/algebraicTokens.d.ts +2 -2
  29. package/dist/src/tokenizer/common/commonTokenizers.d.ts +3 -2
  30. package/dist/src/tokenizer/common/commonTokens.d.ts +6 -2
  31. package/dist/src/tokenizer/polish/polishTokenizers.d.ts +2 -3
  32. package/dist/src/tokenizer/polish/polishTokens.d.ts +4 -8
  33. package/dist/src/tokenizer/tokens.d.ts +2 -2
  34. package/dist/testFramework.esm.js +361 -271
  35. package/dist/testFramework.esm.js.map +1 -1
  36. package/dist/testFramework.js +361 -271
  37. package/dist/testFramework.js.map +1 -1
  38. package/package.json +1 -1
  39. package/dist/cli/src/builtin/specialExpressions/defs.d.ts +0 -5
  40. package/dist/src/builtin/specialExpressions/defs.d.ts +0 -5
@@ -1,15 +1,15 @@
1
1
  export declare const api: {
2
2
  readonly collection: readonly ["count", "get", "get_in", "contains?", "has?", "has_some?", "has_every?", "assoc", "assoc_in", "concat", "not_empty", "every?", "not_every?", "any?", "not_any?", "update", "update_in"];
3
3
  readonly array: readonly ["array", "range", "repeat", "flatten", "mapcat"];
4
- readonly sequence: readonly ["nth", "push", "pop", "unshift", "shift", "slice", "reductions", "reduce", "reduce_right", "map", "filter", "position", "index_of", "some", "reverse", "first", "second", "last", "rest", "nthrest", "next", "nthnext", "take", "take_last", "take_while", "drop", "drop_last", "drop_while", "sort", "sort_by", "distinct", "remove", "remove_at", "split_at", "split_with", "frequencies", "group_by", "partition", "partition_all", "partition_by"];
4
+ readonly sequence: readonly ["nth", "push", "pop", "unshift", "shift", "slice", "reductions", "reduce", "reduce_right", "map", "filter", "position", "index_of", "last_index_of", "some", "reverse", "first", "second", "last", "rest", "nthrest", "next", "nthnext", "take", "take_last", "take_while", "drop", "drop_last", "drop_while", "sort", "sort_by", "distinct", "remove", "remove_at", "split_at", "split_with", "frequencies", "group_by", "partition", "partition_all", "partition_by", "starts_with?", "ends_with?", "interleave", "interpose"];
5
5
  readonly math: readonly ["+", "-", "*", "/", "mod", "%", "quot", "inc", "dec", "sqrt", "cbrt", "**", "exp", "round", "trunc", "floor", "ceil", "min", "max", "abs", "sign", "positive_infinity", "negative_infinity", "max_safe_integer", "min_safe_integer", "max_value", "min_value", "epsilon", "nan", "e", "pi", "log", "log2", "log10", "sin", "cos", "tan", "asin", "acos", "atan", "sinh", "cosh", "tanh", "asinh", "acosh", "atanh"];
6
6
  readonly functional: readonly ["apply", "identity", "partial", "comp", "constantly", "juxt", "complement", "every_pred", "some_pred", "fnil"];
7
7
  readonly misc: readonly ["!=", "==", "<", ">", "<=", ">=", "!", "write!", "iso_date>epoch", "epoch>iso_date", "boolean", "compare", "equal?", "json_parse", "json_stringify"];
8
8
  readonly object: readonly ["dissoc", "object", "keys", "vals", "entries", "find", "merge", "merge_with", "zipmap", "select_keys"];
9
9
  readonly predicate: readonly ["boolean?", "nil?", "number?", "string?", "function?", "integer?", "array?", "object?", "coll?", "seq?", "regexp?", "zero?", "pos?", "neg?", "even?", "odd?", "finite?", "nan?", "negative_infinity?", "positive_infinity?", "false?", "true?", "empty?", "not_empty?"];
10
- readonly regularExpression: readonly ["regexp", "match", "replace"];
11
- readonly specialExpressions: readonly ["&&", "||", "def", "defs", "let", "fn", "defn", "defns", "try", "throw", "if", "unless", "cond", "switch", "comment", "do", "recur", "loop", "doseq", "for", "defined?", "??"];
12
- readonly string: readonly ["subs", "string_repeat", "str", "number", "lower_case", "upper_case", "trim", "trim_left", "trim_right", "pad_left", "pad_right", "split", "template", "to_char_code", "from_char_code", "encode_base64", "decode_base64", "encode_uri_component", "decode_uri_component", "join", "++"];
10
+ readonly regularExpression: readonly ["regexp", "match", "replace", "replace_all"];
11
+ readonly specialExpressions: readonly ["&&", "||", "def", "let", "fn", "defn", "try", "throw", "if", "unless", "cond", "switch", "comment", "do", "recur", "loop", "doseq", "for", "defined?", "??"];
12
+ readonly string: readonly ["subs", "string_repeat", "str", "number", "lower_case", "upper_case", "trim", "trim_left", "trim_right", "pad_left", "pad_right", "split", "split_lines", "template", "to_char_code", "from_char_code", "encode_base64", "decode_base64", "encode_uri_component", "decode_uri_component", "join", "++", "capitalize", "blank?"];
13
13
  readonly bitwise: readonly ["<<", ">>", ">>>", "~", "&", "&!", "|", "^", "bit_flip", "bit_clear", "bit_set", "bit_test"];
14
14
  readonly assert: readonly ["assert", "assert=", "assert!=", "assert_equal", "assert_not_equal", "assert_gt", "assert_lt", "assert_gte", "assert_lte", "assert_true", "assert_false", "assert_truthy", "assert_falsy", "assert_null", "assert_throws", "assert_throws_error", "assert_not_throws"];
15
15
  readonly shorthand: ["-short-regexp", "-short-fn", "-short-string", "-short-dot", "-short-hash"];
@@ -31,7 +31,7 @@ export type AssertApiName = typeof api.assert[number];
31
31
  export type FunctionName = CollectionApiName | ArrayApiName | SequenceApiName | MathApiName | FunctionalApiName | MiscApiName | ObjectApiName | PredicateApiName | RegularExpressionApiName | SpecialExpressionsApiName | StringApiName | BitwiseApiName | AssertApiName;
32
32
  export type ShorthandName = typeof api.shorthand[number];
33
33
  export type DatatypeName = typeof api.datatype[number];
34
- declare const apiNames: readonly ["count", "get", "get_in", "contains?", "has?", "has_some?", "has_every?", "assoc", "assoc_in", "concat", "not_empty", "every?", "not_every?", "any?", "not_any?", "update", "update_in", "array", "range", "repeat", "flatten", "mapcat", "nth", "push", "pop", "unshift", "shift", "slice", "reductions", "reduce", "reduce_right", "map", "filter", "position", "index_of", "some", "reverse", "first", "second", "last", "rest", "nthrest", "next", "nthnext", "take", "take_last", "take_while", "drop", "drop_last", "drop_while", "sort", "sort_by", "distinct", "remove", "remove_at", "split_at", "split_with", "frequencies", "group_by", "partition", "partition_all", "partition_by", "+", "-", "*", "/", "mod", "%", "quot", "inc", "dec", "sqrt", "cbrt", "**", "exp", "round", "trunc", "floor", "ceil", "min", "max", "abs", "sign", "positive_infinity", "negative_infinity", "max_safe_integer", "min_safe_integer", "max_value", "min_value", "epsilon", "nan", "e", "pi", "log", "log2", "log10", "sin", "cos", "tan", "asin", "acos", "atan", "sinh", "cosh", "tanh", "asinh", "acosh", "atanh", "apply", "identity", "partial", "comp", "constantly", "juxt", "complement", "every_pred", "some_pred", "fnil", "!=", "==", "<", ">", "<=", ">=", "!", "write!", "iso_date>epoch", "epoch>iso_date", "boolean", "compare", "equal?", "json_parse", "json_stringify", "dissoc", "object", "keys", "vals", "entries", "find", "merge", "merge_with", "zipmap", "select_keys", "boolean?", "nil?", "number?", "string?", "function?", "integer?", "array?", "object?", "coll?", "seq?", "regexp?", "zero?", "pos?", "neg?", "even?", "odd?", "finite?", "nan?", "negative_infinity?", "positive_infinity?", "false?", "true?", "empty?", "not_empty?", "regexp", "match", "replace", "&&", "||", "def", "defs", "let", "fn", "defn", "defns", "try", "throw", "if", "unless", "cond", "switch", "comment", "do", "recur", "loop", "doseq", "for", "defined?", "??", "subs", "string_repeat", "str", "number", "lower_case", "upper_case", "trim", "trim_left", "trim_right", "pad_left", "pad_right", "split", "template", "to_char_code", "from_char_code", "encode_base64", "decode_base64", "encode_uri_component", "decode_uri_component", "join", "++", "<<", ">>", ">>>", "~", "&", "&!", "|", "^", "bit_flip", "bit_clear", "bit_set", "bit_test", "assert", "assert=", "assert!=", "assert_equal", "assert_not_equal", "assert_gt", "assert_lt", "assert_gte", "assert_lte", "assert_true", "assert_false", "assert_truthy", "assert_falsy", "assert_null", "assert_throws", "assert_throws_error", "assert_not_throws", "-short-regexp", "-short-fn", "-short-string", "-short-dot", "-short-hash", "-type-number", "-type-string", "-type-object", "-type-array", "-type-boolean", "-type-function", "-type-integer", "-type-any", "-type-nil", "-type-collection", "-type-sequence", "-type-regexp", "-type-never"];
34
+ declare const apiNames: readonly ["count", "get", "get_in", "contains?", "has?", "has_some?", "has_every?", "assoc", "assoc_in", "concat", "not_empty", "every?", "not_every?", "any?", "not_any?", "update", "update_in", "array", "range", "repeat", "flatten", "mapcat", "nth", "push", "pop", "unshift", "shift", "slice", "reductions", "reduce", "reduce_right", "map", "filter", "position", "index_of", "last_index_of", "some", "reverse", "first", "second", "last", "rest", "nthrest", "next", "nthnext", "take", "take_last", "take_while", "drop", "drop_last", "drop_while", "sort", "sort_by", "distinct", "remove", "remove_at", "split_at", "split_with", "frequencies", "group_by", "partition", "partition_all", "partition_by", "starts_with?", "ends_with?", "interleave", "interpose", "+", "-", "*", "/", "mod", "%", "quot", "inc", "dec", "sqrt", "cbrt", "**", "exp", "round", "trunc", "floor", "ceil", "min", "max", "abs", "sign", "positive_infinity", "negative_infinity", "max_safe_integer", "min_safe_integer", "max_value", "min_value", "epsilon", "nan", "e", "pi", "log", "log2", "log10", "sin", "cos", "tan", "asin", "acos", "atan", "sinh", "cosh", "tanh", "asinh", "acosh", "atanh", "apply", "identity", "partial", "comp", "constantly", "juxt", "complement", "every_pred", "some_pred", "fnil", "!=", "==", "<", ">", "<=", ">=", "!", "write!", "iso_date>epoch", "epoch>iso_date", "boolean", "compare", "equal?", "json_parse", "json_stringify", "dissoc", "object", "keys", "vals", "entries", "find", "merge", "merge_with", "zipmap", "select_keys", "boolean?", "nil?", "number?", "string?", "function?", "integer?", "array?", "object?", "coll?", "seq?", "regexp?", "zero?", "pos?", "neg?", "even?", "odd?", "finite?", "nan?", "negative_infinity?", "positive_infinity?", "false?", "true?", "empty?", "not_empty?", "regexp", "match", "replace", "replace_all", "&&", "||", "def", "let", "fn", "defn", "try", "throw", "if", "unless", "cond", "switch", "comment", "do", "recur", "loop", "doseq", "for", "defined?", "??", "subs", "string_repeat", "str", "number", "lower_case", "upper_case", "trim", "trim_left", "trim_right", "pad_left", "pad_right", "split", "split_lines", "template", "to_char_code", "from_char_code", "encode_base64", "decode_base64", "encode_uri_component", "decode_uri_component", "join", "++", "capitalize", "blank?", "<<", ">>", ">>>", "~", "&", "&!", "|", "^", "bit_flip", "bit_clear", "bit_set", "bit_test", "assert", "assert=", "assert!=", "assert_equal", "assert_not_equal", "assert_gt", "assert_lt", "assert_gte", "assert_lte", "assert_true", "assert_false", "assert_truthy", "assert_falsy", "assert_null", "assert_throws", "assert_throws_error", "assert_not_throws", "-short-regexp", "-short-fn", "-short-string", "-short-dot", "-short-hash", "-type-number", "-type-string", "-type-object", "-type-array", "-type-boolean", "-type-function", "-type-integer", "-type-any", "-type-nil", "-type-collection", "-type-sequence", "-type-regexp", "-type-never"];
35
35
  export type ApiName = typeof apiNames[number];
36
36
  export declare function isApiName(arg: string): arg is ApiName;
37
37
  export declare const categoryRecord: {
@@ -6,8 +6,6 @@ declare const specialExpressions: {
6
6
  readonly switch: import("./interface").BuiltinSpecialExpression<import("../interface").Any, import("./specialExpressions/switch").SwitchNode>;
7
7
  readonly def: import("./interface").BuiltinSpecialExpression<null, import("./specialExpressions/def").DefNode>;
8
8
  readonly defn: import("./interface").BuiltinSpecialExpression<null, import("./specialExpressions/functions").DefnNode>;
9
- readonly defns: import("./interface").BuiltinSpecialExpression<null, import("./specialExpressions/functions").DefnsNode>;
10
- readonly defs: import("./interface").BuiltinSpecialExpression<null, import("./specialExpressions/defs").DefsNode>;
11
9
  readonly do: import("./interface").BuiltinSpecialExpression<import("../interface").Any, import("./specialExpressions/do").DoNode>;
12
10
  readonly doseq: import("./interface").BuiltinSpecialExpression<null, import("./specialExpressions/loops").DoSeqNode>;
13
11
  readonly for: import("./interface").BuiltinSpecialExpression<import("../interface").Any, import("./specialExpressions/loops").ForNode>;
@@ -5,14 +5,9 @@ export interface DefnNode extends CommonSpecialExpressionNode<'defn'> {
5
5
  f: SymbolNode;
6
6
  o: FunctionOverload[];
7
7
  }
8
- export interface DefnsNode extends CommonSpecialExpressionNode<'defns'> {
9
- f: AstNode;
10
- o: FunctionOverload[];
11
- }
12
8
  export interface FnNode extends CommonSpecialExpressionNode<'fn'> {
13
9
  p: AstNode[];
14
10
  o: FunctionOverload[];
15
11
  }
16
12
  export declare const defnSpecialExpression: BuiltinSpecialExpression<null, DefnNode>;
17
- export declare const defnsSpecialExpression: BuiltinSpecialExpression<null, DefnsNode>;
18
13
  export declare const fnSpecialExpression: BuiltinSpecialExpression<LitsFunction, FnNode>;
@@ -1,17 +1,18 @@
1
1
  import type { CondNode } from '../builtin/specialExpressions/cond';
2
- import type { DefNode } from '../builtin/specialExpressions/def';
3
- import type { DefnNode } from '../builtin/specialExpressions/functions';
4
2
  import type { IfNode } from '../builtin/specialExpressions/if';
3
+ import type { LetNode } from '../builtin/specialExpressions/let';
5
4
  import type { SwitchNode } from '../builtin/specialExpressions/switch';
6
5
  import type { UnlessNode } from '../builtin/specialExpressions/unless';
7
6
  import type { Arity, FunctionArguments } from '../builtin/utils';
8
- import type { A_SymbolToken } from '../tokenizer/algebraic/algebraicTokens';
7
+ import type { A_ReservedSymbolToken, A_SymbolToken } from '../tokenizer/algebraic/algebraicTokens';
9
8
  import type { TokenStream } from '../tokenizer/interface';
10
9
  import type { AstNode, ParseState } from './interface';
11
10
  export declare class AlgebraicParser {
12
11
  private readonly tokenStream;
13
12
  private parseState;
14
13
  constructor(tokenStream: TokenStream, parseState: ParseState);
14
+ private peek;
15
+ private peekAhead;
15
16
  private advance;
16
17
  parse(): AstNode[];
17
18
  private parseExpression;
@@ -36,9 +37,8 @@ export declare class AlgebraicParser {
36
37
  parseIfOrUnless(token: A_SymbolToken): IfNode | UnlessNode;
37
38
  parseCond(token: A_SymbolToken): CondNode;
38
39
  parseSwitch(token: A_SymbolToken): SwitchNode;
39
- parseDef(token: A_SymbolToken): DefNode;
40
- parseDefn(token: A_SymbolToken): DefnNode;
40
+ parseFunction(token: A_ReservedSymbolToken<'function'>): LetNode;
41
41
  private isAtEnd;
42
42
  private isAtExpressionEnd;
43
- private peek;
43
+ private parseExport;
44
44
  }
@@ -1,6 +1,7 @@
1
1
  import type { TokenStream } from '../tokenizer/interface';
2
- import type { NumberNode, ParseState, ReservedSymbolNode, StringNode, SymbolNode } from './interface';
2
+ import type { NormalExpressionNodeWithName, NumberNode, ParseState, ReservedSymbolNode, StringNode, SymbolNode } from './interface';
3
3
  export declare function parseSymbol(tokenStream: TokenStream, parseState: ParseState): SymbolNode;
4
4
  export declare function parseReservedSymbol(tokenStream: TokenStream, parseState: ParseState): ReservedSymbolNode;
5
5
  export declare function parseNumber(tokenStream: TokenStream, parseState: ParseState): NumberNode;
6
6
  export declare function parseString(tokenStream: TokenStream, parseState: ParseState): StringNode;
7
+ export declare function parseRegexpShorthand(tokenStream: TokenStream, parseState: ParseState): NormalExpressionNodeWithName;
@@ -39,16 +39,20 @@ declare const validAlgebraicReservedNamesRecord: {
39
39
  readonly value: null;
40
40
  readonly forbidden: false;
41
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
+ };
42
50
  };
43
51
  export declare const algebraicReservedNamesRecord: {
44
52
  readonly fn: {
45
53
  readonly value: null;
46
54
  readonly forbidden: true;
47
55
  };
48
- readonly defns: {
49
- readonly value: null;
50
- readonly forbidden: true;
51
- };
52
56
  readonly true: {
53
57
  readonly value: true;
54
58
  readonly forbidden: false;
@@ -89,6 +93,14 @@ export declare const algebraicReservedNamesRecord: {
89
93
  readonly value: null;
90
94
  readonly forbidden: false;
91
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
+ };
92
104
  };
93
105
  export type ValidAlgebraicReservedName = keyof typeof validAlgebraicReservedNamesRecord;
94
106
  export type AlgebraicReservedName = keyof typeof algebraicReservedNamesRecord;
@@ -8,4 +8,4 @@ export declare const tokenizeA_ReservedSymbolToken: Tokenizer<A_ReservedSymbolTo
8
8
  export declare const tokenizeA_Operator: Tokenizer<A_OperatorToken>;
9
9
  export declare const tokenizeA_MultiLineComment: Tokenizer<A_MultiLineCommentToken>;
10
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").PolishNotationToken>, Tokenizer<import("../common/commonTokens").AlgebraicNotationToken>, Tokenizer<import("../common/commonTokens").EndNotationToken>, Tokenizer<import("../common/commonTokens").LParenToken>, Tokenizer<import("../common/commonTokens").RParenToken>, Tokenizer<import("../common/commonTokens").LBracketToken>, Tokenizer<import("../common/commonTokens").RBracketToken>, Tokenizer<import("../common/commonTokens").LBraceToken>, Tokenizer<import("../common/commonTokens").RBraceToken>, Tokenizer<import("../common/commonTokens").StringToken>, Tokenizer<A_BasePrefixedNumberToken>, Tokenizer<A_NumberToken>, Tokenizer<A_OperatorToken>, Tokenizer<A_ReservedSymbolToken>, Tokenizer<A_SymbolToken>];
11
+ export declare const algebraicTokenizers: [Tokenizer<A_WhitespaceToken>, Tokenizer<A_MultiLineCommentToken>, Tokenizer<A_SingleLineCommentToken>, Tokenizer<import("../common/commonTokens").PolishNotationToken>, Tokenizer<import("../common/commonTokens").AlgebraicNotationToken>, Tokenizer<import("../common/commonTokens").EndNotationToken>, Tokenizer<import("../common/commonTokens").LParenToken>, Tokenizer<import("../common/commonTokens").RParenToken>, Tokenizer<import("../common/commonTokens").LBracketToken>, Tokenizer<import("../common/commonTokens").RBracketToken>, Tokenizer<import("../common/commonTokens").LBraceToken>, Tokenizer<import("../common/commonTokens").RBraceToken>, Tokenizer<import("../common/commonTokens").StringToken>, Tokenizer<import("../common/commonTokens").RegexpShorthandToken>, Tokenizer<A_BasePrefixedNumberToken>, Tokenizer<A_NumberToken>, Tokenizer<A_OperatorToken>, Tokenizer<A_ReservedSymbolToken>, Tokenizer<A_SymbolToken>];
@@ -4,8 +4,8 @@ import { type TokenDebugData } from '../utils';
4
4
  import type { ValidAlgebraicReservedName } from './algebraicReservedNames';
5
5
  export declare const algebraicSimpleTokenTypes: readonly ["LBrace", "LBracket", "LParen", "RBrace", "RBracket", "RParen", "AlgNotation", "PolNotation", "EndNotation"];
6
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", "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", "AlgNotation", "PolNotation", "EndNotation", "String", "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", "AlgNotation", "PolNotation", "EndNotation", "String", "RegexpShorthand", "A_Whitespace", "A_Operator", "A_Symbol", "A_ReservedSymbol", "A_SingleLineComment", "A_MultiLineComment", "A_Number", "A_BasePrefixedNumber"];
9
9
  declare const symbolicUnaryOperators: readonly ["!", "~", "+", "-"];
10
10
  declare const symbolicBinaryOperators: readonly ["**", "*", "/", "%", "+", "-", "<<", ">>", ">>>", "++", "<", "<=", ">", ">=", "==", "!=", "&", "^", "|", "&&", "||", "??"];
11
11
  declare const symbolicOperators: readonly ["!", "~", "+", "-", "**", "*", "/", "%", "+", "-", "<<", ">>", ">>>", "++", "<", "<=", ">", ">=", "==", "!=", "&", "^", "|", "&&", "||", "??", "=>", "...", ".", ",", "=", ";"];
@@ -1,8 +1,9 @@
1
1
  import type { TokenDescriptor, Tokenizer } from '../interface';
2
2
  import type { SimpleToken } from '../tokens';
3
- import type { AlgebraicNotationToken, EndNotationToken, LBraceToken, LBracketToken, LParenToken, PolishNotationToken, RBraceToken, RBracketToken, RParenToken, StringToken } from './commonTokens';
3
+ import type { AlgebraicNotationToken, EndNotationToken, LBraceToken, LBracketToken, LParenToken, PolishNotationToken, RBraceToken, RBracketToken, RParenToken, RegexpShorthandToken, StringToken } from './commonTokens';
4
4
  export declare const NO_MATCH: TokenDescriptor<never>;
5
5
  export declare function isNoMatch(tokenDescriptor: TokenDescriptor<any>): tokenDescriptor is TokenDescriptor<never>;
6
6
  export declare const tokenizeString: Tokenizer<StringToken>;
7
+ export declare const tokenizeRegexpShorthand: Tokenizer<RegexpShorthandToken>;
7
8
  export declare function tokenizeSimpleToken<T extends SimpleToken>(type: T[0], value: string, input: string, position: number): TokenDescriptor<T>;
8
- export declare const commonTokenizers: readonly [Tokenizer<PolishNotationToken>, Tokenizer<AlgebraicNotationToken>, Tokenizer<EndNotationToken>, Tokenizer<LParenToken>, Tokenizer<RParenToken>, Tokenizer<LBracketToken>, Tokenizer<RBracketToken>, Tokenizer<LBraceToken>, Tokenizer<RBraceToken>, Tokenizer<StringToken>];
9
+ export declare const commonTokenizers: readonly [Tokenizer<PolishNotationToken>, Tokenizer<AlgebraicNotationToken>, Tokenizer<EndNotationToken>, Tokenizer<LParenToken>, Tokenizer<RParenToken>, Tokenizer<LBracketToken>, Tokenizer<RBracketToken>, Tokenizer<LBraceToken>, Tokenizer<RBraceToken>, Tokenizer<StringToken>, Tokenizer<RegexpShorthandToken>];
@@ -1,7 +1,7 @@
1
1
  import { type TokenDebugData } from '../utils';
2
2
  import type { Token } from '../tokens';
3
3
  export declare const commonSimpleTokenTypes: readonly ["LBrace", "LBracket", "LParen", "RBrace", "RBracket", "RParen", "AlgNotation", "PolNotation", "EndNotation"];
4
- export declare const commomValueTokenTypes: readonly ["String"];
4
+ export declare const commomValueTokenTypes: readonly ["String", "RegexpShorthand"];
5
5
  export type CommonSimpleTokenType = typeof commonSimpleTokenTypes[number];
6
6
  export type CommonValueTokenType = typeof commomValueTokenTypes[number];
7
7
  type GenericCommonSimpleToken<T extends CommonSimpleTokenType> = [T] | [T, TokenDebugData];
@@ -16,8 +16,9 @@ export type AlgebraicNotationToken = GenericCommonSimpleToken<'AlgNotation'>;
16
16
  export type PolishNotationToken = GenericCommonSimpleToken<'PolNotation'>;
17
17
  export type EndNotationToken = GenericCommonSimpleToken<'EndNotation'>;
18
18
  export type StringToken = GenericCommonValueToken<'String'>;
19
+ export type RegexpShorthandToken = GenericCommonValueToken<'RegexpShorthand'>;
19
20
  export type CommonSimpleToken = LParenToken | RParenToken | LBracketToken | RBracketToken | LBraceToken | RBraceToken | AlgebraicNotationToken | PolishNotationToken | EndNotationToken;
20
- export type CommonValueToken = StringToken;
21
+ export type CommonValueToken = StringToken | RegexpShorthandToken;
21
22
  export declare function isLParenToken(token?: Token): token is LParenToken;
22
23
  export declare function assertLParenToken(token?: Token): asserts token is LParenToken;
23
24
  export declare function asLParenToken(token?: Token): LParenToken;
@@ -39,6 +40,9 @@ export declare function asRBraceToken(token?: Token): RBraceToken;
39
40
  export declare function isStringToken(token?: Token): token is StringToken;
40
41
  export declare function assertStringToken(token?: Token): asserts token is StringToken;
41
42
  export declare function asStringToken(token?: Token): StringToken;
43
+ export declare function isRegexpShorthandToken(token?: Token): token is RegexpShorthandToken;
44
+ export declare function assertRegexpShorthandToken(token?: Token): asserts token is RegexpShorthandToken;
45
+ export declare function asRegexpShorthandToken(token?: Token): RegexpShorthandToken;
42
46
  export declare function isAlgebraicNotationToken(token?: Token): token is AlgebraicNotationToken;
43
47
  export declare function assertAlgebraicNotationToken(token?: Token): asserts token is AlgebraicNotationToken;
44
48
  export declare function asAlgebraicNotationToken(token?: Token): AlgebraicNotationToken;
@@ -1,5 +1,5 @@
1
1
  import type { Tokenizer } from '../interface';
2
- import type { P_CollectionAccessorToken, P_CommentToken, P_FnShorthandToken, P_ModifierToken, P_NumberToken, P_RegexpShorthandToken, P_ReservedSymbolToken, P_StringShorthandToken, P_SymbolToken, P_WhitespaceToken } from './polishTokens';
2
+ import type { P_CollectionAccessorToken, P_CommentToken, P_FnShorthandToken, P_ModifierToken, P_NumberToken, P_ReservedSymbolToken, P_StringShorthandToken, P_SymbolToken, P_WhitespaceToken } from './polishTokens';
3
3
  export declare const tokenizeP_Comment: Tokenizer<P_CommentToken>;
4
4
  export declare const tokenizeP_Whitespace: Tokenizer<P_WhitespaceToken>;
5
5
  export declare const tokenizeP_Number: Tokenizer<P_NumberToken>;
@@ -10,5 +10,4 @@ export declare const tokenizeP_FnShorthand: Tokenizer<P_FnShorthandToken>;
10
10
  export declare const tokenizeP_ReservedSymbol: Tokenizer<P_ReservedSymbolToken>;
11
11
  export declare const tokenizeP_Modifier: Tokenizer<P_ModifierToken>;
12
12
  export declare const tokenizeP_CollectionAccessor: Tokenizer<P_CollectionAccessorToken>;
13
- export declare const tokenizeP_RegexpShorthand: Tokenizer<P_RegexpShorthandToken>;
14
- export declare const polishTokenizers: [Tokenizer<P_WhitespaceToken>, Tokenizer<P_CommentToken>, Tokenizer<import("../common/commonTokens").PolishNotationToken>, Tokenizer<import("../common/commonTokens").AlgebraicNotationToken>, Tokenizer<import("../common/commonTokens").EndNotationToken>, Tokenizer<import("../common/commonTokens").LParenToken>, Tokenizer<import("../common/commonTokens").RParenToken>, Tokenizer<import("../common/commonTokens").LBracketToken>, Tokenizer<import("../common/commonTokens").RBracketToken>, Tokenizer<import("../common/commonTokens").LBraceToken>, Tokenizer<import("../common/commonTokens").RBraceToken>, Tokenizer<import("../common/commonTokens").StringToken>, Tokenizer<P_StringShorthandToken>, Tokenizer<P_NumberToken>, Tokenizer<P_ReservedSymbolToken>, Tokenizer<P_ModifierToken>, Tokenizer<P_SymbolToken>, Tokenizer<P_RegexpShorthandToken>, Tokenizer<P_FnShorthandToken>, Tokenizer<P_CollectionAccessorToken>];
13
+ export declare const polishTokenizers: [Tokenizer<P_WhitespaceToken>, Tokenizer<P_CommentToken>, Tokenizer<import("../common/commonTokens").PolishNotationToken>, Tokenizer<import("../common/commonTokens").AlgebraicNotationToken>, Tokenizer<import("../common/commonTokens").EndNotationToken>, Tokenizer<import("../common/commonTokens").LParenToken>, Tokenizer<import("../common/commonTokens").RParenToken>, Tokenizer<import("../common/commonTokens").LBracketToken>, Tokenizer<import("../common/commonTokens").RBracketToken>, Tokenizer<import("../common/commonTokens").LBraceToken>, Tokenizer<import("../common/commonTokens").RBraceToken>, Tokenizer<import("../common/commonTokens").StringToken>, Tokenizer<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>];
@@ -5,9 +5,9 @@ export declare const modifierNames: readonly ["&rest", "&let", "&when", "&while"
5
5
  export type ModifierName = typeof modifierNames[number];
6
6
  export declare const polishOnlySimpleTokenTypes: ["P_FnShorthand"];
7
7
  export declare const polishSimpleTokenTypes: readonly ["LBrace", "LBracket", "LParen", "RBrace", "RBracket", "RParen", "AlgNotation", "PolNotation", "EndNotation", "P_FnShorthand"];
8
- export declare const polishOnlyValueTokenTypes: ["P_Modifier", "P_StringShorthand", "P_Symbol", "P_ReservedSymbol", "P_RegexpShorthand", "P_CollectionAccessor", "P_Comment", "P_Whitespace", "P_Number"];
9
- export declare const polishValueTokenTypes: readonly ["String", "P_Modifier", "P_StringShorthand", "P_Symbol", "P_ReservedSymbol", "P_RegexpShorthand", "P_CollectionAccessor", "P_Comment", "P_Whitespace", "P_Number"];
10
- export declare const polishTokenTypes: readonly ["LBrace", "LBracket", "LParen", "RBrace", "RBracket", "RParen", "AlgNotation", "PolNotation", "EndNotation", "P_FnShorthand", "String", "P_Modifier", "P_StringShorthand", "P_Symbol", "P_ReservedSymbol", "P_RegexpShorthand", "P_CollectionAccessor", "P_Comment", "P_Whitespace", "P_Number"];
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", "AlgNotation", "PolNotation", "EndNotation", "P_FnShorthand", "String", "RegexpShorthand", "P_Modifier", "P_StringShorthand", "P_Symbol", "P_ReservedSymbol", "P_CollectionAccessor", "P_Comment", "P_Whitespace", "P_Number"];
11
11
  export type PolishSimpleTokenType = typeof polishSimpleTokenTypes[number];
12
12
  export type PolishValueTokenType = typeof polishValueTokenTypes[number];
13
13
  export type PolishTokenType = typeof polishTokenTypes[number];
@@ -18,13 +18,12 @@ export type P_ModifierToken = GenericPolishValueToken<'P_Modifier', ModifierName
18
18
  export type P_StringShorthandToken = GenericPolishValueToken<'P_StringShorthand'>;
19
19
  export type P_SymbolToken = GenericPolishValueToken<'P_Symbol'>;
20
20
  export type P_ReservedSymbolToken = GenericPolishValueToken<'P_ReservedSymbol'>;
21
- export type P_RegexpShorthandToken = GenericPolishValueToken<'P_RegexpShorthand'>;
22
21
  export type P_CollectionAccessorToken = GenericPolishValueToken<'P_CollectionAccessor', '.' | '#'>;
23
22
  export type P_CommentToken = GenericPolishValueToken<'P_Comment'>;
24
23
  export type P_WhitespaceToken = GenericPolishValueToken<'P_Whitespace'>;
25
24
  export type P_NumberToken = GenericPolishValueToken<'P_Number'>;
26
25
  export type PolishOnlySimpleToken = P_FnShorthandToken;
27
- export type PolishOnlyValueToken = P_ModifierToken | P_StringShorthandToken | P_SymbolToken | P_ReservedSymbolToken | P_RegexpShorthandToken | P_CollectionAccessorToken | P_CommentToken | P_WhitespaceToken | P_NumberToken;
26
+ export type PolishOnlyValueToken = P_ModifierToken | P_StringShorthandToken | P_SymbolToken | P_ReservedSymbolToken | P_CollectionAccessorToken | P_CommentToken | P_WhitespaceToken | P_NumberToken;
28
27
  export type PolishToken = PolishOnlySimpleToken | PolishOnlyValueToken | CommonSimpleToken | CommonValueToken;
29
28
  export declare function isP_StringShorthandToken(token?: Token): token is P_StringShorthandToken;
30
29
  export declare function assertP_StringShorthandToken(token?: Token): asserts token is P_StringShorthandToken;
@@ -38,9 +37,6 @@ export declare function asP_ReservedSymbolToken(token?: Token): P_ReservedSymbol
38
37
  export declare function isP_ModifierToken(token?: Token): token is P_ModifierToken;
39
38
  export declare function assertP_ModifierToken(token?: Token): asserts token is P_ModifierToken;
40
39
  export declare function asP_ModifierToken(token?: Token): P_ModifierToken;
41
- export declare function isP_RegexpShorthandToken(token?: Token): token is P_RegexpShorthandToken;
42
- export declare function assertP_RegexpShorthandToken(token?: Token): asserts token is P_RegexpShorthandToken;
43
- export declare function asP_RegexpShorthandToken(token?: Token): P_RegexpShorthandToken;
44
40
  export declare function isP_FnShorthandToken(token?: Token): token is P_FnShorthandToken;
45
41
  export declare function assertP_FnShorthandToken(token?: Token): asserts token is P_FnShorthandToken;
46
42
  export declare function asP_FnShorthandToken(token?: Token): P_FnShorthandToken;
@@ -2,8 +2,8 @@ import type { CommonSimpleToken, CommonValueToken } from './common/commonTokens'
2
2
  import type { AlgebraicOnlyValueToken } from './algebraic/algebraicTokens';
3
3
  import type { PolishOnlySimpleToken, PolishOnlyValueToken } from './polish/polishTokens';
4
4
  export declare const simpleTokenTypes: readonly ["LBrace", "LBracket", "LParen", "RBrace", "RBracket", "RParen", "AlgNotation", "PolNotation", "EndNotation", "P_FnShorthand"];
5
- export declare const valueTokenTypes: readonly ["String", "A_Whitespace", "A_Operator", "A_Symbol", "A_ReservedSymbol", "A_SingleLineComment", "A_MultiLineComment", "A_Number", "A_BasePrefixedNumber", "P_Modifier", "P_StringShorthand", "P_Symbol", "P_ReservedSymbol", "P_RegexpShorthand", "P_CollectionAccessor", "P_Comment", "P_Whitespace", "P_Number"];
6
- export declare const tokenTypes: readonly ["LBrace", "LBracket", "LParen", "RBrace", "RBracket", "RParen", "AlgNotation", "PolNotation", "EndNotation", "P_FnShorthand", "String", "A_Whitespace", "A_Operator", "A_Symbol", "A_ReservedSymbol", "A_SingleLineComment", "A_MultiLineComment", "A_Number", "A_BasePrefixedNumber", "P_Modifier", "P_StringShorthand", "P_Symbol", "P_ReservedSymbol", "P_RegexpShorthand", "P_CollectionAccessor", "P_Comment", "P_Whitespace", "P_Number"];
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", "AlgNotation", "PolNotation", "EndNotation", "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
7
  export type TokenType = typeof tokenTypes[number];
8
8
  export type SimpleToken = CommonSimpleToken | PolishOnlySimpleToken;
9
9
  export type ValueToken = CommonValueToken | AlgebraicOnlyValueToken | PolishOnlyValueToken;