diff options
Diffstat (limited to 'boot')
| -rw-r--r-- | boot/tree.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/boot/tree.c b/boot/tree.c index 9ea9e6f..aab05eb 100644 --- a/boot/tree.c +++ b/boot/tree.c @@ -16,8 +16,10 @@ enum Unary_Operation UNARY_MINUS, UNARY_NOT, - UNARY_BITWISE_NOT, + + UNARY_REFERENCE, + UNARY_DEREFERENCE, }; enum Unary_Operation @@ -30,6 +32,10 @@ unary_operation_from_token(const struct Token* token) return UNARY_NOT; case TOKEN_TILDE: return UNARY_BITWISE_NOT; + case TOKEN_AMPERSAND: + return UNARY_REFERENCE; + case TOKEN_STAR: + return UNARY_DEREFERENCE; default: return UNARY_NONE; @@ -46,6 +52,10 @@ unary_operation_to_string(enum Unary_Operation operation) return "!"; case UNARY_BITWISE_NOT: return "~"; + case UNARY_REFERENCE: + return "&"; + case UNARY_DEREFERENCE: + return "*"; default: failure("unexpected unary operation passed to `unary_operation_to_string`"); |
