revised p6/src/generate.c