mirror of https://github.com/t1meshift/js.git
Expose `start` and `end` fields in SourceLocation
parent
6b4865af8d
commit
041f4c31fb
|
@ -180,6 +180,10 @@ class SourceLocation:
|
||||||
self.start = start
|
self.start = start
|
||||||
self.end = end
|
self.end = end
|
||||||
|
|
||||||
|
@property
|
||||||
|
def fields(self):
|
||||||
|
return OrderedDict({"start": self.start, "end": self.end})
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
src = "" if self.source is None else f"{self.source}:"
|
src = "" if self.source is None else f"{self.source}:"
|
||||||
return f"{src}{str(self.start)}"
|
return f"{src}{str(self.start)}"
|
||||||
|
|
Loading…
Reference in New Issue