From 83ce1151ee1f06ae6b1c5c1018cc2489494e5ea4 Mon Sep 17 00:00:00 2001 From: mrb0nk500 Date: Fri, 20 Nov 2020 15:10:24 -0500 Subject: - Implemented support for Sux's base extension. This is the biggest milestone I've reached for this project, since the base extension changes alot about what Sux can do by default, and now makes it a viable instruction set for modern day use, when compared with other instruction sets. --- lexer.h | 38 ++++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 18 deletions(-) (limited to 'lexer.h') diff --git a/lexer.h b/lexer.h index 3a9951e..dc478cd 100644 --- a/lexer.h +++ b/lexer.h @@ -34,28 +34,29 @@ static inline uint8_t isdelm2(char c, uint8_t dbg) { static inline uint8_t get_ptok(char c, uint8_t dbg) { switch (c) { - case '.' : return PTOK_DOT ; - case '@' : return PTOK_AT ; - case ':' : return PTOK_COLON ; - case '=' : return PTOK_EQU ; - case '+' : return PTOK_PLUS ; - case '-' : return PTOK_MINUS ; - case '>' : return PTOK_GT ; - case '<' : return PTOK_LT ; - case '|' : return PTOK_PIPE ; - case '(' : return PTOK_LBRACK ; - case ')' : return PTOK_RBRACK ; - case ',' : return PTOK_COMMA ; - case 'B': case 'b' : return PTOK_B ; + case '.' : return PTOK_DOT ; + case '@' : return PTOK_AT ; + case ':' : return PTOK_COLON ; + case '=' : return PTOK_EQU ; + case '+' : return PTOK_PLUS ; + case '-' : return PTOK_MINUS ; + case '>' : return PTOK_GT ; + case '<' : return PTOK_LT ; + case '|' : return PTOK_PIPE ; + case '(' : return PTOK_LBRACK ; + case ')' : return PTOK_RBRACK ; + case ',' : return PTOK_COMMA ; + case 'B': case 'b' : return PTOK_B ; + case 'E': case 'e' : return PTOK_E ; case 'X': case 'x' : return PTOK_X ; case 'Y': case 'y' : return PTOK_Y ; case 'S': case 's' : return PTOK_S ; case 'P': case 'p' : return PTOK_P ; - case '\"': return PTOK_DQUOTE ; - case '\'': return PTOK_SQUOTE ; - case '#' : return PTOK_HASH ; - case ';' : return PTOK_SCOLON ; - case '$' : return PTOK_DOLLAR ; + case '\"': return PTOK_DQUOTE ; + case '\'': return PTOK_SQUOTE ; + case '#' : return PTOK_HASH ; + case ';' : return PTOK_SCOLON ; + case '$' : return PTOK_DOLLAR ; case '%' : return PTOK_PERCENT; default : if (isdigit(c)) { @@ -71,6 +72,7 @@ static inline uint8_t get_ptok(char c, uint8_t dbg) { static inline uint8_t is_altok(uint8_t ptok, uint8_t dbg) { switch (ptok) { case PTOK_B: + case PTOK_E: case PTOK_X: case PTOK_Y: case PTOK_S: -- cgit v1.2.3-13-gbd6f