diff options
author | Daniel Silverstone <dsilvers@netsurf-browser.org> | 2020-10-03 20:19:47 +0100 |
---|---|---|
committer | Michael Drake <tlsa@netsurf-browser.org> | 2021-05-30 12:05:21 +0100 |
commit | db28a2dba7e411e4959152c3cf0e394cde94c57b (patch) | |
tree | ccb215eb0c035edc5d1f20e634948c76c441e344 /src/bytecode/bytecode.h | |
parent | 314d4ded8a89e891c191792894b660a853e0b8fe (diff) | |
download | libcss-db28a2dba7e411e4959152c3cf0e394cde94c57b.tar.gz libcss-db28a2dba7e411e4959152c3cf0e394cde94c57b.tar.bz2 |
parse: calc() test and fixup.
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 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 |