-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathquickjs-lexer.h
42 lines (32 loc) · 970 Bytes
/
quickjs-lexer.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
#ifndef QUICKJS_LEXER_H
#define QUICKJS_LEXER_H
#include "lexer.h"
#include "token.h"
/**
* \defgroup quickjs-lexer quickjs-lexer: Lexical scanner, regex based
* @{
*/
extern VISIBLE JSClassID js_token_class_id, js_lexer_class_id;
JSValue js_lexer_new(JSContext* ctx, JSValueConst proto, JSValueConst in, JSValueConst mode);
JSValue js_lexer_wrap(JSContext* ctx, Lexer* lex);
JSValue js_token_wrap(JSContext* ctx, Token* tok);
static inline Token*
js_token_data(JSValueConst value) {
return JS_GetOpaque(value, js_token_class_id);
}
static inline Token*
js_token_data2(JSContext* ctx, JSValueConst value) {
return JS_GetOpaque2(ctx, value, js_token_class_id);
}
static inline Lexer*
js_lexer_data(JSValueConst value) {
return JS_GetOpaque(value, js_lexer_class_id);
}
static inline Lexer*
js_lexer_data2(JSContext* ctx, JSValueConst value) {
return JS_GetOpaque2(ctx, value, js_lexer_class_id);
}
/**
* @}
*/
#endif /* defined(QUICKJS_LEXER_H) */