expand h_make family to include seq, bytes, sint, and uint tokens

This commit is contained in:
Sven M. Hallberg 2013-01-23 19:29:29 +01:00
parent 54046e25da
commit 71cdd46ceb
2 changed files with 37 additions and 5 deletions

View file

@ -51,9 +51,16 @@ const HParsedToken *h_act_flatten(const HParseResult *p);
HParsedToken *h_make(HArena *arena, HTokenType type, void *value);
HParsedToken *h_make_seq(HArena *arena); // Makes empty sequence.
HParsedToken *h_make_bytes(HArena *arena, size_t len);
HParsedToken *h_make_sint(HArena *arena, int64_t val);
HParsedToken *h_make_uint(HArena *arena, uint64_t val);
// Standard short-hand to make a user-type token.
#define H_MAKE(TYP, VAL) h_make(p->arena, TT_ ## TYP, VAL)
// Standard short-hands to make tokens in an action.
#define H_MAKE(TYP, VAL) h_make(p->arena, TT_ ## TYP, VAL)
#define H_MAKE_SEQ() h_make_seq(p->arena)
#define H_MAKE_BYTES(LEN) h_make_bytes(p->arena, LEN)
#define H_MAKE_SINT(VAL) h_make_sint(p->arena, VAL)
#define H_MAKE_UINT(VAL) h_make_uint(p->arena, VAL)
// Sequence access...