rip-lang 3.17.2 → 3.17.3

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.
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rip-lang",
3
- "version": "3.17.2",
3
+ "version": "3.17.3",
4
4
  "description": "A modern language that compiles to JavaScript",
5
5
  "type": "module",
6
6
  "main": "src/compiler.js",
package/src/lexer.js CHANGED
@@ -1391,7 +1391,11 @@ export class Lexer {
1391
1391
  this.emit('.', '.');
1392
1392
  return 2;
1393
1393
  }
1394
- else if (val === '::') { tag = 'TYPE_ANNOTATION'; this.inTypeAnnotation = true; }
1394
+ else if (val === '::') {
1395
+ // `::` is prototype access (handled above when followed by an identifier).
1396
+ // Type annotations use a single `:` (e.g. `x: T`, `def f(a: T): R`).
1397
+ syntaxError("type annotations use a single ':' (e.g. `x: number`), not '::'", {row: this.row, col: this.col, len: 2});
1398
+ }
1395
1399
  // Reactive and binding operators
1396
1400
  else if (val === '~=') tag = 'COMPUTED_ASSIGN';
1397
1401
  else if (val === ':=') tag = 'REACTIVE_ASSIGN';