MCPcopy Create free account
hub / github.com/TextGeneratorio/text-generator.io / readRegexp

Function readRegexp

static/libs/javascript.js:47–57  ·  view source on GitHub ↗
(stream)

Source from the content-addressed store, hash-verified

45 var isJsonldKeyword = /^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;
46
47 function readRegexp(stream) {
48 var escaped = false, next, inSet = false;
49 while ((next = stream.next()) != null) {
50 if (!escaped) {
51 if (next == "/" && !inSet) return;
52 if (next == "[") inSet = true;
53 else if (inSet && next == "]") inSet = false;
54 }
55 escaped = !escaped && next == "\\";
56 }
57 }
58
59 // Used as scratch variables to communicate multiple values without
60 // consing up tons of objects.

Callers 1

tokenBaseFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected