rip-lang 3.13.17 → 3.13.18
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/README.md +1 -1
- package/docs/dist/rip.js +6 -3
- package/docs/dist/rip.min.js +2 -2
- package/docs/dist/rip.min.js.br +0 -0
- package/docs/index.html +4 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
</p>
|
|
10
10
|
|
|
11
11
|
<p align="center">
|
|
12
|
-
<a href="CHANGELOG.md"><img src="https://img.shields.io/badge/version-3.13.
|
|
12
|
+
<a href="CHANGELOG.md"><img src="https://img.shields.io/badge/version-3.13.18-blue.svg" alt="Version"></a>
|
|
13
13
|
<a href="#zero-dependencies"><img src="https://img.shields.io/badge/dependencies-ZERO-brightgreen.svg" alt="Dependencies"></a>
|
|
14
14
|
<a href="#"><img src="https://img.shields.io/badge/tests-1%2C255%2F1%2C255-brightgreen.svg" alt="Tests"></a>
|
|
15
15
|
<a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-green.svg" alt="License"></a>
|
package/docs/dist/rip.js
CHANGED
|
@@ -7615,8 +7615,11 @@ ${this.indent()}}`;
|
|
|
7615
7615
|
return [body];
|
|
7616
7616
|
if (body[0] === "block")
|
|
7617
7617
|
return body.slice(1);
|
|
7618
|
-
if (Array.isArray(body[0]))
|
|
7618
|
+
if (Array.isArray(body[0])) {
|
|
7619
|
+
if (typeof body[0][0] === "string")
|
|
7620
|
+
return [body];
|
|
7619
7621
|
return body;
|
|
7622
|
+
}
|
|
7620
7623
|
return [body];
|
|
7621
7624
|
}
|
|
7622
7625
|
indent() {
|
|
@@ -8352,8 +8355,8 @@ globalThis.zip ??= (...a) => a[0].map((_, i) => a.map(b => b[i]));
|
|
|
8352
8355
|
return new CodeGenerator({}).getComponentRuntime();
|
|
8353
8356
|
}
|
|
8354
8357
|
// src/browser.js
|
|
8355
|
-
var VERSION = "3.13.
|
|
8356
|
-
var BUILD_DATE = "2026-02-25@
|
|
8358
|
+
var VERSION = "3.13.17";
|
|
8359
|
+
var BUILD_DATE = "2026-02-25@08:50:22GMT";
|
|
8357
8360
|
if (typeof globalThis !== "undefined") {
|
|
8358
8361
|
if (!globalThis.__rip)
|
|
8359
8362
|
new Function(getReactiveRuntime())();
|
package/docs/dist/rip.min.js
CHANGED
|
@@ -282,7 +282,7 @@ ${this.indent()}}`}return`{ if (${this.generate(W,"value")}) ${this.generate($,"
|
|
|
282
282
|
`;this.indentLevel--,U+=this.indent()+"}"}if(W){if(U+=` else {
|
|
283
283
|
`,this.indentLevel++,_==="value")U+=this.indent()+`return ${this.extractExpression(W)};
|
|
284
284
|
`;else for(let u of this.unwrapBlock(W))U+=this.indent()+this.generate(u,"statement")+`;
|
|
285
|
-
`;this.indentLevel--,U+=this.indent()+"}"}return _==="value"?`(() => { ${U} })()`:U}extractExpression($){let W=this.unwrapBlock($);return W.length>0?this.generate(W[W.length-1],"value"):"undefined"}unwrapBlock($){if(!Array.isArray($))return[$];if($[0]==="block")return $.slice(1);if(Array.isArray($[0]))return
|
|
285
|
+
`;this.indentLevel--,U+=this.indent()+"}"}return _==="value"?`(() => { ${U} })()`:U}extractExpression($){let W=this.unwrapBlock($);return W.length>0?this.generate(W[W.length-1],"value"):"undefined"}unwrapBlock($){if(!Array.isArray($))return[$];if($[0]==="block")return $.slice(1);if(Array.isArray($[0])){if(typeof $[0][0]==="string")return[$];return $}return[$]}indent(){return this.indentString.repeat(this.indentLevel)}needsSemicolon($,W){if(!W||W.endsWith(";"))return!1;if(!W.endsWith("}"))return!0;let _=Array.isArray($)?$[0]:null;return!["def","class","if","for-in","for-of","for-as","while","loop","switch","try"].includes(_)}addSemicolon($,W){return W+(this.needsSemicolon($,W)?";":"")}formatStatements($,W="statement"){return $.map((_)=>this.indent()+this.addSemicolon(_,this.generate(_,W)))}wrapForCondition($){if(/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test($))return $;if($.startsWith("(")&&$.endsWith(")"))return $;return`(${$})`}hasExplicitControlFlow($){if(!Array.isArray($))return!1;let W=$[0];if(W==="return"||W==="throw"||W==="break"||W==="continue")return!0;if(W==="block")return $.slice(1).some((_)=>Array.isArray(_)&&["return","throw","break","continue"].includes(_[0]));if(W==="switch"){let[,,_]=$;return _?.some((U)=>{return this.unwrapBlock(U[2]).some((f)=>Array.isArray(f)&&["return","throw","break","continue"].includes(f[0]))})}if(W==="if"){let[,,_,U]=$;return this.branchHasControlFlow(_)&&U&&this.branchHasControlFlow(U)}return!1}branchHasControlFlow($){if(!Array.isArray($))return!1;let W=this.unwrapBlock($);if(W.length===0)return!1;let _=W[W.length-1];return Array.isArray(_)&&["return","throw","break","continue"].includes(_[0])}withIndent($){this.indentLevel++;let W=$();return this.indentLevel--,W}is($,W,_){if(!Array.isArray($))return null;if((S($[0])??$[0])!==W)return null;let U=$.slice(1);if(_!=null&&U.length!==_)return null;return U}unwrap($){if(typeof $!=="string")return $;while($.startsWith("(")&&$.endsWith(")")){let W=0,_=0,U=!0,u=!1;for(let f=0;f<$.length;f++){if($[f]==="(")W++;if($[f]===")")W--;if($[f]==="["||$[f]==="{")_++;if($[f]==="]"||$[f]==="}")_--;if($[f]===","&&W===1&&_===0)u=!0;if(W===0&&f<$.length-1){U=!1;break}}if(u)U=!1;if(U)$=$.slice(1,-1);else break}return $}unwrapLogical($){if(typeof $!=="string")return $;while($.startsWith("(")&&$.endsWith(")")){let W=0,_=1/0;for(let U=1;U<$.length-1;U++){if($[U]==="(")W++;if($[U]===")")W--;_=Math.min(_,W)}if(_>=0)$=$.slice(1,-1);else break}return $}unwrapIfBranch($){if(Array.isArray($)&&$.length===1&&(!Array.isArray($[0])||$[0][0]!=="block"))return $[0];return $}flattenBinaryChain($){if(!Array.isArray($)||$.length<3)return $;let[W,..._]=$;if(W!=="&&"&&W!=="||")return $;let U=[],u=(f)=>{if(Array.isArray(f)&&f[0]===W)for(let F=1;F<f.length;F++)u(f[F]);else U.push(f)};for(let f of _)u(f);return[W,...U]}hasStatementInBranch($){if(!Array.isArray($))return!1;let W=$[0];if(W==="return"||W==="throw"||W==="break"||W==="continue")return!0;if(W==="block")return $.slice(1).some((_)=>this.hasStatementInBranch(_));return!1}hasNestedMultiStatement($){if(!Array.isArray($))return!1;if($[0]==="if"){let[W,_,U,...u]=$;return this.is(U,"block")&&U.length>2||u.some((f)=>this.hasNestedMultiStatement(f))}return!1}buildTernaryChain($){if($.length===0)return"undefined";if($.length===1)return this.extractExpression(this.unwrapIfBranch($[0]));let W=$[0];if(this.is(W,"if")){let[_,U,u,...f]=W,F=this.extractExpression(this.unwrapIfBranch(u)),Y=this.buildTernaryChain([...f,...$.slice(1)]);return`(${this.generate(U,"value")} ? ${F} : ${Y})`}return this.extractExpression(this.unwrapIfBranch(W))}collectVarsFromArray($,W){$.slice(1).forEach((_)=>{if(_===","||_==="...")return;if(typeof _==="string"){W.add(_);return}if(Array.isArray(_)){if(_[0]==="..."&&typeof _[1]==="string")W.add(_[1]);else if(_[0]==="array")this.collectVarsFromArray(_,W);else if(_[0]==="object")this.collectVarsFromObject(_,W)}})}collectVarsFromObject($,W){$.slice(1).forEach((_)=>{if(!Array.isArray(_))return;if(_[0]==="..."&&typeof _[1]==="string"){W.add(_[1]);return}if(_.length>=2){let[U,u,f]=_;if(f==="="){if(typeof U==="string")W.add(U)}else if(typeof u==="string")W.add(u);else if(Array.isArray(u)){if(u[0]==="array")this.collectVarsFromArray(u,W);else if(u[0]==="object")this.collectVarsFromObject(u,W)}}})}extractStringContent($){let W=S($).slice(1,-1),_=V($,"indent");if(_)W=W.replace(new RegExp(`\\n${_}`,"g"),`
|
|
286
286
|
`);if(V($,"initialChunk")&&W.startsWith(`
|
|
287
287
|
`))W=W.slice(1);if(V($,"finalChunk")&&W.endsWith(`
|
|
288
288
|
`))W=W.slice(0,-1);return W}processHeregex($){let W="",_=!1,U=0,u=()=>{let f=0,F=U-1;while(F>=0&&$[F]==="\\")f++,F--;return f%2===1};while(U<$.length){let f=$[U];if(f==="["&&!u()){_=!0,W+=f,U++;continue}if(f==="]"&&_&&!u()){_=!1,W+=f,U++;continue}if(_){W+=f,U++;continue}if(/\s/.test(f)){U++;continue}if(f==="#"){if(u()){W+=f,U++;continue}let F=U-1;while(F>=0&&$[F]==="\\")F--;if(F<U-1){W+=f,U++;continue}while(U<$.length&&$[U]!==`
|
|
@@ -534,7 +534,7 @@ globalThis.sleep ??= (ms) => new Promise(r => setTimeout(r, ms));
|
|
|
534
534
|
globalThis.todo ??= (msg) => { throw new Error(msg || "Not implemented"); };
|
|
535
535
|
globalThis.warn ??= console.warn;
|
|
536
536
|
globalThis.zip ??= (...a) => a[0].map((_, i) => a.map(b => b[i]));
|
|
537
|
-
`}function A1(){return new C({}).getReactiveRuntime()}function Z1(){return new C({}).getComponentRuntime()}var H2="3.13.
|
|
537
|
+
`}function A1(){return new C({}).getReactiveRuntime()}function Z1(){return new C({}).getComponentRuntime()}var H2="3.13.17",z2="2026-02-25@08:50:22GMT";if(typeof globalThis<"u"){if(!globalThis.__rip)Function(A1())();if(!globalThis.__ripComponent)Function(Z1())()}var g3=($)=>{let W=$.match(/^[ \t]*(?=\S)/gm),_=Math.min(...(W||[]).map((U)=>U.length));return $.replace(RegExp(`^[ ]{${_}}`,"gm"),"").trim()};async function O2(){let $=[],W=document.querySelector('script[src$="rip.min.js"], script[src$="rip.js"]'),_=W?.getAttribute("data-src");if(_){for(let u of _.trim().split(/\s+/))if(u)$.push({url:u})}for(let u of document.querySelectorAll('script[type="text/rip"]'))if(u.src)$.push({url:u.src});else{let f=g3(u.textContent);if(f)$.push({code:f})}if($.length>0){await Promise.all($.map(async(F)=>{if(!F.url)return;try{let Y=await fetch(F.url);if(!Y.ok){console.error(`Rip: failed to fetch ${F.url} (${Y.status})`);return}F.code=await Y.text()}catch(Y){console.error(`Rip: failed to fetch ${F.url}:`,Y.message)}}));let u={skipRuntimes:!0,skipExports:!0},f=[];for(let F of $){if(!F.code)continue;try{f.push(n(F.code,u))}catch(Y){console.error("Rip compile error:",Y.message)}}if(f.length>0){let F=f.join(`
|
|
538
538
|
`),Y=W?.getAttribute("data-mount");if(Y){let A=W.getAttribute("data-target")||"body";F+=`
|
|
539
539
|
${Y}.mount(${JSON.stringify(A)});`}try{await(0,eval)(`(async()=>{
|
|
540
540
|
${F}
|
package/docs/dist/rip.min.js.br
CHANGED
|
Binary file
|
package/docs/index.html
CHANGED
|
@@ -378,11 +378,6 @@
|
|
|
378
378
|
border-radius: 5px !important;
|
|
379
379
|
}
|
|
380
380
|
|
|
381
|
-
.monaco-editor .deprecated,
|
|
382
|
-
.monaco-editor .mtks {
|
|
383
|
-
text-decoration: none !important;
|
|
384
|
-
}
|
|
385
|
-
|
|
386
381
|
/* Welcome message */
|
|
387
382
|
.welcome {
|
|
388
383
|
color: #858585;
|
|
@@ -849,6 +844,10 @@
|
|
|
849
844
|
monaco.languages.setMonarchTokensProvider 'rip', window.ripMonarch
|
|
850
845
|
monaco.languages.setLanguageConfiguration 'rip', window.ripLanguageConfig
|
|
851
846
|
|
|
847
|
+
# Disable TypeScript suggestion diagnostics (prevents deprecated strikethrough on e.g. `name`)
|
|
848
|
+
monaco.languages.typescript.javascriptDefaults.setDiagnosticsOptions
|
|
849
|
+
noSuggestionDiagnostics: true
|
|
850
|
+
|
|
852
851
|
# ====================================================================
|
|
853
852
|
# Restore Persisted State
|
|
854
853
|
# ====================================================================
|