summaryrefslogtreecommitdiff
path: root/compiler/lexer/char_info.c
blob: 97ecb7db8039a64da472f9209c2f821a72022f53 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
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           ,
};