1#ifndef DEFINE_FUNC_ATTRIBUTES
2# define DEFINE_FUNC_ATTRIBUTES
3#endif
4#include "nvim/func_attr.h"
5#undef DEFINE_FUNC_ATTRIBUTES
6static void nfa_regcomp_start(char_u *expr, int re_flags );
7static int nfa_get_reganch(nfa_state_T *start, int depth);
8static int nfa_get_regstart(nfa_state_T *start, int depth);
9static char_u *nfa_get_match_text(nfa_state_T *start);
10static void realloc_post_list(void);
11static int nfa_recognize_char_class(char_u *start, char_u *end, int extra_newl);
12static void nfa_emit_equi_class(int c);
13static int nfa_regatom(void);
14static int nfa_regpiece(void);
15static int nfa_regconcat(void);
16static int nfa_regbranch(void);
17static int nfa_reg(int paren );
18static int *re2post(void);
19static nfa_state_T *alloc_state(int c, nfa_state_T *out, nfa_state_T *out1);
20static Frag_T frag(nfa_state_T *start, Ptrlist *out);
21static Ptrlist *list1(nfa_state_T **outp);
22static void patch(Ptrlist *l, nfa_state_T *s);
23static Ptrlist *append(Ptrlist *l1, Ptrlist *l2);
24static void st_error(int *postfix, int *end, int *p);
25static void st_push(Frag_T s, Frag_T **p, Frag_T *stack_end);
26static Frag_T st_pop(Frag_T **p, Frag_T *stack);
27static int nfa_max_width(nfa_state_T *startstate, int depth);
28static nfa_state_T *post2nfa(int *postfix, int *end, int nfa_calc_size);
29static void nfa_postprocess(nfa_regprog_T *prog);
30static void copy_pim(nfa_pim_T *to, nfa_pim_T *from);
31static void clear_sub(regsub_T *sub);
32static void copy_sub(regsub_T *to, regsub_T *from);
33static void copy_sub_off(regsub_T *to, regsub_T *from);
34static void copy_ze_off(regsub_T *to, regsub_T *from);
35static int sub_equal(regsub_T *sub1, regsub_T *sub2);
36static int has_state_with_pos(nfa_list_T *l, nfa_state_T *state, regsubs_T *subs, nfa_pim_T *pim );
37static int pim_equal(nfa_pim_T *one, nfa_pim_T *two);
38static int match_follows(nfa_state_T *startstate, int depth);
39static int state_in_list(nfa_list_T *l, nfa_state_T *state, regsubs_T *subs );
40static regsubs_T *addstate(nfa_list_T *l, nfa_state_T *state, regsubs_T *subs_arg, nfa_pim_T *pim, int off_arg) FUNC_ATTR_NONNULL_ARG(1, 2) FUNC_ATTR_WARN_UNUSED_RESULT;
41static regsubs_T *addstate_here(nfa_list_T *l, nfa_state_T *state, regsubs_T *subs, nfa_pim_T *pim, int *ip ) FUNC_ATTR_NONNULL_ARG(1, 2, 5) FUNC_ATTR_WARN_UNUSED_RESULT;
42static int check_char_class(int class, int c);
43static int match_backref(regsub_T *sub, int subidx, int *bytelen );
44static int match_zref(int subidx, int *bytelen );
45static void nfa_save_listids(nfa_regprog_T *prog, int *list);
46static void nfa_restore_listids(nfa_regprog_T *prog, int *list);
47static _Bool nfa_re_num_cmp(uintmax_t val, int op, uintmax_t pos);
48static int recursive_regmatch(nfa_state_T *state, nfa_pim_T *pim, nfa_regprog_T *prog, regsubs_T *submatch, regsubs_T *m, int **listids, int *listids_len);
49static int failure_chance(nfa_state_T *state, int depth);
50static int skip_to_start(int c, colnr_T *colp);
51static long find_match_text(colnr_T startcol, int regstart, char_u *match_text);
52static int nfa_did_time_out(void);
53static int nfa_regmatch(nfa_regprog_T *prog, nfa_state_T *start, regsubs_T *submatch, regsubs_T *m);
54static long nfa_regtry(nfa_regprog_T *prog, colnr_T col, proftime_T *tm, int *timed_out);
55static long nfa_regexec_both(char_u *line, colnr_T startcol, proftime_T *tm, int *timed_out);
56static regprog_T *nfa_regcomp(char_u *expr, int re_flags);
57static void nfa_regfree(regprog_T *prog);
58static int nfa_regexec_nl(regmatch_T *rmp, char_u *line, colnr_T col, _Bool line_lbr );
59static long nfa_regexec_multi(regmmatch_T *rmp, win_T *win, buf_T *buf, linenr_T lnum, colnr_T col, proftime_T *tm, int *timed_out);
60#include "nvim/func_attr.h"
61