From 9ead94a6b98e4504640748cd4f13664af76f72b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20H=C3=B6lting?= <87192362+moritz-hoelting@users.noreply.github.com> Date: Tue, 14 Oct 2025 13:41:53 +0200 Subject: [PATCH] allow function calls in template strings, update changelog --- CHANGELOG.md | 5 +++-- src/semantic/mod.rs | 10 ++++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 75c2b3d..a8aba3b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,12 +20,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Member access (e.g. `.objective` to get objective name where int is stored) - Return statement - internal `print` function -- reserve `while` and `for` keyword +- While loop +- `for` keyword - Example: barebones compiler ### Changed -- Change the syntax to set the type of a tag from `tag "[name]" of "[type]"` to `tag<"[type]"> "[name]"` +- Change the syntax to set the tag type from `tag "[name]" of "[type]"` to `tag<"[type]"> "[name]"` - Remove the keyword `of` - Option to deduplicate source files during serialization when using `SerdeWrapper` diff --git a/src/semantic/mod.rs b/src/semantic/mod.rs index 5107caf..d25d707 100644 --- a/src/semantic/mod.rs +++ b/src/semantic/mod.rs @@ -1087,6 +1087,16 @@ impl TemplateStringLiteral { Expression::Primary(Primary::MemberAccess(member_access)) => { member_access.parent().analyze_semantics(scope, handler)?; } + Expression::Primary(Primary::FunctionCall(func)) => { + if let Some(args) = func.arguments() { + for arg in args.elements() { + if let Err(err) = arg.analyze_semantics(scope, handler) { + handler.receive(err.clone()); + errs.push(err); + } + } + } + } _ => { let err = error::Error::UnexpectedExpression(UnexpectedExpression( expression.clone(),