@xnoxs/flux-lang 3.4.8 → 3.5.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/dist/flux.esm.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * flux-lang v3.4.8
2
+ * flux-lang v3.5.0
3
3
  * Flux — A modern language that transpiles to JavaScript. Python-clean syntax, TypeScript-level safety, Rust-inspired pattern matching.
4
4
  * (c) 2026 Flux Lang Contributors
5
5
  * Released under the MIT License
@@ -87,6 +87,8 @@ var require_lexer = __commonJS({
87
87
  SATISFIES: "SATISFIES",
88
88
  IS: "IS",
89
89
  CONST: "CONST",
90
+ // Keywords — property/object operators
91
+ DELETE: "DELETE",
90
92
  // Operators
91
93
  PLUS: "PLUS",
92
94
  MINUS: "MINUS",
@@ -215,6 +217,7 @@ var require_lexer = __commonJS({
215
217
  satisfies: T.SATISFIES,
216
218
  is: T.IS,
217
219
  const: T.CONST,
220
+ delete: T.DELETE,
218
221
  true: "__TRUE__",
219
222
  false: "__FALSE__",
220
223
  null: "__NULL__"
@@ -281,7 +284,15 @@ var require_lexer = __commonJS({
281
284
  if (this.ch() === "\\") {
282
285
  this.adv();
283
286
  const e = this.adv();
284
- s += { n: "\n", t: " ", "`": "`", "\\": "\\" }[e] || "\\" + e;
287
+ if (e === "u") {
288
+ const hex = this.adv() + this.adv() + this.adv() + this.adv();
289
+ s += String.fromCodePoint(parseInt(hex, 16));
290
+ } else if (e === "x") {
291
+ const hex = this.adv() + this.adv();
292
+ s += String.fromCodePoint(parseInt(hex, 16));
293
+ } else {
294
+ s += { n: "\n", t: " ", r: "\r", "`": "`", "\\": "\\" }[e] || "\\" + e;
295
+ }
285
296
  } else {
286
297
  s += this.adv();
287
298
  }
@@ -308,7 +319,15 @@ var require_lexer = __commonJS({
308
319
  if (this.ch() === "\\") {
309
320
  this.adv();
310
321
  const e = this.adv();
311
- text += { n: "\n", t: " ", '"': '"', "'": "'", "\\": "\\", "{": "{", "}": "}" }[e] || "\\" + e;
322
+ if (e === "u") {
323
+ const hex = this.adv() + this.adv() + this.adv() + this.adv();
324
+ text += String.fromCodePoint(parseInt(hex, 16));
325
+ } else if (e === "x") {
326
+ const hex = this.adv() + this.adv();
327
+ text += String.fromCodePoint(parseInt(hex, 16));
328
+ } else {
329
+ text += { n: "\n", t: " ", r: "\r", '"': '"', "'": "'", "\\": "\\", "{": "{", "}": "}" }[e] || "\\" + e;
330
+ }
312
331
  } else if (this.ch() === "{") {
313
332
  parts.push({ type: "text", value: text });
314
333
  text = "";
@@ -503,7 +522,15 @@ var require_lexer = __commonJS({
503
522
  if (this.ch() === "\\") {
504
523
  this.adv();
505
524
  const e = this.adv();
506
- s += { n: "\n", t: " ", r: "\r", "'": "'", "\\": "\\" }[e] || "\\" + e;
525
+ if (e === "u") {
526
+ const hex = this.adv() + this.adv() + this.adv() + this.adv();
527
+ s += String.fromCodePoint(parseInt(hex, 16));
528
+ } else if (e === "x") {
529
+ const hex = this.adv() + this.adv();
530
+ s += String.fromCodePoint(parseInt(hex, 16));
531
+ } else {
532
+ s += { n: "\n", t: " ", r: "\r", "'": "'", "\\": "\\" }[e] || "\\" + e;
533
+ }
507
534
  } else {
508
535
  s += this.adv();
509
536
  }
@@ -2192,6 +2219,10 @@ var require_parser = __commonJS({
2192
2219
  this.pos++;
2193
2220
  return { type: "TypeofExpr", operand: this.parseUnary() };
2194
2221
  }
2222
+ if (this.check(T.DELETE)) {
2223
+ this.pos++;
2224
+ return { type: "DeleteExpr", operand: this.parseUnary() };
2225
+ }
2195
2226
  return this.parseLambdaOrPostfix();
2196
2227
  }
2197
2228
  parseLambdaOrPostfix() {
@@ -3023,6 +3054,8 @@ function _fmt(v, s) {
3023
3054
  return `await ${this.genExpr(node.operand)}`;
3024
3055
  case "TypeofExpr":
3025
3056
  return `typeof ${this.genExpr(node.operand)}`;
3057
+ case "DeleteExpr":
3058
+ return `delete ${this.genExpr(node.operand)}`;
3026
3059
  case "SpreadExpr":
3027
3060
  return `...${this.genExpr(node.expr)}`;
3028
3061
  case "CallExpr": {