summaryrefslogtreecommitdiff
path: root/lexer.c
diff options
context:
space:
mode:
Diffstat (limited to 'lexer.c')
-rw-r--r--lexer.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/lexer.c b/lexer.c
index ceccf2f..bf2aaa4 100644
--- a/lexer.c
+++ b/lexer.c
@@ -4,8 +4,6 @@
#include "apl9.h"
-Rune primmonopnames[] = L"¨⍨⌸⌶&";
-Rune primdyadopnames[] = L"⍣.∘⍤⍥@⍠⌺";
Rune primhybridnames[] = L"/\⌿⍀";
Statement *
@@ -77,11 +75,15 @@ lexline(Rune *line)
offset++;
}else if(p = runestrchr(primmonopnames, line[offset])){
stmt->toks[stmt->ntoks].tag = MonadicOpTag;
- stmt->toks[stmt->ntoks].func.code = p-primmonopnames;
+ stmt->toks[stmt->ntoks].operator.type = OperatortypePrim;
+ stmt->toks[stmt->ntoks].operator.dyadic = 0;
+ stmt->toks[stmt->ntoks].operator.code = p-primmonopnames;
offset++;
}else if(p = runestrchr(primdyadopnames, line[offset])){
stmt->toks[stmt->ntoks].tag = DyadicOpTag;
- stmt->toks[stmt->ntoks].func.code = p-primdyadopnames;
+ stmt->toks[stmt->ntoks].operator.type = OperatortypePrim;
+ stmt->toks[stmt->ntoks].operator.dyadic = 1;
+ stmt->toks[stmt->ntoks].operator.code = p-primdyadopnames;
offset++;
}else if(isdigitrune(line[offset])){
char buf[64];