Amos Wenger
Amos Wenger
Alright. I've been reading up more on sweet.js to be able to understand and help with ki. I'll try writing the minimal set of macro/rules required to reproduce the issues...
Here's a test case that makes it obvious what the real problem is:  Generated source maps refer to the macro definitions. Since in...
Including ki's `macros/index.js` verbatim in a test ki program and compiling via sjs gives a similar result than the simple test above: 
@lantiga I managed to isolate the problem, and opened https://github.com/mozilla/sweet.js/issues/411 to track it.
> It's not entirely clear to me what should happen here. Optionally suppress the stack trace that goes into the module? I think, when the code is macro-expanded using definitions...
> My guess is that sweet is concatenating modules to code right before macroexpansion. I don't think so. The line numbers pointed at by the source map do exist and...
Dumping the AST shows this:  As you can see, the throw statement is wrongly located (line 13), but its argument is correct (line...
@lantiga I agree. I've just stumbled upon sweet.js's "debug.js" file that allows stepping through the compilation process, hopefully I can gain a better understanding of how modules are handled in...
> My guess is that sweet is concatenating modules to code right before macroexpansion. Actually it does, but on an AST level, not a source level: ``` js // fun...
Right now, seems to be a feature, not a bug, as `adjustLineContext` seems to show: ``` js function adjustLineContext(stx, original, current) { // short circuit when the array is empty;...