~turminal/hare

7fe2066e51d8d18afce088d9cd054a8f665b0835 — Bor Grošelj Simić 2 years ago c08c937 scan
bringing old branch up to date
4 files changed, 12 insertions(+), 24 deletions(-)

M cmd/harec/gen.ha
M cmd/harec/main.ha
M hare/types/store.ha
M hare/unit/unit.ha
M cmd/harec/gen.ha => cmd/harec/gen.ha +1 -1
@@ 29,7 29,7 @@ fn gen(out: io::handle, store: *types::typestore, unit: *unit::scope) void = {
		},
		...
	};
	defer io::close(&ctx.buf);
	defer io::close(&ctx.buf)!;
	for (let i = 0z; i < len(unit.objects); i += 1) {
		switch (unit.objects[i].kind) {
		case object_kind::FUNC =>

M cmd/harec/main.ha => cmd/harec/main.ha +1 -1
@@ 95,5 95,5 @@ export fn main() void = {
		yield u;
	};
	defer unit::unit_finish(unit);
	gen(out, store, &unit);
	gen(out, store, unit);
};

M hare/types/store.ha => hare/types/store.ha +3 -2
@@ 76,6 76,7 @@ export fn newalias(
		repr = alias {
			id = ast::ident_dup(ident),
			secondary = of,
			...
		},
		id = 0,
		sz = of.sz,


@@ 102,8 103,8 @@ export fn newalias(

	// Or create a new alias
	let bucket = &store.map[id % BUCKETS];
	append(bucket, atype);
	return &bucket[len(bucket) - 1];
	append(bucket, &atype);
	return bucket[len(bucket) - 1];
};

// A resolver function was not provided to [[store]], but was required to look

M hare/unit/unit.ha => hare/unit/unit.ha +7 -20
@@ 5,20 5,7 @@ use hare::lex;
use hare::types;


<<<<<<< HEAD
// A function declaration.
export type decl_func = struct {
	symbol: str,
	ident: ast::ident,
	prototype: const *types::_type,
	body: nullable *expr,
	attrs: ast::fndecl_attrs,
};

// A declaration within a unit.
=======
// A declaration within a unit
>>>>>>> 009b0575 (hare::unit: basic declaration scanning infrastructure)
export type decl = struct {
	exported: bool,
	start: lex::location,


@@ 31,16 18,16 @@ export type decl_func = struct {
	decl,
	symbol: str,
	body: nullable *expr,
	attrs: fndecl_attrs,
	attrs: ast::fndecl_attrs,
};

<<<<<<< HEAD
export fn unit_finish(unit: unit) void = {
	// TODO
	return;
=======
export type decl_global = struct {
	decl,
	symbol: str,
>>>>>>> 009b0575 (hare::unit: basic declaration scanning infrastructure)
};

export fn unit_finish(unit: *scope) void = {
	// TODO
	return;
};