diff options
| author | Anhgelus Morhtuuzh <william@herges.fr> | 2026-05-04 16:40:38 +0200 |
|---|---|---|
| committer | Anhgelus Morhtuuzh <william@herges.fr> | 2026-05-04 16:40:38 +0200 |
| commit | 8dc9a978fc2b0d01c20270b1b690e815e74fdcc7 (patch) | |
| tree | 477ac32bb4e2bf8bb7f0905333411ac96eb6077c /src/root.zig | |
| parent | 308c8893d9706318e8e756069f40c1435a70df91 (diff) | |
feat(lexer): error contains line
Diffstat (limited to 'src/root.zig')
| -rw-r--r-- | src/root.zig | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/root.zig b/src/root.zig index 30386e9..cef8519 100644 --- a/src/root.zig +++ b/src/root.zig @@ -53,7 +53,7 @@ const typdown_Document = extern struct { const typdown_Error = extern struct { code: u8, - location: extern struct { beg: usize, end: usize }, + location: extern struct { beg: usize, end: usize, line: usize }, }; }; @@ -65,7 +65,7 @@ fn from(alloc: Allocator, doc: Document) typdown_Document { for (errors) |err| { res.errors.?[0] = .{ .code = getErrorCode(err.err), - .location = .{ .beg = err.location.beg, .end = err.location.end }, + .location = .{ .beg = err.location.beg, .end = err.location.end, .line = err.location.line }, }; } res.errors_len = errors.len; @@ -75,7 +75,7 @@ fn from(alloc: Allocator, doc: Document) typdown_Document { fn fromError(alloc: Allocator, err: Error) typdown_Document { var v = alloc.alloc(typdown_Document.typdown_Error, 1) catch |e| @panic(@errorName(e)); - v[0] = .{ .code = getErrorCode(err), .location = .{ .beg = 0, .end = 0 } }; + v[0] = .{ .code = getErrorCode(err), .location = .{ .beg = 0, .end = 0, .line = 0 } }; return .{ .errors = v.ptr, .errors_len = 1 }; } |
