cclang/src/Interpreter/Utils.py

20 lines
447 B
Python

from termcolor import colored
from Interpreter.Repo import Repo
class Utils:
def __init__(self, repo: Repo) -> None:
self.__repo = repo
def input(self, prefix: str) -> str:
return input(prefix)
def output(self, text: str) -> None:
print(f'-> {text}')
def error(self) -> None:
if self.__repo is not None:
print(colored(f'{self.__repo.error.code}: {self.__repo.error.msg}', 'red'))