forked from ccxvii/mujs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jslex.h
81 lines (74 loc) · 1.05 KB
/
jslex.h
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
#ifndef js_lex_h
#define js_lex_h
enum
{
TK_IDENTIFIER = 256,
TK_NUMBER,
TK_STRING,
TK_REGEXP,
/* multi-character punctuators */
TK_LE,
TK_GE,
TK_EQ,
TK_NE,
TK_STRICTEQ,
TK_STRICTNE,
TK_SHL,
TK_SHR,
TK_USHR,
TK_AND,
TK_OR,
TK_ADD_ASS,
TK_SUB_ASS,
TK_MUL_ASS,
TK_DIV_ASS,
TK_MOD_ASS,
TK_SHL_ASS,
TK_SHR_ASS,
TK_USHR_ASS,
TK_AND_ASS,
TK_OR_ASS,
TK_XOR_ASS,
TK_INC,
TK_DEC,
/* keywords */
TK_BREAK,
TK_CASE,
TK_CATCH,
TK_CONTINUE,
TK_DEBUGGER,
TK_DEFAULT,
TK_DELETE,
TK_DO,
TK_ELSE,
TK_FALSE,
TK_FINALLY,
TK_FOR,
TK_FUNCTION,
TK_IF,
TK_IN,
TK_INSTANCEOF,
TK_NEW,
TK_NULL,
TK_RETURN,
TK_SWITCH,
TK_THIS,
TK_THROW,
TK_TRUE,
TK_TRY,
TK_TYPEOF,
TK_VAR,
TK_VOID,
TK_WHILE,
TK_WITH,
};
int jsY_iswhite(int c);
int jsY_isnewline(int c);
int jsY_ishex(int c);
int jsY_tohex(int c);
const char *jsY_tokenstring(int token);
int jsY_findword(const char *s, const char **list, int num);
void jsY_initlex(js_State *J, const char *filename, const char *source);
int jsY_lex(js_State *J);
int jsY_lexjson(js_State *J);
#endif