MCPcopy Index your code
hub / github.com/google/adk-python / charAt

Method charAt

src/google/adk/cli/browser/main-3CUQG2IN.js:205–205  ·  view source on GitHub ↗
(e)

Source from the content-addressed store, hash-verified

203\r `),$7=i=>!i||dsA.has(i),Du=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,A=!1){if(e){if(typeof e!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!A;let t=this.next??"stream";for(;t&&(A||this.hasChars(1));)t=yield*Ie(this.parseNext(t))}atLineEnd(){let e=this.pos,A=this.buffer[e];for(;A===" "||A===" ";)A=this.buffer[++e];return!A||A==="#"||A===`
204`?!0:A==="\r"?this.buffer[e+1]===`
205`:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let A=this.buffer[e];if(this.indentNext>0){let t=0;for(;A===" ";)A=this.buffer[++t+e];if(A==="\r"){let n=this.buffer[t+e+1];if(n===`
206`||!n&&!this.atEnd)return e+t+1}return A===`
207`||t>=this.indentNext||!A&&!this.atEnd?e+t:-1}if(A==="-"||A==="."){let t=this.buffer.substr(e,3);if((t==="---"||t==="...")&&ec(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!="number"||e!==-1&&e<this.pos)&&(e=this.buffer.indexOf(`
208`,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]==="\r"&&(e-=1),this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case"stream":return yield*Ie(this.parseStream());case"line-start":return yield*Ie(this.parseLineStart());case"block-start":return yield*Ie(this.parseBlockStart());case"doc":return yield*Ie(this.parseDocument());case"flow":return yield*Ie(this.parseFlowCollection());case"quoted-scalar":return yield*Ie(this.parseQuotedScalar());case"block-scalar":return yield*Ie(this.parseBlockScalar());case"plain-scalar":return yield*Ie(this.parsePlainScalar())}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext("stream");if(e[0]===W7&&(yield*Ie(this.pushCount(1)),e=e.substring(1)),e[0]==="%"){let A=e.length,t=e.indexOf("#");for(;t!==-1;){let o=e[t-1];if(o===" "||o===" "){A=t-1;break}else t=e.indexOf("#",t+1)}for(;;){let o=e[A-1];if(o===" "||o===" ")A-=1;else break}let n=(yield*Ie(this.pushCount(A)))+(yield*Ie(this.pushSpaces(!0)));return yield*Ie(this.pushCount(e.length-n)),this.pushNewline(),"stream"}if(this.atLineEnd()){let A=yield*Ie(this.pushSpaces(!0));return yield*Ie(this.pushCount(e.length-A)),yield*Ie(this.pushNewline()),"stream"}return yield Z7,yield*Ie(this.parseLineStart())}*parseLineStart(){let e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext("line-start");if(e==="-"||e==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let A=this.peek(3);if((A==="---"||A==="...")&&ec(this.charAt(3)))return yield*Ie(this.pushCount(3)),this.indentValue=0,this.indentNext=0,A==="---"?"doc":"stream"}return this.indentValue=yield*Ie(this.pushSpaces(!1)),this.indentNext>this.indentValue&&!ec(this.charAt(1))&&(this.indentNext=this.indentValue),yield*Ie(this.parseBlockStart())}*parseBlockStart(){let[e,A]=this.peek(2);if(!A&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&ec(A)){let t=(yield*Ie(this.pushCount(1)))+(yield*Ie(this.pushSpaces(!0)));return this.indentNext=this.indentValue+1,this.indentValue+=t,yield*Ie(this.parseBlockStart())}return"doc"}*parseDocument(){yield*Ie(this.pushSpaces(!0));let e=this.getLine();if(e===null)return this.setNext("doc");let A=yield*Ie(this.pushIndicators());switch(e[A]){case"#":yield*Ie(this.pushCount(e.length-A));case void 0:return yield*Ie(this.pushNewline()),yield*Ie(this.parseLineStart());case"{":case"[":return yield*Ie(this.pushCount(1)),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*Ie(this.pushCount(1)),"doc";case"*":return yield*Ie(this.pushUntil($7)),"doc";case'"':case"'":return yield*Ie(this.parseQuotedScalar());case"|":case">":return A+=yield*Ie(this.parseBlockScalarHeader()),A+=yield*Ie(this.pushSpaces(!0)),yield*Ie(this.pushCount(e.length-A)),yield*Ie(this.pushNewline()),yield*Ie(this.parseBlockScalar());default:return yield*Ie(this.parsePlainScalar())}}*parseFlowCollection(){let e,A,t=-1;do e=yield*Ie(this.pushNewline()),e>0?(A=yield*Ie(this.pushSpaces(!1)),this.indentValue=t=A):A=0,A+=yield*Ie(this.pushSpaces(!0));while(e+A>0);let n=this.getLine();if(n===null)return this.setNext("flow");if((t!==-1&&t<this.indentNext&&n[0]!=="#"||t===0&&(n.startsWith("---")||n.startsWith("..."))&&ec(n[3]))&&!(t===this.indentNext-1&&this.flowLevel===1&&(n[0]==="]"||n[0]==="}")))return this.flowLevel=0,yield X7,yield*Ie(this.parseLineStart());let o=0;for(;n[o]===",";)o+=yield*Ie(this.pushCount(1)),o+=yield*Ie(this.pushSpaces(!0)),this.flowKey=!1;switch(o+=yield*Ie(this.pushIndicators()),n[o]){case void 0:return"flow";case"#":return yield*Ie(this.pushCount(n.length-o)),"flow";case"{":case"[":return yield*Ie(this.pushCount(1)),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*Ie(this.pushCount(1)),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*Ie(this.pushUntil($7)),"flow";case'"':case"'":return this.flowKey=!0,yield*Ie(this.parseQuotedScalar());case":":{let a=this.charAt(1);if(this.flowKey||ec(a)||a===",")return this.flowKey=!1,yield*Ie(this.pushCount(1)),yield*Ie(this.pushSpaces(!0)),"flow"}default:return this.flowKey=!1,yield*Ie(this.parsePlainScalar())}}*parseQuotedScalar(){let e=this.charAt(0),A=this.buffer.indexOf(e,this.pos+1);if(e==="'")for(;A!==-1&&this.buffer[A+1]==="'";)A=this.buffer.indexOf("'",A+2);else for(;A!==-1;){let o=0;for(;this.buffer[A-1-o]==="\\";)o+=1;if(o%2===0)break;A=this.buffer.indexOf('"',A+1)}let t=this.buffer.substring(0,A),n=t.indexOf(`

Callers 15

chunk-27SWUPRL.jsFile · 0.80
mathmlBuilderFunction · 0.80
handlerFunction · 0.80
parseSymbolMethod · 0.80
itFunction · 0.80
utFunction · 0.80
getLineOffsetsMethod · 0.80
kvFunction · 0.80
eFunction · 0.80
nFunction · 0.80
GFunction · 0.80

Calls

no outgoing calls

Tested by 1

itFunction · 0.64