test: trim-whitespace invokes is-whitespace and is separately compiled in liblib.


module foo
imports liblib
strategies

main =
" foo
"

is-whitespace =
?’

———————————————


martin@logistico:~> strc -i foo.str -la liblib
compiling foo.str
front-end succeeded: user 1.31 system 0.17
optimization succeeded: user 0.06 system 0.12
back-end succeeded: user 0.09 system 0.07
gcc foo.o -o foo /pkg/strategoxt/2004-06-30-19-08/lib/srts/libliblib.so -L/pkg/strategoxt/2004-06-30-19-08//lib/srts /pkg/strategoxt/2004-06-30-19-08/lib/srts/libstratego-lib.opt.so /pkg/strategoxt/2004-06-30-19-08/lib/srts/libstratego-choice.so /pkg/strategoxt/2004-06-30-19-08/lib/srts/libstratego.opt.so -L/home/martin/.nix-profile//lib -lATerm-gcc -lm -Wl,–rpath -Wl,/pkg/strategoxt/2004-06-30-19-08/lib/srts -Wl,–rpath -Wl,/pkg/strategoxt/2004-06-30-19-08/lib/srts
C compilation succeeded: user 0.41 system 0.13
—–
compilation succeeded: user 1.87 system 0.50
———————————————
(should fail)

If is-whitespace is invoked in this program:
———————————————
module foo
imports liblib
strategies

main =
" foo
"
; where(is-whitespace)

is-whitespace =
?’

———————————————


martin@logistico:~> strc -i foo.str -la liblib
compiling foo.str
redefining external definition: is-whitespace
giving-up
compilation failed (1.55 secs)
martin@logistico:~>
———————————————

Submitted on 1 July 2004 at 16:19

On 8 December 2004 at 11:38 Jira commented:

STR-135, martin:
This is not a minor issue.


On 8 December 2004 at 11:49 Jira commented:

STR-135, martin:
Btw, I’m not really into the impelementation of the redefinition detection, but this issue might also be caused by dead code elimination of the strategies that are not invoked. If so, then the check should be move somewhat more to the front of the compiler pipeline

Log in to post comments