simplified switch in parser.c