MCPcopy Create free account
hub / github.com/codemix/htmling / parse

Function parse

lib/parser.js:27–7784  ·  view source on GitHub ↗
(input)

Source from the content-addressed store, hash-verified

25 peg$subclass(SyntaxError, Error);
26
27 function parse(input) {
28 var options = arguments.length > 1 ? arguments[1] : {},
29
30 peg$FAILED = {},
31
32 peg$startRuleFunctions = { Template: peg$parseTemplate },
33 peg$startRuleFunction = peg$parseTemplate,
34
35 peg$c0 = null,
36 peg$c1 = function(html) {
37 return {
38 type: 'Template',
39 body: html || []
40 };
41 },
42 peg$c2 = [],
43 peg$c3 = peg$FAILED,
44 peg$c4 = { type: "other", description: "Raw Content" },
45 peg$c5 = void 0,
46 peg$c6 = "</template>",
47 peg$c7 = { type: "literal", value: "</template>", description: "\"</template>\"" },
48 peg$c8 = "</content>",
49 peg$c9 = { type: "literal", value: "</content>", description: "\"</content>\"" },
50 peg$c10 = "</include>",
51 peg$c11 = { type: "literal", value: "</include>", description: "\"</include>\"" },
52 peg$c12 = "</script>",
53 peg$c13 = { type: "literal", value: "</script>", description: "\"</script>\"" },
54 peg$c14 = { type: "any", description: "any character" },
55 peg$c15 = function(body) {
56 return {
57 type: 'OutputStatement',
58 raw: true,
59 expression: {
60 type: 'Literal',
61 value: body,
62 raw: JSON.stringify(body)
63 }
64 };
65 },
66 peg$c16 = function(c) {
67 return {
68 type: 'OutputStatement',
69 raw: true,
70 expression: {
71 type: 'Literal',
72 value: c,
73 raw: JSON.stringify(c)
74 }
75 };
76 },
77 peg$c17 = { type: "other", description: "<template>" },
78 peg$c18 = "<template",
79 peg$c19 = { type: "literal", value: "<template", description: "\"<template\"" },
80 peg$c20 = function(attrs) { return !attrs || !attrs.client; },
81 peg$c21 = ">",
82 peg$c22 = { type: "literal", value: ">", description: "\">\"" },
83 peg$c23 = function(attrs, body) {
84 attrs = attrs || {};

Callers 1

peg$c54Function · 0.85

Calls 2

peg$failFunction · 0.85
peg$buildExceptionFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…