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.
- package/CHANGELOG.md +0 -1
- package/README.md +4 -7
- package/bin/rip +16 -4
- package/docs/RIP-LANG.md +0 -42
- package/docs/RIP-TYPES.md +47 -52
- package/docs/demo.html +2 -2
- package/docs/dist/rip.js +1585 -826
- package/docs/dist/rip.min.js +149 -137
- package/docs/dist/rip.min.js.br +0 -0
- package/package.json +1 -1
- package/rip-loader.js +2 -2
- package/src/AGENTS.md +1 -2
- package/src/browser.js +5 -5
- package/src/compiler.js +351 -30
- package/src/components.js +176 -11
- package/src/error.js +250 -0
- package/src/grammar/grammar.rip +2 -12
- package/src/lexer.js +15 -11
- package/src/parser.js +220 -223
- package/src/repl.js +3 -2
- package/src/sourcemap-utils.js +39 -6
- package/src/typecheck.js +312 -80
- package/src/types.js +226 -51
- package/src/ui.rip +4 -0
package/docs/dist/rip.min.js.br
CHANGED
|
Binary file
|
package/package.json
CHANGED
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(
|
|
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
|
|
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(
|
|
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(
|
|
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(
|
|
284
|
+
console.error(_formatError(error, { source: code, color: false }));
|
|
285
285
|
return undefined;
|
|
286
286
|
}
|
|
287
287
|
}
|