astn 0.110.12 → 0.110.14
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 +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +4 -4
- package/dist/lib/transformations/create_error_message.js +8 -18
- package/dist/lib/transformations/format.js +8 -18
- package/dist/lib/transformations/fountain_pen/astn.d.ts +11 -0
- package/dist/lib/transformations/fountain_pen/astn.js +156 -0
- package/dist/lib/transformations/fountain_pen/json.d.ts +4 -0
- package/dist/lib/transformations/fountain_pen/json.js +113 -0
- package/dist/lib/transformations/parse.js +8 -18
- package/dist/lib/transformations/parse_generic.js +8 -18
- package/dist/serializers/astn.d.ts +0 -0
- package/dist/serializers/astn.js +28 -0
- package/dist/serializers/json.d.ts +0 -0
- package/dist/serializers/json.js +23 -0
- package/dist/transformations/create_error_message.d.ts +5 -0
- package/dist/transformations/create_error_message.js +99 -0
- package/dist/transformations/format.d.ts +42 -0
- package/dist/transformations/format.js +176 -0
- package/dist/transformations/fountain_pen/astn.d.ts +11 -0
- package/dist/transformations/fountain_pen/astn.js +166 -0
- package/dist/transformations/fountain_pen/json.d.ts +4 -0
- package/dist/transformations/fountain_pen/json.js +123 -0
- package/dist/transformations/parse.d.ts +11 -0
- package/dist/transformations/parse.js +267 -0
- package/dist/transformations/parse_generic.d.ts +43 -0
- package/dist/transformations/parse_generic.js +654 -0
- package/package.json +2 -15
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import * as _et from 'exupery-core-types';
|
|
2
|
+
import * as ast from "../generated/interface/schemas/ast/resolved";
|
|
3
|
+
import * as parse_result from "../generated/interface/schemas/parse_result/resolved";
|
|
4
|
+
export declare const throw_parse_error: (type: parse_result.Parse_Error._type, range: ast.Range) => never;
|
|
5
|
+
export declare const throw_unexpected_token: (found: parse_result.Annotated_Token, expected: _et.Array<parse_result.Parse_Error._type.SG.parser.expected.L>) => never;
|
|
6
|
+
type String_Iterator = {
|
|
7
|
+
'consume character': () => void;
|
|
8
|
+
'consume string': ($: string) => void;
|
|
9
|
+
/**
|
|
10
|
+
* returns the current character, or null if the end of the string has been reached.
|
|
11
|
+
* equivalent to `look ahead(0)`
|
|
12
|
+
*/
|
|
13
|
+
'get current character': () => number | null;
|
|
14
|
+
'look ahead': ($: number) => number | null;
|
|
15
|
+
'create offset location info': (subtract: number) => ast.Location;
|
|
16
|
+
'create location info': () => ast.Location;
|
|
17
|
+
'create location info string': () => string;
|
|
18
|
+
/**
|
|
19
|
+
* if no non-whitespace character has been found yet on the current line,
|
|
20
|
+
* this will return the current column,
|
|
21
|
+
* otherwise it will return the offset of that first non-whitespace character
|
|
22
|
+
* (which is the indentation of the line)
|
|
23
|
+
*/
|
|
24
|
+
'get line indentation': () => number;
|
|
25
|
+
'starts with': ($: string) => boolean;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Creates a string iterator that allows iterating over characters in a string,
|
|
29
|
+
* while keeping track of line numbers, columns, and line indentation.
|
|
30
|
+
*/
|
|
31
|
+
export declare const create_string_iterator: ($: string, $p: {
|
|
32
|
+
"tab size": number;
|
|
33
|
+
}) => String_Iterator;
|
|
34
|
+
export declare const Annotated_Token: (st: String_Iterator) => parse_result.Annotated_Token;
|
|
35
|
+
export declare const Tokenizer_Result: ($: null, $p: {
|
|
36
|
+
"string iterator": String_Iterator;
|
|
37
|
+
}) => parse_result.Tokenizer_Result;
|
|
38
|
+
export type Token_Iterator = {
|
|
39
|
+
'get required token': (expected: _et.Array<parse_result.Parse_Error._type.SG.parser.expected.L>) => parse_result.Annotated_Token;
|
|
40
|
+
'consume token': () => void;
|
|
41
|
+
};
|
|
42
|
+
export declare const create_token_iterator: ($: parse_result.Tokenizer_Result) => Token_Iterator;
|
|
43
|
+
export {};
|