MCPcopy Create free account
hub / github.com/ChinaSiro/claude-code-sourcemap / wm1

Function wm1

package/cli.js:1589–1593  ·  view source on GitHub ↗
(q)

Source from the content-addressed store, hash-verified

1587`)j+=u8(q.L),J8(q.L);while(q.L.i<q.L.len&&MU(u8(q.L)))j+=u8(q.L),J8(q.L)}else while(q.L.i<q.L.len&&k3z(u8(q.L)))j+=u8(q.L),J8(q.L);let J=q.L.b,M=h8(q,"heredoc_start",O,J,[]);q.L.heredocs.push({delim:j,stripTabs:$==="<<-",quoted:w,bodyStart:0,bodyEnd:0,endStart:0,endEnd:0});let X=z?[z,A,M]:[A,M],P=z?z.startIndex:A.startIndex;while(!0){mq(q.L);let W=u8(q.L);if(W===`
1588`||W===""||q.L.i>=q.L.len)break;if(W===">"||W==="<"||xj(W)){let G=BY(q.L),Z=zN8(q);if(Z&&Z.type==="file_redirect"){X.push(Z);continue}r5(q.L,G)}if(W==="|"&&u8(q.L,1)!=="|"){J8(q.L),mq(q.L);let G=[];while(!0){let Z=Hq6(q);if(!Z)break;if(G.push(Z),mq(q.L),u8(q.L)==="|"&&u8(q.L,1)!=="|"){let T=q.L.b;J8(q.L),G.push(h8(q,"|",T,q.L.b,[])),mq(q.L);continue}break}if(G.length>0){let Z=G[G.length-1];X.push(h8(q,"pipeline",G[0].startIndex,Z.endIndex,G))}continue}if(W==="&"&&u8(q.L,1)==="&"||W==="|"&&u8(q.L,1)==="|"){J8(q.L),J8(q.L),mq(q.L);let G=Hq6(q);if(G)X.push(G);continue}if(W==="&"||W===";"||W==="("||W===")"){let G=q.L.b;while(q.L.i<q.L.len&&u8(q.L)!==`
1589`)J8(q.L);X.push(h8(q,"ERROR",G,q.L.b,[]));break}let D=dv(q,"arg");if(D){X.push(D);continue}let f=q.L.b;while(q.L.i<q.L.len&&u8(q.L)!==`
1590`)J8(q.L);if(q.L.b>f)X.push(h8(q,"ERROR",f,q.L.b,[]));break}return h8(q,"heredoc_redirect",P,q.L.b,X)}if($==="<&-"||$===">&-"){let A=i5(q,$,Y),O=[];if(z)O.push(z);O.push(A),mq(q.L);let w=BY(q.L),j=bV4(q)?dv(q,"arg"):null;if(j)O.push(j);else r5(q.L,w);let H=z?z.startIndex:A.startIndex,J=j?j.endIndex:A.endIndex;return h8(q,"file_redirect",H,J,O)}if($===">"||$===">>"||$===">&"||$===">|"||$==="&>"||$==="&>>"||$==="<"||$==="<&"){let A=i5(q,$,Y),O=[];if(z)O.push(z);O.push(A);let w=A.endIndex,j=0;while(!0){if(mq(q.L),!bV4(q))break;if(!K&&j>=1)break;let J=u8(q.L),M=u8(q.L,1),X=null;if((J==="<"||J===">")&&M==="(")X=Wm1(q);else X=dv(q,"arg");if(!X)break;O.push(X),w=X.endIndex,j++}let H=z?z.startIndex:A.startIndex;return h8(q,"file_redirect",H,w,O)}return r5(q.L,_),null}function Wm1(q){let K=u8(q.L);if(K!=="<"&&K!==">"||u8(q.L,1)!=="(")return null;let _=q.L.b;J8(q.L),J8(q.L);let z=h8(q,K+"(",_,q.L.b,[]),Y=Qv(q,")");mq(q.L);let $;if(u8(q.L)===")"){let A=q.L.b;J8(q.L),$=h8(q,")",A,q.L.b,[])}else $=h8(q,")",q.L.b,q.L.b,[]);return h8(q,"process_substitution",_,$.endIndex,[z,...Y,$])}function wm1(q){while(q.L.i<q.L.len&&q.L.src[q.L.i]!==`
1591`)J8(q.L);if(q.L.i<q.L.len)J8(q.L);for(let K of q.L.heredocs){K.bodyStart=q.L.b;let _=K.delim.length;while(q.L.i<q.L.len){let z=q.L.i,Y=q.L.b,$=z;if(K.stripTabs)while($<q.L.len&&q.L.src[$]==="\t")$++;if(q.L.src.startsWith(K.delim,$)&&($+_>=q.L.len||q.L.src[$+_]===`
1592`||q.L.src[$+_]==="\r")){K.bodyEnd=Y;while(q.L.i<$)J8(q.L);K.endStart=q.L.b;for(let A=0;A<_;A++)J8(q.L);if(K.endEnd=q.L.b,q.L.i<q.L.len&&q.L.src[q.L.i]===`
1593`)J8(q.L);return}while(q.L.i<q.L.len&&q.L.src[q.L.i]!==`
1594`)J8(q.L);if(q.L.i<q.L.len)J8(q.L)}K.bodyEnd=q.L.b,K.endStart=q.L.b,K.endEnd=q.L.b}}function S3z(q,K,_){let z=BY(q.L);C3z(q,K);let Y=[],$=q.L.b,A=!1;while(q.L.b<_){let O=u8(q.L);if(O==="\\"){let w=u8(q.L,1);if(w==="$"||w==="`"||w==="\\"){J8(q.L),J8(q.L);continue}J8(q.L);continue}if(O==="$"||O==="`"){let w=q.L.b,j=Sr(q);if(j&&(j.type==="simple_expansion"||j.type==="expansion"||j.type==="command_substitution"||j.type==="arithmetic_expansion")){if(A&&w>$)Y.push(h8(q,"heredoc_content",$,w,[]));Y.push(j),$=q.L.b,A=!0}continue}J8(q.L)}if(A)Y.push(h8(q,"heredoc_content",$,_,[]));return r5(q.L,z),Y}function C3z(q,K){if(!q.L.byteTable)gV4(q.L,0);let _=q.L.byteTable,z=0,Y=q.src.length;while(z<Y){let $=z+Y>>>1;if(_[$]<K)z=$+1;else Y=$}q.L.i=z,q.L.b=K}function dv(q,K){mq(q.L);let _=[];while(q.L.i<q.L.len){let $=u8(q.L);if($===" "||$==="\t"||$===`
1595`||$==="\r"||$===""||$==="|"||$==="&"||$===";"||$==="("||$===")")break;if($==="<"||$===">"){if(u8(q.L,1)==="("){let O=Wm1(q);if(O)_.push(O);continue}break}if($==='"'){_.push(hr(q));continue}if($==="'"){let O=u9(q.L,"arg");_.push(i5(q,"raw_string",O));continue}if($==="$"){let O=u8(q.L,1);if(O==="'"){let j=u9(q.L,"arg");_.push(i5(q,"ansi_c_string",j));continue}if(O==='"'){let j={type:"DOLLAR",value:"$",start:q.L.b,end:q.L.b+1};J8(q.L),_.push(i5(q,"$",j)),_.push(hr(q));continue}if(O==="`"){J8(q.L);continue}let w=Sr(q);if(w)_.push(w);continue}if($==="`"){if(q.inBacktick>0)break;let O=Dm1(q);if(O)_.push(O);continue}if($==="{"){let O=x3z(q);if(O){_.push(O);continue}let w=u8(q.L,1);if(w===";"||w==="|"||w==="&"||w===`
1596`||w===""||w===")"||w===" "||w==="\t"){let H=q.L.b;J8(q.L),_.push(h8(q,"word",H,q.L.b,[]));continue}let j=I3z(q);if(j){for(let H of j)_.push(H);continue}}if($==="}"){let O=q.L.b;J8(q.L),_.push(h8(q,"word",O,q.L.b,[]));continue}if($==="["||$==="]"){let O=q.L.b;J8(q.L),_.push(h8(q,"word",O,q.L.b,[]));continue}let A=b3z(q);if(!A)break;if(A.type==="word"&&/^-?(0x)?[0-9]+#$/.test(A.text)&&u8(q.L)==="$"&&(u8(q.L,1)==="{"||u8(q.L,1)==="(")){let O=Sr(q);if(O){_.push(h8(q,"number",A.startIndex,O.endIndex,[O]));continue}}_.push(A)}if(_.length===0)return null;if(_.length===1)return _[0];let z=_[0],Y=_[_.length-1];return h8(q,"concatenation",z.startIndex,Y.endIndex,_)}function b3z(q){let K=q.L.b,_=q.L.i;while(q.L.i<q.L.len){let $=u8(q.L);if($==="\\"){if(q.L.i+1>=q.L.len)break;let A=q.L.src[q.L.i+1];if(A===`

Callers 2

QvFunction · 0.85
L3zFunction · 0.85

Calls 2

J8Function · 0.85
startsWithMethod · 0.45

Tested by

no test coverage detected