summaryrefslogtreecommitdiff
path: root/src/bytecode/bytecode.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/bytecode/bytecode.h')
-rw-r--r--src/bytecode/bytecode.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/bytecode/bytecode.h b/src/bytecode/bytecode.h
index 041050f..be163b1 100644
--- a/src/bytecode/bytecode.h
+++ b/src/bytecode/bytecode.h
@@ -23,6 +23,14 @@ enum flag {
FLAG_INHERIT = (1<<1)
};
+enum calc_opcodes {
+ CALC_PUSH_VALUE = 'V',
+ CALC_ADD = '+',
+ CALC_SUBTRACT = '-',
+ CALC_MULTIPLY = '*',
+ CALC_DIVIDE = '/',
+ CALC_FINISH = '=',
+};
typedef enum unit {
UNIT_LENGTH = (1u << 8),
@@ -107,6 +115,12 @@ static inline bool isInherit(css_code_t OPV)
return getFlags(OPV) & 0x2;
}
+static inline bool isCalc(css_code_t OPV)
+{
+ /* Note, this relies on all _CALC values being the same ultimately */
+ return getValue(OPV) == 0x7f;
+}
+
#endif