Update all position tracking calls in lex_parser.c to use the scc_pos_* function family (scc_pos_next, scc_pos_next_line) instead of the deprecated core_pos_* variants. This ensures consistency with the scc naming convention and prepares for future removal of the old core functions.
29 lines
540 B
C
29 lines
540 B
C
#ifndef __SCC_CORE_POS_H__
|
|
#define __SCC_CORE_POS_H__
|
|
|
|
#include "core_str.h"
|
|
#include "core_type.h"
|
|
typedef struct scc_pos {
|
|
scc_cstring_t name;
|
|
usize line;
|
|
usize col;
|
|
usize offset;
|
|
} scc_pos_t;
|
|
|
|
static inline scc_pos_t scc_pos_init() {
|
|
return (scc_pos_t){scc_cstring_new(), 1, 1, 0};
|
|
}
|
|
|
|
static inline void scc_pos_next(scc_pos_t *pos) {
|
|
pos->offset++;
|
|
pos->col++;
|
|
}
|
|
|
|
static inline void scc_pos_next_line(scc_pos_t *pos) {
|
|
pos->offset++;
|
|
pos->line++;
|
|
pos->col = 1;
|
|
}
|
|
|
|
#endif /* __SCC_CORE_POS_H__ */
|