diff --git a/vyper/ast/nodes.py b/vyper/ast/nodes.py index cce60561a8..b4042c75a7 100644 --- a/vyper/ast/nodes.py +++ b/vyper/ast/nodes.py @@ -788,11 +788,6 @@ class Num(Constant): # inherited class for all numeric constant node types __slots__ = () - @property - def n(self): - # TODO phase out use of Num.n and remove this - return self.value - def validate(self): if self.value < SizeLimits.MIN_INT256: raise OverflowException("Value is below lower bound for all numeric types", self) @@ -894,11 +889,6 @@ def validate(self): if ord(c) >= 256: raise InvalidLiteral(f"'{c}' is not an allowed string literal character", self) - @property - def s(self): - # TODO phase out use of Str.s and remove this - return self.value - class Bytes(Constant): __slots__ = () diff --git a/vyper/codegen/expr.py b/vyper/codegen/expr.py index 69ffb2bfd6..49c0714110 100644 --- a/vyper/codegen/expr.py +++ b/vyper/codegen/expr.py @@ -89,7 +89,7 @@ def __init__(self, node, context, is_stmt=False): def parse_Int(self): typ = self.expr._metadata["type"] - return IRnode.from_list(self.expr.n, typ=typ) + return IRnode.from_list(self.expr.value, typ=typ) def parse_Decimal(self): val = self.expr.value * DECIMAL_DIVISOR @@ -133,8 +133,8 @@ def parse_Str(self): # Byte literals def parse_Bytes(self): - bytez = self.expr.s - bytez_length = len(self.expr.s) + bytez = self.expr.value + bytez_length = len(self.expr.value) typ = BytesT(bytez_length) return self._make_bytelike(typ, bytez, bytez_length) @@ -345,7 +345,7 @@ def parse_Subscript(self): elif is_tuple_like(sub.typ): # should we annotate expr.slice in the frontend with the # folded value instead of calling reduced() here? - index = self.expr.slice.reduced().n + index = self.expr.slice.reduced().value # note: this check should also happen in get_element_ptr if not 0 <= index < len(sub.typ.member_types): raise TypeCheckFailure("unreachable")