build cflow following special keys #2222

pull/2236/head
nick black 3 years ago committed by nick black
parent f0fd38ef9e
commit 6c45a087bf

@ -265,11 +265,16 @@ link_numeric(automaton* a, esctrie* e, unsigned follow){
if((efollow = esctrie_from_idx(a, create_esctrie_node(a, 0))) == NULL){ if((efollow = esctrie_from_idx(a, create_esctrie_node(a, 0))) == NULL){
return NULL; return NULL;
} }
logdebug("EFOLLOW: %u\n", esctrie_idx(a, efollow));
} }
for(int i = '0' ; i <= '9' ; ++i){ for(int i = '0' ; i <= '9' ; ++i){
if(e->trie[i] == 0){ if(e->trie[i] == 0){
e->trie[i] = esctrie_idx(a, targ); e->trie[i] = esctrie_idx(a, targ);
}else{
logdebug("SKIPPING[%d] %u\n", i, e->trie[i]);
} }
}
for(int i = '0' ; i <= '9' ; ++i){
fill_in_numerics(a, esctrie_from_idx(a, e->trie[i]), targ, follow, efollow); fill_in_numerics(a, esctrie_from_idx(a, e->trie[i]), targ, follow, efollow);
} }
return efollow; return efollow;
@ -305,6 +310,7 @@ insert_path(automaton* a, const char* seq){
return NULL; return NULL;
} }
}else if(c == 'S'){ }else if(c == 'S'){
// strings always end with ST ("\e\\")
if((eptr = esctrie_make_string(a, eptr)) == NULL){ if((eptr = esctrie_make_string(a, eptr)) == NULL){
return NULL; return NULL;
} }
@ -326,7 +332,6 @@ insert_path(automaton* a, const char* seq){
} }
inescape = false; inescape = false;
}else{ // fixed character }else{ // fixed character
logtrace("adding fixed %c %u\n", c, c);
if(eptr->trie[c] == 0){ if(eptr->trie[c] == 0){
if((eptr->trie[c] = create_esctrie_node(a, 0)) == 0){ if((eptr->trie[c] = create_esctrie_node(a, 0)) == 0){
return NULL; return NULL;
@ -348,6 +353,7 @@ insert_path(automaton* a, const char* seq){
eptr->trie[c] = esctrie_idx(a, newe); eptr->trie[c] = esctrie_idx(a, newe);
} }
eptr = esctrie_from_idx(a, eptr->trie[c]); eptr = esctrie_from_idx(a, eptr->trie[c]);
logtrace("added fixed %c %u as %u\n", c, c, esctrie_idx(a, eptr));
} }
} }
if(inescape){ if(inescape){
@ -392,6 +398,7 @@ int inputctx_add_input_escape(automaton* a, const char* esc, uint32_t special,
eptr->ni.alt = alt; eptr->ni.alt = alt;
eptr->ni.y = 0; eptr->ni.y = 0;
eptr->ni.x = 0; eptr->ni.x = 0;
logdebug("added 0x%08x to %u\n", special, esctrie_idx(a, eptr));
} }
return 0; return 0;
} }

@ -1582,10 +1582,10 @@ read_inputs_nblock(inputctx* ictx){
static void* static void*
input_thread(void* vmarshall){ input_thread(void* vmarshall){
inputctx* ictx = vmarshall; inputctx* ictx = vmarshall;
if(build_cflow_automaton(ictx)){ if(prep_all_keys(ictx)){
abort(); // FIXME? abort(); // FIXME?
} }
if(prep_all_keys(ictx)){ if(build_cflow_automaton(ictx)){
abort(); // FIXME? abort(); // FIXME?
} }
for(;;){ for(;;){

@ -318,6 +318,7 @@ init_terminfo_esc(tinfo* ti, const char* name, escape_e idx,
// request kitty keyboard protocol through level 1, first pushing current. // request kitty keyboard protocol through level 1, first pushing current.
// see https://sw.kovidgoyal.net/kitty/keyboard-protocol/#progressive-enhancement // see https://sw.kovidgoyal.net/kitty/keyboard-protocol/#progressive-enhancement
// FIXME go to level 3, but need handle release codes
#define KBDSUPPORT "\x1b[>u\x1b[=1u" #define KBDSUPPORT "\x1b[>u\x1b[=1u"
// the kitty keyboard protocol allows unambiguous, complete identification of // the kitty keyboard protocol allows unambiguous, complete identification of

Loading…
Cancel
Save