You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@royale.apache.org by Greg Dove <gr...@gmail.com> on 2019/09/13 23:08:11 UTC

Question about stringifyNode

Josh, I think this is a question more for you...

In terms of source mapping... is the 'stringifyNode' pattern that is used
in some places supported?

For example

s = stringifyNode(myNode); //<-walks and presumably creates mappings like
normal

write("("): //<-- some wrapper around 's' content (could be any arbitrary
length pre-pended for example
s = s.substring(2,s.length()-3); //<--- some manipulation of s
write(")") //<-- something else to wrap the stuff that changed.

I did not look to see if this was somehow supported, so this is just a lazy
question based on my wondering if/how it was. I did not specifically test
output that uses those parts yet.

Re: Question about stringifyNode

Posted by Greg Dove <gr...@gmail.com>.
sorry there is probably a write(s); in the middle there as well :)

On Sat, Sep 14, 2019 at 11:08 AM Greg Dove <gr...@gmail.com> wrote:

> Josh, I think this is a question more for you...
>
> In terms of source mapping... is the 'stringifyNode' pattern that is used
> in some places supported?
>
> For example
>
> s = stringifyNode(myNode); //<-walks and presumably creates mappings like
> normal
>
> write("("): //<-- some wrapper around 's' content (could be any arbitrary
> length pre-pended for example
> s = s.substring(2,s.length()-3); //<--- some manipulation of s
> write(")") //<-- something else to wrap the stuff that changed.
>
> I did not look to see if this was somehow supported, so this is just a
> lazy question based on my wondering if/how it was. I did not specifically
> test output that uses those parts yet.
>
>

Re: Question about stringifyNode

Posted by Greg Dove <gr...@gmail.com>.
Thanks, Yeah I expected it to create mappings. I just wondered if it might
create problems with offsets if the final output does not align with
whatever happened during the original walk. I will investigate further as I
get along with what I am doing.




On Sat, Sep 14, 2019 at 11:20 AM Josh Tynjala <jo...@bowlerhat.dev>
wrote:

> When I was first implementing source maps, I remember running into an issue
> where a use of stringifyNode() was messing them up. I don't remember the
> exact details, but I think I had to shift some of the logic around to get
> the mappings into the correct order. If that's right, then yes,
> stringifyNode() will create mappings.
>
> --
> Josh Tynjala
> Bowler Hat LLC <https://bowlerhat.dev>
>
>
> On Fri, Sep 13, 2019 at 4:08 PM Greg Dove <gr...@gmail.com> wrote:
>
> > Josh, I think this is a question more for you...
> >
> > In terms of source mapping... is the 'stringifyNode' pattern that is used
> > in some places supported?
> >
> > For example
> >
> > s = stringifyNode(myNode); //<-walks and presumably creates mappings like
> > normal
> >
> > write("("): //<-- some wrapper around 's' content (could be any arbitrary
> > length pre-pended for example
> > s = s.substring(2,s.length()-3); //<--- some manipulation of s
> > write(")") //<-- something else to wrap the stuff that changed.
> >
> > I did not look to see if this was somehow supported, so this is just a
> lazy
> > question based on my wondering if/how it was. I did not specifically test
> > output that uses those parts yet.
> >
>

Re: Question about stringifyNode

Posted by Josh Tynjala <jo...@bowlerhat.dev>.
When I was first implementing source maps, I remember running into an issue
where a use of stringifyNode() was messing them up. I don't remember the
exact details, but I think I had to shift some of the logic around to get
the mappings into the correct order. If that's right, then yes,
stringifyNode() will create mappings.

--
Josh Tynjala
Bowler Hat LLC <https://bowlerhat.dev>


On Fri, Sep 13, 2019 at 4:08 PM Greg Dove <gr...@gmail.com> wrote:

> Josh, I think this is a question more for you...
>
> In terms of source mapping... is the 'stringifyNode' pattern that is used
> in some places supported?
>
> For example
>
> s = stringifyNode(myNode); //<-walks and presumably creates mappings like
> normal
>
> write("("): //<-- some wrapper around 's' content (could be any arbitrary
> length pre-pended for example
> s = s.substring(2,s.length()-3); //<--- some manipulation of s
> write(")") //<-- something else to wrap the stuff that changed.
>
> I did not look to see if this was somehow supported, so this is just a lazy
> question based on my wondering if/how it was. I did not specifically test
> output that uses those parts yet.
>