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:
3
sexc.scm
3
sexc.scm
@@ -269,8 +269,7 @@ status, which is ours to pass on."
|
||||
(write-to-file-or-stdout
|
||||
output
|
||||
(fn
|
||||
(map pp (reverse
|
||||
(read-public-interface input)))))
|
||||
(map pp (read-public-interface input))))
|
||||
(return #f))
|
||||
|
||||
;; The file name in a #line directive now comes from the form's
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user