projects
/
ulas
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f69ddee
)
Added unary + operator
author
Lukas Krickl
<lukas@krickl.dev>
Tue, 27 Feb 2024 16:11:19 +0000
(17:11 +0100)
committer
Lukas Krickl
<lukas@krickl.dev>
Tue, 27 Feb 2024 16:11:19 +0000
(17:11 +0100)
src/ulas.c
patch
|
blob
|
history
diff --git
a/src/ulas.c
b/src/ulas.c
index 46d10aa9c8efdda1e1b4a3b36e2f5d5740511a67..a5783c80efc27d9e7204001d2a7f6067262e4f85 100644
(file)
--- a/
src/ulas.c
+++ b/
src/ulas.c
@@
-1470,7
+1470,7
@@
int ulas_parsecmp(int *i);
int ulas_parseun(int *i) {
struct ulas_tok *t = ulas_tokbufget(&ulas.toks, *i);
- if (t && (t->type == '!' || t->type == '-' || t->type == '~')) {
+ if (t && (t->type == '!' || t->type == '-' || t->type == '~'
|| t->type == '+'
)) {
int op = *i;
*i += 1;
int right = ulas_parseun(i);
@@
-1704,6
+1704,8
@@
int ulas_intexpreval(int i, int *rc) {
return !right;
case '-':
return -right;
+ case '+':
+ return +right;
case '~':
return ~right;
default: