X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=gas%2Fapp.c;h=b9832d14b71f02493e5087b66f3a1538f9262be2;hb=cc3bd654e497aad7fa2793a7b6eac941e41fe4a8;hp=8884d9be821d4aab551e43dd932e0f30b0240c9c;hpb=0146fc9d1ec1b324445da4f89e95184c22308241;p=deliverable%2Fbinutils-gdb.git diff --git a/gas/app.c b/gas/app.c index 8884d9be82..b9832d14b7 100644 --- a/gas/app.c +++ b/gas/app.c @@ -34,6 +34,10 @@ #endif #endif +#ifdef H_TICK_HEX +int enable_h_tick_hex = 0; +#endif + #ifdef TC_M68K /* Whether we are scrubbing in m68k MRI mode. This is different from flag_m68k_mri, because the two flags will be affected by the .mri @@ -78,6 +82,9 @@ static const char symbol_chars[] = #define LEX_IS_DOUBLEBAR_1ST 13 #endif #define LEX_IS_PARALLEL_SEPARATOR 14 +#ifdef H_TICK_HEX +#define LEX_IS_H 15 +#endif #define IS_SYMBOL_COMPONENT(c) (lex[c] == LEX_IS_SYMBOL_COMPONENT) #define IS_WHITESPACE(c) (lex[c] == LEX_IS_WHITESPACE) #define IS_LINE_SEPARATOR(c) (lex[c] == LEX_IS_LINE_SEPARATOR) @@ -190,6 +197,14 @@ do_scrub_begin (int m68k_mri ATTRIBUTE_UNUSED) /* Must do this is we want VLIW instruction with "->" or "<-". */ lex['-'] = LEX_IS_SYMBOL_COMPONENT; #endif + +#ifdef H_TICK_HEX + if (enable_h_tick_hex) + { + lex['h'] = LEX_IS_H; + lex['H'] = LEX_IS_H; + } +#endif } /* Saved state of the scrubber. */ @@ -1009,6 +1024,16 @@ do_scrub_chars (int (*get) (char *, int), char *tostart, int tolen) #ifndef IEEE_STYLE case LEX_IS_ONECHAR_QUOTE: +#ifdef H_TICK_HEX + if (state == 9 && enable_h_tick_hex) + { + char c; + + c = GET (); + as_warn ("'%c found after symbol", c); + UNGET (c); + } +#endif if (state == 10) { /* Preserve the whitespace in foo 'b'. */ @@ -1254,6 +1279,26 @@ do_scrub_chars (int (*get) (char *, int), char *tostart, int tolen) PUT ('\n'); break; +#ifdef H_TICK_HEX + case LEX_IS_H: + /* Look for strings like H'[0-9A-Fa-f] and if found, replace + the H' with 0x to make them gas-style hex characters. */ + if (enable_h_tick_hex) + { + char quot; + + quot = GET (); + if (quot == '\'') + { + UNGET ('x'); + ch = '0'; + } + else + UNGET (quot); + } + /* FALL THROUGH */ +#endif + case LEX_IS_SYMBOL_COMPONENT: if (state == 10) {