1# DExTer : Debugging Experience Tester 2# ~~~~~~ ~ ~~ ~ ~~ 3# 4# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 5# See https://llvm.org/LICENSE.txt for license information. 6# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 7"""Command used to give a line in a test a named psuedonym. Every DexLabel has 8 a line number and Label string component. 9""" 10 11from dex.command.CommandBase import CommandBase 12 13 14class DexLabel(CommandBase): 15 def __init__(self, label): 16 17 if not isinstance(label, str): 18 raise TypeError('invalid argument type') 19 20 self._label = label 21 super(DexLabel, self).__init__() 22 23 def get_as_pair(self): 24 return (self._label, self.lineno) 25 26 @staticmethod 27 def get_name(): 28 return __class__.__name__ 29 30 def eval(self): 31 return self._label 32