esprima-dotnet icon indicating copy to clipboard operation
esprima-dotnet copied to clipboard

Implement convenient ToString() methods for nodes and locations

Open KvanTTT opened this issue 7 years ago • 3 comments

Or use DebuggerDisplay attribute instead. It makes the debug process more clear.

Also, I suggest using the following output line-column based format for Location:

  • [l,c) - if start position equals to the end position.
  • [l,c1..c2) - if start line equals to the end line, but columns are different.
  • [l1..l2,c) - if start line differs from the end, but columns are the same.
  • [l1,c1..l2,c2) - common format.

And the following for index-based (Roslyn-like):

  • [i) - if start position equals to the end position.
  • [i1..i2) - includes the first position but excludes the latest one.

KvanTTT avatar Sep 20 '18 12:09 KvanTTT

I am fine with that. Do you want to create a PR for this?

sebastienros avatar Sep 22 '18 20:09 sebastienros

Yes, I want, but later.

KvanTTT avatar Sep 23 '18 08:09 KvanTTT

What is the reason for using array ranges int[] Range instead of typed ranges like TextSpan Range where TextSpan consist of Start and Length or Start and Stop fields? I think it's more convenient.

KvanTTT avatar Sep 23 '18 17:09 KvanTTT