mirror of
https://github.com/open-simh/simtools.git
synced 2026-01-25 19:56:30 +00:00
Prepare for macros being defined in "other ways" which are not yet put in the macro definition table.
This commit is contained in:
23
macros.c
23
macros.c
@@ -91,7 +91,8 @@ void read_body(
|
||||
break;
|
||||
}
|
||||
|
||||
if (!called && (list_level - 1 + list_md) > 0) {
|
||||
if (!(called & CALLED_NOLIST) &&
|
||||
(list_level - 1 + list_md) > 0) {
|
||||
list_flush();
|
||||
list_source(stack->top, nextline);
|
||||
}
|
||||
@@ -185,17 +186,21 @@ MACRO *defmacro(
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Allow redefinition of a macro; new definition replaces the old. */
|
||||
mac = (MACRO *) lookup_sym(label, ¯o_st);
|
||||
if (mac) {
|
||||
/* Remove from the symbol table... */
|
||||
remove_sym(&mac->sym, ¯o_st);
|
||||
free_macro(mac);
|
||||
if (!(called & CALLED_NODEFINE)) {
|
||||
/* Allow redefinition of a macro; new definition replaces the old. */
|
||||
mac = (MACRO *) lookup_sym(label, ¯o_st);
|
||||
if (mac) {
|
||||
/* Remove from the symbol table... */
|
||||
remove_sym(&mac->sym, ¯o_st);
|
||||
free_macro(mac);
|
||||
}
|
||||
}
|
||||
|
||||
mac = new_macro(label);
|
||||
|
||||
add_table(&mac->sym, ¯o_st);
|
||||
if (!(called & CALLED_NODEFINE)) {
|
||||
add_table(&mac->sym, ¯o_st);
|
||||
}
|
||||
|
||||
argtail = &mac->args;
|
||||
cp = skipdelim(cp);
|
||||
@@ -245,7 +250,7 @@ MACRO *defmacro(
|
||||
|
||||
gb = new_buffer();
|
||||
|
||||
if (!called && !list_md) {
|
||||
if (!(called & CALLED_NOLIST) && !list_md) {
|
||||
list_level--;
|
||||
levelmod = 1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user