summaryrefslogtreecommitdiff
path: root/build.c
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2023-08-05 13:55:53 -0400
committerpommicket <pommicket@gmail.com>2023-08-05 13:55:53 -0400
commit4ab3631aadcd27df708a16f6bf22953e0ff9b1cf (patch)
tree4fca0b612ae40cf8723c4c57fd0243631f7e51e7 /build.c
parent601c081d62e0cd9c0e6750b424ecc5baa9a45b5f (diff)
internalize Line structure
Diffstat (limited to 'build.c')
-rw-r--r--build.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/build.c b/build.c
index d4804b2..5e95b32 100644
--- a/build.c
+++ b/build.c
@@ -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;