MCPcopy Create free account
hub / github.com/codemix/htmling / peg$c23

Function peg$c23

lib/parser.js:83–120  ·  view source on GitHub ↗
(attrs, body)

Source from the content-addressed store, hash-verified

81 peg$c21 = ">",
82 peg$c22 = { type: "literal", value: ">", description: "\">\"" },
83 peg$c23 = function(attrs, body) {
84 attrs = attrs || {};
85 var obj;
86 if (attrs.bind) {
87 obj = {
88 type: 'BindStatement',
89 expression: attrs.bind.expression,
90 body: body
91 }
92 }
93 else if (attrs.repeat) {
94 obj = {
95 type: 'RepeatStatement',
96 expression: attrs.repeat.expression,
97 body: body
98 };
99 }
100 else {
101 obj = {
102 type: 'BlockStatement',
103 body: body
104 };
105 }
106
107 if (attrs.if) {
108 obj = {
109 type: 'IfStatement',
110 test: attrs.if.expression,
111 consequent: obj,
112 alternate: null
113 };
114 }
115
116 if (obj.type === 'BlockStatement') {
117 obj.attributes = attrs;
118 }
119 return obj;
120 },
121 peg$c24 = function(body) {
122 return {
123 type: 'OutputStatement',

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…