diff options
author | Peter Mikkelsen <petermikkelsen10@gmail.com> | 2022-01-21 16:05:41 +0000 |
---|---|---|
committer | Peter Mikkelsen <petermikkelsen10@gmail.com> | 2022-01-21 16:05:41 +0000 |
commit | 80ebae7887e21f58ef09a18515e5521c5162053c (patch) | |
tree | 6b62ff6497d44fc9fe5c05b9a92a65cf2efee386 /lexer.c | |
parent | e12450d52dce2d6271d12720bf18175d082a0003 (diff) |
Get ready for hybrids
Diffstat (limited to 'lexer.c')
-rw-r--r-- | lexer.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -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; |