Varine
And as the moon rises, we shall prepare for war
- Reaction score
- 805
My programs clearly portray my frustration when you go through the source. Especially in the comments once I get too drunk to keep programming.
var prefix = function (id, nud) {
var s = symbol(id);
s.nud = nud || function () {
scope.reserve(this);
this.first = expression(70);
this.arity = "unary";
return this;
};
return s;
}
var prefix = function (id, nud) {
var s = symbol(id);
s.nud = nud || function () {
scope.reserve(this);
this.first = expression(70);
return this;
};
this.arity = "unary";
return s;
}
Oh... And the arity is modified only when it is used specifically as a unary operator..
I understand now but it doesn't seem like a, I duno, like a good way to handle it..
class BinaryNode : public ASTNode{
BinaryOp m_op;
ASTNode *m_left, *m_right;
....
};
class UnaryNode : public ASTNode{
UnaryOp m_op;
ASTNode *m_node;
....
};
....