metal-soy-critic
Version:
A metal-soy code validation utility.
183 lines (182 loc) • 3.5 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
function Program(mark, namespace, body) {
return {
body,
mark,
namespace,
type: 'Program'
};
}
exports.Program = Program;
function Attribute(mark, name, value) {
return {
mark,
name,
value,
type: 'Attribute'
};
}
exports.Attribute = Attribute;
function OtherExpression(mark, content) {
return {
content,
mark,
type: 'OtherExpression'
};
}
exports.OtherExpression = OtherExpression;
function FunctionCall(mark, name, body) {
return {
body,
mark,
name,
type: 'FunctionCall'
};
}
exports.FunctionCall = FunctionCall;
function Reference(mark, name) {
return {
mark,
name,
type: 'Reference'
};
}
exports.Reference = Reference;
function Ternary(mark, condition, left, right) {
return {
condition,
left,
mark,
right,
type: 'Ternary'
};
}
exports.Ternary = Ternary;
function MapLiteral(mark, items) {
return {
items,
mark,
type: 'MapLiteral'
};
}
exports.MapLiteral = MapLiteral;
function MapItem(mark, key, value) {
return {
mark,
key,
value,
type: 'MapItem'
};
}
exports.MapItem = MapItem;
function BooleanLiteral(mark, value) {
return {
mark,
type: 'BooleanLiteral',
value
};
}
exports.BooleanLiteral = BooleanLiteral;
function StringLiteral(mark, value) {
return {
mark,
type: 'StringLiteral',
value
};
}
exports.StringLiteral = StringLiteral;
function NumberLiteral(mark, value) {
return {
mark,
type: 'NumberLiteral',
value
};
}
exports.NumberLiteral = NumberLiteral;
function SoyDoc(mark, about, params) {
return {
about,
mark,
params,
type: 'SoyDoc'
};
}
exports.SoyDoc = SoyDoc;
function Template(mark, doc, id, attributes, params = [], body = []) {
return {
attributes,
body,
mark,
id,
params,
doc,
type: 'Template'
};
}
exports.Template = Template;
function DelTemplate(mark, doc, id, variant, params = [], body = []) {
return {
body,
doc,
mark,
id,
params,
variant,
type: 'DelTemplate'
};
}
exports.DelTemplate = DelTemplate;
function Interpolation(mark, content) {
return {
content,
mark,
type: 'Interpolation'
};
}
exports.Interpolation = Interpolation;
function Param(mark, name, body) {
return {
body,
mark,
name,
type: 'Param'
};
}
exports.Param = Param;
function ParamDeclaration(mark, required, name, paramType) {
return {
mark,
name,
paramType,
required,
type: 'ParamDeclaration'
};
}
exports.ParamDeclaration = ParamDeclaration;
function LetStatement(mark, name, body) {
return {
body,
mark,
name,
type: 'LetStatement'
};
}
exports.LetStatement = LetStatement;
function Call(mark, id, body = []) {
return {
mark,
body,
id,
type: 'Call'
};
}
exports.Call = Call;
function OtherCmd(mark, name, body = []) {
return {
body,
mark,
type: name.charAt(0).toUpperCase() + name.slice(1)
};
}
exports.OtherCmd = OtherCmd;