aboutsummaryrefslogtreecommitdiff
path: root/src/parser.c
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2024-06-29 12:58:25 +0200
committerThomas Voss <mail@thomasvoss.com> 2024-06-29 12:58:25 +0200
commit8dbb8162f99efe0f35b99df6379c71336a575222 (patch)
treebbbee582e9ecc2de225ae343c6a4463602f61c3d /src/parser.c
parenta8a3f92984afbe4e02a427bfea468ebc2e146a5a (diff)
Implement bit shifting operations
Diffstat (limited to 'src/parser.c')
-rw-r--r--src/parser.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/parser.c b/src/parser.c
index f0977d4..45961b0 100644
--- a/src/parser.c
+++ b/src/parser.c
@@ -70,6 +70,8 @@ fwdnode(ast_t ast, idx_t i)
case ASTBINDIV:
case ASTBINMOD:
case ASTBINMUL:
+ case ASTBINSHL:
+ case ASTBINSHR:
case ASTBINSUB:
case ASTBINXOR:
case ASTCDECL:
@@ -278,13 +280,15 @@ parseexpratom(ast_t *ast, lexemes_t toks)
idx_t
parseexprinc(ast_t *ast, lexemes_t toks, idx_t lhs, int minprec)
{
- static const int prectbl[UINT8_MAX] = {
+ static const int prectbl[UINT8_MAX + 1] = {
['+'] = 1,
['-'] = 1,
['~'] = 1,
['%'] = 2,
['*'] = 2,
['/'] = 2,
+ [LEXLANGL_DBL] = 2,
+ [LEXRANGL_DBL] = 2,
};
uint8_t op = toks.kinds[toksidx];