1 | #ifndef DEFINE_FUNC_ATTRIBUTES |
2 | # define DEFINE_FUNC_ATTRIBUTES |
3 | #endif |
4 | #include "nvim/func_attr.h" |
5 | #undef DEFINE_FUNC_ATTRIBUTES |
6 | static inline struct hl_group *HL_TABLE(void); |
7 | static void clear_syn_state(synstate_T *p); |
8 | static void clear_current_state(void); |
9 | static void syn_sync(win_T *wp, linenr_T start_lnum, synstate_T *last_valid); |
10 | static void save_chartab(char_u *chartab); |
11 | static void restore_chartab(char_u *chartab); |
12 | static int syn_match_linecont(linenr_T lnum); |
13 | static void syn_start_line(void); |
14 | static void syn_update_ends(int startofline); |
15 | static void syn_stack_free_block(synblock_T *block); |
16 | static void syn_stack_alloc(void); |
17 | static void syn_stack_apply_changes_block(synblock_T *block, buf_T *buf); |
18 | static int syn_stack_cleanup(void); |
19 | static void syn_stack_free_entry(synblock_T *block, synstate_T *p); |
20 | static synstate_T *syn_stack_find_entry(linenr_T lnum); |
21 | static synstate_T *store_current_state(void); |
22 | static void load_current_state(synstate_T *from); |
23 | static int syn_stack_equal(synstate_T *sp); |
24 | static void invalidate_current_state(void); |
25 | static void validate_current_state(void); |
26 | static _Bool syn_finish_line(const _Bool syncing ); |
27 | static int syn_current_attr(const _Bool syncing, const _Bool displaying, _Bool *const can_spell, const _Bool keep_state ); |
28 | static int did_match_already(int idx, garray_T *gap); |
29 | static stateitem_T *push_next_match(void); |
30 | static void check_state_ends(void); |
31 | static void update_si_attr(int idx); |
32 | static void check_keepend(void); |
33 | static void update_si_end(stateitem_T *sip, int startcol, int force ); |
34 | static void push_current_state(int idx); |
35 | static void pop_current_state(void); |
36 | static void find_endpos(int idx, lpos_T *startpos, lpos_T *m_endpos, lpos_T *hl_endpos, long *flagsp, lpos_T *end_endpos, int *end_idx, reg_extmatch_T *start_ext ); |
37 | static void limit_pos(lpos_T *pos, lpos_T *limit); |
38 | static void limit_pos_zero(lpos_T *pos, lpos_T *limit); |
39 | static void syn_add_end_off(lpos_T *result, regmmatch_T *regmatch, synpat_T *spp, int idx, int ); |
40 | static void syn_add_start_off(lpos_T *result, regmmatch_T *regmatch, synpat_T *spp, int idx, int ); |
41 | static char_u *syn_getcurline(void); |
42 | static int syn_regexec(regmmatch_T *rmp, linenr_T lnum, colnr_T col, syn_time_T *st); |
43 | static int check_keyword_id(char_u *const line, const int startcol, int *const endcolp, long *const flagsp, int16_t **const next_listp, stateitem_T *const cur_si, int *const ccharp ); |
44 | static keyentry_T *match_keyword(char_u *keyword, hashtab_T *ht, stateitem_T *cur_si); |
45 | static void syn_cmd_conceal(exarg_T *eap, int syncing); |
46 | static void syn_cmd_case(exarg_T *eap, int syncing); |
47 | static void syn_cmd_spell(exarg_T *eap, int syncing); |
48 | static void syn_cmd_iskeyword(exarg_T *eap, int syncing); |
49 | static void syntax_sync_clear(void); |
50 | static void syn_remove_pattern(synblock_T *block, int idx); |
51 | static void syn_clear_pattern(synblock_T *block, int i); |
52 | static void syn_clear_cluster(synblock_T *block, int i); |
53 | static void syn_cmd_clear(exarg_T *eap, int syncing); |
54 | static void syn_clear_one(const int id, const _Bool syncing); |
55 | static void syn_cmd_on(exarg_T *eap, int syncing); |
56 | static void syn_cmd_enable(exarg_T *eap, int syncing); |
57 | static void syn_cmd_reset(exarg_T *eap, int syncing); |
58 | static void syn_cmd_manual(exarg_T *eap, int syncing); |
59 | static void syn_cmd_off(exarg_T *eap, int syncing); |
60 | static void syn_cmd_onoff(exarg_T *eap, char *name) FUNC_ATTR_NONNULL_ALL; |
61 | static void syn_cmd_list(exarg_T *eap, int syncing ); |
62 | static void syn_lines_msg(void); |
63 | static void syn_match_msg(void); |
64 | static void syn_list_one(const int id, const _Bool syncing, const _Bool link_only ); |
65 | static void syn_list_flags(struct name_list *nlist, int flags, int attr); |
66 | static void syn_list_cluster(int id); |
67 | static void put_id_list(const char *const name, const int16_t *const list, const int attr); |
68 | static void put_pattern(const char *const s, const int c, const synpat_T *const spp, const int attr); |
69 | static _Bool syn_list_keywords(const int id, const hashtab_T *const ht, _Bool , const int attr ); |
70 | static void syn_clear_keyword(int id, hashtab_T *ht); |
71 | static void clear_keywtab(hashtab_T *ht); |
72 | static void add_keyword(char_u *const name, const int id, const int flags, int16_t *const cont_in_list, int16_t *const next_list, const int conceal_char); |
73 | static char_u *get_group_name(char_u *arg, char_u **name_end ); |
74 | static char_u *get_syn_options(char_u *arg, syn_opt_arg_T *opt, int *conceal_char, int skip ); |
75 | static void syn_incl_toplevel(int id, int *flagsp); |
76 | static void syn_cmd_include(exarg_T *eap, int syncing); |
77 | static void syn_cmd_keyword(exarg_T *eap, int syncing); |
78 | static void syn_cmd_match(exarg_T *eap, int syncing ); |
79 | static void syn_cmd_region(exarg_T *eap, int syncing ); |
80 | static int syn_compare_stub(const void *const v1, const void *const v2); |
81 | static void syn_combine_list(int16_t **const clstr1, int16_t **const clstr2, const int list_op); |
82 | static int syn_scl_name2id(char_u *name); |
83 | static int syn_scl_namen2id(char_u *linep, int len); |
84 | static int syn_check_cluster(char_u *pp, int len); |
85 | static int syn_add_cluster(char_u *name); |
86 | static void syn_cmd_cluster(exarg_T *eap, int syncing); |
87 | static void init_syn_patterns(void); |
88 | static char_u *get_syn_pattern(char_u *arg, synpat_T *ci); |
89 | static void syn_cmd_sync(exarg_T *eap, int syncing); |
90 | static int get_id_list(char_u **const arg, const int keylen, int16_t **const list, const _Bool skip ); |
91 | static int16_t *copy_id_list(const int16_t *const list); |
92 | static int in_id_list(stateitem_T *cur_si, int16_t *list, struct sp_syn *ssp, int contained ); |
93 | static void syn_clear_time(syn_time_T *st); |
94 | static void syntime_clear(void); |
95 | static int syn_compare_syntime(const void *v1, const void *v2); |
96 | static void syntime_report(void); |
97 | static int hl_has_settings(int idx, int check_link); |
98 | static void highlight_clear(int idx); |
99 | static void highlight_list_one(const int id); |
100 | static _Bool highlight_list_arg(const int id, _Bool didh, const int type, int iarg, char_u *const sarg, const char *const name); |
101 | static _Bool (const _Bool , const int outlen, const int id, _Bool force_newline); |
102 | static void set_hl_attr(int idx); |
103 | static int syn_add_group(char_u *name); |
104 | static void syn_unadd_group(void); |
105 | static void combine_stl_hlt(int id, int id_S, int id_alt, int hlcnt, int i, int hlf, int *table) FUNC_ATTR_NONNULL_ALL; |
106 | static void highlight_list(void); |
107 | static void highlight_list_two(int cnt, int attr); |
108 | #include "nvim/func_attr.h" |
109 | |