// IO.trace("curr: "+curr);
Term n = next();
Term t = null;
if (n instanceof RbraToken)
{
t = new Cons(curr, Const.NIL);
}
else if (n instanceof BarToken)
{
t = new Cons(curr, getTerm());
n = next();
if (!(n instanceof RbraToken))
{
throw new ParserException("']'", "bad list end after '|'", n);
}
}
else if (n instanceof CommaToken)
{
Term other = getTerm();
t = new Cons(curr, getListCont(other));
}
if (t == null)
{
throw new ParserException("| or ]", "bad list continuation", n);
}