some tricky ideas - might revert
This commit is contained in:
parent
ea2745da22
commit
07c2c39143
20
engine/slc.h
20
engine/slc.h
@ -274,7 +274,8 @@ static inline slc_state slc_comment_statechange_in(
|
|||||||
static inline slc_state slc_def_name_statechange(
|
static inline slc_state slc_def_name_statechange(
|
||||||
slc_state current_state,
|
slc_state current_state,
|
||||||
char c,
|
char c,
|
||||||
const char *prefix) {
|
const char *prefix,
|
||||||
|
int *prefix_i) {
|
||||||
// FIXME: Implement
|
// FIXME: Implement
|
||||||
return current_state;
|
return current_state;
|
||||||
}
|
}
|
||||||
@ -352,6 +353,7 @@ static inline void slc(
|
|||||||
|
|
||||||
int comment_i = 0;
|
int comment_i = 0;
|
||||||
int multiline_i = 0;
|
int multiline_i = 0;
|
||||||
|
int prefix_i = 0;
|
||||||
|
|
||||||
uint8_t c = 0;
|
uint8_t c = 0;
|
||||||
while(((c = code_src()) != 0)) {
|
while(((c = code_src()) != 0)) {
|
||||||
@ -368,23 +370,27 @@ static inline void slc(
|
|||||||
multiline_comment_opener_len,
|
multiline_comment_opener_len,
|
||||||
&comment_i,
|
&comment_i,
|
||||||
&multiline_i);
|
&multiline_i);
|
||||||
|
|
||||||
/* state -> def_name */
|
/* state -> def_name */
|
||||||
if(state == SLC_START) {
|
if(state == SLC_START) {
|
||||||
state = slc_def_name_statechange(
|
state = slc_def_name_statechange(
|
||||||
state,
|
state,
|
||||||
c,
|
c,
|
||||||
prefix);
|
prefix,
|
||||||
} else goto process_char; // new state might need 'c' too
|
&prefix_i);
|
||||||
|
} else goto process_char; /* new state might need 'c' too */
|
||||||
|
|
||||||
/* state -> word_name */
|
/* state -> word_name */
|
||||||
if(state == SLC_START) {
|
/* XXX: You can't START words with ':', parts of prefix or comment prefix - that makes my life simpler here */
|
||||||
|
if((state == SLC_START) && (comment_i == 0) && (multiline_i == 0) && (prefix_i == 0)) {
|
||||||
state = slc_word_name_statechange(
|
state = slc_word_name_statechange(
|
||||||
state,
|
state,
|
||||||
c,
|
c,
|
||||||
prefix);
|
prefix);
|
||||||
if(state != SLC_START) goto process_char; // new state might need 'c' too
|
if(state != SLC_START) goto process_char; /* new state might need 'c' too */
|
||||||
} else goto process_char; // new state might need 'c' too
|
} else goto process_char; /* new state might need 'c' too */
|
||||||
|
|
||||||
// Step to read next character
|
/* Step to read next character */
|
||||||
break;
|
break;
|
||||||
case SLC_COMMENT:
|
case SLC_COMMENT:
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user