MCPcopy Create free account
hub / github.com/cursorless-dev/cursorless / tokenize

Function tokenize

src/core/tokenizer.ts:56–61  ·  view source on GitHub ↗
(
  text: string,
  mapfn: (v: RegExpMatchArray, k: number) => T
)

Source from the content-addressed store, hash-verified

54export const TOKEN_MATCHER = new RegExp(REGEX, "gu");
55
56export function tokenize<T>(
57 text: string,
58 mapfn: (v: RegExpMatchArray, k: number) => T
59) {
60 return matchAll(text, TOKEN_MATCHER, mapfn);
61}
62
63//https://stackoverflow.com/a/6969486
64function escapeRegExp(string: string) {

Callers 2

tokenizer.test.tsFile · 0.90
getTokensInRangeFunction · 0.90

Calls 1

matchAllFunction · 0.90

Tested by

no test coverage detected