2020-09-08 18:38:05 -07:00
|
|
|
#include "binop.hpp"
|
|
|
|
|
|
|
|
std::string op_name(binop op) {
|
|
|
|
switch(op) {
|
|
|
|
case PLUS: return "+";
|
|
|
|
case MINUS: return "-";
|
|
|
|
case TIMES: return "*";
|
|
|
|
case DIVIDE: return "/";
|
2020-09-10 12:44:41 -07:00
|
|
|
case MODULO: return "%";
|
|
|
|
case EQUALS: return "==";
|
|
|
|
case LESS_EQUALS: return "<=";
|
2020-09-08 18:38:05 -07:00
|
|
|
}
|
|
|
|
return "??";
|
|
|
|
}
|
|
|
|
|
|
|
|
std::string op_action(binop op) {
|
|
|
|
switch(op) {
|
|
|
|
case PLUS: return "plus";
|
|
|
|
case MINUS: return "minus";
|
|
|
|
case TIMES: return "times";
|
|
|
|
case DIVIDE: return "divide";
|
2020-09-10 12:44:41 -07:00
|
|
|
case MODULO: return "modulo";
|
|
|
|
case EQUALS: return "equals";
|
|
|
|
case LESS_EQUALS: return "less_equals";
|
2020-09-08 18:38:05 -07:00
|
|
|
}
|
|
|
|
return "??";
|
|
|
|
}
|