summaryrefslogtreecommitdiff
path: root/compiler/lexer/char_info.c
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2024-11-01 23:46:08 -0400
committerIan Moffett <ian@osmora.org>2024-11-01 23:46:08 -0400
commita515dfb3b8f8e999362db7a6b52b3104c03b750a (patch)
treed0180f0cbc39d9c3e367af30791ad774e4d419ff /compiler/lexer/char_info.c
Import quark sources
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'compiler/lexer/char_info.c')
-rw-r--r--compiler/lexer/char_info.c106
1 files changed, 106 insertions, 0 deletions
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 ,
+};