hammer/src/desugar.c

12 lines
335 B
C
Raw Normal View History

2013-03-17 13:25:02 -07:00
#include "hammer.h"
#include "internal.h"
2013-03-17 13:25:02 -07:00
HCFChoice *h_desugar(HAllocator *mm__, const HParser *parser) {
if(parser->desugared == NULL) {
// we're going to do something naughty and cast away the const to memoize
((HParser *)parser)->desugared = parser->vtable->desugar(mm__, parser->env);
}
return parser->desugared;
}