astn 0.110.10 → 0.110.12
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/bin/validate_astn.js +18 -8
- package/dist/generated/generic/resolve.d.ts +90 -0
- package/dist/generated/generic/resolve.js +259 -0
- package/dist/generated/implementation/schemas/ast/migration_boilerplate.d.ts +13 -0
- package/dist/generated/implementation/schemas/ast/migration_boilerplate.js +174 -0
- package/dist/generated/implementation/schemas/ide/migration_boilerplate.d.ts +2 -0
- package/dist/generated/implementation/schemas/ide/migration_boilerplate.js +56 -0
- package/dist/generated/implementation/schemas/parse_result/migration_boilerplate.d.ts +6 -0
- package/dist/generated/implementation/schemas/parse_result/migration_boilerplate.js +136 -0
- package/dist/generated/implementation/schemas/target/migration_boilerplate.d.ts +3 -0
- package/dist/generated/implementation/schemas/target/migration_boilerplate.js +73 -0
- package/dist/generated/interface/core/poormans_parser.d.ts +184 -0
- package/dist/generated/interface/core/poormans_parser.js +3 -0
- package/dist/generated/interface/core/resolved.d.ts +100 -0
- package/dist/generated/interface/core/resolved.js +3 -0
- package/dist/generated/interface/core/unresolved.d.ts +35 -0
- package/dist/generated/interface/core/unresolved.js +3 -0
- package/dist/generated/interface/schemas/ast/migration_boilerplate.d.ts +266 -0
- package/dist/generated/interface/schemas/ast/migration_boilerplate.js +3 -0
- package/dist/generated/interface/schemas/ast/poormans_parser.d.ts +1087 -0
- package/dist/generated/interface/schemas/ast/poormans_parser.js +3 -0
- package/dist/generated/interface/schemas/ast/resolved.d.ts +1087 -0
- package/dist/generated/interface/schemas/ast/resolved.js +3 -0
- package/dist/generated/interface/schemas/ast/unresolved.d.ts +1087 -0
- package/dist/generated/interface/schemas/ast/unresolved.js +3 -0
- package/dist/generated/interface/schemas/ide/migration_boilerplate.d.ts +24 -0
- package/dist/generated/interface/schemas/ide/migration_boilerplate.js +3 -0
- package/dist/generated/interface/schemas/ide/poormans_parser.d.ts +161 -0
- package/dist/generated/interface/schemas/ide/poormans_parser.js +3 -0
- package/dist/generated/interface/schemas/ide/resolved.d.ts +161 -0
- package/dist/generated/interface/schemas/ide/resolved.js +3 -0
- package/dist/generated/interface/schemas/ide/unresolved.d.ts +161 -0
- package/dist/generated/interface/schemas/ide/unresolved.js +3 -0
- package/dist/generated/interface/schemas/parse_result/migration_boilerplate.d.ts +112 -0
- package/dist/generated/interface/schemas/parse_result/migration_boilerplate.js +3 -0
- package/dist/generated/interface/schemas/parse_result/poormans_parser.d.ts +416 -0
- package/dist/generated/interface/schemas/parse_result/poormans_parser.js +3 -0
- package/dist/generated/interface/schemas/parse_result/resolved.d.ts +416 -0
- package/dist/generated/interface/schemas/parse_result/resolved.js +3 -0
- package/dist/generated/interface/schemas/parse_result/unresolved.d.ts +416 -0
- package/dist/generated/interface/schemas/parse_result/unresolved.js +3 -0
- package/dist/generated/interface/schemas/target/migration_boilerplate.d.ts +46 -0
- package/dist/generated/interface/schemas/target/migration_boilerplate.js +3 -0
- package/dist/generated/interface/schemas/target/poormans_parser.d.ts +186 -0
- package/dist/generated/interface/schemas/target/poormans_parser.js +3 -0
- package/dist/generated/interface/schemas/target/resolved.d.ts +186 -0
- package/dist/generated/interface/schemas/target/resolved.js +3 -0
- package/dist/generated/interface/schemas/target/unresolved.d.ts +186 -0
- package/dist/generated/interface/schemas/target/unresolved.js +3 -0
- package/dist/index.d.ts +3 -4
- package/dist/index.js +22 -13
- package/dist/lib/transformations/create_error_message.d.ts +2 -2
- package/dist/lib/transformations/create_error_message.js +33 -9
- package/dist/lib/transformations/format.d.ts +2 -2
- package/dist/lib/transformations/format.js +18 -14
- package/dist/lib/transformations/parse.d.ts +4 -4
- package/dist/lib/transformations/parse.js +36 -26
- package/dist/lib/transformations/parse_generic.d.ts +8 -9
- package/dist/lib/transformations/parse_generic.js +18 -8
- package/package.json +4 -2
- package/dist/create_error_message.d.ts +0 -3
- package/dist/create_error_message.js +0 -66
- package/dist/format.d.ts +0 -65
- package/dist/format.js +0 -179
- package/dist/lib/create_error_message.d.ts +0 -5
- package/dist/lib/create_error_message.js +0 -75
- package/dist/lib/format.d.ts +0 -42
- package/dist/lib/format.js +0 -172
- package/dist/lib/index.d.ts +0 -4
- package/dist/lib/index.js +0 -34
- package/dist/lib/parse.d.ts +0 -64
- package/dist/lib/parse.js +0 -865
- package/dist/lib/types/ast.d.ts +0 -121
- package/dist/lib/types/ast.js +0 -3
- package/dist/lib/types/ide.d.ts +0 -21
- package/dist/lib/types/ide.js +0 -3
- package/dist/lib/types/parse_result.d.ts +0 -30
- package/dist/lib/types/parse_result.js +0 -3
- package/dist/lib/types/tokenize_result.d.ts +0 -14
- package/dist/lib/types/tokenize_result.js +0 -3
- package/dist/lib/types.d.ts +0 -123
- package/dist/lib/types.js +0 -3
- package/dist/parse.d.ts +0 -88
- package/dist/parse.js +0 -851
- package/dist/types.d.ts +0 -127
- package/dist/types.js +0 -3
- package/dist/validate_astn.d.ts +0 -1
- package/dist/validate_astn.js +0 -45
package/dist/lib/types/ast.d.ts
DELETED
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
import * as _et from 'exupery-core-types';
|
|
2
|
-
export type Location = {
|
|
3
|
-
readonly 'relative': Relative_Location;
|
|
4
|
-
readonly 'absolute': number;
|
|
5
|
-
};
|
|
6
|
-
export type Range = {
|
|
7
|
-
readonly 'start': Location;
|
|
8
|
-
readonly 'end': Location;
|
|
9
|
-
};
|
|
10
|
-
export type Relative_Location = {
|
|
11
|
-
readonly 'line': number;
|
|
12
|
-
readonly 'column': number;
|
|
13
|
-
};
|
|
14
|
-
export type Document = {
|
|
15
|
-
'header': _et.Optional_Value<{
|
|
16
|
-
'!': Structural_Token;
|
|
17
|
-
'value': Value;
|
|
18
|
-
}>;
|
|
19
|
-
'content': Value;
|
|
20
|
-
};
|
|
21
|
-
export type Value = {
|
|
22
|
-
'range': Range;
|
|
23
|
-
'type': Value_Type;
|
|
24
|
-
};
|
|
25
|
-
export type Value_Type = ['string', String] | [
|
|
26
|
-
'indexed collection',
|
|
27
|
-
[
|
|
28
|
-
'dictionary',
|
|
29
|
-
{
|
|
30
|
-
'{': Structural_Token;
|
|
31
|
-
'entries': Key_Value_Pairs;
|
|
32
|
-
'}': Structural_Token;
|
|
33
|
-
}
|
|
34
|
-
] | [
|
|
35
|
-
'verbose group',
|
|
36
|
-
{
|
|
37
|
-
'(': Structural_Token;
|
|
38
|
-
'entries': Key_Value_Pairs;
|
|
39
|
-
')': Structural_Token;
|
|
40
|
-
}
|
|
41
|
-
]
|
|
42
|
-
] | [
|
|
43
|
-
'ordered collection',
|
|
44
|
-
[
|
|
45
|
-
'list',
|
|
46
|
-
{
|
|
47
|
-
'[': Structural_Token;
|
|
48
|
-
'elements': Elements;
|
|
49
|
-
']': Structural_Token;
|
|
50
|
-
}
|
|
51
|
-
] | [
|
|
52
|
-
'concise group',
|
|
53
|
-
{
|
|
54
|
-
'<': Structural_Token;
|
|
55
|
-
'elements': Elements;
|
|
56
|
-
'>': Structural_Token;
|
|
57
|
-
}
|
|
58
|
-
]
|
|
59
|
-
] | [
|
|
60
|
-
'include',
|
|
61
|
-
{
|
|
62
|
-
'@': Structural_Token;
|
|
63
|
-
'path': String;
|
|
64
|
-
}
|
|
65
|
-
] | [
|
|
66
|
-
'tagged value',
|
|
67
|
-
{
|
|
68
|
-
'|': Structural_Token;
|
|
69
|
-
'state': String;
|
|
70
|
-
'value': Value;
|
|
71
|
-
}
|
|
72
|
-
] | [
|
|
73
|
-
'not set',
|
|
74
|
-
{
|
|
75
|
-
'~': Structural_Token;
|
|
76
|
-
}
|
|
77
|
-
] | [
|
|
78
|
-
'set optional value',
|
|
79
|
-
{
|
|
80
|
-
'*': Structural_Token;
|
|
81
|
-
'value': Value;
|
|
82
|
-
}
|
|
83
|
-
];
|
|
84
|
-
export type String = {
|
|
85
|
-
readonly 'trailing trivia': Trivia;
|
|
86
|
-
readonly 'range': Range;
|
|
87
|
-
readonly 'value': string;
|
|
88
|
-
readonly 'type': String_Type;
|
|
89
|
-
};
|
|
90
|
-
export type String_Type = ['quoted', null] | ['apostrophed', null] | ['undelimited', null] | ['backticked', null];
|
|
91
|
-
export type Key_Value_Pairs = _et.Array<Key_Value_Pair>;
|
|
92
|
-
export type Element = {
|
|
93
|
-
'value': Value;
|
|
94
|
-
',': _et.Optional_Value<Structural_Token>;
|
|
95
|
-
};
|
|
96
|
-
export type Elements = _et.Array<Element>;
|
|
97
|
-
export type Key_Value_Pair = {
|
|
98
|
-
'key': String;
|
|
99
|
-
'value': _et.Optional_Value<{
|
|
100
|
-
':': Structural_Token;
|
|
101
|
-
'value': Value;
|
|
102
|
-
}>;
|
|
103
|
-
',': _et.Optional_Value<Structural_Token>;
|
|
104
|
-
};
|
|
105
|
-
export type Structural_Token = {
|
|
106
|
-
readonly 'trailing trivia': Trivia;
|
|
107
|
-
readonly 'range': Range;
|
|
108
|
-
};
|
|
109
|
-
export type Whitespace = {
|
|
110
|
-
'range': Range;
|
|
111
|
-
'value': string;
|
|
112
|
-
};
|
|
113
|
-
export type Trivia = {
|
|
114
|
-
'leading whitespace': Whitespace;
|
|
115
|
-
'comments': _et.Array<{
|
|
116
|
-
'type': ['line', null] | ['block', null];
|
|
117
|
-
'content': string;
|
|
118
|
-
'range': Range;
|
|
119
|
-
'trailing whitespace': Whitespace;
|
|
120
|
-
}>;
|
|
121
|
-
};
|
package/dist/lib/types/ast.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXN0LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2xpYi90eXBlcy9hc3QudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiJ9
|
package/dist/lib/types/ide.d.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import * as _et from 'exupery-core-types';
|
|
2
|
-
import * as ast from "./ast";
|
|
3
|
-
export type Text_Edit = [
|
|
4
|
-
'insert',
|
|
5
|
-
{
|
|
6
|
-
'location': ast.Relative_Location;
|
|
7
|
-
'text': string;
|
|
8
|
-
}
|
|
9
|
-
] | [
|
|
10
|
-
'replace',
|
|
11
|
-
{
|
|
12
|
-
'range': ast.Range;
|
|
13
|
-
'text': string;
|
|
14
|
-
}
|
|
15
|
-
] | [
|
|
16
|
-
'delete',
|
|
17
|
-
{
|
|
18
|
-
'range': ast.Range;
|
|
19
|
-
}
|
|
20
|
-
];
|
|
21
|
-
export type Text_Edits = _et.Array<Text_Edit>;
|
package/dist/lib/types/ide.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaWRlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2xpYi90eXBlcy9pZGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiJ9
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import * as _et from 'exupery-core-types';
|
|
2
|
-
import * as ast from "./ast";
|
|
3
|
-
export type Token_Type = readonly ['{', null] | readonly ['}', null] | readonly ['[', null] | readonly [']', null] | readonly ['(', null] | readonly [')', null] | readonly ['<', null] | readonly ['>', null] | readonly ['!', null] | readonly ['@', null] | readonly ['~', null] | readonly ['*', null] | readonly [',', null] | readonly [':', null] | readonly ['|', null] | readonly [
|
|
4
|
-
'string',
|
|
5
|
-
{
|
|
6
|
-
'value': string;
|
|
7
|
-
'type': ast.String_Type;
|
|
8
|
-
}
|
|
9
|
-
];
|
|
10
|
-
export type Parse_Error_Type = [
|
|
11
|
-
'lexer',
|
|
12
|
-
['unexpected control character', number] | ['missing character after escape', null] | ['unexpected end of line in delimited string', null] | ['unexpected character', number] | ['unterminated string', null] | ['unterminated block comment', null] | ['unterminated unicode escape sequence', null] | ['invalid unicode escape sequence', null] | ['unknown escape character', null] | ['unexpected end of input', null] | ['dangling slash', null]
|
|
13
|
-
] | [
|
|
14
|
-
'parser',
|
|
15
|
-
{
|
|
16
|
-
'expected': _et.Array<Expected>;
|
|
17
|
-
'cause': ['missing token', null] | [
|
|
18
|
-
'unexpected token',
|
|
19
|
-
{
|
|
20
|
-
'found': Token_Type;
|
|
21
|
-
}
|
|
22
|
-
];
|
|
23
|
-
}
|
|
24
|
-
];
|
|
25
|
-
export type Expected = 'a string' | 'a value' | '!' | '>' | '}' | '@' | ',' | ':' | ')' | ']';
|
|
26
|
-
export type Parse_Error = {
|
|
27
|
-
'type': Parse_Error_Type;
|
|
28
|
-
'range': ast.Range;
|
|
29
|
-
};
|
|
30
|
-
export type Parse_Result = ['failure', Parse_Error] | ['success', ast.Document];
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGFyc2VfcmVzdWx0LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2xpYi90eXBlcy9wYXJzZV9yZXN1bHQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiJ9
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import * as _et from 'exupery-core-types';
|
|
2
|
-
import * as ast from "./ast";
|
|
3
|
-
import * as parse_result from "./parse_result";
|
|
4
|
-
export type Annotated_Token = {
|
|
5
|
-
readonly 'start': ast.Location;
|
|
6
|
-
readonly 'type': parse_result.Token_Type;
|
|
7
|
-
readonly 'end': ast.Location;
|
|
8
|
-
readonly 'trailing trivia': ast.Trivia;
|
|
9
|
-
};
|
|
10
|
-
export type Tokenizer_Result = {
|
|
11
|
-
readonly 'leading trivia': ast.Trivia;
|
|
12
|
-
readonly 'tokens': _et.Array<Annotated_Token>;
|
|
13
|
-
readonly 'end': ast.Location;
|
|
14
|
-
};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidG9rZW5pemVfcmVzdWx0LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2xpYi90eXBlcy90b2tlbml6ZV9yZXN1bHQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiJ9
|
package/dist/lib/types.d.ts
DELETED
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
import * as _et from 'exupery-core-types';
|
|
2
|
-
export type Location = {
|
|
3
|
-
readonly 'relative': Relative_Location;
|
|
4
|
-
readonly 'absolute': number;
|
|
5
|
-
};
|
|
6
|
-
export type Range = {
|
|
7
|
-
readonly 'start': Location;
|
|
8
|
-
readonly 'end': Location;
|
|
9
|
-
};
|
|
10
|
-
export type Relative_Location = {
|
|
11
|
-
readonly 'line': number;
|
|
12
|
-
readonly 'column': number;
|
|
13
|
-
};
|
|
14
|
-
export type Document = {
|
|
15
|
-
'header': _et.Optional_Value<{
|
|
16
|
-
'!': Structural_Token;
|
|
17
|
-
'value': Value;
|
|
18
|
-
}>;
|
|
19
|
-
'content': Value;
|
|
20
|
-
};
|
|
21
|
-
export type Value = {
|
|
22
|
-
'start': Location;
|
|
23
|
-
'end': Location;
|
|
24
|
-
'type': Value_Type;
|
|
25
|
-
};
|
|
26
|
-
export type Value_Type = ['string', StringX] | [
|
|
27
|
-
'indexed collection',
|
|
28
|
-
[
|
|
29
|
-
'dictionary',
|
|
30
|
-
{
|
|
31
|
-
'{': Structural_Token;
|
|
32
|
-
'entries': Key_Value_Pairs;
|
|
33
|
-
'}': Structural_Token;
|
|
34
|
-
}
|
|
35
|
-
] | [
|
|
36
|
-
'verbose group',
|
|
37
|
-
{
|
|
38
|
-
'(': Structural_Token;
|
|
39
|
-
'entries': Key_Value_Pairs;
|
|
40
|
-
')': Structural_Token;
|
|
41
|
-
}
|
|
42
|
-
]
|
|
43
|
-
] | [
|
|
44
|
-
'ordered collection',
|
|
45
|
-
[
|
|
46
|
-
'list',
|
|
47
|
-
{
|
|
48
|
-
'[': Structural_Token;
|
|
49
|
-
'elements': Elements;
|
|
50
|
-
']': Structural_Token;
|
|
51
|
-
}
|
|
52
|
-
] | [
|
|
53
|
-
'concise group',
|
|
54
|
-
{
|
|
55
|
-
'<': Structural_Token;
|
|
56
|
-
'elements': Elements;
|
|
57
|
-
'>': Structural_Token;
|
|
58
|
-
}
|
|
59
|
-
]
|
|
60
|
-
] | [
|
|
61
|
-
'include',
|
|
62
|
-
{
|
|
63
|
-
'@': Structural_Token;
|
|
64
|
-
'path': StringX;
|
|
65
|
-
}
|
|
66
|
-
] | [
|
|
67
|
-
'tagged value',
|
|
68
|
-
{
|
|
69
|
-
'|': Structural_Token;
|
|
70
|
-
'state': StringX;
|
|
71
|
-
'value': Value;
|
|
72
|
-
}
|
|
73
|
-
] | [
|
|
74
|
-
'not set',
|
|
75
|
-
{
|
|
76
|
-
'~': Structural_Token;
|
|
77
|
-
}
|
|
78
|
-
] | [
|
|
79
|
-
'set optional value',
|
|
80
|
-
{
|
|
81
|
-
'*': Structural_Token;
|
|
82
|
-
'value': Value;
|
|
83
|
-
}
|
|
84
|
-
];
|
|
85
|
-
export type StringX = {
|
|
86
|
-
readonly 'trailing trivia': Trivia;
|
|
87
|
-
readonly 'start': Location;
|
|
88
|
-
readonly 'value': string;
|
|
89
|
-
readonly 'type': String_Type;
|
|
90
|
-
readonly 'end': Location;
|
|
91
|
-
};
|
|
92
|
-
export type String_Type = ['quoted', null] | ['apostrophed', null] | ['undelimited', null] | ['backticked', null];
|
|
93
|
-
export type Key_Value_Pairs = _et.Array<Key_Value_Pair>;
|
|
94
|
-
export type Element = {
|
|
95
|
-
'value': Value;
|
|
96
|
-
',': _et.Optional_Value<Structural_Token>;
|
|
97
|
-
};
|
|
98
|
-
export type Elements = _et.Array<Element>;
|
|
99
|
-
export type Key_Value_Pair = {
|
|
100
|
-
'key': StringX;
|
|
101
|
-
'value': _et.Optional_Value<{
|
|
102
|
-
':': Structural_Token;
|
|
103
|
-
'value': Value;
|
|
104
|
-
}>;
|
|
105
|
-
',': _et.Optional_Value<Structural_Token>;
|
|
106
|
-
};
|
|
107
|
-
export type Structural_Token = {
|
|
108
|
-
readonly 'trailing trivia': Trivia;
|
|
109
|
-
readonly 'range': Range;
|
|
110
|
-
};
|
|
111
|
-
export type Whitespace = {
|
|
112
|
-
'range': Range;
|
|
113
|
-
'value': string;
|
|
114
|
-
};
|
|
115
|
-
export type Trivia = {
|
|
116
|
-
'leading whitespace': Whitespace;
|
|
117
|
-
'comments': _et.Array<{
|
|
118
|
-
'type': ['line', null] | ['block', null];
|
|
119
|
-
'content': string;
|
|
120
|
-
'range': Range;
|
|
121
|
-
'trailing whitespace': Whitespace;
|
|
122
|
-
}>;
|
|
123
|
-
};
|
package/dist/lib/types.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHlwZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvbGliL3R5cGVzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiIifQ==
|
package/dist/parse.d.ts
DELETED
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import * as _et from 'exupery-core-types';
|
|
2
|
-
import * as types from "./types";
|
|
3
|
-
export type Parse_Error_Type = [
|
|
4
|
-
'lexer',
|
|
5
|
-
['unexpected control character', number] | ['missing character after escape', null] | ['unexpected end of line in delimited string', null] | ['unexpected character', number] | ['unterminated string', null] | ['unterminated block comment', null] | ['unterminated unicode escape sequence', null] | ['invalid unicode escape sequence', null] | ['unknown escape character', null] | ['unexpected end of input', null] | ['dangling slash', null]
|
|
6
|
-
] | [
|
|
7
|
-
'parser',
|
|
8
|
-
['unexpected end of input', null] | [
|
|
9
|
-
'unexpected token',
|
|
10
|
-
{
|
|
11
|
-
'found': Lexer.Token_Type;
|
|
12
|
-
'expected': _et.Array<string>;
|
|
13
|
-
}
|
|
14
|
-
]
|
|
15
|
-
];
|
|
16
|
-
export type Parse_Error = {
|
|
17
|
-
'type': Parse_Error_Type;
|
|
18
|
-
'range': types.Range;
|
|
19
|
-
};
|
|
20
|
-
export declare namespace Lexer {
|
|
21
|
-
type Annotated_Token = {
|
|
22
|
-
readonly 'start': types.Location;
|
|
23
|
-
readonly 'type': Token_Type;
|
|
24
|
-
readonly 'end': types.Location;
|
|
25
|
-
readonly 'trailing trivia': types.Trivia;
|
|
26
|
-
};
|
|
27
|
-
type Token_Type = readonly ['{', null] | readonly ['}', null] | readonly ['[', null] | readonly [']', null] | readonly ['(', null] | readonly [')', null] | readonly ['<', null] | readonly ['>', null] | readonly ['!', null] | readonly ['@', null] | readonly ['~', null] | readonly ['*', null] | readonly [',', null] | readonly [':', null] | readonly ['|', null] | readonly [
|
|
28
|
-
'string',
|
|
29
|
-
{
|
|
30
|
-
'value': string;
|
|
31
|
-
'type': types.String_Type;
|
|
32
|
-
}
|
|
33
|
-
];
|
|
34
|
-
type Tokenizer_Result = {
|
|
35
|
-
readonly 'leading trivia': types.Trivia;
|
|
36
|
-
readonly 'tokens': _et.Array<Annotated_Token>;
|
|
37
|
-
readonly 'end': types.Location;
|
|
38
|
-
};
|
|
39
|
-
type String_Iterator = {
|
|
40
|
-
'consume character': () => void;
|
|
41
|
-
'consume string': ($: string) => void;
|
|
42
|
-
/**
|
|
43
|
-
* returns the current character, or null if the end of the string has been reached.
|
|
44
|
-
* equivalent to `look ahead(0)`
|
|
45
|
-
*/
|
|
46
|
-
'get current character': () => number | null;
|
|
47
|
-
'look ahead': ($: number) => number | null;
|
|
48
|
-
'create offset location info': (subtract: number) => types.Location;
|
|
49
|
-
'create location info': () => types.Location;
|
|
50
|
-
'create location info string': () => string;
|
|
51
|
-
/**
|
|
52
|
-
* if no non-whitespace character has been found yet on the current line,
|
|
53
|
-
* this will return the current column,
|
|
54
|
-
* otherwise it will return the offset of that first non-whitespace character
|
|
55
|
-
* (which is the indentation of the line)
|
|
56
|
-
*/
|
|
57
|
-
'get line indentation': () => number;
|
|
58
|
-
'starts with': ($: string) => boolean;
|
|
59
|
-
};
|
|
60
|
-
/**
|
|
61
|
-
* Creates a string iterator that allows iterating over characters in a string,
|
|
62
|
-
* while keeping track of line numbers, columns, and line indentation.
|
|
63
|
-
*/
|
|
64
|
-
const create_string_iterator: ($: string, $p: {
|
|
65
|
-
"tab size": number;
|
|
66
|
-
}) => String_Iterator;
|
|
67
|
-
const Annotated_Token: (st: String_Iterator) => Annotated_Token;
|
|
68
|
-
const Tokenizer_Result: ($: null, $p: {
|
|
69
|
-
"string iterator": String_Iterator;
|
|
70
|
-
}) => Tokenizer_Result;
|
|
71
|
-
}
|
|
72
|
-
export declare namespace Parser {
|
|
73
|
-
type Token_Iterator = {
|
|
74
|
-
'get required token': () => Lexer.Annotated_Token;
|
|
75
|
-
'consume token': () => void;
|
|
76
|
-
};
|
|
77
|
-
const create_token_iterator: ($: Lexer.Tokenizer_Result) => Token_Iterator;
|
|
78
|
-
namespace type_parsers {
|
|
79
|
-
const Document: (token_iterator: Token_Iterator) => types.Document;
|
|
80
|
-
const Elements: (token_iterator: Token_Iterator, end_reached: ($: Lexer.Token_Type) => boolean) => types.Elements;
|
|
81
|
-
const Key_Value_Pairs: (token_iterator: Token_Iterator, end_reached: ($: Lexer.Token_Type) => boolean) => types.Key_Value_Pairs;
|
|
82
|
-
const Value: (token_iterator: Token_Iterator) => types.Value;
|
|
83
|
-
}
|
|
84
|
-
type Parse_Result = ['failure', Parse_Error] | ['success', types.Document];
|
|
85
|
-
const parse: ($: string, $p: {
|
|
86
|
-
"tab size": number;
|
|
87
|
-
}) => Parse_Result;
|
|
88
|
-
}
|