hare

The Hare programming language
git clone https://git.torresjrjr.com/hare.git
Log | Files | Refs | README | LICENSE

commit 13139aae987b2b00c0d2adbb15583cff270f462e
parent 63e8df1d1e24169790f2edfb805c43b982d29a76
Author: Vlad-Stefan Harbuz <vlad@vladh.net>
Date:   Sun, 24 Apr 2022 16:27:32 +0200

regex: rename regex_free to regex_finish and have it take pointer, fixes #625

Signed-off-by: Vlad-Stefan Harbuz <vlad@vladh.net>

Diffstat:
Mregex/README | 2+-
Mregex/regex.ha | 2+-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/regex/README b/regex/README @@ -17,7 +17,7 @@ This module implements the POSIX match disambiguation rules by returning the longest match among the leftmost matches. const re = regex::compile(`[Hh]are`)!; - defer regex::regex_free(re); + defer regex::regex_finish(&re); const first_match = regex::find(re, "Hello Hare, hello Hare.")!; match (first_match) { diff --git a/regex/regex.ha b/regex/regex.ha @@ -99,7 +99,7 @@ export type regex = struct { }; // Frees the memory used by a regex. -export fn regex_free(re: regex) void = { +export fn regex_finish(re: *regex) void = { free(re.insts); for (let i = 0z; i < len(re.charsets); i += 1) { free(re.charsets[i]);