print the public interface in declaration order

read-public-interface has returned the forms in order since 2512d52,
and --public-interface still reversed them as it had to before.
This commit is contained in:
2026-10-09 17:47:25 +03:00
parent dc15aaadab
commit 981eb6f755
2 changed files with 7 additions and 2 deletions

View File

@@ -21,6 +21,9 @@
# app cannot see -- private to greet, or from a module greet imports
# without `pub' -- crosses behind a pointer, declared and no more.
#
# The interface prints as importers get it: the declarations first, then
# the pub forms in the order they were written.
#
# The app's dependency rule names both modules: greet, which it imports,
# and ledger, which only greet does but which decides what the app is
# told of it.
@@ -30,6 +33,9 @@ SEXC ?= ../../sexc
EXPECTED = hello, world\nhello, sex\n2 greetings\ntext times \ntext times \nmood 1\nclosure 15 21 201\nvec2 7 7\nvec2(3 4)\ntally 2\nboard 42\nledger 2\ncolour 123
check:
@if [ "`$(SEXC) --public-interface greet.sex | head -3`" != "`printf '(record cell)\n(record ledger)\n(include stdio.h)'`" ]; then \
echo "modules FAILED, the interface begins:"; $(SEXC) --public-interface greet.sex | head -3; exit 1; \
fi
@$(SEXC) ledger.sex -c -o ledger.o
@$(SEXC) greet.sex -c -o greet.o
@$(SEXC) greet-app.sex -o greet-app --depfile=greet-app.d -- greet.o ledger.o