@kernlang/core 3.3.9 → 3.4.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 (82) 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/data-layer.d.ts +1 -1
  5. package/dist/codegen/data-layer.js +59 -23
  6. package/dist/codegen/data-layer.js.map +1 -1
  7. package/dist/codegen/events.js +1 -1
  8. package/dist/codegen/events.js.map +1 -1
  9. package/dist/codegen/functions.js +29 -5
  10. package/dist/codegen/functions.js.map +1 -1
  11. package/dist/codegen/ground-layer.js +10 -6
  12. package/dist/codegen/ground-layer.js.map +1 -1
  13. package/dist/codegen/helpers.d.ts +3 -1
  14. package/dist/codegen/helpers.js +5 -1
  15. package/dist/codegen/helpers.js.map +1 -1
  16. package/dist/codegen/machines.js +4 -3
  17. package/dist/codegen/machines.js.map +1 -1
  18. package/dist/codegen/modules.d.ts +1 -0
  19. package/dist/codegen/modules.js +52 -1
  20. package/dist/codegen/modules.js.map +1 -1
  21. package/dist/codegen/screens.js +31 -9
  22. package/dist/codegen/screens.js.map +1 -1
  23. package/dist/codegen/stdlib-preamble.d.ts +39 -0
  24. package/dist/codegen/stdlib-preamble.js +213 -0
  25. package/dist/codegen/stdlib-preamble.js.map +1 -0
  26. package/dist/codegen/type-system.d.ts +113 -1
  27. package/dist/codegen/type-system.js +389 -30
  28. package/dist/codegen/type-system.js.map +1 -1
  29. package/dist/codegen-core.d.ts +2 -2
  30. package/dist/codegen-core.js +58 -10
  31. package/dist/codegen-core.js.map +1 -1
  32. package/dist/codegen-expression.d.ts +3 -0
  33. package/dist/codegen-expression.js +93 -0
  34. package/dist/codegen-expression.js.map +1 -0
  35. package/dist/concepts.d.ts +3 -3
  36. package/dist/config.d.ts +16 -0
  37. package/dist/config.js +13 -0
  38. package/dist/config.js.map +1 -1
  39. package/dist/decompiler.js +356 -4
  40. package/dist/decompiler.js.map +1 -1
  41. package/dist/importer.d.ts +1 -0
  42. package/dist/importer.js +574 -34
  43. package/dist/importer.js.map +1 -1
  44. package/dist/index.d.ts +6 -3
  45. package/dist/index.js +9 -3
  46. package/dist/index.js.map +1 -1
  47. package/dist/node-props.d.ts +177 -1
  48. package/dist/node-props.js.map +1 -1
  49. package/dist/parser-core.js +30 -5
  50. package/dist/parser-core.js.map +1 -1
  51. package/dist/parser-diagnostics.js +5 -0
  52. package/dist/parser-diagnostics.js.map +1 -1
  53. package/dist/parser-expression.d.ts +17 -0
  54. package/dist/parser-expression.js +498 -0
  55. package/dist/parser-expression.js.map +1 -0
  56. package/dist/parser-tokenizer.d.ts +5 -3
  57. package/dist/parser-tokenizer.js +97 -16
  58. package/dist/parser-tokenizer.js.map +1 -1
  59. package/dist/parser-validate-effects.d.ts +21 -0
  60. package/dist/parser-validate-effects.js +188 -0
  61. package/dist/parser-validate-effects.js.map +1 -0
  62. package/dist/parser-validate-expressions.d.ts +6 -0
  63. package/dist/parser-validate-expressions.js +41 -0
  64. package/dist/parser-validate-expressions.js.map +1 -0
  65. package/dist/parser-validate-union-kind.d.ts +24 -0
  66. package/dist/parser-validate-union-kind.js +97 -0
  67. package/dist/parser-validate-union-kind.js.map +1 -0
  68. package/dist/schema.d.ts +1 -1
  69. package/dist/schema.js +373 -27
  70. package/dist/schema.js.map +1 -1
  71. package/dist/semantic-validator.js +15 -8
  72. package/dist/semantic-validator.js.map +1 -1
  73. package/dist/spec.d.ts +5 -2
  74. package/dist/spec.js +24 -2
  75. package/dist/spec.js.map +1 -1
  76. package/dist/types.d.ts +7 -1
  77. package/dist/types.js +7 -1
  78. package/dist/types.js.map +1 -1
  79. package/dist/value-ir.d.ts +69 -0
  80. package/dist/value-ir.js +20 -0
  81. package/dist/value-ir.js.map +1 -0
  82. package/package.json +1 -1
@@ -0,0 +1,69 @@
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
+ export type ValueIRKind = ValueIR['kind'];
69
+ export declare function isValueIR(x: unknown): x is ValueIR;
@@ -0,0 +1,20 @@
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
+ }
20
+ //# 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;AAgDtF,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,CACf,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.0",
4
4
  "description": "Kern core — parser, types, spec, config, style engines, codegen",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",