~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
2 2

[PATCH hare] hare::parse: allow static binding in for expression

Details
Message ID
<20220514033515.23005-1-sebastian@sebsite.pw>
DKIM signature
pass
Download raw message
Patch: +10 -3
Signed-off-by: Sebastian <sebastian@sebsite.pw>
---
 hare/parse/+test/expr.ha |  3 +++
 hare/parse/expr.ha       | 10 +++++++---
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/hare/parse/+test/expr.ha b/hare/parse/+test/expr.ha
index db41f3f5..0b2a17a1 100644
--- a/hare/parse/+test/expr.ha
+++ b/hare/parse/+test/expr.ha
@@ -191,6 +191,9 @@
	for (let x = 10; x < 10; x) {
		x;
	};
	for (static let x = 0; x < 10) {
		x;
	};
};
");
};
diff --git a/hare/parse/expr.ha b/hare/parse/expr.ha
index b3d80e98..295c360a 100644
--- a/hare/parse/expr.ha
+++ b/hare/parse/expr.ha
@@ -637,11 +637,15 @@ fn for_expr(lexer: *lex::lexer) (ast::expr | error) = {
	want(lexer, ltok::LPAREN)?;

	const bindings: nullable *ast::expr =
		match (peek(lexer, ltok::LET, ltok::CONST)?) {
		match (peek(lexer, ltok::LET, ltok::CONST, ltok::STATIC)?) {
		case void =>
			yield null;
		case lex::token =>
			const bindings = alloc(binding(lexer, false)?);
		case let tok: lex::token =>
			let is_static = if (tok.0 == ltok::STATIC) {
				want(lexer, ltok::STATIC)?;
				yield true;
			} else false;
			const bindings = alloc(binding(lexer, is_static)?);
			want(lexer, ltok::SEMICOLON)?;
			yield bindings;
		};
-- 
2.35.1

[hare/patches] build success

builds.sr.ht <builds@sr.ht>
Details
Message ID
<CJZ64ISJRYJ7.1MBYH1A4FWUFF@cirno2>
In-Reply-To
<20220514033515.23005-1-sebastian@sebsite.pw> (view parent)
DKIM signature
missing
Download raw message
hare/patches: SUCCESS in 1m26s

[hare::parse: allow static binding in for expression][0] from [Sebastian][1]

[0]: https://lists.sr.ht/~sircmpwn/hare-dev/patches/32272
[1]: sebastian@sebsite.pw

✓ #757837 SUCCESS hare/patches/freebsd.yml https://builds.sr.ht/~sircmpwn/job/757837
✓ #757836 SUCCESS hare/patches/alpine.yml  https://builds.sr.ht/~sircmpwn/job/757836
Details
Message ID
<CK15T7RTJDKS.3SL0E68VYM0KT@taiga>
In-Reply-To
<20220514033515.23005-1-sebastian@sebsite.pw> (view parent)
DKIM signature
fail
Download raw message
DKIM signature: fail
Thanks!

To git@git.sr.ht:~sircmpwn/hare
   8f4f4f57..16b3595b  master -> master
Reply to thread Export thread (mbox)