while (*in_pos >= 'A' && *in_pos <= 'Z' ||
*in_pos >= 'a' && *in_pos <= 'z' ||
*in_pos >= '0' && *in_pos <= '9' ||
- *in_pos == '_')
+ *in_pos == '_' ||
+ *in_pos == '-')
token += *in_pos++;
return TOK_IDENT;
}
t = next_token();
if (t != TOK_IDENT)
- parse_error("Parameter %s must have a unit", adef->name);
+ {
+ if (is_zero(tmp))
+ {
+ return_token();
+ return 0;
+ }
+ parse_error("Parameter %s must have a unit", adef->name);
+ }
for (uint i=0; units[i].name; i++)
if (token == units[i].name)
return tmp * units[i].multiplier;
{
for (auto c: cmds)
{
- c->exec = c->def->constructor(c);
+ try
+ {
+ c->exec = c->def->constructor(c);
+ }
+ catch (exception &e)
+ {
+ die("Error in %s: %s", c->def->name, e.what());
+ }
if (c->pipe)
{
for (auto pb: c->pipe->branches)