diff options
author | pommicket <pommicket@gmail.com> | 2023-08-05 13:55:53 -0400 |
---|---|---|
committer | pommicket <pommicket@gmail.com> | 2023-08-05 13:55:53 -0400 |
commit | 4ab3631aadcd27df708a16f6bf22953e0ff9b1cf (patch) | |
tree | 4fca0b612ae40cf8723c4c57fd0243631f7e51e7 /build.c | |
parent | 601c081d62e0cd9c0e6750b424ecc5baa9a45b5f (diff) |
internalize Line structure
Diffstat (limited to 'build.c')
-rw-r--r-- | build.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -204,8 +204,8 @@ void build_check_for_errors(Ted *ted) { TextBuffer *buffer = &ted->build_buffer; arr_clear(ted->build_errors); for (u32 line_idx = 0; line_idx < buffer->nlines; ++line_idx) { - Line *line = &buffer->lines[line_idx]; - if (line->len < 3) { + String32 line = buffer_get_line(buffer, line_idx); + if (line.len < 3) { continue; } bool is_error = true; @@ -218,7 +218,7 @@ void build_check_for_errors(Ted *ted) { // all this is to say that columns_per_tab is currently always 1, // but might be useful at some point. u8 columns_per_tab = 1; - char32_t *p = line->str, *end = p + line->len; + char32_t *p = line.str, *end = p + line.len; { // rust errors look like: @@ -242,7 +242,7 @@ void build_check_for_errors(Ted *ted) { char32_t *filename_start = p; while (p != end) { if ((*p == ':' || *p == '(') - && p != line->str + 1) // don't catch "C:\thing\whatever.c" as "filename: C, line number: \thing\whatever.c" + && p != line.str + 1) // don't catch "C:\thing\whatever.c" as "filename: C, line number: \thing\whatever.c" break; if (!is_source_path(*p)) { is_error = false; |