nomen-lang 0.9.0 → 0.11.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.
Files changed (72) hide show
  1. package/core/System/Arena.nm +9 -7
  2. package/core/System/Array.nm +1 -1
  3. package/core/System/Atomic.nm +3 -3
  4. package/core/System/BigInt.nm +182 -23
  5. package/core/System/Buffer.nm +37 -35
  6. package/core/System/ClassBuffer.nm +18 -18
  7. package/core/System/Controls/Alert.nm +1 -1
  8. package/core/System/Controls/App.nm +5 -5
  9. package/core/System/Controls/Button.nm +1 -1
  10. package/core/System/Controls/CheckBox.nm +1 -1
  11. package/core/System/Controls/ColorPicker.nm +1 -1
  12. package/core/System/Controls/ComboBox.nm +1 -1
  13. package/core/System/Controls/Container.nm +34 -34
  14. package/core/System/Controls/DatePicker.nm +1 -1
  15. package/core/System/Controls/Form.nm +2 -2
  16. package/core/System/Controls/GroupBox.nm +1 -1
  17. package/core/System/Controls/ImageView.nm +1 -1
  18. package/core/System/Controls/Layout.nm +5 -5
  19. package/core/System/Controls/LevelIndicator.nm +1 -1
  20. package/core/System/Controls/ListView.nm +1 -1
  21. package/core/System/Controls/Menu.nm +1 -1
  22. package/core/System/Controls/NumberInput.nm +3 -3
  23. package/core/System/Controls/OtpInput.nm +2 -2
  24. package/core/System/Controls/OutlineView.nm +1 -1
  25. package/core/System/Controls/Pagination.nm +6 -6
  26. package/core/System/Controls/Popover.nm +1 -1
  27. package/core/System/Controls/Progress.nm +1 -1
  28. package/core/System/Controls/Radio.nm +1 -1
  29. package/core/System/Controls/Scrollable.nm +1 -1
  30. package/core/System/Controls/SearchField.nm +1 -1
  31. package/core/System/Controls/SecureField.nm +1 -1
  32. package/core/System/Controls/Segmented.nm +1 -1
  33. package/core/System/Controls/Select.nm +1 -1
  34. package/core/System/Controls/Separator.nm +1 -1
  35. package/core/System/Controls/Sheet.nm +1 -1
  36. package/core/System/Controls/Slider.nm +1 -1
  37. package/core/System/Controls/Spinner.nm +3 -3
  38. package/core/System/Controls/SplitView.nm +2 -2
  39. package/core/System/Controls/Stepper.nm +1 -1
  40. package/core/System/Controls/Switch.nm +1 -1
  41. package/core/System/Controls/Table.nm +1 -1
  42. package/core/System/Controls/Tabs.nm +1 -1
  43. package/core/System/Controls/Text.nm +1 -1
  44. package/core/System/Controls/TextBox.nm +1 -1
  45. package/core/System/Controls/TextView.nm +1 -1
  46. package/core/System/Controls/Toggle.nm +1 -1
  47. package/core/System/Controls/Toolbar.nm +1 -1
  48. package/core/System/Controls/Window.nm +11 -3
  49. package/core/System/Fiber.nm +16 -3
  50. package/core/System/Format.nm +751 -0
  51. package/core/System/Graph.nm +2 -2
  52. package/core/System/LinkedList.nm +8 -6
  53. package/core/System/List.nm +16 -13
  54. package/core/System/Map.nm +11 -9
  55. package/core/System/Random.nm +3 -3
  56. package/core/System/Set.nm +9 -7
  57. package/core/System/StableList.nm +7 -7
  58. package/core/System/Stream/File.nm +16 -16
  59. package/core/System/Stream/Http.nm +3 -3
  60. package/core/System/Stream/Tcp.nm +5 -5
  61. package/core/System/StringBuilder.nm +16 -16
  62. package/core/System/Task.nm +56 -64
  63. package/core/System/Test.nm +18 -18
  64. package/core/System/Text/Chars.nm +1 -1
  65. package/core/System/Text/Json.nm +12 -12
  66. package/core/System/Text/JsonTree.nm +8 -8
  67. package/core/System/Text/Regex.nm +20 -20
  68. package/core/System/Thread.nm +26 -3
  69. package/core/System/Tree.nm +19 -3
  70. package/dist/index.mjs +3423 -1849
  71. package/package.json +1 -1
  72. package/src/docs.ts +10 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nomen-lang",
3
- "version": "0.9.0",
3
+ "version": "0.11.0",
4
4
  "description": "The CLI for the Nomen programming language.",
5
5
  "keywords": [],
6
6
  "license": "ISC",
package/src/docs.ts CHANGED
@@ -6,6 +6,7 @@ import type BaseNode from "../../src/nodes/BaseNode.ts";
6
6
  import type BitsetNode from "../../src/nodes/BitsetNode.ts";
7
7
  import type EnumNode from "../../src/nodes/EnumNode.ts";
8
8
  import type FunctionNode from "../../src/nodes/FunctionNode.ts";
9
+ import type ParameterNode from "../../src/nodes/ParameterNode.ts";
9
10
  import type StructNode from "../../src/nodes/StructNode.ts";
10
11
  import type TraitNode from "../../src/nodes/TraitNode.ts";
11
12
  import type Type from "../../src/nodes/Type.ts";
@@ -231,12 +232,20 @@ function heading_of(item: DocItem): string {
231
232
  function signature_of(fn: FunctionNode): string {
232
233
  const params = fn.params
233
234
  .filter((p) => !p.is_self_param)
234
- .map((p) => `${render_type(p.type)}${p.name ? " " + p.name : ""}`);
235
+ .map((p) => `${render_type(p.type)}${p.name ? " " + p.name : ""}${field_set_of(p)}`);
235
236
  let sig = `${fn.name}(${params.join(", ")})`;
236
237
  if (fn.return_type?.name) sig += ` -> ${render_type(fn.return_type)}`;
237
238
  return sig;
238
239
  }
239
240
 
241
+ /** The declared field set suffix (FIELD_EFFECTS.md): `{}` for "displaces
242
+ * nothing", `{ a, b }` for a named set, nothing for a wildcard. */
243
+ function field_set_of(param: ParameterNode): string {
244
+ if (param.field_set === undefined) return "";
245
+ if (param.field_set.length === 0) return " {}";
246
+ return ` { ${param.field_set.join(", ")} }`;
247
+ }
248
+
240
249
  function members_of(node: BaseNode): FunctionNode[] {
241
250
  if (node.node_type === "struct" || node.node_type === "trait") {
242
251
  const n = node as unknown as { functions: FunctionNode[] };