File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,20 @@ static inline bool is_debug_info(const char* command) {
3232 return laco_is_match (debug_info_matches , command );
3333}
3434
35+ void laco_dispatch (const struct LacoCommand * commands ,
36+ struct LacoState * laco , const char * command_keyword ,
37+ const char * * arguments ) {
38+ int i ;
39+ const char * * matches ;
40+
41+ for (i = 0 ; (matches = commands [i ].matches ); i ++ ) {
42+ if (laco_is_match (matches , command_keyword )) {
43+ commands [i ].handler (laco , arguments );
44+ break ;
45+ }
46+ }
47+ }
48+
3549void laco_handle_command (struct LacoState * laco , char * line ) {
3650 if (laco != NULL && line != NULL ) {
3751 char * command_line = strdup (line + 1 );
Original file line number Diff line number Diff line change @@ -10,6 +10,10 @@ struct LacoCommand {
1010 LacoHandler handler ;
1111};
1212
13+ void laco_dispatch (const struct LacoCommand * commands ,
14+ struct LacoState * laco , const char * command_keyword ,
15+ const char * * arguments );
16+
1317/**
1418 * Gets passed ever line to see if it matches one of the REPL command. If it
1519 * does, that command will be executed.
You can’t perform that action at this time.
0 commit comments