From 80ebae7887e21f58ef09a18515e5521c5162053c Mon Sep 17 00:00:00 2001 From: Peter Mikkelsen Date: Fri, 21 Jan 2022 16:05:41 +0000 Subject: Get ready for hybrids --- lexer.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lexer.c') diff --git a/lexer.c b/lexer.c index 626d181..303951d 100644 --- a/lexer.c +++ b/lexer.c @@ -4,8 +4,6 @@ #include "apl9.h" -Rune primhybridnames[] = L"/\⌿⍀"; - Statement * lexline(Rune *line, int toplevel) { @@ -101,6 +99,10 @@ lexline(Rune *line, int toplevel) stmt->toks[stmt->ntoks].operator.dyadic = 1; stmt->toks[stmt->ntoks].operator.code = p-primdyadopnames; offset++; + }else if(p = runestrchr(primhybridnames, line[offset])){ + stmt->toks[stmt->ntoks].tag = HybridTag; + stmt->toks[stmt->ntoks].hybrid = p-primhybridnames; + offset++; }else if(isdigitrune(line[offset]) || (line[offset] == L'¯' && isdigitrune(line[offset+1]))){ char buf[64]; char *p = buf; -- cgit v1.2.3