{
token_type t = next_token();
if (t != TOK_NUMBER)
- parse_error("Parameter %s must be a dimension", adef->name);
+ parse_error("Argument %s must be a dimension", adef->name);
double tmp = token_num;
t = next_token();
return_token();
return 0;
}
- parse_error("Parameter %s must have a unit", adef->name);
+ parse_error("Argument %s must have a unit", adef->name);
}
for (uint i=0; units[i].name; i++)
if (token == units[i].name)
while (adefs[argi].name && token != adefs[argi].name)
argi++;
if (!adefs[argi].name)
- parse_error("Command %s has no parameter %s", cdef->name, token.c_str());
+ parse_error("Command %s has no argument %s", cdef->name, token.c_str());
if (c->args.count(token))
- parse_error("Parameter %s given multiple times", token.c_str());
+ parse_error("Argument %s given multiple times", token.c_str());
t = next_token();
if (t == TOK_EQUAL)
has_value = true;
saw_named = true;
}
else if (saw_named)
- parse_error("Positional parameters must precede named ones");
+ parse_error("Positional arguments must precede named ones");
else
{
return_token();
case AT_STRING:
t = next_token();
if (t != TOK_STRING)
- parse_error("Parameter %s must be a string", adef->name);
+ parse_error("Argument %s must be a string", adef->name);
val = new arg_string(token);
break;
case AT_INT:
t = next_token();
if (t != TOK_NUMBER || !token_is_int())
- parse_error("Parameter %s must be an integer", adef->name);
+ parse_error("Argument %s must be an integer", adef->name);
val = new arg_int((int) token_num);
break;
case AT_DOUBLE:
t = next_token();
if (t != TOK_NUMBER)
- parse_error("Parameter %s must be a number", adef->name);
+ parse_error("Argument %s must be a number", adef->name);
val = new arg_double(token_num);
break;
case AT_DIMEN:
case AT_SWITCH:
t = next_token();
if (t != TOK_NUMBER || !token_is_int() || ((int) token_num != 0 && (int) token_num != 1))
- parse_error("Parameter %s must be a switch", adef->name);
+ parse_error("Argument %s must be a switch", adef->name);
val = new arg_int((int) token_num);
break;
default:
if (type == AT_SWITCH)
val = new arg_int(1);
else
- parse_error("Parameter %s must have a value", adef->name);
+ parse_error("Argument %s must have a value", adef->name);
}
c->args[adef->name] = val;
if (t == TOK_CLOSE_PAREN)
break;
if (t != TOK_COMMA)
- parse_error("Comma expected after parameter %s", adef->name);
+ parse_error("Comma expected after argument %s", adef->name);
}
for (uint i=0; i<num_args; i++)
if ((adefs[i].type & AT_MANDATORY) && !c->args.count(adefs[i].name))
- parse_error("Command %s is missing a parameter %s", cdef->name, adefs[i].name);
+ parse_error("Command %s is missing an argument %s", cdef->name, adefs[i].name);
}
static void debug_cmd(cmd *c, uint indent=0)