fractalpop 0.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/LICENSE +21 -0
- package/README.md +232 -0
- package/dist/core.d.ts +110 -0
- package/dist/core.js +313 -0
- package/dist/full.d.ts +1 -0
- package/dist/full.js +356 -0
- package/dist/gpu.d.ts +59 -0
- package/dist/gpu.js +215 -0
- package/dist/index.d.ts +108 -0
- package/dist/index.js +523 -0
- package/dist/lang/c.d.ts +5 -0
- package/dist/lang/c.js +90 -0
- package/dist/lang/cpp.d.ts +5 -0
- package/dist/lang/cpp.js +138 -0
- package/dist/lang/csharp.d.ts +5 -0
- package/dist/lang/csharp.js +148 -0
- package/dist/lang/css.d.ts +21 -0
- package/dist/lang/css.js +164 -0
- package/dist/lang/diff.d.ts +30 -0
- package/dist/lang/diff.js +18 -0
- package/dist/lang/dockerfile.d.ts +5 -0
- package/dist/lang/dockerfile.js +60 -0
- package/dist/lang/go.d.ts +5 -0
- package/dist/lang/go.js +91 -0
- package/dist/lang/graphql.d.ts +5 -0
- package/dist/lang/graphql.js +66 -0
- package/dist/lang/hcl.d.ts +5 -0
- package/dist/lang/hcl.js +51 -0
- package/dist/lang/html.d.ts +12 -0
- package/dist/lang/html.js +168 -0
- package/dist/lang/java.d.ts +5 -0
- package/dist/lang/java.js +96 -0
- package/dist/lang/javascript.d.ts +5 -0
- package/dist/lang/javascript.js +0 -0
- package/dist/lang/json.d.ts +5 -0
- package/dist/lang/json.js +47 -0
- package/dist/lang/kotlin.d.ts +5 -0
- package/dist/lang/kotlin.js +113 -0
- package/dist/lang/lua.d.ts +5 -0
- package/dist/lang/lua.js +65 -0
- package/dist/lang/markdown.d.ts +12 -0
- package/dist/lang/markdown.js +172 -0
- package/dist/lang/php.d.ts +5 -0
- package/dist/lang/php.js +129 -0
- package/dist/lang/plaintext.d.ts +7 -0
- package/dist/lang/plaintext.js +3 -0
- package/dist/lang/powershell.d.ts +5 -0
- package/dist/lang/powershell.js +74 -0
- package/dist/lang/python.d.ts +5 -0
- package/dist/lang/python.js +75 -0
- package/dist/lang/ruby.d.ts +5 -0
- package/dist/lang/ruby.js +84 -0
- package/dist/lang/rust.d.ts +5 -0
- package/dist/lang/rust.js +95 -0
- package/dist/lang/sass.d.ts +15 -0
- package/dist/lang/sass.js +201 -0
- package/dist/lang/scss.d.ts +14 -0
- package/dist/lang/scss.js +105 -0
- package/dist/lang/shell.d.ts +5 -0
- package/dist/lang/shell.js +64 -0
- package/dist/lang/sql.d.ts +5 -0
- package/dist/lang/sql.js +129 -0
- package/dist/lang/svelte.d.ts +15 -0
- package/dist/lang/svelte.js +0 -0
- package/dist/lang/swift.d.ts +5 -0
- package/dist/lang/swift.js +125 -0
- package/dist/lang/toml.d.ts +5 -0
- package/dist/lang/toml.js +45 -0
- package/dist/lang/typescript.d.ts +5 -0
- package/dist/lang/typescript.js +0 -0
- package/dist/lang/yaml.d.ts +5 -0
- package/dist/lang/yaml.js +64 -0
- package/dist/lang/zig.d.ts +5 -0
- package/dist/lang/zig.js +133 -0
- package/dist/lang.d.ts +30 -0
- package/dist/lang.js +345 -0
- package/package.json +68 -0
package/dist/lang/sql.js
ADDED
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
/** Reusable comment-scanner bases shared by keyword-based language presets. */ /** Build onCommentStart/onCommentEnd for a mix of line + block comment styles.
|
|
2
|
+
* Line comments open as type 1 and close at `\n`; block comments open as type 2
|
|
3
|
+
* and close at the terminator — so a single onCommentEnd serves both. */ function commentRules(style) {
|
|
4
|
+
const line = style.line ?? [];
|
|
5
|
+
const hasSlash = line.includes('//');
|
|
6
|
+
const hasHash = line.includes('#');
|
|
7
|
+
const hasDash = line.includes('--');
|
|
8
|
+
const block = style.block ?? false;
|
|
9
|
+
return {
|
|
10
|
+
onCommentStart (curr, next) {
|
|
11
|
+
if (block && curr === '/' && next === '*') return 2;
|
|
12
|
+
if (hasSlash && curr === '/' && next === '/') return 1;
|
|
13
|
+
if (hasHash && curr === '#') return 1;
|
|
14
|
+
if (hasDash && curr === '-' && next === '-') return 1;
|
|
15
|
+
return 0;
|
|
16
|
+
},
|
|
17
|
+
onCommentEnd (prev, curr) {
|
|
18
|
+
if (curr === '\n') return 1;
|
|
19
|
+
if (block && prev === '*' && curr === '/') return 2;
|
|
20
|
+
return 0;
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
/** Assemble a keyword-based language config over the shared general lexer. */ function keywordLang(spec) {
|
|
25
|
+
const config = {};
|
|
26
|
+
if (spec.keywords) config.keywords = new Set(spec.keywords);
|
|
27
|
+
if (spec.typeKeywords) config.typeKeywords = new Set(spec.typeKeywords);
|
|
28
|
+
config.caseInsensitive = true;
|
|
29
|
+
if (spec.comments) Object.assign(config, commentRules(spec.comments));
|
|
30
|
+
return config;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const config = keywordLang({
|
|
34
|
+
keywords: [
|
|
35
|
+
"add",
|
|
36
|
+
"all",
|
|
37
|
+
"alter",
|
|
38
|
+
"and",
|
|
39
|
+
"as",
|
|
40
|
+
"asc",
|
|
41
|
+
"between",
|
|
42
|
+
"by",
|
|
43
|
+
"case",
|
|
44
|
+
"check",
|
|
45
|
+
"column",
|
|
46
|
+
"constraint",
|
|
47
|
+
"create",
|
|
48
|
+
"cross",
|
|
49
|
+
"database",
|
|
50
|
+
"default",
|
|
51
|
+
"delete",
|
|
52
|
+
"desc",
|
|
53
|
+
"distinct",
|
|
54
|
+
"drop",
|
|
55
|
+
"else",
|
|
56
|
+
"end",
|
|
57
|
+
"exists",
|
|
58
|
+
"foreign",
|
|
59
|
+
"from",
|
|
60
|
+
"full",
|
|
61
|
+
"group",
|
|
62
|
+
"having",
|
|
63
|
+
"in",
|
|
64
|
+
"index",
|
|
65
|
+
"inner",
|
|
66
|
+
"insert",
|
|
67
|
+
"into",
|
|
68
|
+
"is",
|
|
69
|
+
"join",
|
|
70
|
+
"key",
|
|
71
|
+
"left",
|
|
72
|
+
"like",
|
|
73
|
+
"limit",
|
|
74
|
+
"not",
|
|
75
|
+
"null",
|
|
76
|
+
"offset",
|
|
77
|
+
"on",
|
|
78
|
+
"or",
|
|
79
|
+
"order",
|
|
80
|
+
"outer",
|
|
81
|
+
"primary",
|
|
82
|
+
"references",
|
|
83
|
+
"right",
|
|
84
|
+
"select",
|
|
85
|
+
"set",
|
|
86
|
+
"table",
|
|
87
|
+
"then",
|
|
88
|
+
"union",
|
|
89
|
+
"unique",
|
|
90
|
+
"update",
|
|
91
|
+
"values",
|
|
92
|
+
"view",
|
|
93
|
+
"when",
|
|
94
|
+
"where",
|
|
95
|
+
"with"
|
|
96
|
+
],
|
|
97
|
+
typeKeywords: [
|
|
98
|
+
"bigint",
|
|
99
|
+
"binary",
|
|
100
|
+
"bit",
|
|
101
|
+
"blob",
|
|
102
|
+
"boolean",
|
|
103
|
+
"char",
|
|
104
|
+
"date",
|
|
105
|
+
"datetime",
|
|
106
|
+
"decimal",
|
|
107
|
+
"double",
|
|
108
|
+
"float",
|
|
109
|
+
"int",
|
|
110
|
+
"integer",
|
|
111
|
+
"interval",
|
|
112
|
+
"json",
|
|
113
|
+
"numeric",
|
|
114
|
+
"real",
|
|
115
|
+
"smallint",
|
|
116
|
+
"text",
|
|
117
|
+
"time",
|
|
118
|
+
"timestamp",
|
|
119
|
+
"uuid",
|
|
120
|
+
"varchar"
|
|
121
|
+
],
|
|
122
|
+
comments: {
|
|
123
|
+
"line": [
|
|
124
|
+
"--"
|
|
125
|
+
],
|
|
126
|
+
"block": true
|
|
127
|
+
}});
|
|
128
|
+
|
|
129
|
+
export { config };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ParseOptions } from '../core.js';
|
|
2
|
+
|
|
3
|
+
/** A lexer emits these: `[numericType, value]`. */
|
|
4
|
+
type Token = [number, string];
|
|
5
|
+
|
|
6
|
+
/** Svelte composite lexer. A `.svelte` file mixes three languages:
|
|
7
|
+
* <script [lang=ts]> … </script> → the JS/TS runtime
|
|
8
|
+
* markup with {expr} / {#if} / {@render} blocks → Svelte markup (expressions delegated to JS)
|
|
9
|
+
* <style [lang=sass|scss]> … </style> → the css / scss / sass tokenizer
|
|
10
|
+
* The region splitter tokenizes each part and concatenates the streams in source order. */
|
|
11
|
+
|
|
12
|
+
declare const tokenize: (code: string) => Token[];
|
|
13
|
+
declare const config: ParseOptions;
|
|
14
|
+
|
|
15
|
+
export { config, tokenize };
|
|
Binary file
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
/** Reusable comment-scanner bases shared by keyword-based language presets. */ /** Build onCommentStart/onCommentEnd for a mix of line + block comment styles.
|
|
2
|
+
* Line comments open as type 1 and close at `\n`; block comments open as type 2
|
|
3
|
+
* and close at the terminator — so a single onCommentEnd serves both. */ function commentRules(style) {
|
|
4
|
+
const line = style.line ?? [];
|
|
5
|
+
const hasSlash = line.includes('//');
|
|
6
|
+
const hasHash = line.includes('#');
|
|
7
|
+
const hasDash = line.includes('--');
|
|
8
|
+
const block = style.block ?? false;
|
|
9
|
+
return {
|
|
10
|
+
onCommentStart (curr, next) {
|
|
11
|
+
if (block && curr === '/' && next === '*') return 2;
|
|
12
|
+
if (hasSlash && curr === '/' && next === '/') return 1;
|
|
13
|
+
if (hasHash && curr === '#') return 1;
|
|
14
|
+
if (hasDash && curr === '-' && next === '-') return 1;
|
|
15
|
+
return 0;
|
|
16
|
+
},
|
|
17
|
+
onCommentEnd (prev, curr) {
|
|
18
|
+
if (curr === '\n') return 1;
|
|
19
|
+
if (block && prev === '*' && curr === '/') return 2;
|
|
20
|
+
return 0;
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
/** Assemble a keyword-based language config over the shared general lexer. */ function keywordLang(spec) {
|
|
25
|
+
const config = {};
|
|
26
|
+
if (spec.keywords) config.keywords = new Set(spec.keywords);
|
|
27
|
+
if (spec.typeKeywords) config.typeKeywords = new Set(spec.typeKeywords);
|
|
28
|
+
if (spec.caseInsensitive) config.caseInsensitive = true;
|
|
29
|
+
if (spec.comments) Object.assign(config, commentRules(spec.comments));
|
|
30
|
+
return config;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const config = keywordLang({
|
|
34
|
+
keywords: [
|
|
35
|
+
"as",
|
|
36
|
+
"associatedtype",
|
|
37
|
+
"break",
|
|
38
|
+
"case",
|
|
39
|
+
"catch",
|
|
40
|
+
"class",
|
|
41
|
+
"continue",
|
|
42
|
+
"convenience",
|
|
43
|
+
"default",
|
|
44
|
+
"defer",
|
|
45
|
+
"deinit",
|
|
46
|
+
"didSet",
|
|
47
|
+
"do",
|
|
48
|
+
"dynamic",
|
|
49
|
+
"else",
|
|
50
|
+
"enum",
|
|
51
|
+
"extension",
|
|
52
|
+
"fallthrough",
|
|
53
|
+
"false",
|
|
54
|
+
"fileprivate",
|
|
55
|
+
"final",
|
|
56
|
+
"for",
|
|
57
|
+
"func",
|
|
58
|
+
"get",
|
|
59
|
+
"guard",
|
|
60
|
+
"if",
|
|
61
|
+
"import",
|
|
62
|
+
"in",
|
|
63
|
+
"indirect",
|
|
64
|
+
"infix",
|
|
65
|
+
"init",
|
|
66
|
+
"inout",
|
|
67
|
+
"internal",
|
|
68
|
+
"is",
|
|
69
|
+
"lazy",
|
|
70
|
+
"let",
|
|
71
|
+
"mutating",
|
|
72
|
+
"nil",
|
|
73
|
+
"nonmutating",
|
|
74
|
+
"open",
|
|
75
|
+
"operator",
|
|
76
|
+
"override",
|
|
77
|
+
"precedencegroup",
|
|
78
|
+
"private",
|
|
79
|
+
"protocol",
|
|
80
|
+
"public",
|
|
81
|
+
"repeat",
|
|
82
|
+
"required",
|
|
83
|
+
"rethrows",
|
|
84
|
+
"return",
|
|
85
|
+
"self",
|
|
86
|
+
"set",
|
|
87
|
+
"some",
|
|
88
|
+
"static",
|
|
89
|
+
"struct",
|
|
90
|
+
"subscript",
|
|
91
|
+
"super",
|
|
92
|
+
"switch",
|
|
93
|
+
"throw",
|
|
94
|
+
"throws",
|
|
95
|
+
"true",
|
|
96
|
+
"try",
|
|
97
|
+
"typealias",
|
|
98
|
+
"unowned",
|
|
99
|
+
"var",
|
|
100
|
+
"weak",
|
|
101
|
+
"where",
|
|
102
|
+
"while",
|
|
103
|
+
"willSet"
|
|
104
|
+
],
|
|
105
|
+
typeKeywords: [
|
|
106
|
+
"Any",
|
|
107
|
+
"Bool",
|
|
108
|
+
"Character",
|
|
109
|
+
"Double",
|
|
110
|
+
"Float",
|
|
111
|
+
"Int",
|
|
112
|
+
"Never",
|
|
113
|
+
"String",
|
|
114
|
+
"UInt",
|
|
115
|
+
"Void"
|
|
116
|
+
],
|
|
117
|
+
comments: {
|
|
118
|
+
"line": [
|
|
119
|
+
"//"
|
|
120
|
+
],
|
|
121
|
+
"block": true
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
export { config };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/** Reusable comment-scanner bases shared by keyword-based language presets. */ /** Build onCommentStart/onCommentEnd for a mix of line + block comment styles.
|
|
2
|
+
* Line comments open as type 1 and close at `\n`; block comments open as type 2
|
|
3
|
+
* and close at the terminator — so a single onCommentEnd serves both. */ function commentRules(style) {
|
|
4
|
+
const line = style.line ?? [];
|
|
5
|
+
const hasSlash = line.includes('//');
|
|
6
|
+
const hasHash = line.includes('#');
|
|
7
|
+
const hasDash = line.includes('--');
|
|
8
|
+
const block = style.block ?? false;
|
|
9
|
+
return {
|
|
10
|
+
onCommentStart (curr, next) {
|
|
11
|
+
if (block && curr === '/' && next === '*') return 2;
|
|
12
|
+
if (hasSlash && curr === '/' && next === '/') return 1;
|
|
13
|
+
if (hasHash && curr === '#') return 1;
|
|
14
|
+
if (hasDash && curr === '-' && next === '-') return 1;
|
|
15
|
+
return 0;
|
|
16
|
+
},
|
|
17
|
+
onCommentEnd (prev, curr) {
|
|
18
|
+
if (curr === '\n') return 1;
|
|
19
|
+
if (block && prev === '*' && curr === '/') return 2;
|
|
20
|
+
return 0;
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
/** Assemble a keyword-based language config over the shared general lexer. */ function keywordLang(spec) {
|
|
25
|
+
const config = {};
|
|
26
|
+
if (spec.keywords) config.keywords = new Set(spec.keywords);
|
|
27
|
+
if (spec.typeKeywords) config.typeKeywords = new Set(spec.typeKeywords);
|
|
28
|
+
if (spec.caseInsensitive) config.caseInsensitive = true;
|
|
29
|
+
if (spec.comments) Object.assign(config, commentRules(spec.comments));
|
|
30
|
+
return config;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const config = keywordLang({
|
|
34
|
+
keywords: [
|
|
35
|
+
"false",
|
|
36
|
+
"true"
|
|
37
|
+
],
|
|
38
|
+
comments: {
|
|
39
|
+
"line": [
|
|
40
|
+
"#"
|
|
41
|
+
]
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
export { config };
|
|
Binary file
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/** Reusable comment-scanner bases shared by keyword-based language presets. */ /** Build onCommentStart/onCommentEnd for a mix of line + block comment styles.
|
|
2
|
+
* Line comments open as type 1 and close at `\n`; block comments open as type 2
|
|
3
|
+
* and close at the terminator — so a single onCommentEnd serves both. */ function commentRules(style) {
|
|
4
|
+
const line = style.line ?? [];
|
|
5
|
+
const hasSlash = line.includes('//');
|
|
6
|
+
const hasHash = line.includes('#');
|
|
7
|
+
const hasDash = line.includes('--');
|
|
8
|
+
const block = style.block ?? false;
|
|
9
|
+
return {
|
|
10
|
+
onCommentStart (curr, next) {
|
|
11
|
+
if (block && curr === '/' && next === '*') return 2;
|
|
12
|
+
if (hasSlash && curr === '/' && next === '/') return 1;
|
|
13
|
+
if (hasHash && curr === '#') return 1;
|
|
14
|
+
if (hasDash && curr === '-' && next === '-') return 1;
|
|
15
|
+
return 0;
|
|
16
|
+
},
|
|
17
|
+
onCommentEnd (prev, curr) {
|
|
18
|
+
if (curr === '\n') return 1;
|
|
19
|
+
if (block && prev === '*' && curr === '/') return 2;
|
|
20
|
+
return 0;
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
/** Assemble a keyword-based language config over the shared general lexer. */ function keywordLang(spec) {
|
|
25
|
+
const config = {};
|
|
26
|
+
if (spec.keywords) config.keywords = new Set(spec.keywords);
|
|
27
|
+
if (spec.typeKeywords) config.typeKeywords = new Set(spec.typeKeywords);
|
|
28
|
+
if (spec.caseInsensitive) config.caseInsensitive = true;
|
|
29
|
+
if (spec.comments) Object.assign(config, commentRules(spec.comments));
|
|
30
|
+
return config;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const config = keywordLang({
|
|
34
|
+
keywords: [
|
|
35
|
+
"false",
|
|
36
|
+
"False",
|
|
37
|
+
"FALSE",
|
|
38
|
+
"no",
|
|
39
|
+
"No",
|
|
40
|
+
"NO",
|
|
41
|
+
"null",
|
|
42
|
+
"Null",
|
|
43
|
+
"NULL",
|
|
44
|
+
"off",
|
|
45
|
+
"Off",
|
|
46
|
+
"OFF",
|
|
47
|
+
"on",
|
|
48
|
+
"On",
|
|
49
|
+
"ON",
|
|
50
|
+
"true",
|
|
51
|
+
"True",
|
|
52
|
+
"TRUE",
|
|
53
|
+
"yes",
|
|
54
|
+
"Yes",
|
|
55
|
+
"YES"
|
|
56
|
+
],
|
|
57
|
+
comments: {
|
|
58
|
+
"line": [
|
|
59
|
+
"#"
|
|
60
|
+
]
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
export { config };
|
package/dist/lang/zig.js
ADDED
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
/** Reusable comment-scanner bases shared by keyword-based language presets. */ /** Build onCommentStart/onCommentEnd for a mix of line + block comment styles.
|
|
2
|
+
* Line comments open as type 1 and close at `\n`; block comments open as type 2
|
|
3
|
+
* and close at the terminator — so a single onCommentEnd serves both. */ function commentRules(style) {
|
|
4
|
+
const line = style.line ?? [];
|
|
5
|
+
const hasSlash = line.includes('//');
|
|
6
|
+
const hasHash = line.includes('#');
|
|
7
|
+
const hasDash = line.includes('--');
|
|
8
|
+
const block = style.block ?? false;
|
|
9
|
+
return {
|
|
10
|
+
onCommentStart (curr, next) {
|
|
11
|
+
if (block && curr === '/' && next === '*') return 2;
|
|
12
|
+
if (hasSlash && curr === '/' && next === '/') return 1;
|
|
13
|
+
if (hasHash && curr === '#') return 1;
|
|
14
|
+
if (hasDash && curr === '-' && next === '-') return 1;
|
|
15
|
+
return 0;
|
|
16
|
+
},
|
|
17
|
+
onCommentEnd (prev, curr) {
|
|
18
|
+
if (curr === '\n') return 1;
|
|
19
|
+
if (block && prev === '*' && curr === '/') return 2;
|
|
20
|
+
return 0;
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
/** Assemble a keyword-based language config over the shared general lexer. */ function keywordLang(spec) {
|
|
25
|
+
const config = {};
|
|
26
|
+
if (spec.keywords) config.keywords = new Set(spec.keywords);
|
|
27
|
+
if (spec.typeKeywords) config.typeKeywords = new Set(spec.typeKeywords);
|
|
28
|
+
if (spec.caseInsensitive) config.caseInsensitive = true;
|
|
29
|
+
if (spec.comments) Object.assign(config, commentRules(spec.comments));
|
|
30
|
+
return config;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const config = keywordLang({
|
|
34
|
+
keywords: [
|
|
35
|
+
"addrspace",
|
|
36
|
+
"align",
|
|
37
|
+
"allowzero",
|
|
38
|
+
"and",
|
|
39
|
+
"anyframe",
|
|
40
|
+
"anytype",
|
|
41
|
+
"asm",
|
|
42
|
+
"async",
|
|
43
|
+
"await",
|
|
44
|
+
"break",
|
|
45
|
+
"callconv",
|
|
46
|
+
"catch",
|
|
47
|
+
"comptime",
|
|
48
|
+
"const",
|
|
49
|
+
"continue",
|
|
50
|
+
"defer",
|
|
51
|
+
"else",
|
|
52
|
+
"enum",
|
|
53
|
+
"errdefer",
|
|
54
|
+
"error",
|
|
55
|
+
"export",
|
|
56
|
+
"extern",
|
|
57
|
+
"false",
|
|
58
|
+
"fn",
|
|
59
|
+
"for",
|
|
60
|
+
"if",
|
|
61
|
+
"inline",
|
|
62
|
+
"linksection",
|
|
63
|
+
"noalias",
|
|
64
|
+
"noinline",
|
|
65
|
+
"nosuspend",
|
|
66
|
+
"null",
|
|
67
|
+
"opaque",
|
|
68
|
+
"or",
|
|
69
|
+
"orelse",
|
|
70
|
+
"packed",
|
|
71
|
+
"pub",
|
|
72
|
+
"resume",
|
|
73
|
+
"return",
|
|
74
|
+
"struct",
|
|
75
|
+
"suspend",
|
|
76
|
+
"switch",
|
|
77
|
+
"test",
|
|
78
|
+
"threadlocal",
|
|
79
|
+
"true",
|
|
80
|
+
"try",
|
|
81
|
+
"undefined",
|
|
82
|
+
"union",
|
|
83
|
+
"unreachable",
|
|
84
|
+
"usingnamespace",
|
|
85
|
+
"var",
|
|
86
|
+
"volatile",
|
|
87
|
+
"while"
|
|
88
|
+
],
|
|
89
|
+
typeKeywords: [
|
|
90
|
+
"anyerror",
|
|
91
|
+
"anyopaque",
|
|
92
|
+
"bool",
|
|
93
|
+
"c_char",
|
|
94
|
+
"c_int",
|
|
95
|
+
"c_long",
|
|
96
|
+
"c_longdouble",
|
|
97
|
+
"c_longlong",
|
|
98
|
+
"c_short",
|
|
99
|
+
"c_uint",
|
|
100
|
+
"c_ulong",
|
|
101
|
+
"c_ulonglong",
|
|
102
|
+
"c_ushort",
|
|
103
|
+
"comptime_float",
|
|
104
|
+
"comptime_int",
|
|
105
|
+
"f16",
|
|
106
|
+
"f32",
|
|
107
|
+
"f64",
|
|
108
|
+
"f80",
|
|
109
|
+
"f128",
|
|
110
|
+
"i8",
|
|
111
|
+
"i16",
|
|
112
|
+
"i32",
|
|
113
|
+
"i64",
|
|
114
|
+
"i128",
|
|
115
|
+
"isize",
|
|
116
|
+
"noreturn",
|
|
117
|
+
"type",
|
|
118
|
+
"u8",
|
|
119
|
+
"u16",
|
|
120
|
+
"u32",
|
|
121
|
+
"u64",
|
|
122
|
+
"u128",
|
|
123
|
+
"usize",
|
|
124
|
+
"void"
|
|
125
|
+
],
|
|
126
|
+
comments: {
|
|
127
|
+
"line": [
|
|
128
|
+
"//"
|
|
129
|
+
]
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
export { config };
|
package/dist/lang.d.ts
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ParseOptions } from './core.js';
|
|
2
|
+
|
|
3
|
+
/** Mutable registry that maps a canonical language id to its parse config. */
|
|
4
|
+
|
|
5
|
+
declare function getLanguageConfig(id: string): ParseOptions | undefined;
|
|
6
|
+
|
|
7
|
+
/** Mutable language metadata registry with alias/extension normalization. */
|
|
8
|
+
|
|
9
|
+
interface Language {
|
|
10
|
+
id: string;
|
|
11
|
+
extension: string;
|
|
12
|
+
aliases: readonly string[];
|
|
13
|
+
}
|
|
14
|
+
declare function registerLanguage(language: Language, config?: ParseOptions): void;
|
|
15
|
+
declare function setDefaults(languages: readonly Language[]): void;
|
|
16
|
+
declare function setDefaults(configs: Record<string, ParseOptions>): void;
|
|
17
|
+
declare function importDefaults(ids: string[]): Promise<void>;
|
|
18
|
+
/** Find canonical language metadata by name, alias, or extension. */
|
|
19
|
+
declare function findLanguage(name: string): Language | undefined;
|
|
20
|
+
/** Resolve a name/alias/extension to its canonical language id. */
|
|
21
|
+
declare function lang(name: string): string | undefined;
|
|
22
|
+
/** Alias for {@link lang}. */
|
|
23
|
+
declare const canonicalizeLang: typeof lang;
|
|
24
|
+
declare function getRegisteredLanguages(): readonly Language[];
|
|
25
|
+
declare function resetLanguageRegistry(): void;
|
|
26
|
+
|
|
27
|
+
declare const allLanguages: readonly Language[];
|
|
28
|
+
|
|
29
|
+
export { allLanguages, canonicalizeLang, findLanguage, getLanguageConfig, getRegisteredLanguages, importDefaults, lang, registerLanguage, resetLanguageRegistry, setDefaults };
|
|
30
|
+
export type { Language };
|