~sircmpwn/hare-xml

parser: don't excessively unread runes
io::close can error

Signed-off-by: Sebastian <sebastian@sebsite.pw>
change dynamic_stream to stream due to stdlib change

Signed-off-by: Chris Palmer <chris@red-oxide.org>
Makefile: add docs target

Signed-off-by: Sebastian <sebastian@sebsite.pw>
Makefile: use $(HARE) for check

Signed-off-by: Sebastian <sebastian@sebsite.pw>
Import from Hare standard library

Signed-off-by: Drew DeVault <sir@cmpwn.com>
ascii: abort strcasecmp when non-ASCII encountered

Signed-off-by: Sebastian <sebastian@sebsite.pw>
format::xml: return line number of syntax error

This also expands the tests to ensure that the line number is accurate.

Signed-off-by: Sebastian <sebastian@sebsite.pw>
format::xml: more informative error in xmltest

This was taken from hare::parse::roundtrip

Signed-off-by: Sebastian <sebastian@sebsite.pw>
xml: Fix module name in README

Signed-off-by: Christopher M. Riedl <cmr@bluescreens.de>
all: add copyright headers

Signed-off-by: Drew DeVault <sir@cmpwn.com>
xml: fix memory leak

Signed-off-by: Sebastian <sebastian@sebsite.pw>
Fix up tests using bufio

Oops

Signed-off-by: Alexey Yerin <yyp@disroot.org>
bufio: use caller allocation

fixed() and dynamic() return a memstream, and buffered() returns
bufstream. This also removes the need for static_buffered() hack.

Similarly to strio, bufio::finish() is removed as the streams do not
allocate themselves.

Necessary update is adding '&' to uses of bufio streams.

Signed-off-by: Alexey Yerin <yyp@disroot.org>
strio: use caller allocation

Instead of allocated io::handle strio::dynamic() returns dynamic_stream
and strio::fixed() returns fixed_stream.

Also, strio::finish() is gone and should be replaced by strio::string(),
since the stream itself doesn't need to be freed.

Another update necessary is adding '&' to uses of strio streams:

    let s = strio::dynamic();

    // Previously: fmt::fprint(s, "Hiya")!;
    fmt::fprint(&s, "Hiya")!;

    // io::close(s);
    io::close(&s);

Signed-off-by: Alexey Yerin <yyp@disroot.org>
9129528d — Bor Grošelj Simić 7 months ago
all: resolve name clashes that weren't noticed before

All these issues surfaced after a bugfix that changed type shadowing
logic in harec.

Signed-off-by: Bor Grošelj Simić <bor.groseljsimic@telemach.net>
hare::parse::expr: update match binding syntax

And update the rest of the stdlib for the new syntax

Signed-off-by: Eyal Sawady <ecs@d2evs.net>
all: introduce io::handle and refactor usage

The goal of this round of refactoring is to simplify the API a bit and
reduce the ABI footprint of io::file (and io::handle).

Signed-off-by: Drew DeVault <sir@cmpwn.com>
all: overhaul switch/match syntax

This changes the syntax of switch and match expressions following
similar changes to harec et al.

match (x) {
	case type =>
		do_work();
		yield 10;
	case x: type =>
		process(x);
		yield 20;
	case =>
		abort();
};

Signed-off-by: Drew DeVault <sir@cmpwn.com>
Signed-off-by: Alexey Yerin <yyp@disroot.org>
Co-authored-by: Alexey Yerin <yyp@disroot.org>
all: yield WIP

Signed-off-by: Drew DeVault <sir@cmpwn.com>
Next