hare

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

commit 5c280bfad8daa3a94cbe559ec0837e0168fa88c1
parent f33b520e97ba15ba8b06732eb0e3b388ecaa871b
Author: Drew DeVault <sir@cmpwn.com>
Date:   Wed, 21 Apr 2021 12:40:51 -0400

format::xml: improve documentation

Diffstat:
Mformat/xml/parser.ha | 4++--
Mformat/xml/types.ha | 4+---
2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/format/xml/parser.ha b/format/xml/parser.ha @@ -53,8 +53,8 @@ export fn parser_free(par: *parser) void = { }; // Scans for and returns the next [[token]]. Tokens are borrowed from the parser -// and are not valid on subsequent calls to [[scan]]; use [[token_dup]] to extend -// their lifetime. +// and are not valid on subsequent calls to [[scan]]; use [[token_dup]] to +// extend their lifetime. export fn scan(par: *parser) (token | void | error) = { switch (par.state) { state::ROOT, state::ATTRS => want(par, OPTWS)?, diff --git a/format/xml/types.ha b/format/xml/types.ha @@ -2,13 +2,13 @@ use encoding::utf8; use io; use os; -// Represents the state for an XML parser. export type parser = struct { orig: *io::stream, in: *io::stream, buf: [os::BUFSIZ]u8, state: state, tags: []str, + // strio buffers: namebuf: *io::stream, entbuf: *io::stream, @@ -50,5 +50,3 @@ export fn strerror(err: error) const str = { err: io::error => io::strerror(err), }; }; - -export fn token_dup(tok: token) void = abort(); // TODO