From 700b5bc2b24bf9fd8e69f0586739c692be0dc2cb Mon Sep 17 00:00:00 2001 From: FreeArtMan Date: Sat, 17 Aug 2019 13:26:00 +0100 Subject: updated lib, compiles --- libcmd/cmd_parse.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'libcmd/cmd_parse.c') diff --git a/libcmd/cmd_parse.c b/libcmd/cmd_parse.c index b9904e9..0377e1d 100644 --- a/libcmd/cmd_parse.c +++ b/libcmd/cmd_parse.c @@ -7,8 +7,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 ) { @@ -111,7 +111,7 @@ static const int cmd_error = 0; static const int cmd_en_main = 6; -#line 75 "cmd_parse.ragel" +#line 62 "cmd_parse.ragel" int parse_cmd( cmd_tok_t *tl, const char *str, size_t str_size ) @@ -126,7 +126,7 @@ int parse_cmd( cmd_tok_t *tl, const char *str, size_t str_size ) /*save for cmd_begin state*/ //char *ts_cb=0, *te_cb=0; - printf("PE:%s %02x\n",pe,(unsigned char)*pe); + //printf("PE:%s %02x\n",pe,(unsigned char)*pe); /* variables used in state machine @@ -141,7 +141,7 @@ int parse_cmd( cmd_tok_t *tl, const char *str, size_t str_size ) act = 0; } -#line 96 "cmd_parse.ragel" +#line 83 "cmd_parse.ragel" #line 147 "cmd_parse.c" { @@ -235,39 +235,39 @@ _eof_trans: {te = p+1;} break; case 4: -#line 60 "cmd_parse.ragel" +#line 53 "cmd_parse.ragel" {act = 2;} break; case 5: -#line 62 "cmd_parse.ragel" +#line 55 "cmd_parse.ragel" {te = p+1;{PR_TK_DBG("qstr = ");TADD(CMDT_QSTR, ts,te,te-ts);}} break; case 6: -#line 64 "cmd_parse.ragel" +#line 57 "cmd_parse.ragel" {te = p+1;{PR_TK_DBG("sp = ");TADD(CMDT_SP, ts,te,te-ts);}} break; case 7: -#line 59 "cmd_parse.ragel" +#line 52 "cmd_parse.ragel" {te = p;p--;{PR_TK_DBG("hex = ");TADD(CMDT_HEX, ts,te,te-ts);}} break; case 8: -#line 60 "cmd_parse.ragel" +#line 53 "cmd_parse.ragel" {te = p;p--;{PR_TK_DBG("dec = ");TADD(CMDT_INT, ts,te,te-ts);}} break; case 9: -#line 61 "cmd_parse.ragel" +#line 54 "cmd_parse.ragel" {te = p;p--;{PR_TK_DBG("bin = ");TADD(CMDT_BIN, ts,te,te-ts);}} break; case 10: -#line 63 "cmd_parse.ragel" +#line 56 "cmd_parse.ragel" {te = p;p--;{PR_TK_DBG("word = ");TADD(CMDT_WORD, ts,te,te-ts);}} break; case 11: -#line 66 "cmd_parse.ragel" +#line 58 "cmd_parse.ragel" {te = p;p--;{PR_TK_DBG("float= ");TADD(CMDT_FLOAT, ts,te,te-ts);}} break; case 12: -#line 60 "cmd_parse.ragel" +#line 53 "cmd_parse.ragel" {{p = ((te))-1;}{PR_TK_DBG("dec = ");TADD(CMDT_INT, ts,te,te-ts);}} break; case 13: @@ -319,7 +319,7 @@ _again: _out: {} } -#line 97 "cmd_parse.ragel" +#line 84 "cmd_parse.ragel" if ( cs == cmd_error ) { -- cgit v1.2.3