authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2026-08-26 18:38:52-07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2026-08-26 18:38:52-07:00
logc561680fdc28a7014e3b69006c4153a0ac4406fc
tree1348bb9835bac63d9bbc1a24986a0906330b9c8a
parent6fec0eaf001798773fac4fc7d1c81dc351924d5e
signature Signed by SSH key SHA256:4hHJbtBRU58AYXwjL7fkz2fnQHdiye8x1QpTCQ0sHNw

cull the unused parts of the input string


1 files changed, 4 insertions(+), 2 deletions(-)

src/tokenize.zig+4-2
...@@ -70,8 +70,9 @@ pub fn do(comptime input: string, comptime symbols: []const u8) []const Token {...@@ -70,8 +70,9 @@ pub fn do(comptime input: string, comptime symbols: []const u8) []const Token {
70 }70 }
71 if (mode == 2) {71 if (mode == 2) {
72 if (c == input[start]) {72 if (c == input[start]) {
73 const data = input[start .. i + 1][0..].*;
73 ret = ret ++ &[_]Token{.{74 ret = ret ++ &[_]Token{.{
74 .data = .{ .string = input[start .. i + 1] },75 .data = .{ .string = &data },
75 .line = line,76 .line = line,
76 .pos = pos,77 .pos = pos,
77 }};78 }};
...@@ -100,8 +101,9 @@ pub fn do(comptime input: string, comptime symbols: []const u8) []const Token {...@@ -100,8 +101,9 @@ pub fn do(comptime input: string, comptime symbols: []const u8) []const Token {
100 if (shouldFlush) {101 if (shouldFlush) {
101 if (mode == 0) {102 if (mode == 0) {
102 if (end - start > 0) {103 if (end - start > 0) {
104 const data = input[start..end][0..].*;
103 ret = ret ++ &[_]Token{.{105 ret = ret ++ &[_]Token{.{
104 .data = .{ .word = input[start..end] },106 .data = .{ .word = &data },
105 .line = line,107 .line = line,
106 .pos = pos,108 .pos = pos,
107 }};109 }};