MCPcopy Index your code
hub / github.com/bigskysoftware/_hyperscript / parseURLOrExpression

Method parseURLOrExpression

src/core/parser.js:304–319  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

302 }
303
304 parseURLOrExpression() {
305 var cur = this.currentToken();
306 if (cur.value === "/" && cur.type === "DIVIDE") {
307 // starts with / - naked URL
308 var tokens = this.consumeUntilWhitespace();
309 this.matchTokenType("WHITESPACE");
310 return new NakedString(tokens);
311 }
312 if (cur.type === "IDENTIFIER" && (cur.value === "http" || cur.value === "https" || cur.value === "ws" || cur.value === "wss")) {
313 // starts with http/https - naked URL
314 var tokens = this.consumeUntilWhitespace();
315 this.matchTokenType("WHITESPACE");
316 return new NakedString(tokens);
317 }
318 return this.requireElement("expression");
319 }
320
321 ensureTerminated(commandList) {
322 var implicitReturn = new ImplicitReturn();

Callers 4

parseMethod · 0.45
parseMethod · 0.45
parseMethod · 0.45
parseMethod · 0.45

Calls 4

currentTokenMethod · 0.95
matchTokenTypeMethod · 0.95
requireElementMethod · 0.95

Tested by

no test coverage detected