Github User Fetcher 1.0.0
C Application with Server and GUI
|
#include "duk_internal.h"
Go to the source code of this file.
Macros | |
#define | DUK__MAX_RE_DECESC_DIGITS 9 |
#define | DUK__MAX_RE_QUANT_DIGITS 9 /* Does not allow e.g. 2**31-1, but one more would allow overflows of u32. */ |
#define | DUK__ISDIGIT(x) ((x) >= DUK_ASC_0 && (x) <= DUK_ASC_9) |
#define | DUK__ISHEXDIGIT(x) duk__is_hex_digit((x)) |
#define | DUK__ISOCTDIGIT(x) ((x) >= DUK_ASC_0 && (x) <= DUK_ASC_7) |
#define | DUK__ISDIGIT03(x) ((x) >= DUK_ASC_0 && (x) <= DUK_ASC_3) |
#define | DUK__ISDIGIT47(x) ((x) >= DUK_ASC_4 && (x) <= DUK_ASC_7) |
#define | DUK__LOOKUP(lex_ctx, index) ((lex_ctx)->window[(index)].codepoint) |
#define | DUK__ADVANCECHARS(lex_ctx, count) duk__advance_bytes((lex_ctx), (count) * sizeof(duk_lexer_codepoint)) |
#define | DUK__ADVANCEBYTES(lex_ctx, count) duk__advance_bytes((lex_ctx), (count)) |
#define | DUK__INITBUFFER(lex_ctx) duk__initbuffer((lex_ctx)) |
#define | DUK__APPENDBUFFER(lex_ctx, x) duk__appendbuffer((lex_ctx), (duk_codepoint_t) (x)) |
#define | DUK__L0() DUK__LOOKUP(lex_ctx, 0) |
#define | DUK__L1() DUK__LOOKUP(lex_ctx, 1) |
#define | DUK__L2() DUK__LOOKUP(lex_ctx, 2) |
#define | DUK__L3() DUK__LOOKUP(lex_ctx, 3) |
#define | DUK__L4() DUK__LOOKUP(lex_ctx, 4) |
#define | DUK__L5() DUK__LOOKUP(lex_ctx, 5) |
#define | DUK__ADVTOK(advbytes, tok) ((((advbytes) * sizeof(duk_lexer_codepoint)) << 8) + (tok)) |
#define DUK__ADVANCEBYTES | ( | lex_ctx, | |
count ) duk__advance_bytes((lex_ctx), (count)) |
Definition at line 92 of file duktape-1.5.2/src-separate/duk_lexer.c.
Referenced by duk_lexer_parse_js_input_element(), and duk_lexer_parse_re_token().
#define DUK__ADVANCECHARS | ( | lex_ctx, | |
count ) duk__advance_bytes((lex_ctx), (count) * sizeof(duk_lexer_codepoint)) |
Definition at line 91 of file duktape-1.5.2/src-separate/duk_lexer.c.
Referenced by duk_lexer_parse_js_input_element(), duk_lexer_parse_re_ranges(), and duk_lexer_parse_re_token().
#define DUK__ADVTOK | ( | advbytes, | |
tok ) ((((advbytes) * sizeof(duk_lexer_codepoint)) << 8) + (tok)) |
Definition at line 105 of file duktape-1.5.2/src-separate/duk_lexer.c.
Referenced by duk_lexer_parse_js_input_element(), and duk_lexer_parse_re_token().
#define DUK__APPENDBUFFER | ( | lex_ctx, | |
x ) duk__appendbuffer((lex_ctx), (duk_codepoint_t) (x)) |
Definition at line 94 of file duktape-1.5.2/src-separate/duk_lexer.c.
Referenced by duk_lexer_parse_js_input_element().
#define DUK__INITBUFFER | ( | lex_ctx | ) | duk__initbuffer((lex_ctx)) |
Definition at line 93 of file duktape-1.5.2/src-separate/duk_lexer.c.
Referenced by duk_lexer_parse_js_input_element().
Definition at line 83 of file duktape-1.5.2/src-separate/duk_lexer.c.
Referenced by duk_lexer_parse_js_input_element(), duk_lexer_parse_re_ranges(), and duk_lexer_parse_re_token().
Definition at line 86 of file duktape-1.5.2/src-separate/duk_lexer.c.
Referenced by duk_lexer_parse_js_input_element().
Definition at line 87 of file duktape-1.5.2/src-separate/duk_lexer.c.
Referenced by duk_lexer_parse_js_input_element().
#define DUK__ISHEXDIGIT | ( | x | ) | duk__is_hex_digit((x)) |
Definition at line 84 of file duktape-1.5.2/src-separate/duk_lexer.c.
Referenced by duk_lexer_parse_js_input_element().
Definition at line 85 of file duktape-1.5.2/src-separate/duk_lexer.c.
Referenced by duk_lexer_parse_js_input_element().
#define DUK__L0 | ( | ) | DUK__LOOKUP(lex_ctx, 0) |
Definition at line 97 of file duktape-1.5.2/src-separate/duk_lexer.c.
Referenced by duk_lexer_parse_js_input_element(), duk_lexer_parse_re_ranges(), and duk_lexer_parse_re_token().
#define DUK__L1 | ( | ) | DUK__LOOKUP(lex_ctx, 1) |
Definition at line 98 of file duktape-1.5.2/src-separate/duk_lexer.c.
Referenced by duk_lexer_parse_js_input_element(), and duk_lexer_parse_re_token().
#define DUK__L2 | ( | ) | DUK__LOOKUP(lex_ctx, 2) |
Definition at line 99 of file duktape-1.5.2/src-separate/duk_lexer.c.
Referenced by duk_lexer_parse_js_input_element(), and duk_lexer_parse_re_token().
#define DUK__L3 | ( | ) | DUK__LOOKUP(lex_ctx, 3) |
Definition at line 100 of file duktape-1.5.2/src-separate/duk_lexer.c.
Referenced by duk_lexer_parse_js_input_element().
#define DUK__L4 | ( | ) | DUK__LOOKUP(lex_ctx, 4) |
Definition at line 101 of file duktape-1.5.2/src-separate/duk_lexer.c.
#define DUK__L5 | ( | ) | DUK__LOOKUP(lex_ctx, 5) |
Definition at line 102 of file duktape-1.5.2/src-separate/duk_lexer.c.
Definition at line 90 of file duktape-1.5.2/src-separate/duk_lexer.c.
Referenced by duk_lexer_parse_js_input_element().
#define DUK__MAX_RE_DECESC_DIGITS 9 |
Definition at line 79 of file duktape-1.5.2/src-separate/duk_lexer.c.
Referenced by duk_lexer_parse_re_token().
#define DUK__MAX_RE_QUANT_DIGITS 9 /* Does not allow e.g. 2**31-1, but one more would allow overflows of u32. */ |
Definition at line 80 of file duktape-1.5.2/src-separate/duk_lexer.c.
Referenced by duk_lexer_parse_re_token().
DUK_LOCAL void duk__advance_bytes | ( | duk_lexer_ctx * | lex_ctx, |
duk_small_uint_t | count_bytes ) |
Definition at line 317 of file duktape-1.5.2/src-separate/duk_lexer.c.
References duk_lexer_ctx::buffer, duk__fill_lexer_buffer(), DUK_ASSERT, DUK_ASSERT_DISABLE, DUK_LEXER_BUFFER_SIZE, DUK_LEXER_WINDOW_SIZE, DUK_MEMMOVE, and duk_lexer_ctx::window.
DUK_LOCAL void duk__appendbuffer | ( | duk_lexer_ctx * | lex_ctx, |
duk_codepoint_t | x ) |
Definition at line 529 of file duktape-1.5.2/src-separate/duk_lexer.c.
References duk_lexer_ctx::bw, DUK_ASSERT, DUK_BW_WRITE_ENSURE_CESU8, and duk_lexer_ctx::thr.
DUK_LOCAL duk_codepoint_t duk__decode_hexesc_from_window | ( | duk_lexer_ctx * | lex_ctx, |
duk_small_int_t | lookup_offset ) |
Definition at line 622 of file duktape-1.5.2/src-separate/duk_lexer.c.
References duk_lexer_codepoint::codepoint, duk__hexval(), and duk_lexer_ctx::window.
Referenced by duk_lexer_parse_js_input_element(), duk_lexer_parse_re_ranges(), and duk_lexer_parse_re_token().
DUK_LOCAL duk_codepoint_t duk__decode_uniesc_from_window | ( | duk_lexer_ctx * | lex_ctx, |
duk_small_int_t | lookup_offset ) |
Definition at line 628 of file duktape-1.5.2/src-separate/duk_lexer.c.
References duk_lexer_codepoint::codepoint, duk__hexval(), and duk_lexer_ctx::window.
Referenced by duk_lexer_parse_js_input_element(), duk_lexer_parse_re_ranges(), and duk_lexer_parse_re_token().
DUK_LOCAL void duk__emit_u16_direct_ranges | ( | duk_lexer_ctx * | lex_ctx, |
duk_re_range_callback | gen_range, | ||
void * | userdata, | ||
const duk_uint16_t * | ranges, | ||
duk_small_int_t | num ) |
Definition at line 1868 of file duktape-1.5.2/src-separate/duk_lexer.c.
References DUK_UNREF.
Referenced by duk_lexer_parse_re_ranges().
DUK_LOCAL void duk__fill_lexer_buffer | ( | duk_lexer_ctx * | lex_ctx, |
duk_small_uint_t | start_offset_bytes ) |
Definition at line 177 of file duktape-1.5.2/src-separate/duk_lexer.c.
References duk_lexer_ctx::buffer, duk_lexer_codepoint::codepoint, DUK_ASSERT, DUK_ERROR_SYNTAX, DUK_LEXER_BUFFER_SIZE, DUK_LIKELY, DUK_UNLIKELY, duk_lexer_ctx::input, duk_lexer_ctx::input_length, duk_lexer_ctx::input_line, duk_lexer_ctx::input_offset, duk_lexer_codepoint::line, duk_lexer_codepoint::offset, and duk_lexer_ctx::thr.
Referenced by duk__advance_bytes(), and duk__init_lexer_window().
DUK_LOCAL duk_codepoint_t duk__hexval | ( | duk_lexer_ctx * | lex_ctx, |
duk_codepoint_t | x ) |
Definition at line 596 of file duktape-1.5.2/src-separate/duk_lexer.c.
References DUK_ERROR_SYNTAX, duk_hex_dectab, DUK_LIKELY, and duk_lexer_ctx::thr.
Referenced by duk__decode_hexesc_from_window(), duk__decode_uniesc_from_window(), duk_lexer_parse_js_input_element(), and duk_lexer_parse_re_token().
DUK_LOCAL void duk__init_lexer_window | ( | duk_lexer_ctx * | lex_ctx | ) |
Definition at line 345 of file duktape-1.5.2/src-separate/duk_lexer.c.
References duk_lexer_ctx::buffer, duk__fill_lexer_buffer(), and duk_lexer_ctx::window.
Referenced by duk_lexer_setpoint().
DUK_LOCAL void duk__initbuffer | ( | duk_lexer_ctx * | lex_ctx | ) |
Definition at line 512 of file duktape-1.5.2/src-separate/duk_lexer.c.
References duk_lexer_ctx::buf, duk_lexer_ctx::bw, DUK_BW_INIT_WITHBUF, DUK_HBUFFER_DYNAMIC_GET_SIZE, duk_hbuffer_resize(), DUK_LEXER_TEMP_BUF_LIMIT, and duk_lexer_ctx::thr.
DUK_LOCAL void duk__internbuffer | ( | duk_lexer_ctx * | lex_ctx, |
duk_idx_t | valstack_idx ) |
Definition at line 550 of file duktape-1.5.2/src-separate/duk_lexer.c.
References duk_lexer_ctx::bw, DUK_ASSERT, DUK_BW_PUSH_AS_STRING, duk_replace(), duk_lexer_ctx::slot1_idx, duk_lexer_ctx::slot2_idx, and duk_lexer_ctx::thr.
Referenced by duk_lexer_parse_js_input_element().
DUK_LOCAL duk_bool_t duk__is_hex_digit | ( | duk_codepoint_t | x | ) |
Definition at line 615 of file duktape-1.5.2/src-separate/duk_lexer.c.
References duk_hex_dectab, and DUK_LIKELY.
DUK_INTERNAL void duk_lexer_initctx | ( | duk_lexer_ctx * | lex_ctx | ) |
Definition at line 563 of file duktape-1.5.2/src-separate/duk_lexer.c.
References duk_lexer_ctx::buf, DUK_ASSERT, DUK_MEMZERO, duk_lexer_ctx::input, NULL, duk_lexer_ctx::thr, and duk_lexer_ctx::window.
DUK_INTERNAL void duk_lexer_parse_js_input_element | ( | duk_lexer_ctx * | lex_ctx, |
duk_token * | out_token, | ||
duk_bool_t | strict_mode, | ||
duk_bool_t | regexp_mode ) |
Definition at line 701 of file duktape-1.5.2/src-separate/duk_lexer.c.
References duk_token::allow_auto_semi, DUK__ADVANCEBYTES, DUK__ADVANCECHARS, DUK__ADVTOK, DUK__APPENDBUFFER, duk__decode_hexesc_from_window(), duk__decode_uniesc_from_window(), duk__hexval(), DUK__INITBUFFER, duk__internbuffer(), DUK__ISDIGIT, DUK__ISDIGIT03, DUK__ISDIGIT47, DUK__ISHEXDIGIT, DUK__ISOCTDIGIT, DUK__L0, DUK__L1, DUK__L2, DUK__L3, DUK__LOOKUP, DUK_ASC_AMP, DUK_ASC_CARET, DUK_ASC_COLON, DUK_ASC_COMMA, DUK_ASC_DOUBLEQUOTE, DUK_ASC_EQUALS, DUK_ASC_EXCLAMATION, DUK_ASC_HT, DUK_ASC_LANGLE, DUK_ASC_LBRACKET, DUK_ASC_LCURLY, DUK_ASC_LF, DUK_ASC_LPAREN, DUK_ASC_MINUS, DUK_ASC_PERCENT, DUK_ASC_PERIOD, DUK_ASC_PIPE, DUK_ASC_PLUS, DUK_ASC_QUESTION, DUK_ASC_RANGLE, DUK_ASC_RBRACKET, DUK_ASC_RCURLY, DUK_ASC_RPAREN, DUK_ASC_SEMICOLON, DUK_ASC_SINGLEQUOTE, DUK_ASC_SLASH, DUK_ASC_SPACE, DUK_ASC_STAR, DUK_ASC_TILDE, DUK_ASSERT, DUK_DOUBLE_NAN, duk_dup(), DUK_ERROR_RANGE, DUK_ERROR_SYNTAX, duk_get_hstring(), DUK_HEAP_NUM_STRINGS, DUK_HTHREAD_GET_STRING, DUK_ISNAN, duk_numconv_parse(), duk_replace(), DUK_S2N_FLAG_ALLOW_AUTO_HEX_INT, DUK_S2N_FLAG_ALLOW_AUTO_OCT_INT, DUK_S2N_FLAG_ALLOW_EMPTY_FRAC, DUK_S2N_FLAG_ALLOW_EXP, DUK_S2N_FLAG_ALLOW_FRAC, DUK_S2N_FLAG_ALLOW_NAKED_FRAC, DUK_STRIDX_END_RESERVED, DUK_STRIDX_START_RESERVED, DUK_STRIDX_START_STRICT_RESERVED, DUK_STRIDX_TO_TOK, duk_to_number(), duk_to_undefined(), DUK_TOK_ADD, DUK_TOK_ADD_EQ, DUK_TOK_ALSHIFT, DUK_TOK_ALSHIFT_EQ, DUK_TOK_ARSHIFT, DUK_TOK_ARSHIFT_EQ, DUK_TOK_BAND, DUK_TOK_BAND_EQ, DUK_TOK_BNOT, DUK_TOK_BOR, DUK_TOK_BOR_EQ, DUK_TOK_BXOR, DUK_TOK_BXOR_EQ, DUK_TOK_COLON, DUK_TOK_COMMA, DUK_TOK_DECREMENT, DUK_TOK_DIV, DUK_TOK_DIV_EQ, DUK_TOK_EOF, DUK_TOK_EQ, DUK_TOK_EQUALSIGN, DUK_TOK_GE, DUK_TOK_GT, DUK_TOK_IDENTIFIER, DUK_TOK_INCREMENT, DUK_TOK_LAND, DUK_TOK_LBRACKET, DUK_TOK_LCURLY, DUK_TOK_LE, DUK_TOK_LNOT, DUK_TOK_LOR, DUK_TOK_LPAREN, DUK_TOK_LT, DUK_TOK_MOD, DUK_TOK_MOD_EQ, DUK_TOK_MUL, DUK_TOK_MUL_EQ, DUK_TOK_NEQ, DUK_TOK_NUMBER, DUK_TOK_PERIOD, DUK_TOK_QUESTION, DUK_TOK_RBRACKET, DUK_TOK_RCURLY, DUK_TOK_REGEXP, DUK_TOK_RPAREN, DUK_TOK_RSHIFT, DUK_TOK_RSHIFT_EQ, DUK_TOK_SEMICOLON, DUK_TOK_SEQ, DUK_TOK_SNEQ, DUK_TOK_STRING, DUK_TOK_SUB, DUK_TOK_SUB_EQ, duk_unicode_is_identifier_part(), duk_unicode_is_identifier_start(), duk_unicode_is_line_terminator(), duk_unicode_is_whitespace(), duk_lexer_codepoint::line, duk_token::lineterm, NULL, duk_token::num, duk_token::num_escapes, duk_lexer_codepoint::offset, duk_lexer_ctx::slot1_idx, duk_lexer_ctx::slot2_idx, duk_token::start_line, duk_token::start_offset, duk_token::str1, duk_token::str2, duk_token::t, duk_token::t_nores, duk_lexer_ctx::thr, duk_lexer_ctx::token_count, duk_lexer_ctx::token_limit, and duk_lexer_ctx::window.
DUK_INTERNAL void duk_lexer_parse_re_ranges | ( | duk_lexer_ctx * | lex_ctx, |
duk_re_range_callback | gen_range, | ||
void * | userdata ) |
Definition at line 1885 of file duktape-1.5.2/src-separate/duk_lexer.c.
References DUK__ADVANCECHARS, duk__decode_hexesc_from_window(), duk__decode_uniesc_from_window(), duk__emit_u16_direct_ranges(), DUK__ISDIGIT, DUK__L0, DUK_ASSERT, DUK_DD, DUK_DDPRINT, DUK_ERROR_SYNTAX, duk_unicode_is_identifier_part(), duk_unicode_re_ranges_digit, duk_unicode_re_ranges_not_digit, duk_unicode_re_ranges_not_white, duk_unicode_re_ranges_not_wordchar, duk_unicode_re_ranges_white, duk_unicode_re_ranges_wordchar, DUK_UNREF, DUK_USE_NONSTD_REGEXP_DOLLAR_ESCAPE, and duk_lexer_ctx::thr.
DUK_INTERNAL void duk_lexer_parse_re_token | ( | duk_lexer_ctx * | lex_ctx, |
duk_re_token * | out_token ) |
Definition at line 1534 of file duktape-1.5.2/src-separate/duk_lexer.c.
References DUK__ADVANCEBYTES, DUK__ADVANCECHARS, DUK__ADVTOK, duk__decode_hexesc_from_window(), duk__decode_uniesc_from_window(), duk__hexval(), DUK__ISDIGIT, DUK__L0, DUK__L1, DUK__L2, DUK__MAX_RE_DECESC_DIGITS, DUK__MAX_RE_QUANT_DIGITS, DUK_DDD, DUK_DDDPRINT, DUK_ERROR_RANGE, DUK_ERROR_SYNTAX, DUK_LEXER_GETPOINT, DUK_LEXER_SETPOINT, DUK_MEMZERO, DUK_RE_QUANTIFIER_INFINITE, DUK_RETOK_ASSERT_END, DUK_RETOK_ASSERT_NOT_WORD_BOUNDARY, DUK_RETOK_ASSERT_START, DUK_RETOK_ASSERT_START_NEG_LOOKAHEAD, DUK_RETOK_ASSERT_START_POS_LOOKAHEAD, DUK_RETOK_ASSERT_WORD_BOUNDARY, DUK_RETOK_ATOM_BACKREFERENCE, DUK_RETOK_ATOM_CHAR, DUK_RETOK_ATOM_DIGIT, DUK_RETOK_ATOM_END_GROUP, DUK_RETOK_ATOM_NOT_DIGIT, DUK_RETOK_ATOM_NOT_WHITE, DUK_RETOK_ATOM_NOT_WORD_CHAR, DUK_RETOK_ATOM_PERIOD, DUK_RETOK_ATOM_START_CAPTURE_GROUP, DUK_RETOK_ATOM_START_CHARCLASS, DUK_RETOK_ATOM_START_CHARCLASS_INVERTED, DUK_RETOK_ATOM_START_NONCAPTURE_GROUP, DUK_RETOK_ATOM_WHITE, DUK_RETOK_ATOM_WORD_CHAR, DUK_RETOK_DISJUNCTION, DUK_RETOK_QUANTIFIER, DUK_TOK_EOF, DUK_UNICODE_CP_ZWJ, DUK_UNICODE_CP_ZWNJ, duk_unicode_is_identifier_part(), DUK_USE_NONSTD_REGEXP_DOLLAR_ESCAPE, duk_re_token::greedy, duk_re_token::num, duk_re_token::qmax, duk_re_token::qmin, duk_re_token::t, duk_lexer_ctx::thr, duk_lexer_ctx::token_count, and duk_lexer_ctx::token_limit.
DUK_INTERNAL void duk_lexer_setpoint | ( | duk_lexer_ctx * | lex_ctx, |
duk_lexer_point * | pt ) |
Definition at line 583 of file duktape-1.5.2/src-separate/duk_lexer.c.
References duk__init_lexer_window(), DUK_ASSERT, DUK_ASSERT_DISABLE, duk_lexer_ctx::input_line, duk_lexer_ctx::input_offset, duk_lexer_point::line, and duk_lexer_point::offset.