From 22fb54a917676e61f19d773cc4f931300ace925e Mon Sep 17 00:00:00 2001 From: Jari Vetoniemi Date: Sat, 13 May 2017 01:50:39 +0300 Subject: lexer.rl: hex can be as long as we want hex expression shared the esc_hex expression before. But esc_hex is limited to 2 hexdecimal characters, and thus poor choice for parsing hexdecimal numbers in source. (This is different from C which allows "n" length hex escapes causing problems when you mix hex escapes with strings for example) --- src/fspec/lexer.rl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/fspec/lexer.rl b/src/fspec/lexer.rl index 8fdc960..51d1a54 100644 --- a/src/fspec/lexer.rl +++ b/src/fspec/lexer.rl @@ -530,7 +530,7 @@ state_finish_declaration(struct state *state, const enum fspec_declaration decl) esc = [abfnrtv\\'"e]; esc_chr = '\\'; esc_hex = 'x' <: xdigit{2}; - hex = '0' <: esc_hex; + hex = '0x' <: xdigit{1,}; oct = [0-7]{1,3}; dec = [\-+]? <: (([1-9] <: digit*) | '0'); valid = ^cntrl; -- cgit v1.2.3