static Renode *parsecat(struct cstate *g)
{
	Renode *cat, *head, **tail;
	if (g->lookahead && g->lookahead != '|' && g->lookahead != ')') {
		/* Build a right-leaning tree by splicing in new 'cat' at the tail. */
		head = parserep(g);
		tail = &head;
		while (g->lookahead && g->lookahead != '|' && g->lookahead != ')') {
			cat = newnode(g, P_CAT);
			cat->x = *tail;
			cat->y = parserep(g);
			*tail = cat;
			tail = &cat->y;
		}
		return head;
	}
	return NULL;
}
static Renode *parsecat(struct cstate *g)
{
	Renode *cat, *head, **tail;
	if (g->lookahead && g->lookahead != '|' && g->lookahead != ')') {
		 
		head = parserep(g);
		tail = &head;
		while (g->lookahead && g->lookahead != '|' && g->lookahead != ')') {
			cat = newnode(g, P_CAT);
			cat->x = *tail;
			cat->y = parserep(g);
			*tail = cat;
			tail = &cat->y;
		}
		return head;
	}
	return NULL;
}