MCPcopy Create free account
hub / github.com/RtlZeroMemory/Rezi / consumeString

Function consumeString

packages/core/src/widgets/codeEditorSyntax.ts:864–880  ·  view source on GitHub ↗
(scanner: Scanner, quote: string)

Source from the content-addressed store, hash-verified

862}
863
864function consumeString(scanner: Scanner, quote: string): string {
865 const source = scanner.source;
866 const start = scanner.index;
867 scanner.index += 1;
868
869 while (scanner.index < source.length) {
870 const ch = asChar(source, scanner.index);
871 if (ch === "\\") {
872 scanner.index += Math.min(2, source.length - scanner.index);
873 continue;
874 }
875 scanner.index += 1;
876 if (ch === quote) break;
877 }
878
879 return source.slice(start, scanner.index);
880}
881
882function consumeCSharpVerbatimString(scanner: Scanner): string {
883 const source = scanner.source;

Callers 1

tokenizeLineWithGrammarFunction · 0.85

Calls 1

asCharFunction · 0.85

Tested by

no test coverage detected