MCPcopy Create free account
hub / github.com/compiler-explorer/compiler-explorer / updateStickyStack

Function updateStickyStack

static/ansi-to-html.ts:486–501  ·  view source on GitHub ↗

* If streaming, then the stack is "sticky"

(
    stickyStack: StickyStackElement[],
    token: string,
    data: string | number,
)

Source from the content-addressed store, hash-verified

484 * If streaming, then the stack is "sticky"
485 */
486function updateStickyStack(
487 stickyStack: StickyStackElement[],
488 token: string,
489 data: string | number,
490): StickyStackElement[] {
491 if (token !== 'text' && token !== 'url') {
492 stickyStack = stickyStack.filter(notCategory(categoryForCode(data)));
493 stickyStack.push({
494 token: token,
495 data: data,
496 category: categoryForCode(data),
497 });
498 }
499
500 return stickyStack;
501}
502
503export class Filter {
504 private readonly opts: AnsiToHtmlOptions;

Callers 1

toHtmlMethod · 0.85

Calls 3

notCategoryFunction · 0.85
categoryForCodeFunction · 0.85
pushMethod · 0.80

Tested by

no test coverage detected