2016-12-28 20:32:00 +00:00
|
|
|
// ACME - a crossassembler for producing 6502/65c02/65816/65ce02 code.
|
2020-04-28 16:02:09 +00:00
|
|
|
// Copyright (C) 1998-2020 Marco Baye
|
2012-02-27 21:14:46 +00:00
|
|
|
// Have a look at "acme.c" for further info
|
|
|
|
//
|
|
|
|
// Macro stuff
|
2014-12-22 00:47:52 +00:00
|
|
|
#include "macro.h"
|
2012-02-27 21:14:46 +00:00
|
|
|
#include <string.h> // needs strlen() + memcpy()
|
|
|
|
#include "config.h"
|
|
|
|
#include "platform.h"
|
|
|
|
#include "acme.h"
|
|
|
|
#include "alu.h"
|
|
|
|
#include "dynabuf.h"
|
|
|
|
#include "global.h"
|
|
|
|
#include "input.h"
|
|
|
|
#include "section.h"
|
2014-06-07 00:12:10 +00:00
|
|
|
#include "symbol.h"
|
2012-02-27 21:14:46 +00:00
|
|
|
#include "tree.h"
|
|
|
|
|
|
|
|
|
|
|
|
// Constants
|
|
|
|
#define MACRONAME_DYNABUF_INITIALSIZE 128
|
|
|
|
#define ARG_SEPARATOR ' ' // separates macro title from arg types
|
2020-05-20 16:39:19 +00:00
|
|
|
#define ARGTYPE_VALUE 'v'
|
|
|
|
#define ARGTYPE_REF 'r'
|
2012-02-27 21:14:46 +00:00
|
|
|
#define REFERENCE_CHAR '~' // prefix for call-by-reference
|
|
|
|
#define HALF_INITIAL_ARG_TABLE_SIZE 4
|
|
|
|
static const char exception_macro_twice[] = "Macro already defined.";
|
|
|
|
|
|
|
|
|
|
|
|
// macro struct type definition
|
2014-03-11 12:07:11 +00:00
|
|
|
struct macro {
|
2012-02-27 21:14:46 +00:00
|
|
|
int def_line_number; // line number of definition for error msgs
|
|
|
|
char *def_filename, // file name of definition for error msgs
|
|
|
|
*original_name, // user-supplied name for error msgs
|
|
|
|
*parameter_list, // parameters (whole line)
|
|
|
|
*body; // RAM block containing macro body
|
|
|
|
};
|
|
|
|
// there's no need to make this a struct and add a type component:
|
|
|
|
// when the macro has been found, accessing its parameter_list component
|
|
|
|
// gives us the possibility to find out which args are call-by-value and
|
|
|
|
// which ones are call-by-reference.
|
|
|
|
union macro_arg_t {
|
2020-05-13 23:26:40 +00:00
|
|
|
struct object result; // value and flags (call by value)
|
2014-06-07 00:12:10 +00:00
|
|
|
struct symbol *symbol; // pointer to symbol struct (call by reference)
|
2012-02-27 21:14:46 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// Variables
|
2014-03-11 12:07:11 +00:00
|
|
|
static struct dynabuf *user_macro_name; // original macro title
|
|
|
|
static struct dynabuf *internal_name; // plus param type chars
|
2014-11-24 14:52:05 +00:00
|
|
|
static struct rwnode *macro_forest[256]; // trees (because of 8b hash)
|
2012-02-27 21:14:46 +00:00
|
|
|
// Dynamic argument table
|
|
|
|
static union macro_arg_t *arg_table = NULL;
|
|
|
|
static int argtable_size = HALF_INITIAL_ARG_TABLE_SIZE;
|
|
|
|
|
|
|
|
|
|
|
|
// Functions
|
|
|
|
|
|
|
|
// Enlarge the argument table
|
|
|
|
static void enlarge_arg_table(void)
|
|
|
|
{
|
|
|
|
argtable_size *= 2;
|
|
|
|
arg_table = realloc(arg_table, argtable_size * sizeof(*arg_table));
|
|
|
|
if (arg_table == NULL)
|
|
|
|
Throw_serious_error(exception_no_memory_left);
|
|
|
|
}
|
|
|
|
|
|
|
|
// create dynamic buffers and arg table
|
|
|
|
void Macro_init(void)
|
|
|
|
{
|
|
|
|
user_macro_name = DynaBuf_create(MACRONAME_DYNABUF_INITIALSIZE);
|
|
|
|
internal_name = DynaBuf_create(MACRONAME_DYNABUF_INITIALSIZE);
|
|
|
|
enlarge_arg_table();
|
|
|
|
}
|
|
|
|
|
2016-08-05 09:59:07 +00:00
|
|
|
// Read macro scope and title. Title is read to GlobalDynaBuf and then copied
|
2012-02-27 21:14:46 +00:00
|
|
|
// over to internal_name DynaBuf, where ARG_SEPARATOR is added.
|
|
|
|
// In user_macro_name DynaBuf, the original name is reconstructed (even with
|
2013-06-26 23:01:00 +00:00
|
|
|
// LOCAL_PREFIX) so a copy can be linked to the resulting macro struct.
|
2016-08-05 09:59:07 +00:00
|
|
|
static scope_t get_scope_and_title(void)
|
2012-02-27 21:14:46 +00:00
|
|
|
{
|
2016-08-05 09:59:07 +00:00
|
|
|
scope_t macro_scope;
|
2012-02-27 21:14:46 +00:00
|
|
|
|
2016-08-05 09:59:07 +00:00
|
|
|
Input_read_scope_and_keyword(¯o_scope); // skips spaces before
|
2012-02-27 21:14:46 +00:00
|
|
|
// now GotByte = illegal character after title
|
|
|
|
// copy macro title to private dynabuf and add separator character
|
|
|
|
DYNABUF_CLEAR(user_macro_name);
|
|
|
|
DYNABUF_CLEAR(internal_name);
|
2017-10-29 23:29:07 +00:00
|
|
|
if (macro_scope != SCOPE_GLOBAL) {
|
|
|
|
// TODO - allow "cheap macros"?!
|
2013-06-26 23:01:00 +00:00
|
|
|
DynaBuf_append(user_macro_name, LOCAL_PREFIX);
|
2017-10-29 23:29:07 +00:00
|
|
|
}
|
2012-02-27 21:14:46 +00:00
|
|
|
DynaBuf_add_string(user_macro_name, GLOBALDYNABUF_CURRENT);
|
|
|
|
DynaBuf_add_string(internal_name, GLOBALDYNABUF_CURRENT);
|
|
|
|
DynaBuf_append(user_macro_name, '\0');
|
|
|
|
DynaBuf_append(internal_name, ARG_SEPARATOR);
|
|
|
|
SKIPSPACE(); // done here once so it's not necessary at two callers
|
2016-08-05 09:59:07 +00:00
|
|
|
return macro_scope;
|
2012-02-27 21:14:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Check for comma. If there, append to GlobalDynaBuf.
|
|
|
|
static int pipe_comma(void)
|
|
|
|
{
|
|
|
|
int result;
|
|
|
|
|
|
|
|
result = Input_accept_comma();
|
|
|
|
if (result)
|
|
|
|
DYNABUF_APPEND(GlobalDynaBuf, ',');
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Return malloc'd copy of string
|
|
|
|
static char *get_string_copy(const char *original)
|
|
|
|
{
|
|
|
|
size_t size;
|
|
|
|
char *copy;
|
|
|
|
|
|
|
|
size = strlen(original) + 1;
|
|
|
|
copy = safe_malloc(size);
|
|
|
|
memcpy(copy, original, size);
|
|
|
|
return copy;
|
|
|
|
}
|
|
|
|
|
|
|
|
// This function is called from both macro definition and macro call.
|
|
|
|
// Terminate macro name and copy from internal_name to GlobalDynaBuf
|
|
|
|
// (because that's where Tree_hard_scan() looks for the search string).
|
|
|
|
// Then try to find macro and return whether it was created.
|
2016-08-05 09:59:07 +00:00
|
|
|
static int search_for_macro(struct rwnode **result, scope_t scope, int create)
|
2012-02-27 21:14:46 +00:00
|
|
|
{
|
|
|
|
DynaBuf_append(internal_name, '\0'); // terminate macro name
|
|
|
|
// now internal_name = macro_title SPC argument_specifiers NUL
|
|
|
|
DYNABUF_CLEAR(GlobalDynaBuf);
|
|
|
|
DynaBuf_add_string(GlobalDynaBuf, internal_name->buffer);
|
|
|
|
DynaBuf_append(GlobalDynaBuf, '\0');
|
2016-08-05 09:59:07 +00:00
|
|
|
return Tree_hard_scan(result, macro_forest, scope, create);
|
2012-02-27 21:14:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// This function is called when an already existing macro is re-defined.
|
|
|
|
// It first outputs a warning and then a serious error, stopping assembly.
|
|
|
|
// Showing the first message as a warning guarantees that ACME does not reach
|
|
|
|
// the maximum error limit inbetween.
|
2014-11-24 14:52:05 +00:00
|
|
|
static void report_redefinition(struct rwnode *macro_node)
|
2012-02-27 21:14:46 +00:00
|
|
|
{
|
2014-03-11 12:07:11 +00:00
|
|
|
struct macro *original_macro = macro_node->body;
|
2012-02-27 21:14:46 +00:00
|
|
|
|
|
|
|
// show warning with location of current definition
|
|
|
|
Throw_warning(exception_macro_twice);
|
2016-08-05 09:59:07 +00:00
|
|
|
// CAUTION, ugly kluge: fiddle with Input_now and section_now
|
2012-02-27 21:14:46 +00:00
|
|
|
// data to generate helpful error messages
|
|
|
|
Input_now->original_filename = original_macro->def_filename;
|
|
|
|
Input_now->line_number = original_macro->def_line_number;
|
2016-08-05 09:59:07 +00:00
|
|
|
section_now->type = "original";
|
|
|
|
section_now->title = "definition";
|
2012-02-27 21:14:46 +00:00
|
|
|
// show serious error with location of original definition
|
|
|
|
Throw_serious_error(exception_macro_twice);
|
|
|
|
}
|
|
|
|
|
|
|
|
// This function is only called during the first pass, so there's no need to
|
|
|
|
// check whether to skip the definition or not.
|
|
|
|
// Return with GotByte = '}'
|
|
|
|
void Macro_parse_definition(void) // Now GotByte = illegal char after "!macro"
|
|
|
|
{
|
2014-11-24 14:52:05 +00:00
|
|
|
char *formal_parameters;
|
|
|
|
struct rwnode *macro_node;
|
|
|
|
struct macro *new_macro;
|
2016-08-05 09:59:07 +00:00
|
|
|
scope_t macro_scope = get_scope_and_title();
|
2012-02-27 21:14:46 +00:00
|
|
|
|
|
|
|
// now GotByte = first non-space after title
|
|
|
|
DYNABUF_CLEAR(GlobalDynaBuf); // prepare to hold formal parameters
|
|
|
|
// GlobalDynaBuf = "" (will hold formal parameter list)
|
2013-06-26 23:01:00 +00:00
|
|
|
// user_macro_name = [LOCAL_PREFIX] MacroTitle NUL
|
2012-02-27 21:14:46 +00:00
|
|
|
// internal_name = MacroTitle ARG_SEPARATOR (grows to signature)
|
|
|
|
// Accept n>=0 comma-separated formal parameters before CHAR_SOB ('{').
|
|
|
|
// Valid argument formats are:
|
|
|
|
// .LOCAL_LABEL_BY_VALUE
|
|
|
|
// ~.LOCAL_LABEL_BY_REFERENCE
|
2017-10-29 23:29:07 +00:00
|
|
|
// @CHEAP_LOCAL_LABEL_BY_VALUE
|
|
|
|
// ~@CHEAP_LOCAL_LABEL_BY_REFERENCE
|
2012-02-27 21:14:46 +00:00
|
|
|
// GLOBAL_LABEL_BY_VALUE global args are very uncommon,
|
|
|
|
// ~GLOBAL_LABEL_BY_REFERENCE but not forbidden
|
|
|
|
// now GotByte = non-space
|
|
|
|
if (GotByte != CHAR_SOB) { // any at all?
|
|
|
|
do {
|
|
|
|
// handle call-by-reference character ('~')
|
|
|
|
if (GotByte != REFERENCE_CHAR) {
|
2020-05-20 16:39:19 +00:00
|
|
|
DynaBuf_append(internal_name, ARGTYPE_VALUE);
|
2012-02-27 21:14:46 +00:00
|
|
|
} else {
|
2020-05-20 16:39:19 +00:00
|
|
|
DynaBuf_append(internal_name, ARGTYPE_REF);
|
2012-02-27 21:14:46 +00:00
|
|
|
DynaBuf_append(GlobalDynaBuf, REFERENCE_CHAR);
|
|
|
|
GetByte();
|
|
|
|
}
|
2017-10-29 23:29:07 +00:00
|
|
|
// handle prefix for (cheap) local symbols ('.'/'@')
|
|
|
|
if ((GotByte == LOCAL_PREFIX)
|
|
|
|
|| (GotByte == CHEAP_PREFIX)) {
|
|
|
|
DynaBuf_append(GlobalDynaBuf, GotByte);
|
2012-02-27 21:14:46 +00:00
|
|
|
GetByte();
|
|
|
|
}
|
2014-06-07 00:12:10 +00:00
|
|
|
// handle symbol name
|
2012-02-27 21:14:46 +00:00
|
|
|
Input_append_keyword_to_global_dynabuf();
|
|
|
|
} while (pipe_comma());
|
|
|
|
// ensure CHAR_SOB ('{')
|
|
|
|
if (GotByte != CHAR_SOB)
|
|
|
|
Throw_serious_error(exception_no_left_brace);
|
|
|
|
}
|
|
|
|
DynaBuf_append(GlobalDynaBuf, CHAR_EOS); // terminate param list
|
|
|
|
// now GlobalDynaBuf = comma-separated parameter list without spaces,
|
|
|
|
// but terminated with CHAR_EOS.
|
|
|
|
formal_parameters = DynaBuf_get_copy(GlobalDynaBuf);
|
|
|
|
// now GlobalDynaBuf = unused
|
|
|
|
// Reading the macro body would change the line number. To have correct
|
|
|
|
// error messages, we're checking for "macro twice" *now*.
|
|
|
|
// Search for macro. Create if not found.
|
|
|
|
// But if found, complain (macro twice).
|
2016-08-05 09:59:07 +00:00
|
|
|
if (search_for_macro(¯o_node, macro_scope, TRUE) == FALSE)
|
2012-02-27 21:14:46 +00:00
|
|
|
report_redefinition(macro_node); // quits with serious error
|
|
|
|
// Create new macro struct and set it up. Finally we'll read the body.
|
|
|
|
new_macro = safe_malloc(sizeof(*new_macro));
|
|
|
|
new_macro->def_line_number = Input_now->line_number;
|
|
|
|
new_macro->def_filename = get_string_copy(Input_now->original_filename);
|
|
|
|
new_macro->original_name = get_string_copy(user_macro_name->buffer);
|
|
|
|
new_macro->parameter_list = formal_parameters;
|
|
|
|
new_macro->body = Input_skip_or_store_block(TRUE); // changes LineNumber
|
|
|
|
macro_node->body = new_macro; // link macro struct to tree node
|
|
|
|
// and that about sums it up
|
|
|
|
}
|
|
|
|
|
|
|
|
// Parse macro call ("+MACROTITLE"). Has to be re-entrant.
|
|
|
|
void Macro_parse_call(void) // Now GotByte = dot or first char of macro name
|
|
|
|
{
|
2014-11-24 14:52:05 +00:00
|
|
|
char local_gotbyte;
|
|
|
|
struct symbol *symbol;
|
|
|
|
struct section new_section,
|
|
|
|
*outer_section;
|
|
|
|
struct input new_input,
|
|
|
|
*outer_input;
|
|
|
|
struct macro *actual_macro;
|
|
|
|
struct rwnode *macro_node,
|
|
|
|
*symbol_node;
|
2016-08-05 09:59:07 +00:00
|
|
|
scope_t macro_scope,
|
|
|
|
symbol_scope;
|
2012-02-27 21:14:46 +00:00
|
|
|
int arg_count = 0;
|
2016-10-08 12:19:12 +00:00
|
|
|
int outer_err_count;
|
2012-02-27 21:14:46 +00:00
|
|
|
|
|
|
|
// Enter deeper nesting level
|
|
|
|
// Quit program if recursion too deep.
|
|
|
|
if (--macro_recursions_left < 0)
|
|
|
|
Throw_serious_error("Too deeply nested. Recursive macro calls?");
|
2016-08-05 09:59:07 +00:00
|
|
|
macro_scope = get_scope_and_title();
|
2012-02-27 21:14:46 +00:00
|
|
|
// now GotByte = first non-space after title
|
|
|
|
// internal_name = MacroTitle ARG_SEPARATOR (grows to signature)
|
|
|
|
// Accept n>=0 comma-separated arguments before CHAR_EOS.
|
|
|
|
// Valid argument formats are:
|
|
|
|
// EXPRESSION (everything that does NOT start with '~'
|
2020-05-20 16:39:19 +00:00
|
|
|
// ~SYMBOL
|
2012-02-27 21:14:46 +00:00
|
|
|
// now GotByte = non-space
|
|
|
|
if (GotByte != CHAR_EOS) { // any at all?
|
|
|
|
do {
|
|
|
|
// if arg table cannot take another element, enlarge
|
|
|
|
if (argtable_size <= arg_count)
|
|
|
|
enlarge_arg_table();
|
|
|
|
// Decide whether call-by-reference or call-by-value
|
|
|
|
// In both cases, GlobalDynaBuf may be used.
|
|
|
|
if (GotByte == REFERENCE_CHAR) {
|
|
|
|
// read call-by-reference arg
|
2020-05-20 16:39:19 +00:00
|
|
|
DynaBuf_append(internal_name, ARGTYPE_REF);
|
2012-02-27 21:14:46 +00:00
|
|
|
GetByte(); // skip '~' character
|
2016-08-05 09:59:07 +00:00
|
|
|
Input_read_scope_and_keyword(&symbol_scope);
|
2012-02-27 21:14:46 +00:00
|
|
|
// GotByte = illegal char
|
2020-06-04 14:31:15 +00:00
|
|
|
arg_table[arg_count].symbol = symbol_find(symbol_scope, 0); // FIXME - do not default to undefined int!
|
2012-02-27 21:14:46 +00:00
|
|
|
} else {
|
|
|
|
// read call-by-value arg
|
2020-05-20 16:39:19 +00:00
|
|
|
DynaBuf_append(internal_name, ARGTYPE_VALUE);
|
2012-02-27 21:14:46 +00:00
|
|
|
ALU_any_result(&(arg_table[arg_count].result));
|
|
|
|
}
|
2014-11-30 17:00:13 +00:00
|
|
|
++arg_count;
|
2012-02-27 21:14:46 +00:00
|
|
|
} while (Input_accept_comma());
|
|
|
|
}
|
|
|
|
// now arg_table contains the arguments
|
|
|
|
// now GlobalDynaBuf = unused
|
|
|
|
// check for "unknown macro"
|
|
|
|
// Search for macro. Do not create if not found.
|
2016-08-05 09:59:07 +00:00
|
|
|
search_for_macro(¯o_node, macro_scope, FALSE);
|
2012-02-27 21:14:46 +00:00
|
|
|
if (macro_node == NULL) {
|
|
|
|
Throw_error("Macro not defined (or wrong signature).");
|
|
|
|
Input_skip_remainder();
|
|
|
|
} else {
|
|
|
|
// make macro_node point to the macro struct
|
|
|
|
actual_macro = macro_node->body;
|
|
|
|
local_gotbyte = GotByte; // CAUTION - ugly kluge
|
2016-10-08 12:19:12 +00:00
|
|
|
|
2012-02-27 21:14:46 +00:00
|
|
|
// set up new input
|
|
|
|
new_input.original_filename = actual_macro->def_filename;
|
|
|
|
new_input.line_number = actual_macro->def_line_number;
|
2020-05-18 22:10:01 +00:00
|
|
|
new_input.source = INPUTSRC_RAM;
|
2012-02-27 21:14:46 +00:00
|
|
|
new_input.state = INPUTSTATE_NORMAL; // FIXME - fix others!
|
|
|
|
new_input.src.ram_ptr = actual_macro->parameter_list;
|
|
|
|
// remember old input
|
|
|
|
outer_input = Input_now;
|
|
|
|
// activate new input
|
|
|
|
Input_now = &new_input;
|
2016-10-08 12:19:12 +00:00
|
|
|
|
|
|
|
outer_err_count = Throw_get_counter(); // remember error count (for call stack decision)
|
|
|
|
|
2012-02-27 21:14:46 +00:00
|
|
|
// remember old section
|
2016-08-05 09:59:07 +00:00
|
|
|
outer_section = section_now;
|
|
|
|
// start new section (with new scope)
|
2012-02-27 21:14:46 +00:00
|
|
|
// FALSE = title mustn't be freed
|
2016-08-05 09:59:07 +00:00
|
|
|
section_new(&new_section, "Macro", actual_macro->original_name, FALSE);
|
2017-10-29 23:29:07 +00:00
|
|
|
section_new_cheap_scope(&new_section);
|
2012-02-27 21:14:46 +00:00
|
|
|
GetByte(); // fetch first byte of parameter list
|
|
|
|
// assign arguments
|
|
|
|
if (GotByte != CHAR_EOS) { // any at all?
|
|
|
|
arg_count = 0;
|
|
|
|
do {
|
|
|
|
// Decide whether call-by-reference
|
|
|
|
// or call-by-value
|
|
|
|
// In both cases, GlobalDynaBuf may be used.
|
|
|
|
if (GotByte == REFERENCE_CHAR) {
|
|
|
|
// assign call-by-reference arg
|
|
|
|
GetByte(); // skip '~' character
|
2016-08-05 09:59:07 +00:00
|
|
|
Input_read_scope_and_keyword(&symbol_scope);
|
2020-06-04 14:31:15 +00:00
|
|
|
// create new tree node and link existing symbol struct from arg list to it
|
2016-08-05 09:59:07 +00:00
|
|
|
if ((Tree_hard_scan(&symbol_node, symbols_forest, symbol_scope, TRUE) == FALSE)
|
2020-05-02 10:40:10 +00:00
|
|
|
&& (FIRST_PASS))
|
2012-02-27 21:14:46 +00:00
|
|
|
Throw_error("Macro parameter twice.");
|
2014-06-07 00:12:10 +00:00
|
|
|
symbol_node->body = arg_table[arg_count].symbol;
|
2012-02-27 21:14:46 +00:00
|
|
|
} else {
|
|
|
|
// assign call-by-value arg
|
2016-08-05 09:59:07 +00:00
|
|
|
Input_read_scope_and_keyword(&symbol_scope);
|
2020-06-04 14:31:15 +00:00
|
|
|
symbol = symbol_find(symbol_scope, 0); // FIXME - split into "find", "ensure freshly created"
|
2014-06-07 00:12:10 +00:00
|
|
|
// FIXME - add a possibility to symbol_find to make it possible to find out
|
|
|
|
// whether symbol was just created. Then check for the same error message here
|
2012-02-27 21:14:46 +00:00
|
|
|
// as above ("Macro parameter twice.").
|
2020-06-04 14:31:15 +00:00
|
|
|
// TODO - on the other hand, this would rule out globals as args (stupid anyway, but not illegal yet!)
|
|
|
|
symbol->object = arg_table[arg_count].result; // FIXME - this assignment redefines globals without throwing errors!
|
2012-02-27 21:14:46 +00:00
|
|
|
}
|
2014-11-30 17:00:13 +00:00
|
|
|
++arg_count;
|
2012-02-27 21:14:46 +00:00
|
|
|
} while (Input_accept_comma());
|
|
|
|
}
|
|
|
|
// and now, finally, parse the actual macro body
|
|
|
|
Input_now->state = INPUTSTATE_NORMAL; // FIXME - fix others!
|
|
|
|
// maybe call parse_ram_block(actual_macro->def_line_number, actual_macro->body)
|
|
|
|
Input_now->src.ram_ptr = actual_macro->body;
|
|
|
|
Parse_until_eob_or_eof();
|
|
|
|
if (GotByte != CHAR_EOB)
|
|
|
|
Bug_found("IllegalBlockTerminator", GotByte);
|
|
|
|
// end section (free title memory, if needed)
|
2016-08-05 09:59:07 +00:00
|
|
|
section_finalize(&new_section);
|
2012-02-27 21:14:46 +00:00
|
|
|
// restore previous section
|
2016-08-05 09:59:07 +00:00
|
|
|
section_now = outer_section;
|
2012-02-27 21:14:46 +00:00
|
|
|
// restore previous input:
|
|
|
|
Input_now = outer_input;
|
|
|
|
// restore old Gotbyte context
|
|
|
|
GotByte = local_gotbyte; // CAUTION - ugly kluge
|
2016-10-08 12:19:12 +00:00
|
|
|
|
|
|
|
// if needed, output call stack
|
|
|
|
if (Throw_get_counter() != outer_err_count)
|
|
|
|
Throw_warning("...called from here.");
|
|
|
|
|
2012-02-27 21:14:46 +00:00
|
|
|
Input_ensure_EOS();
|
|
|
|
}
|
2014-11-30 17:00:13 +00:00
|
|
|
++macro_recursions_left; // leave this nesting level
|
2012-02-27 21:14:46 +00:00
|
|
|
}
|