desugaring done for many and attr_bool

This commit is contained in:
Meredith L. Patterson 2013-02-20 20:43:16 -05:00
parent 101e90ad9b
commit ab89b0fd4d
6 changed files with 70 additions and 15 deletions

View file

@ -26,4 +26,17 @@ static inline size_t token_length(HParseResult *pr) {
static inline bool h_true(void *env) { return true; }
static inline bool h_false(void *env) { return false; }
/* Epsilon rules happen during desugaring. This handles them. */
static inline HCFChoice* desugar_epsilon(HAllocator *mm__, void *env) {
static HCFChoice *res_seq_l[] = {NULL};
static HCFSequence res_seq = {res_seq_l};
static HCFSequence *res_ch_l[] = {&res_seq, NULL};
static HCFChoice res_ch = {
.type = HCF_CHOICE,
.seq = res_ch_l,
.action = NULL
};
return &res_ch;
}
#endif // HAMMER_PARSE_INTERNAL__H