aboutsummaryrefslogtreecommitdiffstats
path: root/src/string_view.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/string_view.c')
-rw-r--r--src/string_view.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/string_view.c b/src/string_view.c
index 8247bd4..4e9df5c 100644
--- a/src/string_view.c
+++ b/src/string_view.c
@@ -11,6 +11,15 @@ sv_next(StringView *sv) {
11 return c; 11 return c;
12} 12}
13 13
14void
15sv_rewind(StringView *sv) {
16 if (sv->start == 0) {
17 return;
18 }
19 sv->start--;
20 sv->n++;
21}
22
14char 23char
15sv_peek(const StringView *sv) { 24sv_peek(const StringView *sv) {
16 if (sv->n == 0) { 25 if (sv->n == 0) {