Skip to content

Commit

Permalink
add interface for to_elf
Browse files Browse the repository at this point in the history
  • Loading branch information
katsyoshi committed Jul 30, 2023
1 parent 35cb1a7 commit e0c1cb4
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
17 changes: 17 additions & 0 deletions lib/vaporware/compiler/assemble.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# frozen_string_literal: true

module Vaporware
class Compiler::Assemble
attr_reader :input, :output
def self.compile!(input, output = File.basename(input, ".*")) = new(input, output).compile

def initialize(input, output = File.basename(input, ".*"))
@input, @output = input, output
@target_file = File.open(output, "wb")
end

def compile(compile_options = [])
self
end
end
end
13 changes: 13 additions & 0 deletions sig/vaporware.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,19 @@ module Vaporware
@generator: Vaporware::Compiler::Generator
# instance methods
def compile: (?compiler: String, ?compiler_options: Array[String]) -> nil

class Assemble
@input: String
@output: String
@target_file: File
# class methods
def self.compile!: (String, ?String) -> Vaporware::Compiler::Assemble
def initialize: (String, ?String) -> untyped

# instance methods
def compile: (?Array[String]) -> self
end

class Generator
REGISTER: Array[String]
# instance variables
Expand Down

0 comments on commit e0c1cb4

Please sign in to comment.