How can I use babel to regenerate the original source while wrapping certain token contents (or even that of entire serialized nodes) in custom string?
For example (not what I'm doing): how do you generate a syntax highlighted html page with babel?
Cc @left_pad @sebmck
Theres no way to include AST changes but a hack is to just serialize it then do the tokenizing on the generated output. There's no whitespace tokens but you can derive it by measuring the line/column differences between tokens.
-
-
Oh btw I got this working today. I just build up a Map with token.start as key and whichever gaps appear are filled by slicing lastStart,token.start. Then when traversing look up the token for path.node.start and that'll be the first token. this seems to work perfectly :D cheers
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
he/him 