rip-lang 3.13.134 → 3.13.135

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.13.134",
3
+ "version": "3.13.135",
4
4
  "description": "A modern language that compiles to JavaScript",
5
5
  "type": "module",
6
6
  "main": "src/compiler.js",
package/rip-loader.js CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  import { plugin } from "bun";
4
4
  import { fileURLToPath } from "url";
5
- import { compileToJS } from "./src/compiler.js";
5
+ import { compileToJS, formatError } from "./src/compiler.js";
6
6
 
7
7
  await plugin({
8
8
  name: "rip-loader",
@@ -32,7 +32,7 @@ await plugin({
32
32
  loader: "js",
33
33
  };
34
34
  } catch (err) {
35
- console.error(`Error compiling ${args.path}:`, err.message);
35
+ console.error(formatError(err, { file: args.path }));
36
36
  throw err;
37
37
  }
38
38
  });
package/src/AGENTS.md CHANGED
@@ -63,7 +63,7 @@ Complete node reference:
63
63
  ['program', ...statements]
64
64
 
65
65
  // Variables & Assignment
66
- ['=', target, value] // x = expr or expr :> x (both produce this)
66
+ ['=', target, value] // x = expr
67
67
  ['+=', target, value] // Also: -=, *=, /=, %=, **=
68
68
  ['&&=', target, value] ['||=', target, value]
69
69
  ['?=', target, value] ['??=', target, value]
@@ -103,7 +103,6 @@ Complete node reference:
103
103
  ['!', expr] ['~', expr] ['typeof', expr]
104
104
  ['delete', expr] ['instanceof', expr, type]
105
105
  ['?', expr] // Existence check (x?)
106
- ['defined', expr] // Defined check (x!?)
107
106
  ['presence', expr] // Presence check (x?!) — Houdini operator
108
107
  ['++', expr, isPostfix] ['--', expr, isPostfix]
109
108
 
package/src/browser.js CHANGED
@@ -3,8 +3,8 @@
3
3
 
4
4
  export { Lexer } from './lexer.js';
5
5
  export { parser } from './parser.js';
6
- export { CodeEmitter, Compiler, compile, compileToJS, formatSExpr, getStdlibCode, getReactiveRuntime, getComponentRuntime } from './compiler.js';
7
- import { getStdlibCode } from './compiler.js';
6
+ export { CodeEmitter, Compiler, compile, compileToJS, formatSExpr, getStdlibCode, getReactiveRuntime, getComponentRuntime, RipError, formatError, formatErrorHTML } from './compiler.js';
7
+ import { getStdlibCode, formatError as _formatError } from './compiler.js';
8
8
 
9
9
  // Version info (replaced during build)
10
10
  export const VERSION = "0.0.0";
@@ -90,7 +90,7 @@ async function processRipScripts() {
90
90
  let js = '';
91
91
  for (const s of individual) {
92
92
  try { js += compileToJS(s.code, opts) + '\n'; }
93
- catch (e) { console.error(`Rip compile error in ${s.url || 'inline'}:`, e.message); }
93
+ catch (e) { console.error(_formatError(e, { source: s.code, file: s.url || 'inline', color: false })); }
94
94
  }
95
95
  if (js) {
96
96
  try { await (0, eval)(`(async()=>{\n${js}\n})()`); }
@@ -132,7 +132,7 @@ async function processRipScripts() {
132
132
  const js = compileToJS(s.code, opts);
133
133
  compiled.push({ js, url: s.url || 'inline' });
134
134
  } catch (e) {
135
- console.error(`Rip compile error in ${s.url || 'inline'}:`, e.message);
135
+ console.error(_formatError(e, { source: s.code, file: s.url || 'inline', color: false }));
136
136
  }
137
137
  }
138
138
 
@@ -281,7 +281,7 @@ export function rip(code) {
281
281
  if (result !== undefined) globalThis._ = result;
282
282
  return result;
283
283
  } catch (error) {
284
- console.error('Rip compilation error:', error.message);
284
+ console.error(_formatError(error, { source: code, color: false }));
285
285
  return undefined;
286
286
  }
287
287
  }