}
+
+/* Fetch string from the input stream,
+ rules:
+ 'Bxyx<whitespace> -> return 'Bxyza
+ %<char> -> return string of decimal value of x
+ "<string>" -> return string
+ xyx<whitespace> -> return xyz
+*/
int
-get_any_string (idx, in, out, expand)
+get_any_string (idx, in, out, expand, pretend_quoted)
int idx;
sb *in;
sb *out;
int expand;
+ int pretend_quoted;
{
sb_reset (out);
idx = sb_skip_white (idx, in);
|| in->ptr[idx] == '<'
|| (alternate && in->ptr[idx] == '\''))
{
- if (alternate && !expand)
+ if (alternate && expand)
{
/* Keep the quotes */
- /* sb_add_char (out, '\"');*/
+ sb_add_char (out, '\"');
+
idx = getstring (idx, in, out);
- /* sb_add_char (out, '\"');*/
+ sb_add_char (out, '\"');
}
else {
while (idx < in->len
&& (in->ptr[idx] == '"'
|| in->ptr[idx] == '\''
+ || pretend_quoted
|| !ISSEP (in->ptr[idx])))
{
if (in->ptr[idx] == '"'
{
sb t;
sb_new (&t);
- idx = get_any_string (idx, in, &t, 1);
+ idx = get_any_string (idx, in, &t, 1, 0);
process_assigns (0, &t, out);
sb_kill (&t);
return idx;
if (idx < in->len && in->ptr[idx] == '=')
{
/* Got a default */
- idx = get_any_string (idx + 1, in, &formal->def, 1);
+ idx = get_any_string (idx + 1, in, &formal->def, 1, 0);
}
}
{
/* Insert this value into the right place */
sb_reset (&ptr->value.f->actual);
- idx = get_any_string (idx + 1, in, &ptr->value.f->actual, 0);
+ idx = get_any_string (idx + 1, in, &ptr->value.f->actual, 0, 0);
}
}
else
}
sb_reset (&f->actual);
- idx = get_any_string (idx, in, &f->actual, 1);
+ idx = get_any_string (idx, in, &f->actual, 1, 0);
f = f->next;
}
idx = sb_skip_comma (idx, in);
idx = sb_skip_white (idx, in);
while (!eol (idx, in))
{
- pidx = idx = get_any_string (idx, in, &acc, 1);
+ pidx = idx = get_any_string (idx, in, &acc, 0, 1);
if (type == 'c')
{
if (acc.len > 255)
switch (ptr->value.i)
{
case K_AIF:
- do_aif ();
+ do_aif (idx, line);
break;
case K_AELSE:
do_aelse ();