From 32d4059d621542720843d9594b08f9580e18df7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=B8=D1=85=D0=B0=D0=B8=D0=BB=20=D0=9A=D0=B0=D0=BF?= =?UTF-8?q?=D0=B5=D0=BB=D1=8C=D0=BA=D0=BE?= Date: Sat, 17 Oct 2026 06:38:50 +0300 Subject: [PATCH] fix --- AGENTS.md | 9 +++++++++ dialect.yml | 4 ++-- game/ver-mac/src/dialect.swift | 4 ++-- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index dc04111..61fa521 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -121,6 +121,15 @@ util/rm-mac-geom # reset the app's saved window geometry otherwise the build fails on `F.` being unresolved. - `dialect.swift` is generated — edits there are overwritten on the next `util/build-mac`. Change the source (`dialect.yml` / `components/`) instead. +- **Validate `dialect.yml` after edits** (e.g. `ruby -ryaml -e 'YAML.load_file("dialect.yml")'`). + Every should-branch label (`1. Upon each ...`) MUST end with a colon — the + parser (`components/yml/ymlFun.swift`) blindly `dropLast()`s it, so a missing + colon silently eats the label's last character in the generated `about` + comment. Note the file can never pass a *strict* YAML parser: condition and + reaction lines (under `if:` / `then:`) contain unquoted `: ` (e.g. + `c.countText = "Count: '\(c.count)'"`), which standard YAML rejects. So treat + a parser complaint pointing *inside* an `if:`/`then:` block as expected; any + complaint elsewhere (like a missing branch-label colon) is a real bug. ## Swift 6 diff --git a/dialect.yml b/dialect.yml index 4258641..fbf003b 100644 --- a/dialect.yml +++ b/dialect.yml @@ -23,12 +23,12 @@ RootComponent: then: c.count += 1 countText: - 1. Upon each count change + 1. Upon each count change: if: c.recentField == F.count then: c.countText = "Count: '\(c.count)'" - 2. Upon launch + 2. Upon launch: if: c.recentField == F.didLaunch then: diff --git a/game/ver-mac/src/dialect.swift b/game/ver-mac/src/dialect.swift index 98b4ee9..4b69471 100644 --- a/game/ver-mac/src/dialect.swift +++ b/game/ver-mac/src/dialect.swift @@ -215,7 +215,7 @@ func rootShouldResetCount(_ c: RootContext) -> RootContext { func rootShouldResetCountText(_ c: RootContext) -> RootContext { var c = c - /* 1. Upon each count chang */ + /* 1. Upon each count change */ if c.recentField == F.count { @@ -224,7 +224,7 @@ func rootShouldResetCountText(_ c: RootContext) -> RootContext { return c } - /* 2. Upon launc */ + /* 2. Upon launch */ if c.recentField == F.didLaunch {