diff options
Diffstat (limited to 'src/bytecode/bytecode.h')
-rw-r--r-- | src/bytecode/bytecode.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/bytecode/bytecode.h b/src/bytecode/bytecode.h index 92040b4..7c21d50 100644 --- a/src/bytecode/bytecode.h +++ b/src/bytecode/bytecode.h @@ -34,6 +34,14 @@ enum flag { FLAG_UNSET = (FLAG_VALUE_UNSET << 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), @@ -128,6 +136,12 @@ static inline bool isInherit(css_code_t OPV) return getFlagValue(OPV) == FLAG_VALUE_INHERIT; } +static inline bool isCalc(css_code_t OPV) +{ + /* Note, this relies on all _CALC values being the same ultimately */ + return getValue(OPV) == 0x7f; +} + #endif |