hare

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

commit a9c144a8d09cbdfee82857f926a413fea0e57298
parent 09f6c32bd19fb7436e441fc8cc17383290b01cc3
Author: Yasumasa Tada <ytada@spartan.dev>
Date:   Tue, 26 Apr 2022 22:33:07 +0900

glob: rename functions

Signed-off-by: Yasumasa Tada <ytada@spartan.dev>

Diffstat:
Mglob/+test.ha | 2+-
Mglob/glob.ha | 4++--
2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/glob/+test.ha b/glob/+test.ha @@ -21,7 +21,7 @@ use strings; ]; for (let i = 0z; i < len(cases); i += 1) { let gen = glob(cases[i].0, cases[i].1); - defer globfree(&gen); + defer finish(&gen); for (true) match (next(&gen)) { case void => break; diff --git a/glob/glob.ha b/glob/glob.ha @@ -46,7 +46,7 @@ export type failure = !struct { }; // Returns a generator of pathnames matching a pattern. The result must be -// freed using [[globfree]]. +// freed using [[finish]]. export fn glob(pattern: str, flags: flags...) generator = { let ss = strstack_init(); strio::concat(strstack_push(&ss), pattern)!; @@ -63,7 +63,7 @@ export fn glob(pattern: str, flags: flags...) generator = { }; // Frees all memory allocated by the generator. -export fn globfree(gen: *generator) void = { +export fn finish(gen: *generator) void = { strstack_free(&gen.pats); io::close(&gen.tmps); };