This is kinda a weird class. It represents an entry in an argument list / struct body.
| 48 | return name.split('::')[-1] |
| 49 | |
| 50 | class Var(object): |
| 51 | '''This is kinda a weird class. |
| 52 | It represents an entry in an argument list / struct body.''' |
| 53 | def __init__(self, type, name): |
| 54 | self.type = type |
| 55 | self.name = name |
| 56 | |
| 57 | def to_swig(self): |
| 58 | return f'{self.type.to_swig()} {self.name}' |
| 59 | |
| 60 | def to_c(self): |
| 61 | return f'{self.type.to_c()} {self.name}' |
| 62 | |
| 63 | def to_rust(self): |
| 64 | return f'{self.name}: {self.type.to_rust()}' |
| 65 | |
| 66 | def to_python(self): |
| 67 | return self.name |