Skip to content

Commit

Permalink
fixes to SpanVal
Browse files Browse the repository at this point in the history
  • Loading branch information
EasyArray committed Mar 19, 2022
1 parent bfd2e4d commit d5c4620
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions phosphorus/phival.py
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,8 @@ def type(self):

class SpanVal(PhiVal): #Todo inherit from span? Messes up printing?
def __init__(self, span=Span()):
if not isinstance(span, Span):
span = Span.parse(span)
self.span = span

def type(self):
Expand All @@ -467,6 +469,9 @@ def semtype(self):
def __repr__(self):
return str(self.span)
#return repr(self.span)

def __bool__(self):
return bool(self.span)

def debugstr(self):
return self.span.debugstr()
Expand Down

0 comments on commit d5c4620

Please sign in to comment.