rip-lang 3.17.0-wip.1 → 3.17.1
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 +1 -1
- package/docs/dist/rip.min.js +1 -1
- package/docs/dist/rip.min.js.br +0 -0
- 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="https://github.com/shreeve/rip-lang/commits/main"><img src="https://img.shields.io/badge/version-3.17.
|
|
12
|
+
<a href="https://github.com/shreeve/rip-lang/commits/main"><img src="https://img.shields.io/badge/version-3.17.1-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%2C436%2F1%2C436-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
|
@@ -16923,7 +16923,7 @@ if (typeof globalThis !== 'undefined') {
|
|
|
16923
16923
|
return new CodeEmitter({}).getComponentRuntime();
|
|
16924
16924
|
}
|
|
16925
16925
|
// src/browser.js
|
|
16926
|
-
var VERSION = "3.17.
|
|
16926
|
+
var VERSION = "3.17.1";
|
|
16927
16927
|
var BUILD_DATE = "2026-06-28@00:08:17GMT";
|
|
16928
16928
|
if (typeof globalThis !== "undefined") {
|
|
16929
16929
|
if (!globalThis.__rip)
|
package/docs/dist/rip.min.js
CHANGED
|
@@ -2955,7 +2955,7 @@ if (typeof globalThis !== 'undefined') {
|
|
|
2955
2955
|
`:"",n=t.slice(0,i).join(`
|
|
2956
2956
|
`)}let u=new vn,l;try{l=u.tokenize(n)}catch(m){throw hi(m,n,this.options.filename)}if(this.options.showTokens)l.forEach((m)=>console.log(`${m[0].padEnd(12)} ${JSON.stringify(m[1])}`)),console.log();let a=null,c=null;if(this.options.types==="emit"||this.options.types==="check"||this.options.types===!0)c=[...l];if(l=l.filter((m)=>m[0]!=="TYPE_DECL"),u.typeRefNames?.size>0&&!this.options.inlineTypes){let m=new Set,R=!1;for(let _ of l){if(_[0]==="IMPORT"){R=!0;continue}if(R&&_[0]==="TERMINATOR"){R=!1;continue}if(R)continue;if(_[0]==="IDENTIFIER")m.add(_[1])}let U=(_)=>!m.has(_);for(let _=l.length-1;_>=0;_--){if(l[_][0]!=="IMPORT")continue;let D=_+1;if(D>=l.length)continue;if(l[D][0]==="CALL_START"||l[D][0]==="(")continue;if(l[D][0]==="STRING")continue;let M=-1,q=D;while(q<l.length&&l[q][0]!=="TERMINATOR"){if(M===-1&&l[q][0]==="FROM")M=q;q++}if(M===-1)continue;let S=-1,d=-1;for(let X=_+1;X<M;X++)if(l[X][0]==="{"){S=X;break}if(S!==-1){for(let X=S+1;X<M;X++)if(l[X][0]==="}"){d=X;break}}let K=!1,E=S!==-1?S:M;for(let X=_+1;X<E;X++){let fn=l[X][0];if(fn==="IDENTIFIER"||fn==="*"){K=!0;break}}if(S===-1||d===-1){if(K){let X=[],fn=_+1;while(fn<M)if(l[fn][0]==="AS"&&fn+1<M&&l[fn+1][0]==="IDENTIFIER")X.push(l[fn+1][1]),fn+=2;else if(l[fn][0]==="IDENTIFIER")X.push(l[fn][1]),fn++;else fn++;if(X.length===0||!X.every(U))continue;let Y=q<l.length?q+1:q;l.splice(_,Y-_)}continue}let Z=[],Q=S+1;while(Q<d){let X=Q;while(X<d&&l[X][0]!==",")X++;if(X>Q)Z.push({start:Q,end:X});Q=X+1}for(let X of Z){let fn=null;for(let Y=X.start;Y<X.end;Y++){if(l[Y][0]!=="IDENTIFIER")continue;if(fn===null)fn=l[Y][1];else if(l[Y-1]?.[0]==="AS")fn=l[Y][1]}X.local=fn,X.drop=fn!=null&&U(fn)}if(!Z.some((X)=>X.drop))continue;let C=Z.every((X)=>X.drop),L=[];if(C&&K){let X=_+1;while(X<S)if(l[X][0]==="AS"&&X+1<S&&l[X+1][0]==="IDENTIFIER")L.push(l[X+1][1]),X+=2;else if(l[X][0]==="IDENTIFIER")L.push(l[X][1]),X++;else X++}if(C)if(!K){let X=q<l.length?q+1:q;l.splice(_,X-_)}else if(L.length>0&&L.every(U)){let X=q<l.length?q+1:q;l.splice(_,X-_)}else{let X=S,fn=d+1,Y=S-1;while(Y>_&&l[Y][0]!==","&&l[Y][0]!=="IDENTIFIER"&&l[Y][0]!=="*")Y--;if(Y>_&&l[Y][0]===",")X=Y;l.splice(X,fn-X)}else for(let X=Z.length-1;X>=0;X--){let fn=Z[X];if(!fn.drop)continue;let{start:Y,end:Un}=fn;if(Un<d&&l[Un][0]===",")Un++;else if(Y>S+1&&l[Y-1][0]===",")Y--;l.splice(Y,Un-Y)}}}while(l.length>0&&l[0][0]==="TERMINATOR")l.shift();if(l.every((m)=>m[0]==="TERMINATOR")){if(c&&Ii)a=Ii(c,["program"],n);return{tokens:l,sexpr:["program"],code:"",dts:a,data:e,reactiveVars:{},gates:[]}}let r=null;Nn.lexer={tokens:l,pos:0,setInput:function(){},lex:function(){if(this.pos>=this.tokens.length)return 1;let m=this.tokens[this.pos++],R=m[1];if(m.data)R=new String(R),Object.assign(R,m.data);return this.text=R,this.loc=m.loc,this.line=m.loc?.r,r=m.loc,m[0]}},Ol(!!this.options.exactMarks);let h;try{h=Nn.parse(n)}catch(m){if(/\?\s*\([^)]*\?[^)]*:[^)]*\)\s*:/.test(n)||/\?\s+\w+\s+\?\s+/.test(n))throw new Hn("Nested ternary operators are not supported",{code:"E_PARSE",source:n,file:this.options.filename,suggestion:"Use if/else statements instead.",phase:"parser"});let R=hi(m,n,this.options.filename);if(R.phase==="parser"&&r)R.line=r.r??R.line,R.column=r.c??R.column,R.length=r.n||1;throw R}if(this.options.showSExpr)console.log(Bn(h,0,!0)),console.log();let o=null;if(this.options.sourceMap){let m=(this.options.filename||"output")+".js",R=this.options.filename||"input.rip";o=new _l(m,R,n)}let s=new Fn({dataSection:e,source:n,filename:this.options.filename,skipPreamble:this.options.skipPreamble,skipRuntimes:this.options.skipRuntimes,skipExports:this.options.skipExports,skipImports:this.options.skipImports,skipDataPart:this.options.skipDataPart,stubComponents:this.options.stubComponents,reactiveVars:this.options.reactiveVars,inlineTypes:this.options.inlineTypes,schemaMode:this.options.schemaMode,foldProjections:this.options.foldProjections,exactMarks:this.options.exactMarks,sourceMap:o}),w=s.compile(h),y=o?o.toJSON():null,A=o?o.toReverseMap():null;if(y&&this.options.sourceMap==="inline"){let m;if(typeof Buffer<"u")m=Buffer.from(y,"utf8").toString("base64");else{let R=new TextEncoder().encode(y),U="";for(let _=0;_<R.length;_++)U+=String.fromCharCode(R[_]);m=btoa(U)}w+=`
|
|
2957
2957
|
//# sourceMappingURL=data:application/json;base64,${m}`}else if(y&&this.options.filename)w+=`
|
|
2958
|
-
//# sourceMappingURL=${this.options.filename}.js.map`;if(c&&Ii)a=Ii(c,h,n,s._schemaBehavior,s._schemaAnon);return{tokens:l,sexpr:h,code:w,dts:a,map:y,reverseMap:A,data:e,reactiveVars:s.reactiveVars,gates:s._gateDecls||[]}}compileToJS(n){return this.compile(n).code}compileToSExpr(n){return this.compile(n).sexpr}}Ef(Fn,vn);Fn.prototype.emitEnum=function(f,e,t){let[i,u]=e,l=i?.valueOf?.()??i,a=[];if(Array.isArray(u)){let h=u[0]==="block"?u.slice(1):[u];for(let o of h)if(Array.isArray(o)){if(o[0]?.valueOf?.()==="="){let s=o[1]?.valueOf?.()??o[1],w=o[2]?.valueOf?.()??o[2];a.push([s,w])}}}if(a.length===0)return`const ${l} = {}`;let c=a.map(([h,o])=>`${h}: ${o}`).join(", "),r=a.map(([h,o])=>`${o}: "${h}"`).join(", ");return`const ${l} = {${c}, ${r}}`};Yi(null,Fn);function gi(n,f={}){return new Ei(f).compile(n)}function Tn(n,f={}){return new Ei(f).compileToJS(n)}function di(){return new Fn({}).getReactiveRuntime()}function Fi(){return new Fn({}).getComponentRuntime()}var Qf="3.17.
|
|
2958
|
+
//# sourceMappingURL=${this.options.filename}.js.map`;if(c&&Ii)a=Ii(c,h,n,s._schemaBehavior,s._schemaAnon);return{tokens:l,sexpr:h,code:w,dts:a,map:y,reverseMap:A,data:e,reactiveVars:s.reactiveVars,gates:s._gateDecls||[]}}compileToJS(n){return this.compile(n).code}compileToSExpr(n){return this.compile(n).sexpr}}Ef(Fn,vn);Fn.prototype.emitEnum=function(f,e,t){let[i,u]=e,l=i?.valueOf?.()??i,a=[];if(Array.isArray(u)){let h=u[0]==="block"?u.slice(1):[u];for(let o of h)if(Array.isArray(o)){if(o[0]?.valueOf?.()==="="){let s=o[1]?.valueOf?.()??o[1],w=o[2]?.valueOf?.()??o[2];a.push([s,w])}}}if(a.length===0)return`const ${l} = {}`;let c=a.map(([h,o])=>`${h}: ${o}`).join(", "),r=a.map(([h,o])=>`${o}: "${h}"`).join(", ");return`const ${l} = {${c}, ${r}}`};Yi(null,Fn);function gi(n,f={}){return new Ei(f).compile(n)}function Tn(n,f={}){return new Ei(f).compileToJS(n)}function di(){return new Fn({}).getReactiveRuntime()}function Fi(){return new Fn({}).getComponentRuntime()}var Qf="3.17.1",Wf="2026-06-28@00:08:17GMT";if(typeof globalThis<"u"){if(!globalThis.__rip)Function(di())();if(!globalThis.__ripComponent)Function(Fi())()}var bt=(n)=>{let f=n.match(/^[ \t]*(?=\S)/gm),e=Math.min(...(f||[]).map((t)=>t.length));return n.replace(RegExp(`^[ ]{${e}}`,"gm"),"").trim()},Al=(n)=>String(n).replace(/[\r\n]/g,"").replace(/\s+$/g,"");function yl(n){let f=/^(\s*)import\s+([^'"]+?)\s+from\s+['"](@rip-lang\/[^'"]+)['"];?\s*$/gm;return n.replace(f,(e,t,i,u)=>{let l=i.trim();if(l.startsWith("type "))return`${t}// type-only import erased: ${u}`;let a=l.indexOf("{"),c=l.lastIndexOf("}");if(a<0||c<=a)return console.warn(`[Rip] Skipping non-named import from ${u}; only \`import { … } from '@rip-lang/*'\` is supported in browser bundles.`),e;let r=l.slice(a+1,c),h=[];for(let o of r.split(",")){let s=o.trim().replace(/^type\s+/,"");if(!s)continue;if(/\s+as\s+/.test(s)){let[w,y]=s.split(/\s+as\s+/).map((A)=>A.trim());h.push(`${w}: ${y}`)}else h.push(s)}if(h.length===0)return`${t}// import erased: ${u}`;return`${t}const { ${h.join(", ")} } = globalThis;`})}function Jf(n,f){let t=`//# sourceURL=${Al(f)}`,i=/\n?\/\/# sourceMappingURL=[^\n]*\s*$/,u=n.match(i);if(u)return n.slice(0,u.index)+`
|
|
2959
2959
|
`+t+n.slice(u.index);return n+`
|
|
2960
2960
|
`+t}function Yf(n,f){if(!f)return n;return n.replace(/\/\/# sourceMappingURL=data:application\/json;base64,([A-Za-z0-9+/=]+)/,(e,t)=>{let i;try{let c=atob(t),r=new Uint8Array(c.length);for(let h=0;h<c.length;h++)r[h]=c.charCodeAt(h);i=new TextDecoder().decode(r)}catch{return e}let u;try{u=JSON.parse(i)}catch{return e}u.mappings=";".repeat(f)+u.mappings;let l=new TextEncoder().encode(JSON.stringify(u)),a="";for(let c=0;c<l.length;c++)a+=String.fromCharCode(l[c]);return`//# sourceMappingURL=data:application/json;base64,${btoa(a)}`})}function Pt(n,f){let e=`${Al(f)}.js`,t=Yf(n,1);return`(async()=>{
|
|
2961
2961
|
${Jf(t,e)}
|
package/docs/dist/rip.min.js.br
CHANGED
|
Binary file
|