From a43d15c546f6e264de2782ea9ef8e2ab9bbe9b55 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sun, 26 Oct 2003 02:04:47 +0000 Subject: [PATCH] Allow colons for EQU labels (e.g. "value: equ 5"). Reported by: Brian Gladman svn path=/trunk/yasm/; revision=1078 --- modules/parsers/nasm/nasm-bison.y | 78 ++++++++++++--------- modules/parsers/nasm/tests/Makefile.inc | 3 + modules/parsers/nasm/tests/equcolon.asm | 3 + modules/parsers/nasm/tests/equcolon.errwarn | 0 modules/parsers/nasm/tests/equcolon.hex | 2 + 5 files changed, 53 insertions(+), 33 deletions(-) create mode 100644 modules/parsers/nasm/tests/equcolon.asm create mode 100644 modules/parsers/nasm/tests/equcolon.errwarn create mode 100644 modules/parsers/nasm/tests/equcolon.hex diff --git a/modules/parsers/nasm/nasm-bison.y b/modules/parsers/nasm/nasm-bison.y index abbe8fa3..2db48c22 100644 --- a/modules/parsers/nasm/nasm-bison.y +++ b/modules/parsers/nasm/nasm-bison.y @@ -45,6 +45,8 @@ static void nasm_parser_directive /*@null@*/ yasm_valparamhead *objext_valparams); static int fix_directive_symrec(/*@null@*/ yasm_expr__item *ei, /*@null@*/ void *d); +static void define_label(yasm_parser_nasm *parser_nasm, /*@only@*/ char *name, + int local); #define nasm_parser_error(s) yasm__parser_error(cur_line, s) #define YYPARSE_PARAM parser_nasm_arg @@ -76,6 +78,10 @@ static int fix_directive_symrec(/*@null@*/ yasm_expr__item *ei, int num_operands; } insn_operands; yasm_insn_operand *insn_operand; + struct { + char *name; + int local; + } label; } %token INTNUM @@ -96,7 +102,7 @@ static int fix_directive_symrec(/*@null@*/ yasm_expr__item *ei, %type memaddr %type dvexpr expr direxpr %type explabel -%type label_id label_id_equ +%type