Skip to content

Commit e9c9c3c

Browse files
committed
jimp: path -> file_path
1 parent 531125c commit e9c9c3c

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

jimp.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,16 +68,16 @@ typedef struct {
6868

6969
int main()
7070
{
71-
const char *path = "profile.json";
71+
const char *file_path = "profile.json";
7272
// const char *path = "numbers.json";
7373
// const char *path = "profiles.json";
7474
// const char *path = "empty.json";
7575
// const char *path = "one.json";
7676
// const char *path = "database.json";
7777
String_Builder sb = {0};
78-
if (!read_entire_file(path, &sb)) return 1;
78+
if (!read_entire_file(file_path, &sb)) return 1;
7979
Jimp jimp = {
80-
.path = path,
80+
.file_path = file_path,
8181
};
8282
static char string_store[1024];
8383
stb_c_lexer_init(&jimp.l, sb.items, sb.items + sb.count, string_store, sizeof(string_store));

jimp.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
typedef struct {
77
stb_lexer l;
8-
const char *path;
8+
const char *file_path;
99
const char *member;
1010
} Jimp;
1111

@@ -97,7 +97,7 @@ void jimp_unknown_member(Jimp *jimp)
9797
{
9898
stb_lex_location loc = {0};
9999
stb_c_lexer_get_location(&jimp->l, jimp->l.where_firstchar, &loc);
100-
fprintf(stderr, "%s:%d:%d: ERROR: Unexpected member `%s`\n", jimp->path, loc.line_number, loc.line_offset + 1, jimp->member);
100+
fprintf(stderr, "%s:%d:%d: ERROR: Unexpected member `%s`\n", jimp->file_path, loc.line_number, loc.line_offset + 1, jimp->member);
101101
}
102102

103103
bool jimp_object_begin(Jimp *jimp)
@@ -147,7 +147,7 @@ bool jimp_bool(Jimp *jimp, bool *boolean)
147147
} else {
148148
stb_lex_location loc = {0};
149149
stb_c_lexer_get_location(&jimp->l, jimp->l.where_firstchar, &loc);
150-
fprintf(stderr, "%s:%d:%d: ERROR: Expected boolean but got `%s`\n", jimp->path, loc.line_number, loc.line_offset + 1, jimp_token_kind(jimp->l.token));
150+
fprintf(stderr, "%s:%d:%d: ERROR: Expected boolean but got `%s`\n", jimp->file_path, loc.line_number, loc.line_offset + 1, jimp_token_kind(jimp->l.token));
151151
return false;
152152
}
153153
return true;
@@ -172,7 +172,7 @@ bool jimp_expect_token(Jimp *jimp, long token)
172172
if (jimp->l.token != token) {
173173
stb_lex_location loc = {0};
174174
stb_c_lexer_get_location(&jimp->l, jimp->l.where_firstchar, &loc);
175-
fprintf(stderr, "%s:%d:%d: ERROR: expected %s, but got %s\n", jimp->path, loc.line_number, loc.line_offset + 1, jimp_token_kind(token), jimp_token_kind(jimp->l.token));
175+
fprintf(stderr, "%s:%d:%d: ERROR: expected %s, but got %s\n", jimp->file_path, loc.line_number, loc.line_offset + 1, jimp_token_kind(token), jimp_token_kind(jimp->l.token));
176176
return false;
177177
}
178178
return true;

0 commit comments

Comments
 (0)