word def name state will handle all whitespaces anyways so simplified state change to it

This commit is contained in:
Richard Thier 2024-09-28 13:02:55 +02:00
parent 4889472dd3
commit 2b2cc47d7a

View File

@ -351,21 +351,20 @@ static inline slc_state slc_def_name_statechange(
} else { } else {
*prefix_i = -1; *prefix_i = -1;
} }
} else {
if(c == ':') {
*prefix_i = 0; /* XXX: restarts scan */
return SLC_WORD_NAME;
}
} }
return current_state; return current_state;
} else {
/* Check if ended by ':' after full prefix or not */
if(prevc == ':' && (*prefix_i > 0) && prefix[*prefix_i] == 0) {
/* Found: a word definition! */
return SLC_WORD_NAME;
} else { } else {
/* Not Found: Probably a word occurence */ /* Not Found: Probably a word occurence */
*prefix_i = 0; /* XXX: restarts scan */ *prefix_i = 0; /* XXX: restarts scan */
return current_state; return current_state;
} }
} }
}
/** Handles state change into word occurences - shared wordname with def_name_statechange! */ /** Handles state change into word occurences - shared wordname with def_name_statechange! */
static inline slc_state slc_word_statechange( static inline slc_state slc_word_statechange(