1cb93a386Sopenharmony_ci// *****************
2cb93a386Sopenharmony_ci// *** IMPORTANT ***
3cb93a386Sopenharmony_ci// *****************
4cb93a386Sopenharmony_ci//
5cb93a386Sopenharmony_ci// 1. This file is only used when gn arg sksl_lex is set to true. It is used to regenerate the
6cb93a386Sopenharmony_ci//    SkSLLexer.h and SkSLLexer.cpp files.
7cb93a386Sopenharmony_ci// 2. Since token IDs are used to identify operators and baked into the .dehydrated.sksl files,
8cb93a386Sopenharmony_ci//    after modifying this file it is likely everything will break until you update the dehydrated
9cb93a386Sopenharmony_ci//    binaries. If things break after updating the lexer, set REHYDRATE in SkSLCompiler.cpp to 0,
10cb93a386Sopenharmony_ci//    rebuild, and then set it back to 1.
11cb93a386Sopenharmony_ci
12cb93a386Sopenharmony_ciFLOAT_LITERAL  = [0-9]*\.[0-9]+([eE][+-]?[0-9]+)?|[0-9]+\.[0-9]*([eE][+-]?[0-9]+)?|[0-9]+([eE][+-]?[0-9]+)
13cb93a386Sopenharmony_ciINT_LITERAL    = [0-9]+|0[xX][0-9a-fA-F]+
14cb93a386Sopenharmony_ciTRUE_LITERAL   = "true"
15cb93a386Sopenharmony_ciFALSE_LITERAL  = "false"
16cb93a386Sopenharmony_ciIF             = "if"
17cb93a386Sopenharmony_ciSTATIC_IF      = "@if"
18cb93a386Sopenharmony_ciELSE           = "else"
19cb93a386Sopenharmony_ciFOR            = "for"
20cb93a386Sopenharmony_ciWHILE          = "while"
21cb93a386Sopenharmony_ciDO             = "do"
22cb93a386Sopenharmony_ciSWITCH         = "switch"
23cb93a386Sopenharmony_ciSTATIC_SWITCH  = "@switch"
24cb93a386Sopenharmony_ciCASE           = "case"
25cb93a386Sopenharmony_ciDEFAULT        = "default"
26cb93a386Sopenharmony_ciBREAK          = "break"
27cb93a386Sopenharmony_ciCONTINUE       = "continue"
28cb93a386Sopenharmony_ciDISCARD        = "discard"
29cb93a386Sopenharmony_ciRETURN         = "return"
30cb93a386Sopenharmony_ciIN             = "in"
31cb93a386Sopenharmony_ciOUT            = "out"
32cb93a386Sopenharmony_ciINOUT          = "inout"
33cb93a386Sopenharmony_ciUNIFORM        = "uniform"
34cb93a386Sopenharmony_ciCONST          = "const"
35cb93a386Sopenharmony_ciFLAT           = "flat"
36cb93a386Sopenharmony_ciNOPERSPECTIVE  = "noperspective"
37cb93a386Sopenharmony_ciINLINE         = "inline"
38cb93a386Sopenharmony_ciNOINLINE       = "noinline"
39cb93a386Sopenharmony_ciHASSIDEEFFECTS = "sk_has_side_effects"
40cb93a386Sopenharmony_ciSTRUCT         = "struct"
41cb93a386Sopenharmony_ciLAYOUT         = "layout"
42cb93a386Sopenharmony_ciHIGHP          = "highp"
43cb93a386Sopenharmony_ciMEDIUMP        = "mediump"
44cb93a386Sopenharmony_ciLOWP           = "lowp"
45cb93a386Sopenharmony_ciES3            = "$es3"
46cb93a386Sopenharmony_ciRESERVED       = attribute|varying|precision|invariant|asm|class|union|enum|typedef|template|this|packed|goto|volatile|public|static|extern|external|interface|long|double|fixed|unsigned|superp|input|output|hvec[234]|dvec[234]|fvec[234]|sampler[12]DShadow|sampler3DRect|sampler2DRectShadow|samplerCube|sizeof|cast|namespace|using|gl_[0-9a-zA-Z_$]*
47cb93a386Sopenharmony_ciIDENTIFIER     = [a-zA-Z_$][0-9a-zA-Z_$]*
48cb93a386Sopenharmony_ciDIRECTIVE      = #[a-zA-Z_$][0-9a-zA-Z_$]*
49cb93a386Sopenharmony_ciLPAREN         = "("
50cb93a386Sopenharmony_ciRPAREN         = ")"
51cb93a386Sopenharmony_ciLBRACE         = "{"
52cb93a386Sopenharmony_ciRBRACE         = "}"
53cb93a386Sopenharmony_ciLBRACKET       = "["
54cb93a386Sopenharmony_ciRBRACKET       = "]"
55cb93a386Sopenharmony_ciDOT            = "."
56cb93a386Sopenharmony_ciCOMMA          = ","
57cb93a386Sopenharmony_ciPLUSPLUS       = "++"
58cb93a386Sopenharmony_ciMINUSMINUS     = "--"
59cb93a386Sopenharmony_ciPLUS           = "+"
60cb93a386Sopenharmony_ciMINUS          = "-"
61cb93a386Sopenharmony_ciSTAR           = "*"
62cb93a386Sopenharmony_ciSLASH          = "/"
63cb93a386Sopenharmony_ciPERCENT        = "%"
64cb93a386Sopenharmony_ciSHL            = "<<"
65cb93a386Sopenharmony_ciSHR            = ">>"
66cb93a386Sopenharmony_ciBITWISEOR      = "|"
67cb93a386Sopenharmony_ciBITWISEXOR     = "^"
68cb93a386Sopenharmony_ciBITWISEAND     = "&"
69cb93a386Sopenharmony_ciBITWISENOT     = "~"
70cb93a386Sopenharmony_ciLOGICALOR      = "||"
71cb93a386Sopenharmony_ciLOGICALXOR     = "^^"
72cb93a386Sopenharmony_ciLOGICALAND     = "&&"
73cb93a386Sopenharmony_ciLOGICALNOT     = "!"
74cb93a386Sopenharmony_ciQUESTION       = "?"
75cb93a386Sopenharmony_ciCOLON          = ":"
76cb93a386Sopenharmony_ciEQ             = "="
77cb93a386Sopenharmony_ciEQEQ           = "=="
78cb93a386Sopenharmony_ciNEQ            = "!="
79cb93a386Sopenharmony_ciGT             = ">"
80cb93a386Sopenharmony_ciLT             = "<"
81cb93a386Sopenharmony_ciGTEQ           = ">="
82cb93a386Sopenharmony_ciLTEQ           = "<="
83cb93a386Sopenharmony_ciPLUSEQ         = "+="
84cb93a386Sopenharmony_ciMINUSEQ        = "-="
85cb93a386Sopenharmony_ciSTAREQ         = "*="
86cb93a386Sopenharmony_ciSLASHEQ        = "/="
87cb93a386Sopenharmony_ciPERCENTEQ      = "%="
88cb93a386Sopenharmony_ciSHLEQ          = "<<="
89cb93a386Sopenharmony_ciSHREQ          = ">>="
90cb93a386Sopenharmony_ciBITWISEOREQ    = "|="
91cb93a386Sopenharmony_ciBITWISEXOREQ   = "^="
92cb93a386Sopenharmony_ciBITWISEANDEQ   = "&="
93cb93a386Sopenharmony_ciSEMICOLON      = ";"
94cb93a386Sopenharmony_ciARROW          = "->"
95cb93a386Sopenharmony_ciWHITESPACE     = \s+
96cb93a386Sopenharmony_ciLINE_COMMENT   = //.*
97cb93a386Sopenharmony_ciBLOCK_COMMENT  = /\*([^*]|\*[^/])*\*/
98cb93a386Sopenharmony_ciINVALID        = .
99