@libernet/prettier-plugin-starkom 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 ADDED
@@ -0,0 +1,176 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
package/README.md ADDED
@@ -0,0 +1,44 @@
1
+ # Prettier Plugin for Starkom
2
+
3
+ [Prettier](https://prettier.io) plugin for formatting [Starkom](https://starkom.io) source files.
4
+
5
+ ## Installation
6
+
7
+ ```sh
8
+ npm install --save-dev prettier @libernet/prettier-plugin-starkom
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ### CLI
14
+
15
+ ```sh
16
+ npx prettier --write '**/*.starkom'
17
+ ```
18
+
19
+ ### Configuration
20
+
21
+ Add the plugin to your Prettier config (e.g. `.prettierrc`):
22
+
23
+ ```json
24
+ {
25
+ "plugins": ["@libernet/prettier-plugin-starkom"]
26
+ }
27
+ ```
28
+
29
+ Prettier will then pick it up automatically for `.starkom` files.
30
+
31
+ ### VS Code
32
+
33
+ Install the
34
+ [Prettier - Code formatter](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode)
35
+ extension, add the plugin to your config as above, and optionally enable format-on-save:
36
+
37
+ ```json
38
+ {
39
+ "editor.formatOnSave": true,
40
+ "[starkom]": {
41
+ "editor.defaultFormatter": "esbenp.prettier-vscode"
42
+ }
43
+ }
44
+ ```
@@ -0,0 +1,6 @@
1
+ import type { Plugin } from "prettier";
2
+ import { parse } from "@libernet/starkom";
3
+ type File = ReturnType<typeof parse>;
4
+ declare const plugin: Plugin<File>;
5
+ export default plugin;
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAyB,MAAM,EAAE,MAAM,UAAU,CAAC;AAE9D,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAO1C,KAAK,IAAI,GAAG,UAAU,CAAC,OAAO,KAAK,CAAC,CAAC;AA6gBrC,QAAA,MAAM,MAAM,EAAE,MAAM,CAAC,IAAI,CA4BxB,CAAC;AAEF,eAAe,MAAM,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,467 @@
1
+ // Copyright 2026 The Libernet Team
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ import { doc } from "prettier";
4
+ import { parse } from "@libernet/starkom";
5
+ import * as starkom_ast from "@libernet/starkom/ast";
6
+ var ast = starkom_ast.starkom.ast.v1;
7
+ // ---- Prettier doc builders -------------------------------------------------------
8
+ const { hardline, softline, line, group, indent, join, ifBreak } = doc.builders;
9
+ // ---- Enum constants (matching proto values) --------------------------------------
10
+ const DeclarationType = ast.DeclarationStatement.Type;
11
+ const DeclarationModifier = ast.DeclarationStatement.Modifier;
12
+ const AssignmentDirection = ast.AssignmentDirection;
13
+ const InfixType = ast.InfixExpression.Type;
14
+ const AssignType = ast.AssignExpression.Type;
15
+ const PrefixType = ast.PrefixChainExpression.Type;
16
+ const INFIX_SYMBOLS = {
17
+ [InfixType.INFIX_EXPRESSION_TYPE_ADD]: "+",
18
+ [InfixType.INFIX_EXPRESSION_TYPE_SUBTRACT]: "-",
19
+ [InfixType.INFIX_EXPRESSION_TYPE_MULTIPLY]: "*",
20
+ [InfixType.INFIX_EXPRESSION_TYPE_POWER]: "**",
21
+ [InfixType.INFIX_EXPRESSION_TYPE_DIVIDE]: "/",
22
+ [InfixType.INFIX_EXPRESSION_TYPE_DIVIDE_INTEGER]: "\\",
23
+ [InfixType.INFIX_EXPRESSION_TYPE_MODULUS]: "%",
24
+ [InfixType.INFIX_EXPRESSION_TYPE_LOGICAL_AND]: "&&",
25
+ [InfixType.INFIX_EXPRESSION_TYPE_LOGICAL_OR]: "||",
26
+ [InfixType.INFIX_EXPRESSION_TYPE_BITWISE_AND]: "&",
27
+ [InfixType.INFIX_EXPRESSION_TYPE_BITWISE_OR]: "|",
28
+ [InfixType.INFIX_EXPRESSION_TYPE_BITWISE_XOR]: "^",
29
+ [InfixType.INFIX_EXPRESSION_TYPE_SHIFT_LEFT]: "<<",
30
+ [InfixType.INFIX_EXPRESSION_TYPE_SHIFT_RIGHT]: ">>",
31
+ [InfixType.INFIX_EXPRESSION_TYPE_LESS_THAN]: "<",
32
+ [InfixType.INFIX_EXPRESSION_TYPE_LESS_THAN_OR_EQUAL_TO]: "<=",
33
+ [InfixType.INFIX_EXPRESSION_TYPE_GREATER_THAN]: ">",
34
+ [InfixType.INFIX_EXPRESSION_TYPE_GREATER_THAN_OR_EQUAL_TO]: ">=",
35
+ [InfixType.INFIX_EXPRESSION_TYPE_EQUAL_TO]: "==",
36
+ [InfixType.INFIX_EXPRESSION_TYPE_NOT_EQUAL_TO]: "!=",
37
+ };
38
+ const ASSIGN_SYMBOLS = {
39
+ [AssignType.ASSIGNMENT_TYPE_SIMPLE]: "=",
40
+ [AssignType.ASSIGNMENT_TYPE_COMPOUND_ADD]: "+=",
41
+ [AssignType.ASSIGNMENT_TYPE_COMPOUND_SUBTRACT]: "-=",
42
+ [AssignType.ASSIGNMENT_TYPE_COMPOUND_MULTIPLY]: "*=",
43
+ [AssignType.ASSIGNMENT_TYPE_COMPOUND_POWER]: "**=",
44
+ [AssignType.ASSIGNMENT_TYPE_COMPOUND_DIVIDE]: "/=",
45
+ [AssignType.ASSIGNMENT_TYPE_COMPOUND_DIVIDE_INTEGER]: "\\=",
46
+ [AssignType.ASSIGNMENT_TYPE_COMPOUND_MODULUS]: "%=",
47
+ [AssignType.ASSIGNMENT_TYPE_COMPOUND_LOGICAL_AND]: "&&=",
48
+ [AssignType.ASSIGNMENT_TYPE_COMPOUND_LOGICAL_OR]: "||=",
49
+ [AssignType.ASSIGNMENT_TYPE_COMPOUND_BITWISE_AND]: "&=",
50
+ [AssignType.ASSIGNMENT_TYPE_COMPOUND_BITWISE_OR]: "|=",
51
+ [AssignType.ASSIGNMENT_TYPE_COMPOUND_BITWISE_XOR]: "^=",
52
+ [AssignType.ASSIGNMENT_TYPE_COMPOUND_SHIFT_LEFT]: "<<=",
53
+ [AssignType.ASSIGNMENT_TYPE_COMPOUND_SHIFT_RIGHT]: ">>=",
54
+ };
55
+ const PREFIX_SYMBOLS = {
56
+ [PrefixType.PREFIX_EXRESSION_INCREMENT]: "++",
57
+ [PrefixType.PREFIX_EXRESSION_DECREMENT]: "--",
58
+ [PrefixType.PREFIX_EXRESSION_LOGICAL_NOT]: "!",
59
+ [PrefixType.PREFIX_EXRESSION_BITWISE_NOT]: "~",
60
+ [PrefixType.PREFIX_EXRESSION_UNARY_PLUS]: "+",
61
+ [PrefixType.PREFIX_EXRESSION_UNARY_MINUS]: "-",
62
+ };
63
+ // ---- Helpers --------------------------------------------------------------------
64
+ function mustExpression(file, idx) {
65
+ if (idx === 0) {
66
+ throw new Error("Cannot print sentinel expression");
67
+ }
68
+ const node = file["expressions"][idx];
69
+ if (!node) {
70
+ throw new Error(`Expression index ${idx} out of range`);
71
+ }
72
+ return node;
73
+ }
74
+ function mustStatement(file, idx) {
75
+ if (idx === 0) {
76
+ throw new Error("Cannot print sentinel statement");
77
+ }
78
+ const node = file["statements"][idx];
79
+ if (!node) {
80
+ throw new Error(`Statement index ${idx} out of range`);
81
+ }
82
+ return node;
83
+ }
84
+ // Returns the index, defaulting to 0 (sentinel) if absent.
85
+ function ref(idx) {
86
+ return idx ?? 0;
87
+ }
88
+ function hasRef(idx) {
89
+ return (idx ?? 0) !== 0;
90
+ }
91
+ function escapeString(s) {
92
+ return s
93
+ .replace(/\\/g, "\\\\")
94
+ .replace(/"/g, '\\"')
95
+ .replace(/\n/g, "\\n")
96
+ .replace(/\r/g, "\\r")
97
+ .replace(/\t/g, "\\t")
98
+ .replace(/\0/g, "\\0");
99
+ }
100
+ // ---- File -----------------------------------------------------------------------
101
+ function printFile(file) {
102
+ const sections = [];
103
+ const v = file["version"];
104
+ sections.push(`pragma starkom ${v?.["major"] ?? 0}.${v?.["minor"] ?? 0}.${v?.["patch"] ?? 0};`);
105
+ const includes = file["includes"] ?? [];
106
+ if (includes.length > 0) {
107
+ sections.push(join(hardline, includes.map((inc) => `include "${escapeString(inc)}";`)));
108
+ }
109
+ for (const def of file["definitions"] ?? []) {
110
+ if (def["templateDefinition"]) {
111
+ sections.push(printTemplate(file, def["templateDefinition"]));
112
+ }
113
+ else if (def["functionDefinition"]) {
114
+ sections.push(printFunction(file, def["functionDefinition"]));
115
+ }
116
+ }
117
+ if (file["mainComponent"]) {
118
+ sections.push(printMainComponent(file, file["mainComponent"]));
119
+ }
120
+ return [join([hardline, hardline], sections), hardline];
121
+ }
122
+ // ---- Definitions ----------------------------------------------------------------
123
+ function formatParams(params) {
124
+ if (params.length === 0)
125
+ return "()";
126
+ return group(["(", indent([softline, join([",", line], params)]), softline, ")"]);
127
+ }
128
+ function printTemplate(file, t) {
129
+ return [
130
+ "template ",
131
+ t["name"] ?? "",
132
+ formatParams(t["params"] ?? []),
133
+ " ",
134
+ printBlock(file, ref(t["bodyIndex"])),
135
+ ];
136
+ }
137
+ function printFunction(file, f) {
138
+ return [
139
+ "function ",
140
+ f["name"] ?? "",
141
+ formatParams(f["params"] ?? []),
142
+ " ",
143
+ printBlock(file, ref(f["bodyIndex"])),
144
+ ];
145
+ }
146
+ function printMainComponent(file, mc) {
147
+ const sigs = mc["publicSignals"] ?? [];
148
+ const pubPart = sigs.length > 0 ? [" { public [", join(", ", sigs), "] }"] : [];
149
+ return ["component main", pubPart, " = ", printExpression(file, ref(mc["instantiation"])), ";"];
150
+ }
151
+ // ---- Statements -----------------------------------------------------------------
152
+ function printBlock(file, idx) {
153
+ const node = mustStatement(file, idx);
154
+ if (node["statement"] !== "block") {
155
+ return ["{", indent([hardline, printStatement(file, idx)]), hardline, "}"];
156
+ }
157
+ const statements = node["block"]?.["statements"] ?? [];
158
+ if (statements.length === 0) {
159
+ return "{}";
160
+ }
161
+ return [
162
+ "{",
163
+ indent([
164
+ hardline,
165
+ join(hardline, statements.map((i) => printStatement(file, i))),
166
+ ]),
167
+ hardline,
168
+ "}",
169
+ ];
170
+ }
171
+ function printStatement(file, idx) {
172
+ const node = mustStatement(file, idx);
173
+ switch (node["statement"]) {
174
+ case "empty":
175
+ return ";";
176
+ case "block":
177
+ return printBlock(file, idx);
178
+ case "declaration":
179
+ return [printDeclarationStatement(file, node["declaration"]), ";"];
180
+ case "expression":
181
+ return [printExpression(file, ref(node["expression"]?.["expression"])), ";"];
182
+ case "ifStatement": {
183
+ const s = node["ifStatement"];
184
+ const head = ["if (", printExpression(file, ref(s["condition"])), ") "];
185
+ const then_ = printBlock(file, ref(s["thenBranch"]));
186
+ if (!hasRef(s["elseBranch"])) {
187
+ return [head, then_];
188
+ }
189
+ const elseNode = mustStatement(file, ref(s["elseBranch"]));
190
+ if (elseNode["statement"] === "ifStatement") {
191
+ // else-if chain: omit braces around the nested if
192
+ return [head, then_, " else ", printStatement(file, ref(s["elseBranch"]))];
193
+ }
194
+ return [head, then_, " else ", printBlock(file, ref(s["elseBranch"]))];
195
+ }
196
+ case "whileLoopStatement": {
197
+ const s = node["whileLoopStatement"];
198
+ return [
199
+ "while (",
200
+ printExpression(file, ref(s["condition"])),
201
+ ") ",
202
+ printBlock(file, ref(s["body"])),
203
+ ];
204
+ }
205
+ case "doWhileLoopStatement": {
206
+ const s = node["doWhileLoopStatement"];
207
+ return [
208
+ "do ",
209
+ printBlock(file, ref(s["body"])),
210
+ " while (",
211
+ printExpression(file, ref(s["condition"])),
212
+ ");",
213
+ ];
214
+ }
215
+ case "forLoopStatement": {
216
+ const s = node["forLoopStatement"];
217
+ const hasCondition = hasRef(s["condition"]);
218
+ const hasStep = hasRef(s["step"]);
219
+ const initializer = hasRef(s["initializer"])
220
+ ? printForInit(file, ref(s["initializer"]))
221
+ : "";
222
+ const condition = hasCondition ? [" ", printExpression(file, ref(s["condition"]))] : "";
223
+ const step = hasStep ? [" ", printExpression(file, ref(s["step"]))] : "";
224
+ return [
225
+ "for (",
226
+ initializer,
227
+ ";",
228
+ condition,
229
+ ";",
230
+ step,
231
+ ") ",
232
+ printBlock(file, ref(s["body"])),
233
+ ];
234
+ }
235
+ case "breakStatement":
236
+ return "break;";
237
+ case "continueStatement":
238
+ return "continue;";
239
+ case "returnStatement":
240
+ return ["return ", printExpression(file, ref(node["returnStatement"]?.["returnValue"])), ";"];
241
+ case "logStatement":
242
+ return ["log ", printExpression(file, ref(node["logStatement"]?.["value"])), ";"];
243
+ case "assertStatement":
244
+ return ["assert ", printExpression(file, ref(node["assertStatement"]?.["condition"])), ";"];
245
+ default:
246
+ throw new Error(`Unknown statement type: ${String(node["statement"])}`);
247
+ }
248
+ }
249
+ // Prints a for-loop initializer (declaration or expression, without trailing semicolon).
250
+ function printForInit(file, idx) {
251
+ const node = mustStatement(file, idx);
252
+ switch (node["statement"]) {
253
+ case "empty":
254
+ return "";
255
+ case "declaration":
256
+ return printDeclarationStatement(file, node["declaration"]);
257
+ case "expression":
258
+ return printExpression(file, ref(node["expression"]?.["expression"]));
259
+ default:
260
+ throw new Error(`Invalid for-init statement type: ${String(node["statement"])}`);
261
+ }
262
+ }
263
+ // ---- Declarations ---------------------------------------------------------------
264
+ function printDeclarationStatement(file, stmt) {
265
+ const type = stmt["type"] ?? DeclarationType.DECLARATION_TYPE_VARIABLE;
266
+ const declarations = stmt["declarations"] ?? [];
267
+ let keyword;
268
+ switch (type) {
269
+ case DeclarationType.DECLARATION_TYPE_VARIABLE:
270
+ keyword = "var";
271
+ break;
272
+ case DeclarationType.DECLARATION_TYPE_CONSTANT:
273
+ keyword = "const";
274
+ break;
275
+ case DeclarationType.DECLARATION_TYPE_SIGNAL: {
276
+ const mod = declarations[0]?.["modifier"] ?? DeclarationModifier.MODIFIER_NONE;
277
+ keyword =
278
+ mod === DeclarationModifier.MODIFIER_SIGNAL_TYPE_INPUT
279
+ ? "signal input"
280
+ : mod === DeclarationModifier.MODIFIER_SIGNAL_TYPE_OUTPUT
281
+ ? "signal output"
282
+ : "signal";
283
+ break;
284
+ }
285
+ case DeclarationType.DECLARATION_TYPE_COMPONENT:
286
+ keyword = "component";
287
+ break;
288
+ default:
289
+ throw new Error(`Unknown declaration type: ${type}`);
290
+ }
291
+ const declDocs = declarations.map((d) => printDeclarator(file, d));
292
+ if (declDocs.length === 1) {
293
+ return [keyword, " ", declDocs[0]];
294
+ }
295
+ return group([keyword, " ", indent([join([",", line], declDocs)])]);
296
+ }
297
+ function printDeclarator(file, d) {
298
+ const name = d["name"] ?? "";
299
+ const dimensions = (d["dimensions"] ?? []).map((i) => ["[", printExpression(file, i), "]"]);
300
+ const initializer = hasRef(d["initializer"])
301
+ ? [" = ", printExpression(file, ref(d["initializer"]))]
302
+ : [];
303
+ return [name, ...dimensions, ...initializer];
304
+ }
305
+ // ---- Expressions ----------------------------------------------------------------
306
+ function printExpression(file, idx) {
307
+ const node = mustExpression(file, idx);
308
+ switch (node["expression"]) {
309
+ case "booleanLiteral":
310
+ return node["booleanLiteral"]?.["value"] ? "true" : "false";
311
+ case "numericLiteral":
312
+ return node["numericLiteral"]?.["value"] ?? "0";
313
+ case "stringLiteral":
314
+ // The parser stores the literal verbatim (with surrounding quotes and raw escapes).
315
+ return node["stringLiteral"]?.["value"] ?? '""';
316
+ case "arrayLiteral": {
317
+ const elements = (node["arrayLiteral"]?.["elements"] ?? []).map((i) => printExpression(file, i));
318
+ if (elements.length === 0)
319
+ return "[]";
320
+ return group([
321
+ "[",
322
+ indent([softline, join([",", line], elements), ifBreak(",", "")]),
323
+ softline,
324
+ "]",
325
+ ]);
326
+ }
327
+ case "variable":
328
+ return node["variable"]?.["name"] ?? "";
329
+ case "subExpression":
330
+ return ["(", printExpression(file, ref(node["subExpression"]?.["inner"])), ")"];
331
+ case "tuple": {
332
+ const components = node["tuple"]?.["components"] ?? [];
333
+ if (components.length === 0)
334
+ return "()";
335
+ if (components.length === 1) {
336
+ // Single-element tuple: (x,) — trailing comma is mandatory.
337
+ return ["(", printExpression(file, components[0]), ",)"];
338
+ }
339
+ const elements = components.map((i) => printExpression(file, i));
340
+ return group(["(", indent([softline, join([",", line], elements)]), softline, ")"]);
341
+ }
342
+ case "postfixChain": {
343
+ const chain = node["postfixChain"];
344
+ let result = printExpression(file, ref(chain["operand"]));
345
+ for (const pf of chain["postfix"] ?? []) {
346
+ result = printPostfix(file, result, pf);
347
+ }
348
+ return result;
349
+ }
350
+ case "prefixChain": {
351
+ const chain = node["prefixChain"];
352
+ // types are listed innermost-to-outermost, so reverse for printing.
353
+ const prefixes = [...(chain["types"] ?? [])].reverse().map((t) => PREFIX_SYMBOLS[t] ?? "");
354
+ return [...prefixes, printExpression(file, ref(chain["operand"]))];
355
+ }
356
+ case "infixExpression": {
357
+ const inf = node["infixExpression"];
358
+ const op = INFIX_SYMBOLS[inf["type"] ?? 0] ?? "?";
359
+ return [
360
+ printExpression(file, ref(inf["lhs"])),
361
+ " ",
362
+ op,
363
+ " ",
364
+ printExpression(file, ref(inf["rhs"])),
365
+ ];
366
+ }
367
+ case "assign": {
368
+ const a = node["assign"];
369
+ const op = ASSIGN_SYMBOLS[a["type"] ?? 0] ?? "=";
370
+ return [
371
+ printExpression(file, ref(a["lhs"])),
372
+ " ",
373
+ op,
374
+ " ",
375
+ printExpression(file, ref(a["rhs"])),
376
+ ];
377
+ }
378
+ case "unconstrainedAssign": {
379
+ const a = node["unconstrainedAssign"];
380
+ const op = (a["direction"] ?? AssignmentDirection.ASSIGNMENT_DIRECTION_INVALID) ===
381
+ AssignmentDirection.ASSIGNMENT_DIRECTION_LEFT_TO_RIGHT
382
+ ? "-->"
383
+ : "<--";
384
+ return [
385
+ printExpression(file, ref(a["lhs"])),
386
+ " ",
387
+ op,
388
+ " ",
389
+ printExpression(file, ref(a["rhs"])),
390
+ ];
391
+ }
392
+ case "constrainedAssign": {
393
+ const a = node["constrainedAssign"];
394
+ const op = (a["direction"] ?? AssignmentDirection.ASSIGNMENT_DIRECTION_INVALID) ===
395
+ AssignmentDirection.ASSIGNMENT_DIRECTION_LEFT_TO_RIGHT
396
+ ? "==>"
397
+ : "<==";
398
+ return [
399
+ printExpression(file, ref(a["lhs"])),
400
+ " ",
401
+ op,
402
+ " ",
403
+ printExpression(file, ref(a["rhs"])),
404
+ ];
405
+ }
406
+ case "constrainedEquality": {
407
+ const eq = node["constrainedEquality"];
408
+ return [
409
+ printExpression(file, ref(eq["lhs"])),
410
+ " === ",
411
+ printExpression(file, ref(eq["rhs"])),
412
+ ];
413
+ }
414
+ default:
415
+ throw new Error(`Unknown expression type: ${String(node["expression"])}`);
416
+ }
417
+ }
418
+ function printPostfix(file, operand, pf) {
419
+ switch (pf["postfix"]) {
420
+ case "fieldName":
421
+ return [operand, ".", pf["fieldName"]];
422
+ case "subscriptExpression":
423
+ return [operand, "[", printExpression(file, pf["subscriptExpression"] ?? 0), "]"];
424
+ case "invocation": {
425
+ const args = (pf["invocation"]?.["arguments"] ?? []).map((i) => printExpression(file, i));
426
+ if (args.length === 0)
427
+ return [operand, "()"];
428
+ return [operand, group(["(", indent([softline, join([",", line], args)]), softline, ")"])];
429
+ }
430
+ case "increment":
431
+ return [operand, "++"];
432
+ case "decrement":
433
+ return [operand, "--"];
434
+ default:
435
+ throw new Error(`Unknown postfix type: ${String(pf["postfix"])}`);
436
+ }
437
+ }
438
+ // ---- Plugin export --------------------------------------------------------------
439
+ const plugin = {
440
+ languages: [
441
+ {
442
+ name: "Starkom",
443
+ parsers: ["starkom"],
444
+ extensions: [".starkom"],
445
+ vscodeLanguageIds: ["starkom"],
446
+ },
447
+ ],
448
+ parsers: {
449
+ starkom: {
450
+ parse(text, options) {
451
+ return parse(options["filepath"] ?? "<anonymous>", text, false);
452
+ },
453
+ astFormat: "starkom",
454
+ locStart: (_node) => 0,
455
+ locEnd: (_node) => 0,
456
+ },
457
+ },
458
+ printers: {
459
+ starkom: {
460
+ print(path, _options, _print) {
461
+ return printFile(path.node);
462
+ },
463
+ },
464
+ },
465
+ };
466
+ export default plugin;
467
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,mCAAmC;AACnC,sCAAsC;AAGtC,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAC/B,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAE1C,OAAO,KAAK,WAAW,MAAM,uBAAuB,CAAC;AACrD,IAAO,GAAG,GAAG,WAAW,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;AAexC,qFAAqF;AAErF,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,GAAG,CAAC,QAAQ,CAAC;AAEhF,qFAAqF;AAErF,MAAM,eAAe,GAAG,GAAG,CAAC,oBAAoB,CAAC,IAAI,CAAC;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AAC;QAEzB,KAAK,WAAW;YACd,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;QAEzB;YACE,MAAM,IAAI,KAAK,CAAC,yBAAyB,MAAM,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC;IACtE,CAAC;AACH,CAAC;AAED,oFAAoF;AAEpF,MAAM,MAAM,GAAiB;IAC3B,SAAS,EAAE;QACT;YACE,IAAI,EAAE,SAAS;YACf,OAAO,EAAE,CAAC,SAAS,CAAC;YACpB,UAAU,EAAE,CAAC,UAAU,CAAC;YACxB,iBAAiB,EAAE,CAAC,SAAS,CAAC;SAC/B;KACF;IAED,OAAO,EAAE;QACP,OAAO,EAAE;YACP,KAAK,CAAC,IAAI,EAAE,OAAO;gBACjB,OAAO,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,aAAa,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;YAClE,CAAC;YACD,SAAS,EAAE,SAAS;YACpB,QAAQ,EAAE,CAAC,KAAc,EAAE,EAAE,CAAC,CAAC;YAC/B,MAAM,EAAE,CAAC,KAAc,EAAE,EAAE,CAAC,CAAC;SAC9B;KACF;IAED,QAAQ,EAAE;QACR,OAAO,EAAE;YACP,KAAK,CAAC,IAAmB,EAAE,QAAiB,EAAE,MAAM;gBAClD,OAAO,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAC9B,CAAC;SACF;KACF;CACF,CAAC;AAEF,eAAe,MAAM,CAAC"}
package/package.json ADDED
@@ -0,0 +1,42 @@
1
+ {
2
+ "name": "@libernet/prettier-plugin-starkom",
3
+ "version": "0.1.0",
4
+ "description": "Prettier plugin for formatting Starkom code.",
5
+ "homepage": "https://github.com/libernet-xyz/prettier-plugin-starkom#readme",
6
+ "bugs": {
7
+ "url": "https://github.com/libernet-xyz/prettier-plugin-starkom/issues"
8
+ },
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "git+https://github.com/libernet-xyz/prettier-plugin-starkom.git"
12
+ },
13
+ "license": "Apache-2.0",
14
+ "author": "Alberto La Rocca <alr@libernet.xyz>",
15
+ "type": "module",
16
+ "main": "dist/index.js",
17
+ "exports": "./dist/index.js",
18
+ "types": "dist/index.d.ts",
19
+ "files": [
20
+ "dist"
21
+ ],
22
+ "scripts": {
23
+ "build": "npx tsc",
24
+ "test": "NODE_OPTIONS='--import tsx/esm' mocha 'test/*.ts'"
25
+ },
26
+ "peerDependencies": {
27
+ "prettier": ">=3.0.0"
28
+ },
29
+ "dependencies": {
30
+ "@libernet/starkom": "^0.4.0"
31
+ },
32
+ "devDependencies": {
33
+ "@types/chai": "^5.2.3",
34
+ "@types/mocha": "^10.0.10",
35
+ "@types/node": "^25.9.3",
36
+ "chai": "^6.2.2",
37
+ "mocha": "^11.7.6",
38
+ "prettier": "^3.8.4",
39
+ "tsx": "^4.22.4",
40
+ "typescript": "^6.0.3"
41
+ }
42
+ }