~sircmpwn/hare-dev

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
1

[PATCH hare-xml] Update per stdlib changes

Details
Message ID
<20230909135227.19050-1-yyp@disroot.org>
DKIM signature
missing
Download raw message
Patch: +23 -23
---
 format/xml/parser.ha | 46 ++++++++++++++++++++++----------------------
 1 file changed, 23 insertions(+), 23 deletions(-)

diff --git a/format/xml/parser.ha b/format/xml/parser.ha
index 8e45aa3..9b8351a 100644
--- a/format/xml/parser.ha
+++ b/format/xml/parser.ha
@@ -77,7 +77,7 @@ export fn scan(par: *parser) (token | void | error) = {
	case state::ROOT, state::ATTRS => want(par, OPTWS)?;
	case => void;
	};
	let rn: rune = match (bufio::scanrune(par.in)?) {
	let rn: rune = match (bufio::read_rune(par.in)?) {
	case io::EOF =>
		if (par.state == state::ROOT) {
			return par.line: syntaxerr;
@@ -91,7 +91,7 @@ export fn scan(par: *parser) (token | void | error) = {
	case state::ROOT, state::ELEMENT =>
		switch (rn) {
		case '<' =>
			const next = match (bufio::scanrune(par.in)?) {
			const next = match (bufio::read_rune(par.in)?) {
			case io::EOF =>
				return par.line: syntaxerr;
			case let rn: rune =>
@@ -151,7 +151,7 @@ fn scan_attr(par: *parser) (token | error) = {
	want(par, OPTWS, '=', OPTWS)?;
	let quot = quote(par)?;
	memio::reset(&par.textbuf);
	for (true) match (bufio::scanrune(par.in)?) {
	for (true) match (bufio::read_rune(par.in)?) {
	case io::EOF =>
		return par.line: syntaxerr;
	case let rn: rune =>
@@ -175,7 +175,7 @@ fn scan_attr(par: *parser) (token | error) = {

fn scan_comment(par: *parser) (token | void | error) = {
	want(par, "!")?;
	match (bufio::scanrune(par.in)?) {
	match (bufio::read_rune(par.in)?) {
	case io::EOF =>
		return par.line: syntaxerr;
	case let rn: rune =>
@@ -193,7 +193,7 @@ fn scan_comment(par: *parser) (token | void | error) = {
		};
	};
	for (true) {
		const rn = match (bufio::scanrune(par.in)?) {
		const rn = match (bufio::read_rune(par.in)?) {
		case io::EOF =>
			return par.line: syntaxerr;
		case let rn: rune =>
@@ -201,7 +201,7 @@ fn scan_comment(par: *parser) (token | void | error) = {
			yield rn;
		};
		if (rn != '-') continue;
		const rn = match (bufio::scanrune(par.in)?) {
		const rn = match (bufio::read_rune(par.in)?) {
		case io::EOF =>
			return par.line: syntaxerr;
		case let rn: rune =>
@@ -209,7 +209,7 @@ fn scan_comment(par: *parser) (token | void | error) = {
			yield rn;
		};
		if (rn != '-') continue;
		const rn = match (bufio::scanrune(par.in)?) {
		const rn = match (bufio::read_rune(par.in)?) {
		case io::EOF =>
			return par.line: syntaxerr;
		case let rn: rune =>
@@ -229,7 +229,7 @@ fn scan_comment(par: *parser) (token | void | error) = {
fn scan_cdata(par: *parser) (text | error) = {
	memio::reset(&par.textbuf);
	for (true) {
		const rn = match (bufio::scanrune(par.in)?) {
		const rn = match (bufio::read_rune(par.in)?) {
		case io::EOF =>
			return par.line: syntaxerr;
		case let rn: rune =>
@@ -240,7 +240,7 @@ fn scan_cdata(par: *parser) (text | error) = {
			memio::appendrune(&par.textbuf, rn)!;
			continue;
		};
		const rn = match (bufio::scanrune(par.in)?) {
		const rn = match (bufio::read_rune(par.in)?) {
		case io::EOF =>
			return par.line: syntaxerr;
		case let rn: rune =>
@@ -251,7 +251,7 @@ fn scan_cdata(par: *parser) (text | error) = {
			memio::appendrune(&par.textbuf, rn)!;
			continue;
		};
		const rn = match (bufio::scanrune(par.in)?) {
		const rn = match (bufio::read_rune(par.in)?) {
		case io::EOF =>
			return par.line: syntaxerr;
		case let rn: rune =>
@@ -271,7 +271,7 @@ fn scan_cdata(par: *parser) (text | error) = {

fn scan_content(par: *parser) (text | error) = {
	memio::reset(&par.textbuf);
	for (true) match (bufio::scanrune(par.in)?) {
	for (true) match (bufio::read_rune(par.in)?) {
	case io::EOF =>
		break;
	case let rn: rune =>
@@ -295,7 +295,7 @@ fn scan_content(par: *parser) (text | error) = {

fn scan_element(par: *parser) (token | error) = {
	let close = false;
	match (bufio::scanrune(par.in)?) {
	match (bufio::read_rune(par.in)?) {
	case io::EOF =>
		return par.line: syntaxerr;
	case let rn: rune =>
@@ -321,7 +321,7 @@ fn scan_element(par: *parser) (token | error) = {

fn scan_entity(par: *parser) (rune | error) = {
	want(par, '&')?;
	let rn = match (bufio::scanrune(par.in)?) {
	let rn = match (bufio::read_rune(par.in)?) {
	case io::EOF =>
		return par.line: syntaxerr;
	case let rn: rune =>
@@ -345,7 +345,7 @@ fn scan_paramentity(par: *parser) (rune | error) = {

fn scan_charref(par: *parser) (rune | error) = {
	let base = strconv::base::DEC;
	match (bufio::scanrune(par.in)?) {
	match (bufio::read_rune(par.in)?) {
	case io::EOF =>
		return par.line: syntaxerr;
	case let rn: rune =>
@@ -358,7 +358,7 @@ fn scan_charref(par: *parser) (rune | error) = {

	memio::reset(&par.entbuf);
	for (true) {
		let rn = match (bufio::scanrune(par.in)?) {
		let rn = match (bufio::read_rune(par.in)?) {
		case io::EOF =>
			return par.line: syntaxerr;
		case let rn: rune =>
@@ -406,7 +406,7 @@ fn scan_namedent(par: *parser) (rune | error) = {
fn scan_name(par: *parser, buf: *memio::stream) (str | error) = {
	memio::reset(buf);

	const rn = match (bufio::scanrune(par.in)?) {
	const rn = match (bufio::read_rune(par.in)?) {
	case io::EOF =>
		return par.line: syntaxerr;
	case let rn: rune =>
@@ -417,7 +417,7 @@ fn scan_name(par: *parser, buf: *memio::stream) (str | error) = {
	};
	memio::appendrune(buf, rn)!;

	for (true) match (bufio::scanrune(par.in)?) {
	for (true) match (bufio::read_rune(par.in)?) {
	case io::EOF =>
		return par.line: syntaxerr;
	case let rn: rune =>
@@ -445,7 +445,7 @@ fn prolog(par: *parser) (void | error) = {
	want(par, "version", OPTWS, '=', OPTWS)?;
	let quot = quote(par)?;
	want(par, OPTWS, "1.")?;
	for (true) match (bufio::scanrune(par.in)?) {
	for (true) match (bufio::read_rune(par.in)?) {
	case io::EOF =>
		break;
	case let rn: rune =>
@@ -457,7 +457,7 @@ fn prolog(par: *parser) (void | error) = {
	want(par, quot)?;

	let hadws = want(par, OPTWS)?;
	let encoding = match (bufio::scanrune(par.in)) {
	let encoding = match (bufio::read_rune(par.in)) {
	case io::EOF =>
		yield false;
	case let rn: rune =>
@@ -479,7 +479,7 @@ fn prolog(par: *parser) (void | error) = {
	};

	let hadws = want(par, OPTWS)?;
	let standalone = match (bufio::scanrune(par.in)) {
	let standalone = match (bufio::read_rune(par.in)) {
	case io::EOF =>
		yield false;
	case let rn: rune =>
@@ -511,7 +511,7 @@ def WS: whitespace = true;
def OPTWS: whitespace = false;

fn quote(par: *parser) (rune | error) = {
	match (bufio::scanrune(par.in)?) {
	match (bufio::read_rune(par.in)?) {
	case let rn: rune =>
		switch (rn) {
		case '"', '\'' =>
@@ -528,7 +528,7 @@ fn want(par: *parser, tok: (rune | str | whitespace)...) (bool | error) = {
	let hadws = false;
	for (let i = 0z; i < len(tok); i += 1) match (tok[i]) {
	case let x: rune =>
		let have = match (bufio::scanrune(par.in)?) {
		let have = match (bufio::read_rune(par.in)?) {
		case io::EOF =>
			return par.line: syntaxerr;
		case let rn: rune =>
@@ -550,7 +550,7 @@ fn want(par: *parser, tok: (rune | str | whitespace)...) (bool | error) = {
		};
	case let ws: whitespace =>
		let n = 0;
		for (true; n += 1) match (bufio::scanrune(par.in)?) {
		for (true; n += 1) match (bufio::read_rune(par.in)?) {
		case io::EOF =>
			break;
		case let rn: rune =>
-- 
2.42.0
Details
Message ID
<CVOGJOBLJIUX.3UYRAW5HX4TON@taiga>
In-Reply-To
<20230909135227.19050-1-yyp@disroot.org> (view parent)
DKIM signature
missing
Download raw message
Thanks!

To git@git.sr.ht:~sircmpwn/hare-xml
   17ae6b3..6b90e48  master -> master
Reply to thread Export thread (mbox)