File: unit.ha

package info (click to toggle)
hare-update 0.26.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,044 kB
  • sloc: makefile: 37; sh: 14
file content (15 lines) | stat: -rw-r--r-- 343 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// SPDX-License-Identifier: MPL-2.0
// (c) Hare authors <https://harelang.org>

use vNEXT::ast;
use vNEXT::lex;

// Parses an entire subunit (i.e. one Hare source file).
export fn subunit(lexer: *lex::lexer) (ast::subunit | error) = {
	let i = imports(lexer)?;
	let d = decls(lexer)?;
	return ast::subunit {
		imports = i,
		decls = d,
	};
};