Skip to content
Snippets Groups Projects
Commit 0b14e421 authored by Frederik Hennig's avatar Frederik Hennig
Browse files

remove now-unnecessary functions

parent 04fffe91
No related merge requests found
Pipeline #63214 failed with stages
in 3 minutes and 22 seconds
......@@ -5,11 +5,11 @@ exclude = "src/pystencils/old"
[mypy-pystencils.*]
ignore_errors=true
[mypy-pystencils.backend.*]
ignore_errors = False
[mypy-setuptools.*]
ignore_missing_imports=true
[mypy-appdirs.*]
ignore_missing_imports=true
[mypy-pystencils.backend.*]
ignore_errors = False
......@@ -19,8 +19,6 @@ from typing import Any, TYPE_CHECKING
from abc import ABC
from enum import Enum
from .types import PsAbstractType
if TYPE_CHECKING:
from .ast.expressions import PsExpression
......@@ -97,43 +95,3 @@ class PsMathFunction(PsFunction):
@property
def arg_count(self) -> int:
return self._func.arg_count
class Deref(PsFunction):
"""Dereferences a pointer."""
def __init__(self):
super().__init__("deref", 1)
deref = Deref()
class AddressOf(PsFunction):
"""Take the address of an object"""
def __init__(self):
super().__init__("address_of", 1)
address_of = AddressOf()
class Cast(PsFunction):
"""An unsafe C-style type cast"""
def __init__(self, target_type: PsAbstractType):
super().__init__("cast", 1)
self._target_type = target_type
@property
def arg_count(self) -> int:
return 1
@property
def target_type(self) -> PsAbstractType:
return self._target_type
def cast(target_type: PsAbstractType, arg: PsExpression):
return Cast(target_type)(arg)
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment