#line splits a ternary in a call argument #54

Closed
opened 2026-10-08 18:43:12 +02:00 by alex-eg · 0 comments
Owner

(if c a b) in expression position becomes c ? a : b. Inside a
multi-line call, though, the statement anchor lands between the
ternary's parts, and the C doesn't compile:

(.set (& river) x y (if (== d 0) 4219071 (grey (- 255 d))))
dump.sex:128:1: error: expected expression
  128 | , grey(255 - d));

-C output, without the directives, is fine. The build now passes
--line-directives=toplevel to every Sex unit.


Found with sexc dfafe8b while building vs-map-viewer (from its Sex-field-notes.org).

`(if c a b)` in expression position becomes `c ? a : b`. Inside a multi-line call, though, the statement anchor lands between the ternary's parts, and the C doesn't compile: ```scheme (.set (& river) x y (if (== d 0) 4219071 (grey (- 255 d)))) ``` ``` dump.sex:128:1: error: expected expression 128 | , grey(255 - d)); ``` `-C` output, without the directives, is fine. The build now passes `--line-directives=toplevel` to every Sex unit. --- Found with sexc `dfafe8b` while building vs-map-viewer (from its `Sex-field-notes.org`).
alex-eg added the bug label 2026-10-08 18:43:12 +02:00
Sign in to join this conversation.