#ifndef __SCC_POS_H__ #define __SCC_POS_H__ #include #include typedef struct scc_pos { const char *name; usize line; usize col; usize offset; } scc_pos_t; static inline scc_pos_t scc_pos_create() { return (scc_pos_t){0, 1, 1, 0}; } static inline void scc_pos_next(scc_pos_t *pos) { pos->offset++; pos->col++; } static inline void scc_pos_next_offset(scc_pos_t *pos, int offset) { pos->offset += offset; pos->offset += offset; } static inline void scc_pos_next_line(scc_pos_t *pos) { pos->offset++; pos->line++; pos->col = 1; } #endif /* __SCC_POS_H__ */