@kernlang/core 3.3.9 → 3.4.1

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 (97) hide show
  1. package/dist/capability-matrix.d.ts +15 -0
  2. package/dist/capability-matrix.js +245 -0
  3. package/dist/capability-matrix.js.map +1 -0
  4. package/dist/codegen/body-ts.d.ts +68 -0
  5. package/dist/codegen/body-ts.js +214 -0
  6. package/dist/codegen/body-ts.js.map +1 -0
  7. package/dist/codegen/data-layer.d.ts +1 -1
  8. package/dist/codegen/data-layer.js +59 -23
  9. package/dist/codegen/data-layer.js.map +1 -1
  10. package/dist/codegen/events.js +1 -1
  11. package/dist/codegen/events.js.map +1 -1
  12. package/dist/codegen/functions.js +48 -7
  13. package/dist/codegen/functions.js.map +1 -1
  14. package/dist/codegen/ground-layer.js +10 -6
  15. package/dist/codegen/ground-layer.js.map +1 -1
  16. package/dist/codegen/helpers.d.ts +3 -1
  17. package/dist/codegen/helpers.js +5 -1
  18. package/dist/codegen/helpers.js.map +1 -1
  19. package/dist/codegen/kern-stdlib.d.ts +63 -0
  20. package/dist/codegen/kern-stdlib.js +160 -0
  21. package/dist/codegen/kern-stdlib.js.map +1 -0
  22. package/dist/codegen/machines.js +4 -3
  23. package/dist/codegen/machines.js.map +1 -1
  24. package/dist/codegen/modules.d.ts +1 -0
  25. package/dist/codegen/modules.js +52 -1
  26. package/dist/codegen/modules.js.map +1 -1
  27. package/dist/codegen/screens.js +31 -9
  28. package/dist/codegen/screens.js.map +1 -1
  29. package/dist/codegen/stdlib-preamble.d.ts +58 -0
  30. package/dist/codegen/stdlib-preamble.js +271 -0
  31. package/dist/codegen/stdlib-preamble.js.map +1 -0
  32. package/dist/codegen/type-system.d.ts +113 -1
  33. package/dist/codegen/type-system.js +404 -31
  34. package/dist/codegen/type-system.js.map +1 -1
  35. package/dist/codegen-core.d.ts +2 -2
  36. package/dist/codegen-core.js +65 -10
  37. package/dist/codegen-core.js.map +1 -1
  38. package/dist/codegen-expression.d.ts +11 -0
  39. package/dist/codegen-expression.js +199 -0
  40. package/dist/codegen-expression.js.map +1 -0
  41. package/dist/concepts.d.ts +3 -3
  42. package/dist/config.d.ts +16 -0
  43. package/dist/config.js +13 -0
  44. package/dist/config.js.map +1 -1
  45. package/dist/decompiler.js +575 -4
  46. package/dist/decompiler.js.map +1 -1
  47. package/dist/importer.d.ts +1 -0
  48. package/dist/importer.js +574 -34
  49. package/dist/importer.js.map +1 -1
  50. package/dist/index.d.ts +16 -3
  51. package/dist/index.js +19 -3
  52. package/dist/index.js.map +1 -1
  53. package/dist/node-props.d.ts +181 -1
  54. package/dist/node-props.js.map +1 -1
  55. package/dist/parser-core.d.ts +7 -1
  56. package/dist/parser-core.js +33 -7
  57. package/dist/parser-core.js.map +1 -1
  58. package/dist/parser-diagnostics.js +8 -0
  59. package/dist/parser-diagnostics.js.map +1 -1
  60. package/dist/parser-expression.d.ts +22 -0
  61. package/dist/parser-expression.js +774 -0
  62. package/dist/parser-expression.js.map +1 -0
  63. package/dist/parser-keywords.js +16 -0
  64. package/dist/parser-keywords.js.map +1 -1
  65. package/dist/parser-tokenizer.d.ts +5 -3
  66. package/dist/parser-tokenizer.js +97 -16
  67. package/dist/parser-tokenizer.js.map +1 -1
  68. package/dist/parser-validate-effects.d.ts +21 -0
  69. package/dist/parser-validate-effects.js +188 -0
  70. package/dist/parser-validate-effects.js.map +1 -0
  71. package/dist/parser-validate-expressions.d.ts +6 -0
  72. package/dist/parser-validate-expressions.js +41 -0
  73. package/dist/parser-validate-expressions.js.map +1 -0
  74. package/dist/parser-validate-propagation.d.ts +105 -0
  75. package/dist/parser-validate-propagation.js +684 -0
  76. package/dist/parser-validate-propagation.js.map +1 -0
  77. package/dist/parser-validate-union-kind.d.ts +24 -0
  78. package/dist/parser-validate-union-kind.js +97 -0
  79. package/dist/parser-validate-union-kind.js.map +1 -0
  80. package/dist/parser.d.ts +10 -3
  81. package/dist/parser.js +11 -5
  82. package/dist/parser.js.map +1 -1
  83. package/dist/schema.d.ts +1 -1
  84. package/dist/schema.js +562 -30
  85. package/dist/schema.js.map +1 -1
  86. package/dist/semantic-validator.js +24 -13
  87. package/dist/semantic-validator.js.map +1 -1
  88. package/dist/spec.d.ts +5 -2
  89. package/dist/spec.js +36 -2
  90. package/dist/spec.js.map +1 -1
  91. package/dist/types.d.ts +7 -1
  92. package/dist/types.js +7 -1
  93. package/dist/types.js.map +1 -1
  94. package/dist/value-ir.d.ts +96 -0
  95. package/dist/value-ir.js +25 -0
  96. package/dist/value-ir.js.map +1 -0
  97. package/package.json +1 -1
