robin/laufey
git clone https://git.robinwobin.dev/robin/laufey
1813661a61
master
1#pragma once 2 3#include "nvim/buffer_defs.h" 4 5#define SST_MIN_ENTRIES 150 // minimal size for state stack array 6#define SST_MAX_ENTRIES 1000 // maximal size for state stack array 7#define SST_FIX_STATES 7 // size of sst_stack[]. 8#define SST_DIST 16 // normal distance between entries 9#define SST_INVALID ((synstate_T *)-1) // invalid syn_state pointer 10 11// struct passed to in_id_list() 12struct sp_syn { 13int inc_tag ;// ":syn include" unique tag 14int16_t id ;// highlight group ID of item 15int16_t * cont_in_list ;// cont.in group IDs, if non-zero 16}; 17 18// Each keyword has one keyentry, which is linked in a hash list. 19typedef struct keyentry keyentry_T ; 20 21struct keyentry { 22keyentry_T * ke_next ;// next entry with identical "keyword[]" 23struct sp_syn k_syn ;// struct passed to in_id_list() 24int16_t * next_list ;// ID list for next match (if non-zero) 25int flags ; 26int k_char ;// conceal substitute character 27char keyword []; 28}; 29 30// Struct used to store one state of the state stack. 31typedef struct { 32int bs_idx ;// index of pattern 33int bs_flags ;// flags for pattern 34int bs_seqnr ;// stores si_seqnr 35int bs_cchar ;// stores si_cchar 36reg_extmatch_T * bs_extmatch ;// external matches from start pattern 37}bufstate_T ; 38 39// syn_state contains the syntax state stack for the start of one line. 40// Used by b_sst_array[]. 41struct syn_state { 42synstate_T * sst_next ;// next entry in used or free list 43linenr_T sst_lnum ;// line number for this state 44union { 45bufstate_T sst_stack [SST_FIX_STATES ];// short state stack 46garray_T sst_ga ;// growarray for long state stack 47 }sst_union ; 48int sst_next_flags ;// flags for sst_next_list 49int sst_stacksize ;// number of states on the stack 50int16_t * sst_next_list ;// "nextgroup" list in this state 51// (this is a copy, don't free it! 52disptick_T sst_tick ;// tick when last displayed 53linenr_T sst_change_lnum ;// when non-zero, change in this line 54// may have made the state invalid 55};