~ecs/hare-qbe

e928f8b68a54ba5260b340e4081678a99cbf7703 — Sebastian 5 months ago 6aada6a
fix compilation

Signed-off-by: Sebastian <sebastian@sebsite.pw>
2 files changed, 6 insertions(+), 3 deletions(-)

M qbe/lex.ha
M qbe/parse.ha
M qbe/lex.ha => qbe/lex.ha +3 -3
@@ 3,6 3,7 @@ use bufio;
use io;
use memio;
use sort;
use sort::cmp;
use strconv;
use math;



@@ 17,7 18,7 @@ fn get(in: *lexer) (rune | io::EOF | error) = {
		defer delete(in.lastrns[len(in.lastrns) - 1]);
		return in.lastrns[len(in.lastrns) - 1];
	};
	return bufio::scanrune(in.in)?;
	return bufio::read_rune(in.in)?;
};

fn unget(in: *lexer, rn: rune) void = append(in.lastrns, rn);


@@ 29,7 30,6 @@ fn comment(in: *lexer) (token | error | io::EOF) = {
	case io::EOF =>
		return io::EOF;
	};
	abort();
};

fn isword(rn: rune) bool =


@@ 52,7 52,7 @@ fn word(in: *lexer) (str | error) = {

fn keyword(in: *lexer) (token | error) = {
	let n = word(in)?;
	match (sort::searchstrings(bmap[..ltok::LAST_KEYWORD+1], n)) {
	match (sort::search(bmap[..ltok::LAST_KEYWORD+1], size(str), &n, &cmp::strs)) {
	case void =>
		return n: unrecognized;
	case let i: size =>

M qbe/parse.ha => qbe/parse.ha +3 -0
@@ 234,6 234,7 @@ fn parse_param(in: *lexer) (param | error) = {
		return want(in, ltok::LIT_TEMP)?.1 as str: param;
	case ltok::DOTS =>
		return variadic;
	case => abort(); // unreachable i think
	};
};



@@ 262,6 263,7 @@ fn parse_val(in: *lexer) (val | error) = {
		return t.1 as f64: constant;
	case ltok::LIT_F32 =>
		return t.1 as f32: constant;
	case => abort(); // unreachable i think
	};
};



@@ 488,6 490,7 @@ fn parse_definition(in: *lexer) (definition | void | error) = {
		if (linkage.exported) return ltok::EXPORT: unexpected;
		if (linkage.secname != "") return ltok::SECTION: unexpected;
		return parse_typedef(in)?;
	case => abort(); // unreachable i think
	};
};