From 1ab601071e94fc08de31670e3fcb6fe13f7341a7 Mon Sep 17 00:00:00 2001 From: Renaud Fivet Date: Wed, 19 Aug 2015 15:46:40 +0800 Subject: [PATCH] In order to support # as comment indicator, buffer content prefix is changed to '='. #buffername becomes =buffername. --- eval.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/eval.c b/eval.c index 00b7a2b..7e5c685 100644 --- a/eval.c +++ b/eval.c @@ -1117,15 +1117,9 @@ static int gettyp( char *token) { /* grab the first char (this is all we need) */ c = *token; - /* no blanks!!! */ - if (c == 0) - return TKNUL; - - /* a numeric literal? */ - if( (c >= '0' && c <= '9') || c == '-') - return TKLIT; - switch (c) { + case 0: /* no blanks!!! */ + return TKNUL ; case '"': return TKSTR; @@ -1133,7 +1127,7 @@ static int gettyp( char *token) { return TKDIR; case '@': return TKARG; - case '#': + case '=': return TKBUF; case '$': return TKENV; @@ -1145,7 +1139,11 @@ static int gettyp( char *token) { return TKLBL; default: - return TKCMD; + /* a numeric literal? */ + if( (c >= '0' && c <= '9') || c == '-') + return TKLIT; + else + return TKCMD; } }