Files
marcsello c0a554ea98
All checks were successful
continuous-integration/drone/push Build is passing
Changed name to command
2021-04-14 17:48:46 +02:00

20 lines
612 B
Python

from plugins import AbstractCommand
from typing import List
from plugin_repository import PluginRepository
import logging
def compile_program(plugin_repository: PluginRepository, program_source: List[dict]) -> List[AbstractCommand]:
logger = logging.getLogger('compiler')
compiled_program = []
for command_source in program_source:
cmd = command_source['command']
args = command_source['args']
logger.debug(f"Compiling: [{cmd}:{args}]")
compiled_program.append(
plugin_repository.get_compiler(cmd).compile(**args)
)
return compiled_program