extra-parser 0.3.0 → 0.4.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/README.md
CHANGED
|
@@ -8,13 +8,13 @@ yarn add extra-parser
|
|
|
8
8
|
|
|
9
9
|
## API
|
|
10
10
|
```ts
|
|
11
|
-
interface IToken<
|
|
12
|
-
|
|
11
|
+
interface IToken<TokenType extends string> {
|
|
12
|
+
tokenType: TokenType
|
|
13
13
|
value: string
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
interface INode<
|
|
17
|
-
|
|
16
|
+
interface INode<NodeType extends string> {
|
|
17
|
+
nodeType: NodeType
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
interface ITokenPatternMatch<Token extends IToken<string>> {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { IToken, ITokenPattern } from './types';
|
|
2
2
|
export declare function createTokenPatternFromRegExp<TokenType extends string>(tokenType: TokenType, regExp: RegExp): ITokenPattern<IToken<TokenType>>;
|
|
3
|
-
export declare function createTokenPatternFromRegExp<Token extends IToken<string>>(tokenType: Token['
|
|
3
|
+
export declare function createTokenPatternFromRegExp<Token extends IToken<string>>(tokenType: Token['tokenType'], regExp: RegExp): ITokenPattern<IToken<Token['tokenType']>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-token-pattern-from-regexp.js","sourceRoot":"","sources":["../src/create-token-pattern-from-regexp.ts"],"names":[],"mappings":";;;AACA,6CAA4C;AAW5C,SAAgB,4BAA4B,CAC1C,SAAiB,EACjB,MAAc;IAEd,MAAM,gBAAgB,GAAG,yBAAyB,CAAC,MAAM,CAAC,CAAA;IAE1D,OAAO,CAAC,IAAY,EAA8C,EAAE;QAClE,MAAM,MAAM,GAAG,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAC1C,IAAI,IAAA,gBAAQ,EAAC,MAAM,CAAC,EAAE;YACpB,MAAM,CAAC,WAAW,CAAC,GAAG,MAAM,CAAA;YAC5B,OAAO;gBACL,QAAQ,EAAE,WAAW,CAAC,MAAM;gBAC5B,KAAK,EAAE;oBACL,
|
|
1
|
+
{"version":3,"file":"create-token-pattern-from-regexp.js","sourceRoot":"","sources":["../src/create-token-pattern-from-regexp.ts"],"names":[],"mappings":";;;AACA,6CAA4C;AAW5C,SAAgB,4BAA4B,CAC1C,SAAiB,EACjB,MAAc;IAEd,MAAM,gBAAgB,GAAG,yBAAyB,CAAC,MAAM,CAAC,CAAA;IAE1D,OAAO,CAAC,IAAY,EAA8C,EAAE;QAClE,MAAM,MAAM,GAAG,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAC1C,IAAI,IAAA,gBAAQ,EAAC,MAAM,CAAC,EAAE;YACpB,MAAM,CAAC,WAAW,CAAC,GAAG,MAAM,CAAA;YAC5B,OAAO;gBACL,QAAQ,EAAE,WAAW,CAAC,MAAM;gBAC5B,KAAK,EAAE;oBACL,SAAS,EAAE,SAAS;oBACpB,KAAK,EAAE,WAAW;iBACnB;aACF,CAAA;SACF;aAAM;YACL,OAAO,KAAK,CAAA;SACb;IACH,CAAC,CAAA;AACH,CAAC;AArBD,oEAqBC;AAED,SAAS,yBAAyB,CAAC,EAAU;IAC3C,OAAO,IAAI,MAAM,CACf,EAAE,CAAC,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,MAAM,EAAE,EACvD,EAAE,CAAC,KAAK,CACT,CAAA;AACH,CAAC"}
|
package/lib/types.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Falsy, Awaitable } from '@blackglory/prelude';
|
|
2
|
-
export interface IToken<
|
|
3
|
-
|
|
2
|
+
export interface IToken<TokenType extends string> {
|
|
3
|
+
tokenType: TokenType;
|
|
4
4
|
value: string;
|
|
5
5
|
}
|
|
6
|
-
export interface INode<
|
|
7
|
-
|
|
6
|
+
export interface INode<NodeType extends string> {
|
|
7
|
+
nodeType: NodeType;
|
|
8
8
|
}
|
|
9
9
|
export interface ITokenPatternMatch<Token extends IToken<string>> {
|
|
10
10
|
consumed: number;
|