Skip to content

Commit 93745d4

Browse files
committed
refact: use a ICInstruction dummy interface
This allows defining another IR instruction set
1 parent 245fb10 commit 93745d4

3 files changed

Lines changed: 9 additions & 3 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from enum import StrEnum
2+
3+
4+
class ICInstruction(StrEnum):
5+
pass

src/arch/interface/quad.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@
77

88
from dataclasses import dataclass
99

10-
from src.arch.z80.backend.icinstruction import ICInstruction
1110
from src.symbols.symbol_ import Symbol
1211

12+
from .icinstruction import ICInstruction
13+
1314
__all__ = ("Quad",)
1415

1516

src/arch/z80/backend/icinstruction.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@
55
# See https://www.gnu.org/licenses/agpl-3.0.html for details.
66
# --------------------------------------------------------------------
77

8-
from enum import StrEnum
98
from functools import lru_cache
109
from typing import Any
1110

11+
from src.arch.interface.icinstruction import ICInstruction as ICInstructionInterface
1212
from src.arch.z80.backend.exception import InvalidICError
1313

1414
__all__ = ("ICInstruction",)
1515

1616

1717
# HINT: Do not use Enums here. They cannot be subclassed
18-
class ICInstruction(StrEnum):
18+
class ICInstruction(ICInstructionInterface):
1919
ADDU8 = "addu8"
2020
ADDI8 = "addi8"
2121
ADDI16 = "addi16"

0 commit comments

Comments
 (0)