~sircmpwn/hare-xml

37ab94757f15e56eb2806557340de0dd3a8115c2 — Drew DeVault 2 months ago 1e4db08 master
parser: don't excessively unread runes
1 files changed, 1 insertions(+), 3 deletions(-)

M format/xml/parser.ha
M format/xml/parser.ha => format/xml/parser.ha +1 -3
@@ 97,7 97,6 @@ export fn scan(par: *parser) (token | void | error) = {
				bufio::unreadrune(par.in, rn);
				yield rn;
			};
			bufio::unreadrune(par.in, rn);
			switch (next) {
			case '!' =>
				return scan_comment(par);


@@ 174,7 173,7 @@ fn scan_attr(par: *parser) (token | error) = {
};

fn scan_comment(par: *parser) (token | void | error) = {
	want(par, "<!")?;
	want(par, "!")?;
	match (bufio::scanrune(par.in)?) {
	case io::EOF =>
		return par.line: syntaxerr;


@@ 294,7 293,6 @@ fn scan_content(par: *parser) (text | error) = {
};

fn scan_element(par: *parser) (token | error) = {
	want(par, '<')?;
	let close = false;
	match (bufio::scanrune(par.in)?) {
	case io::EOF =>