Closed SuzanneSoy closed 7 years ago
The eval
call isn't the only problem here. If you replace the eval call with:
(parameterize ([current-namespace
(variable-reference->namespace (#%variable-reference))])
(expand #'orig-mod))
You get (roughly) the same error.
(syntax-source #'orig-mod)
is "../repltest/lang/reader.rkt"
regardless of the file being read, which confuses Cover. You can see this if you open tests/doc1.rkt
and expand it in the macro stepper. (I think this is whats going on, I'm having trouble creating a small test case).
It will probably take me a little while to fix this, since I need to disentangle the eval
issue from this syntax-source
issue. But having the module have a different syntax-source
than the actual file probably isn't what you want anyways. If you can fix this and replace the call to eval with the parameterize code above that should work around this issue.
When I manage to disentangle the eval
issue from the syntax-source
issue I'll
(Notes for myself)
There are two things to be done to fix this:
1) Cover's internal mapping tables should be using module-path-index
es instead of file paths.
2) If an unknown syntax location is found during expansion of a previously initialized module cover should fall back to a slow path where it copies and grows the coverage vector to accommodate the new expansion.
Thanks a lot for taking the time to track down this bug!
I applied the changes you suggested, and it seems to work find except for two issues:
debug
meta-language "above" my repltest
meta-language. When expanding with (eval #'(expand #'orig-stx) …)
the expansion works, but with (parameterize ([current-namespace …]) (expand #'orig-stx))
it gives an error about ambiguous identifiers in the code injected by debug
, due to some missing scopes. I have no idea why eval
gives a different result, so I just disabled this test file on the branch running raco cover
, and I'll re-enable it once eval
works with cover
.raco cover
, see #129 .A few things might be going on with the debug issue: The namespace might be wrong (maybe make-base-namespace
or namespace-anchor->namespace
are the right things?) or maybe a namespace-syntax-introduce
? Those are shots in the dark though.
This is probably a question for the mailing list, where wiser minds lurk.
Fixed by 568823c and 13e3764.
I'm using raco cover for most of my projects, and it is failing on this one:
https://github.com/jsmaniac/repltest/tree/30e68d3a2ca445a8399a4f144d4f438b48bd2ab1
See the travis logs: https://travis-ci.org/jsmaniac/repltest/jobs/152937538#L430
Given the
key
, I suspect the error is due to the eval statement – the evaluated expression starts at character 590 in the file:https://github.com/jsmaniac/repltest/blob/30e68d3a2ca445a8399a4f144d4f438b48bd2ab1/lang/reader.rkt#L18