diff options
Diffstat (limited to 'libcmd/cmd_parse.ragel')
-rw-r--r-- | libcmd/cmd_parse.ragel | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/libcmd/cmd_parse.ragel b/libcmd/cmd_parse.ragel index 85aa7d8..dd5ff13 100644 --- a/libcmd/cmd_parse.ragel +++ b/libcmd/cmd_parse.ragel @@ -5,8 +5,8 @@ #define TADD(T,S,E,SZ) {cmd_tok_t *t=cmd_tok_create(S,E,SZ,T);cmd_tok_add(tl,t);tl=tl->next;} //#define TADD(T,S,E) -#define PR_TK_DBG(S) printf(S);fwrite(ts,1,te-ts,stdout);printf("\n"); -//#define PR_TK_DBG(S) +//#define PR_TK_DBG(S) printf(S);fwrite(ts,1,te-ts,stdout);printf("\n"); +#define PR_TK_DBG(S) ; char *new_string( const char *start, const char *end ) { @@ -36,13 +36,13 @@ int print_token( char *s, char *e, int tok) binary = '0b' [0-1]+; string = ('"' ([a-zA-Z0-9' '])+ '"'); seperate = ';'; - word = [a-zA-Z] ([a-zA-Z0-9])+; + word = [a-zA-Z] ([a-zA-Z0-9])*; - sp = (' ' | '\t' | '\n'); + sp = (' ' | '\t' | '\n')*; main := |* hex {PR_TK_DBG("hex = ");TADD(CMDT_HEX, ts,te,te-ts);}; - sp {}; + sp {PR_TK_DBG("sp = ");}; string {PR_TK_DBG("str = ");TADD(CMDT_STR, ts,te,te-ts);}; decimal {PR_TK_DBG("dec = ");TADD(CMDT_INT, ts,te,te-ts);}; binary {PR_TK_DBG("bin = ");TADD(CMDT_BIN, ts,te,te-ts);}; |