disco/ast.js

10 lines
686 B
JavaScript
Raw Normal View History

2022-02-25 22:44:07 -05:00
module.exports = {
2022-03-12 07:49:35 -05:00
Body(statements) { return { type: 'body', value: statements } },
Link(identifier) { return { type: 'link', value: identifier } },
Invocation(identifier, ...args) { return { type: 'invo', value: identifier, args } },
Const(name, value) { return { type: 'const', value, name } },
Int(n) { return { type: 'int', value: n } },
String(s) { return { type: 'string', value: s } },
Variable(name, value) { return { type: 'var', value, name } },
VariableReference(name) { return { type: 'ref', value: name } },
2022-02-25 22:44:07 -05:00
}