hare

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

commit ce79901bd64e351dc0269f939a3da31367427b03
parent ad6ff91398d83dabacc2aeda0220d61db71d55fc
Author: Sebastian <sebastian@sebsite.pw>
Date:   Sat, 30 Sep 2023 23:36:54 -0400

haredoc: allow path to be a file

So you can do `haredoc foo.ha` and get all exported declarations within
that file.

Signed-off-by: Sebastian <sebastian@sebsite.pw>

Diffstat:
Mcmd/haredoc/main.ha | 7++++++-
1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/cmd/haredoc/main.ha b/cmd/haredoc/main.ha @@ -207,7 +207,12 @@ fn doc(name: str, cmd: *getopt::command) (void | error) = { }; const submods: []str = if (!ambiguous && modpath != "") { - yield doc::submodules(modpath)?; + yield match (doc::submodules(modpath)) { + case let s: []str => + yield s; + case doc::error => + yield []; + }; } else []; const srcs = if (!ambiguous && modpath != "") modsrcs else declsrcs; const ctx = doc::context {