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

Method parseStringTemplate

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

Source from the content-addressed store, hash-verified

243 // ===========================
244
245 parseStringTemplate() {
246 var returnArr = [""];
247 do {
248 returnArr.push(this.lastWhitespace());
249 if (this.currentToken().value === "$") {
250 this.consumeToken();
251 var startingBrace = this.matchOpToken("{");
252 returnArr.push(this.requireElement("expression"));
253 if (startingBrace) {
254 this.requireOpToken("}");
255 }
256 returnArr.push("");
257 } else if (this.currentToken().value === "\\") {
258 this.consumeToken(); // skip next
259 this.consumeToken();
260 } else {
261 var token = this.consumeToken();
262 returnArr[returnArr.length - 1] += token ? token.value : "";
263 }
264 } while (this.hasMore());
265 returnArr.push(this.lastWhitespace());
266 return returnArr;
267 }
268
269 commandBoundary(token) {
270 if (

Callers 2

parseMethod · 0.45
parseMethod · 0.45

Calls 7

lastWhitespaceMethod · 0.95
currentTokenMethod · 0.95
consumeTokenMethod · 0.95
matchOpTokenMethod · 0.95
requireElementMethod · 0.95
requireOpTokenMethod · 0.95
hasMoreMethod · 0.95

Tested by

no test coverage detected