#define ISSEP(x) \
((x) == ' ' || (x) == '\t' || (x) == ',' || (x) == '"' || (x) == ';' \
|| (x) == ')' || (x) == '(' \
- || ((macro_alternate || flag_mri) && ((x) == '<' || (x) == '>')))
+ || ((flag_macro_alternate || flag_mri) && ((x) == '<' || (x) == '>')))
#define ISBASE(x) \
((x) == 'b' || (x) == 'B' \
int macro_defined;
-/* Whether we are in alternate syntax mode. */
-
-static int macro_alternate;
-
/* Whether we should strip '@' characters. */
#define macro_strip_at false
/* Initialize macro processing. */
void
-macro_init (int alternate)
+macro_init (void)
{
macro_hash = htab_create_alloc (16, hash_string_tuple, eq_string_tuple,
macro_del_f, notes_calloc, NULL);
macro_defined = 0;
- macro_alternate = alternate;
}
void
htab_delete (macro_hash);
}
-/* Switch in and out of alternate mode on the fly. */
-
-void
-macro_set_alternate (int alternate)
-{
- macro_alternate = alternate;
-}
-
/* Read input lines till we get to a TO string.
Increase nesting depth if we get a FROM string.
Put the results into sb at PTR.
}
}
/* Ignore trailing &. */
- if (macro_alternate && idx < in->len && in->ptr[idx] == '&')
+ if (flag_macro_alternate && idx < in->len && in->ptr[idx] == '&')
idx++;
return idx;
}
{
while (idx < in->len
&& (in->ptr[idx] == '"'
- || (in->ptr[idx] == '<' && (macro_alternate || flag_mri))
- || (in->ptr[idx] == '\'' && macro_alternate)))
+ || (in->ptr[idx] == '<' && (flag_macro_alternate || flag_mri))
+ || (in->ptr[idx] == '\'' && flag_macro_alternate)))
{
if (in->ptr[idx] == '<')
{
else
escaped = 0;
- if (macro_alternate && in->ptr[idx] == '!')
+ if (flag_macro_alternate && in->ptr[idx] == '!')
{
idx ++;
while (idx < in->len && !ISSEP (in->ptr[idx]))
sb_add_char (out, in->ptr[idx++]);
}
- else if (in->ptr[idx] == '%' && macro_alternate)
+ else if (in->ptr[idx] == '%' && flag_macro_alternate)
{
/* Turn the following expression into a string. */
expressionS ex;
sb_add_string (out, buf);
}
else if (in->ptr[idx] == '"'
- || (in->ptr[idx] == '<' && (macro_alternate || flag_mri))
- || (macro_alternate && in->ptr[idx] == '\''))
+ || (in->ptr[idx] == '<' && (flag_macro_alternate || flag_mri))
+ || (flag_macro_alternate && in->ptr[idx] == '\''))
{
- if (macro_alternate && ! macro_strip_at && in->ptr[idx] != '<')
+ if (flag_macro_alternate && ! macro_strip_at && in->ptr[idx] != '<')
{
/* Keep the quotes. */
sb_add_char (out, '"');
&& in->ptr[idx] != '\t'))
&& in->ptr[idx] != ','
&& (in->ptr[idx] != '<'
- || (! macro_alternate && ! flag_mri)))
+ || (! flag_macro_alternate && ! flag_mri)))
{
char tchar = in->ptr[idx];
src = sub_actual (src, in, &t, formal_hash, '\'', out, 0);
}
}
- else if ((macro_alternate || flag_mri)
+ else if ((flag_macro_alternate || flag_mri)
&& is_name_beginner (in->ptr[src])
&& (! inquote
|| ! macro_strip_at
while (scan < in->len
&& !ISSEP (in->ptr[scan])
&& !(flag_mri && in->ptr[scan] == '\'')
- && (!macro_alternate && in->ptr[scan] != '='))
+ && (!flag_macro_alternate && in->ptr[scan] != '='))
scan++;
- if (scan < in->len && !macro_alternate && in->ptr[scan] == '=')
+ if (scan < in->len && !flag_macro_alternate && in->ptr[scan] == '=')
{
is_keyword = 1;