From f9591eebe40c9d898483c83c6d4d23d553ec43fc Mon Sep 17 00:00:00 2001 From: Daniel Borkmann Date: Mon, 25 Mar 2013 20:21:15 +0100 Subject: trafgen: lexer/parser: fix cpu() selection and whitespacing It looks unintuitive when once needs to write cpu(0:3), so also allow cpu(0-3). Then it's quite stupid to enforce whitespace after the double colon before the curley braces open. So make this rather optional here. Signed-off-by: Daniel Borkmann --- trafgen_lexer.l | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'trafgen_lexer.l') diff --git a/trafgen_lexer.l b/trafgen_lexer.l index 72bd56c..be6917f 100644 --- a/trafgen_lexer.l +++ b/trafgen_lexer.l @@ -72,7 +72,7 @@ static char *try_convert_shellcode(char *sstr) number_oct ([0][0-9]+) number_hex ([0][x][a-fA-F0-9]+) number_bin ([0][b][0-1]+) -number_dec (([0])|([-+]?[1-9][0-9]*)) +number_dec (([0])|([1-9][0-9]*)) number_ascii ([a-zA-Z]) %% @@ -120,7 +120,7 @@ number_ascii ([a-zA-Z]) "\""[^\"]+"\"" { yylval.str = try_convert_shellcode(xstrdup(yytext)); return string; } -([ \t\r\n]+)? { return K_WHITE; } +([ \t\n]+)? { return K_WHITE; } "/*"([^\*]|\*[^/])*"*/" { return K_COMMENT; } -- cgit v1.2.3-54-g00ecf