From e0901f6c8a9e62717ca6813281b45771e8bc2d42 Mon Sep 17 00:00:00 2001 From: alex-eg Date: Fri, 9 Oct 2026 18:11:37 +0300 Subject: [PATCH] pass the river colour as a conditional, with #line on every statement A #line no longer lands inside a ?: (sex#54), so the build goes back to statement-level directives, which is what lands a debugger on the right line. Co-Authored-By: Claude Opus 5.5 --- Makefile | 6 +----- src/dump.sex | 6 +----- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index bc08a6e..5482d78 100644 --- a/Makefile +++ b/Makefile @@ -20,12 +20,8 @@ all: $(B)/vsmv $(B)/vs-map-viewer # dependency files. SEX_SRC := $(wildcard src/*.sex) -# Statement-level #line directives can land inside a ?: and break the -# C (see Sex-field-notes.org), so they are kept to toplevel forms. -# TODO sex#54: drop --line-directives=toplevel once #line no longer -# lands inside a ?:. $(B)/%.o: src/%.sex $(SEX_SRC) | $(B) - $(SEXC) --line-directives=toplevel $< -c -o $@ -- $(CFLAGS) $(SEX_CFLAGS) $(CPPFLAGS) + $(SEXC) $< -c -o $@ -- $(CFLAGS) $(SEX_CFLAGS) $(CPPFLAGS) $(B)/nk.o: src/nk.c src/nk.h | $(B) $(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@ diff --git a/src/dump.sex b/src/dump.sex index d311185..b797d9a 100644 --- a/src/dump.sex +++ b/src/dump.sex @@ -128,11 +128,7 @@ (if (. m has-river-distance) (do (var d int [(. m river-distance) i]) - ;; TODO sex#54: pass the colour as an (if ...) argument to - ;; .set once #line no longer splits it. - (var c u32 (grey (- 255 d))) - (if (== d 0) (= c 0x4060BF)) - (.set (& river) x y c)) + (.set (& river) x y (if (== d 0) 0x4060BF (grey (- 255 d))))) (.set (& river) x y 0x202020))))) (write-image (& height) dir "height")