From 3a8a66d7a973b45f8abf29d29d8ed996cb709dab Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Wed, 19 Jan 2005 02:51:38 +0000 Subject: [PATCH] * nasm-token.re (nasm_parser_lex): b/q/h suffixes should be case-insensitive. * numcase.asm, numcase.errwarn, numcase.hex: Add testcases. Noticed by: Albrecht Kleine svn path=/trunk/yasm/; revision=1193 --- modules/parsers/nasm/nasm-token.re | 6 +++--- modules/parsers/nasm/tests/numcase.asm | 6 ++++++ modules/parsers/nasm/tests/numcase.errwarn | 0 modules/parsers/nasm/tests/numcase.hex | 24 ++++++++++++++++++++++ 4 files changed, 33 insertions(+), 3 deletions(-) create mode 100644 modules/parsers/nasm/tests/numcase.asm create mode 100644 modules/parsers/nasm/tests/numcase.errwarn create mode 100644 modules/parsers/nasm/tests/numcase.hex diff --git a/modules/parsers/nasm/nasm-token.re b/modules/parsers/nasm/nasm-token.re index a8b09e53..194f7d74 100644 --- a/modules/parsers/nasm/nasm-token.re +++ b/modules/parsers/nasm/nasm-token.re @@ -218,21 +218,21 @@ scan: } /* 10010011b - binary number */ - bindigit+ "b" { + bindigit+ B { s->tok[TOKLEN-1] = '\0'; /* strip off 'b' */ lvalp->intn = yasm_intnum_create_bin(s->tok, cur_line); RETURN(INTNUM); } /* 777q - octal number */ - octdigit+ "q" { + octdigit+ Q { s->tok[TOKLEN-1] = '\0'; /* strip off 'q' */ lvalp->intn = yasm_intnum_create_oct(s->tok, cur_line); RETURN(INTNUM); } /* 0AAh form of hexidecimal number */ - digit hexdigit* "h" { + digit hexdigit* H { s->tok[TOKLEN-1] = '\0'; /* strip off 'h' */ lvalp->intn = yasm_intnum_create_hex(s->tok, cur_line); RETURN(INTNUM); diff --git a/modules/parsers/nasm/tests/numcase.asm b/modules/parsers/nasm/tests/numcase.asm new file mode 100644 index 00000000..6f74f2fb --- /dev/null +++ b/modules/parsers/nasm/tests/numcase.asm @@ -0,0 +1,6 @@ +dd 10100100b +dd 10101010B +dd 76543210q +dd 01234567Q +dd 005A5h +dd 010ABH diff --git a/modules/parsers/nasm/tests/numcase.errwarn b/modules/parsers/nasm/tests/numcase.errwarn new file mode 100644 index 00000000..e69de29b diff --git a/modules/parsers/nasm/tests/numcase.hex b/modules/parsers/nasm/tests/numcase.hex new file mode 100644 index 00000000..bafcbd2d --- /dev/null +++ b/modules/parsers/nasm/tests/numcase.hex @@ -0,0 +1,24 @@ +a4 +00 +00 +00 +aa +00 +00 +00 +88 +c6 +fa +00 +77 +39 +05 +00 +a5 +05 +00 +00 +ab +10 +00 +00 -- 2.40.0