From a515dfb3b8f8e999362db7a6b52b3104c03b750a Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Fri, 1 Nov 2024 23:46:08 -0400 Subject: Import quark sources Signed-off-by: Ian Moffett --- compiler/lexer/char_info.c | 106 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 compiler/lexer/char_info.c (limited to 'compiler/lexer/char_info.c') diff --git a/compiler/lexer/char_info.c b/compiler/lexer/char_info.c new file mode 100644 index 0000000..97ecb7d --- /dev/null +++ b/compiler/lexer/char_info.c @@ -0,0 +1,106 @@ +/* + * Character info table. + * Copyright (c) 2023-2024, Quinn Stephens and the OSMORA team. + * Provided under the BSD 3-Clause license. + */ + +#include "lexer/char_info.h" + +uint16_t char_info[256] = { + /* + NUL SOH STX ETX + EOT ENQ ACK BEL + */ + 0 , 0 , 0 , 0 , + 0 , 0 , 0 , 0 , + /* + BS TAB LF VT + FF CR SO SI + */ + 0 , CHAR_HORZ_WS, CHAR_VERT_WS, CHAR_VERT_WS, + CHAR_VERT_WS, CHAR_HORZ_WS, 0 , 0 , + /* + DLE DC1 DC2 DC3 + DC4 NAK SYN ETB + */ + 0 , 0 , 0 , 0 , + 0 , 0 , 0 , 0 , + /* + CAN EM SUB ESC + FS GS RS US + */ + 0 , 0 , 0 , 0 , + 0 , 0 , 0 , 0 , + /* + ! " # + $ % & ' + */ + CHAR_HORZ_WS, CHAR_EXCLAIM, 0 , 0 , + 0 , CHAR_PERCENT, CHAR_AMPER , 0 , + /* + ( ) * + + , - . / + */ + CHAR_LPAREN , CHAR_RPAREN , CHAR_STAR , CHAR_PLUS , + CHAR_COMMA , CHAR_MINUS , CHAR_DOT , CHAR_SLASH , + /* + 0 1 2 3 + 4 5 6 7 + */ + CHAR_DIGIT , CHAR_DIGIT , CHAR_DIGIT , CHAR_DIGIT , + CHAR_DIGIT , CHAR_DIGIT , CHAR_DIGIT , CHAR_DIGIT , + /* + 8 9 : ; + < = > ? + */ + CHAR_DIGIT , CHAR_DIGIT , CHAR_COLON , CHAR_SEMI , + CHAR_LESS , CHAR_EQUALS , CHAR_GREATER, 0 , + /* + @ A B C + D E F G + */ + 0 , CHAR_XUPPER , CHAR_XUPPER , CHAR_XUPPER , + CHAR_XUPPER , CHAR_XUPPER , CHAR_XUPPER , CHAR_UPPER , + /* + H I J K + L M N O + */ + CHAR_UPPER , CHAR_UPPER , CHAR_UPPER , CHAR_UPPER , + CHAR_UPPER , CHAR_UPPER , CHAR_UPPER , CHAR_UPPER , + /* + P Q R S + T U V W + */ + CHAR_UPPER , CHAR_UPPER , CHAR_UPPER , CHAR_UPPER , + CHAR_UPPER , CHAR_UPPER , CHAR_UPPER , CHAR_UPPER , + /* + X Y Z [ + \ ] ^ _ + */ + CHAR_UPPER , CHAR_UPPER , CHAR_UPPER , CHAR_LBRACK , + 0 , CHAR_RBRACK , CHAR_CARET , 0 , + /* + ` a b c + d e f g + */ + 0 , CHAR_XLOWER , CHAR_XLOWER , CHAR_XLOWER , + CHAR_XLOWER , CHAR_XLOWER , CHAR_XLOWER , CHAR_LOWER , + /* + h i j k + l m n o + */ + CHAR_LOWER , CHAR_LOWER , CHAR_LOWER , CHAR_LOWER , + CHAR_LOWER , CHAR_LOWER , CHAR_LOWER , CHAR_LOWER , + /* + p q r s + t u v w + */ + CHAR_LOWER , CHAR_LOWER , CHAR_LOWER , CHAR_LOWER , + CHAR_LOWER , CHAR_LOWER , CHAR_LOWER , CHAR_LOWER , + /* + x y z { + | } ~ + */ + CHAR_LOWER , CHAR_LOWER , CHAR_LOWER , CHAR_LBRACE , + CHAR_PIPE , CHAR_RBRACE , CHAR_TILDE , 0 , +}; -- cgit v1.2.3