added type grammar to readme, add example, del spho loc

This commit is contained in:
Ellen Arvidsson 2025-05-05 13:05:03 +02:00
parent a22c9726cd
commit 7e3c7c88ea
3 changed files with 47 additions and 35 deletions

View file

@ -1,34 +0,0 @@
#ifndef _SPHO_LOC_H
#define _SPHO_LOC_H
#define SPHO_LOCTYPE_LINE 1
#define SPHO_LOCTYPE_LINE_COL 2
struct spho_loc_line {
char *fpath;
unsigned int lineno;
};
struct spho_loc_line {
char *fpath;
unsigned int lineno;
unsigned int colno;
};
union spho_loc_info {
struct spho_loc_line line;
};
struct spho_loc {
struct spho_ctx *ctx;
int loctype;
union spho_loc_info locinfo;
};
char *spho_loc_str(struct spho_loc *);
struct spho_loc *spho_loc_create_line(struct spho_ctx *, char *, int);
struct spho_loc *spho_loc_create_linecol(struct spho_ctx *, char *, int, int);
void spho_loc_destroy(struct spho_loc *);
#endif