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

Function Wr

src/google/adk/cli/browser/chunk-NALL4A3P.js:81–81  ·  view source on GitHub ↗
(t)

Source from the content-addressed store, hash-verified

79 For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR`;if(e.issue===Le.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the <line_breaks> option.
80 The problem is in the <${t.name}> Token Type
81 For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK`;throw Error("non exhaustive match")}function vm(t){return I(t,r=>mt(r)?r.charCodeAt(0):r)}function pf(t,e,r){t[e]===void 0?t[e]=[r]:t[e].push(r)}var Ui=256,Rc=[];function vr(t){return t<Ui?t:Rc[t]}function TE(){if(Z(Rc)){Rc=new Array(65536);for(let t=0;t<65536;t++)Rc[t]=t>255?255+~~(t/255):t}}function Br(t,e){let r=t.tokenTypeIdx;return r===e.tokenTypeIdx?!0:e.isParent===!0&&e.categoryMatchesMap[r]===!0}function zi(t,e){return t.tokenTypeIdx===e.tokenTypeIdx}var Em=1,$m={};function Wr(t){let e=RE(t);xE(e),EE(e),vE(e),D(e,r=>{r.isParent=r.categoryMatches.length>0})}function RE(t){let e=Ne(t),r=t,n=!0;for(;n;){r=Or(Ve(I(r,s=>s.CATEGORIES)));let i=wn(r,e);e=e.concat(i),Z(i)?n=!1:r=i}return e}function xE(t){D(t,e=>{hf(e)||($m[Em]=e,e.tokenTypeIdx=Em++),Am(e)&&!Ze(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),Am(e)||(e.CATEGORIES=[]),AE(e)||(e.categoryMatches=[]),$E(e)||(e.categoryMatchesMap={})})}function vE(t){D(t,e=>{e.categoryMatches=[],D(e.categoryMatchesMap,(r,n)=>{e.categoryMatches.push($m[n].tokenTypeIdx)})})}function EE(t){D(t,e=>{Sm([],e)})}function Sm(t,e){D(t,r=>{e.categoryMatchesMap[r.tokenTypeIdx]=!0}),D(e.CATEGORIES,r=>{let n=t.concat(e);Pe(n,r)||Sm(n,r)})}function hf(t){return q(t,"tokenTypeIdx")}function Am(t){return q(t,"CATEGORIES")}function AE(t){return q(t,"categoryMatches")}function $E(t){return q(t,"categoryMatchesMap")}function km(t){return q(t,"tokenTypeIdx")}var ji={buildUnableToPopLexerModeMessage(t){return`Unable to pop Lexer Mode after encountering Token ->${t.image}<- The Mode Stack is empty`},buildUnexpectedCharactersMessage(t,e,r,n,i,s){return`unexpected character: ->${t.charAt(e)}<- at offset: ${e}, skipped ${r} characters.`}};var Le=(function(t){return t[t.MISSING_PATTERN=0]="MISSING_PATTERN",t[t.INVALID_PATTERN=1]="INVALID_PATTERN",t[t.EOI_ANCHOR_FOUND=2]="EOI_ANCHOR_FOUND",t[t.UNSUPPORTED_FLAGS_FOUND=3]="UNSUPPORTED_FLAGS_FOUND",t[t.DUPLICATE_PATTERNS_FOUND=4]="DUPLICATE_PATTERNS_FOUND",t[t.INVALID_GROUP_TYPE_FOUND=5]="INVALID_GROUP_TYPE_FOUND",t[t.PUSH_MODE_DOES_NOT_EXIST=6]="PUSH_MODE_DOES_NOT_EXIST",t[t.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]="MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE",t[t.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]="MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY",t[t.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]="MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST",t[t.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]="LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED",t[t.SOI_ANCHOR_FOUND=11]="SOI_ANCHOR_FOUND",t[t.EMPTY_MATCH_PATTERN=12]="EMPTY_MATCH_PATTERN",t[t.NO_LINE_BREAKS_FLAGS=13]="NO_LINE_BREAKS_FLAGS",t[t.UNREACHABLE_PATTERN=14]="UNREACHABLE_PATTERN",t[t.IDENTIFY_TERMINATOR=15]="IDENTIFY_TERMINATOR",t[t.CUSTOM_LINE_BREAK=16]="CUSTOM_LINE_BREAK",t[t.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE=17]="MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE",t})(Le||{}),Ra={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:[`
82`,"\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:ji,traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(Ra);var He=(()=>{class t{constructor(r,n=Ra){if(this.lexerDefinition=r,this.lexerDefinitionErrors=[],this.lexerDefinitionWarning=[],this.patternIdxToConfig={},this.charCodeToPatternIdxToConfig={},this.modes=[],this.emptyGroups={},this.trackStartLines=!0,this.trackEndLines=!0,this.hasCustom=!1,this.canModeBeOptimized={},this.TRACE_INIT=(s,a)=>{if(this.traceInitPerf===!0){this.traceInitIndent++;let o=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent<this.traceInitMaxIdent&&console.log(`${o}--> <${s}>`);let{time:c,value:l}=ga(a),u=c>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&u(`${o}<-- <${s}> time: ${c}ms`),this.traceInitIndent--,l}else return a()},typeof n=="boolean")throw Error(`The second argument to the Lexer constructor is now an ILexerConfig Object.
83a boolean 2nd argument is no longer supported`);this.config=dt({},Ra,n);let i=this.config.traceInitPerf;i===!0?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):typeof i=="number"&&(this.traceInitMaxIdent=i,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",()=>{let s,a=!0;this.TRACE_INIT("Lexer Config handling",()=>{if(this.config.lineTerminatorsPattern===Ra.lineTerminatorsPattern)this.config.lineTerminatorsPattern=Rm;else if(this.config.lineTerminatorCharacters===Ra.lineTerminatorCharacters)throw Error(`Error: Missing <lineTerminatorCharacters> property on the Lexer config.
84 For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS`);if(n.safeMode&&n.ensureOptimizations)throw Error('"safeMode" and "ensureOptimizations" flags are mutually exclusive.');this.trackStartLines=/full|onlyStart/i.test(this.config.positionTracking),this.trackEndLines=/full/i.test(this.config.positionTracking),Ze(r)?s={modes:{defaultMode:Ne(r)},defaultMode:qi}:(a=!1,s=Ne(r))}),this.config.skipValidations===!1&&(this.TRACE_INIT("performRuntimeChecks",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(mm(s,this.trackStartLines,this.config.lineTerminatorCharacters))}),this.TRACE_INIT("performWarningRuntimeChecks",()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(gm(s,this.trackStartLines,this.config.lineTerminatorCharacters))})),s.modes=s.modes?s.modes:{},D(s.modes,(c,l)=>{s.modes[l]=In(c,u=>$t(u))});let o=Pr(s.modes);if(D(s.modes,(c,l)=>{this.TRACE_INIT(`Mode: <${l}> processing`,()=>{if(this.modes.push(l),this.config.skipValidations===!1&&this.TRACE_INIT("validatePatterns",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(hm(c,o))}),Z(this.lexerDefinitionErrors)){Wr(c);let u;this.TRACE_INIT("analyzeTokenTypes",()=>{u=pm(c,{lineTerminatorCharacters:this.config.lineTerminatorCharacters,positionTracking:n.positionTracking,ensureOptimizations:n.ensureOptimizations,safeMode:n.safeMode,tracer:this.TRACE_INIT})}),this.patternIdxToConfig[l]=u.patternIdxToConfig,this.charCodeToPatternIdxToConfig[l]=u.charCodeToPatternIdxToConfig,this.emptyGroups=dt({},this.emptyGroups,u.emptyGroups),this.hasCustom=u.hasCustom||this.hasCustom,this.canModeBeOptimized[l]=u.canBeOptimized}})}),this.defaultMode=s.defaultMode,!Z(this.lexerDefinitionErrors)&&!this.config.deferDefinitionErrorsHandling){let l=I(this.lexerDefinitionErrors,u=>u.message).join(`-----------------------

Callers 4

constructorMethod · 0.70
kEFunction · 0.70
chunk-NALL4A3P.jsFile · 0.70
initRecognizerEngineMethod · 0.70

Calls 5

DFunction · 0.90
xEFunction · 0.85
REFunction · 0.70
EEFunction · 0.70
vEFunction · 0.70

Tested by

no test coverage detected