package/dist/types.js CHANGED
@@ -7,5 +7,11 @@
7
7
  * 3. A decompiler that converts IRNode tree → human-readable TypeScript
8
8
  * 4. Source map generation for debugging
9
9
  */
10
- export {};
10
+ /** Type guard for ExprObject — matches the ExprObject contract exactly. */
11
+ export function isExprObject(value) {
12
+ return (typeof value === 'object' &&
13
+ value !== null &&
14
+ value.__expr === true &&
15
+ typeof value.code === 'string');
16
+ }
11
17
  //# sourceMappingURL=types.js.map
package/dist/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG"}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAQH,2EAA2E;AAC3E,MAAM,UAAU,YAAY,CAAC,KAAc;IACzC,OAAO,CACL,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,KAAK,IAAI;QACb,KAA8B,CAAC,MAAM,KAAK,IAAI;QAC/C,OAAQ,KAA4B,CAAC,IAAI,KAAK,QAAQ,CACvD,CAAC;AACJ,CAAC"}
@@ -0,0 +1,96 @@
1
+ /** Expression value AST. Mirrors TS/JS precedence semantics for round-trip safety. */
2
+ import type { IRSourceLocation } from './types.js';
3
+ export type BinaryOp = '+' | '-' | '*' | '/' | '%' | '**' | '==' | '!=' | '===' | '!==' | '<' | '<=' | '>' | '>=' | '&&' | '||' | '??' | '&' | '|' | '^' | '<<' | '>>' | '>>>';
4
+ export type UnaryOp = '!' | '-' | '+' | '~' | 'typeof' | 'void';
5
+ export type ValueIR = {
6
+ kind: 'numLit';
7
+ value: number;
8
+ bigint?: boolean;
9
+ raw: string;
10
+ loc?: IRSourceLocation;
11
+ } | {
12
+ kind: 'strLit';
13
+ value: string;
14
+ quote: '"' | "'";
15
+ loc?: IRSourceLocation;
16
+ } | {
17
+ kind: 'tmplLit';
18
+ quasis: string[];
19
+ expressions: ValueIR[];
20
+ loc?: IRSourceLocation;
21
+ } | {
22
+ kind: 'boolLit';
23
+ value: boolean;
24
+ loc?: IRSourceLocation;
25
+ } | {
26
+ kind: 'nullLit';
27
+ loc?: IRSourceLocation;
28
+ } | {
29
+ kind: 'undefLit';
30
+ loc?: IRSourceLocation;
31
+ } | {
32
+ kind: 'regexLit';
33
+ pattern: string;
34
+ flags: string;
35
+ loc?: IRSourceLocation;
36
+ } | {
37
+ kind: 'ident';
38
+ name: string;
39
+ loc?: IRSourceLocation;
40
+ } | {
41
+ kind: 'member';
42
+ object: ValueIR;
43
+ property: string;
44
+ optional: boolean;
45
+ loc?: IRSourceLocation;
46
+ } | {
47
+ kind: 'call';
48
+ callee: ValueIR;
49
+ args: ValueIR[];
50
+ optional: boolean;
51
+ loc?: IRSourceLocation;
52
+ } | {
53
+ kind: 'binary';
54
+ op: BinaryOp;
55
+ left: ValueIR;
56
+ right: ValueIR;
57
+ loc?: IRSourceLocation;
58
+ } | {
59
+ kind: 'unary';
60
+ op: UnaryOp;
61
+ argument: ValueIR;
62
+ loc?: IRSourceLocation;
63
+ } | {
64
+ kind: 'spread';
65
+ argument: ValueIR;
66
+ loc?: IRSourceLocation;
67
+ } | {
68
+ kind: 'await';
69
+ argument: ValueIR;
70
+ loc?: IRSourceLocation;
71
+ } | {
72
+ kind: 'new';
73
+ argument: ValueIR;
74
+ loc?: IRSourceLocation;
75
+ } | {
76
+ kind: 'propagate';
77
+ argument: ValueIR;
78
+ op: '?' | '!';
79
+ loc?: IRSourceLocation;
80
+ } | {
81
+ kind: 'objectLit';
82
+ entries: ({
83
+ key: string;
84
+ value: ValueIR;
85
+ } | {
86
+ kind: 'spread';
87
+ argument: ValueIR;
88
+ })[];
89
+ loc?: IRSourceLocation;
90
+ } | {
91
+ kind: 'arrayLit';
92
+ items: ValueIR[];
93
+ loc?: IRSourceLocation;
94
+ };
95
+ export type ValueIRKind = ValueIR['kind'];
96
+ export declare function isValueIR(x: unknown): x is ValueIR;
@@ -0,0 +1,25 @@
1
+ /** Expression value AST. Mirrors TS/JS precedence semantics for round-trip safety. */
2
+ export function isValueIR(x) {
3
+ if (typeof x !== 'object' || x === null)
4
+ return false;
5
+ const k = x.kind;
6
+ return (k === 'numLit' ||
7
+ k === 'strLit' ||
8
+ k === 'tmplLit' ||
9
+ k === 'boolLit' ||
10
+ k === 'nullLit' ||
11
+ k === 'undefLit' ||
12
+ k === 'regexLit' ||
13
+ k === 'ident' ||
14
+ k === 'member' ||
15
+ k === 'call' ||
16
+ k === 'binary' ||
17
+ k === 'unary' ||
18
+ k === 'spread' ||
19
+ k === 'await' ||
20
+ k === 'new' ||
21
+ k === 'propagate' ||
22
+ k === 'objectLit' ||
23
+ k === 'arrayLit');
24
+ }
25
+ //# sourceMappingURL=value-ir.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"value-ir.js","sourceRoot":"","sources":["../src/value-ir.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAyDtF,MAAM,UAAU,SAAS,CAAC,CAAU;IAClC,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,IAAI;QAAE,OAAO,KAAK,CAAC;IACtD,MAAM,CAAC,GAAI,CAAwB,CAAC,IAAI,CAAC;IACzC,OAAO,CACL,CAAC,KAAK,QAAQ;QACd,CAAC,KAAK,QAAQ;QACd,CAAC,KAAK,SAAS;QACf,CAAC,KAAK,SAAS;QACf,CAAC,KAAK,SAAS;QACf,CAAC,KAAK,UAAU;QAChB,CAAC,KAAK,UAAU;QAChB,CAAC,KAAK,OAAO;QACb,CAAC,KAAK,QAAQ;QACd,CAAC,KAAK,MAAM;QACZ,CAAC,KAAK,QAAQ;QACd,CAAC,KAAK,OAAO;QACb,CAAC,KAAK,QAAQ;QACd,CAAC,KAAK,OAAO;QACb,CAAC,KAAK,KAAK;QACX,CAAC,KAAK,WAAW;QACjB,CAAC,KAAK,WAAW;QACjB,CAAC,KAAK,UAAU,CACjB,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kernlang/core",
3
- "version": "3.3.9",
3
+ "version": "3.4.1",
4
4
  "description": "Kern core — parser, types, spec, config, style engines, codegen",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",