X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-psi;a=blobdiff_plain;f=src%2Ftoken.h;h=e87a16df2b872aaed257d3f2c28fa18c76355850;hp=5f6c7c71820bce2ee4a9dbbc95d3aa1d3fb26d00;hb=69da9075d8a72c094e0bb977226d975365431f55;hpb=c9384515a81cb64d345b299908b2852f51bb8e6e diff --git a/src/token.h b/src/token.h index 5f6c7c7..e87a16d 100644 --- a/src/token.h +++ b/src/token.h @@ -174,26 +174,28 @@ static inline const char *psi_t_indirection(unsigned pointer_level) { return &indir[32 - MIN(32, pointer_level)]; } +struct psi_dump; + struct psi_token { token_t type; - unsigned size, line, col, flags; - char *text, *file; - char buf[1]; + unsigned line; + unsigned col; + unsigned flags; + zend_string *file; + zend_string *text; }; struct psi_parser; struct psi_token *psi_token_init(token_t token_typ, const char *token_txt, - size_t token_len, unsigned col, unsigned line, const char *file); -size_t psi_token_alloc_size(size_t token_len, size_t fname_len); + size_t token_len, unsigned col, unsigned line, zend_string *file); struct psi_token *psi_token_copy(struct psi_token *src); void psi_token_copy_ctor(struct psi_token **src); struct psi_token *psi_token_cat(const char *sep, unsigned argc, ...); -struct psi_token *psi_token_prepend(const char *sep, struct psi_token *T, unsigned argc, ...); struct psi_token *psi_token_append(const char *sep, struct psi_token *T, unsigned argc, ...); struct psi_token *psi_token_translit(struct psi_token *T, char *from, char *to); uint64_t psi_token_hash(struct psi_token *t, char *digest_buf); -void psi_token_dump(int fd, struct psi_token *t); +void psi_token_dump(struct psi_dump *dump, struct psi_token *t); void psi_token_free(struct psi_token **token); #endif