-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17 from katsyoshi/refactoring-rbs-file
Refactoring rbs file
- Loading branch information
Showing
6 changed files
with
51 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,5 @@ gems: | |
ignore: true | ||
- name: vaporware | ||
ignore: true | ||
- name: parser | ||
- name: set | ||
ignore: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
class Vaporware::Compiler | ||
# class methods | ||
def self.compile: (String, ?compiler: String, ?dest: String, ?debug: bool, ?compiler_options: Array[String], ?shared: bool) -> void | ||
def initialize: (String, ?_precompile: String, ?debug: bool, ?shared: bool) -> void | ||
|
||
@generator: Vaporware::Compiler::Generator | ||
# instance methods | ||
def compile: (?compiler: String, ?compiler_options: Array[String]) -> void | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
class Vaporware::Compiler::Generator | ||
REGISTER: Array[String] | ||
|
||
# attr_accessor and define instance variables | ||
@main: bool | ||
attr_accessor main (): bool | ||
|
||
# attr_reader for instance variables | ||
attr_reader debug: bool | ||
attr_reader doned: Set[Symbol] | ||
attr_reader defined_methods: Set[Symbol] | ||
attr_reader defined_variables: Set[Symbol] | ||
attr_reader precompile: String | ||
attr_reader seq: Integer | ||
attr_reader shared: bool | ||
|
||
# temporarily using untyped types since parser.gem's rbs information is unchecked. | ||
attr_reader ast: RubyVM::AbstractSyntaxTree::Node | ||
|
||
# class methods | ||
def initialize: (String, precompile: String, debug: bool, shared: bool) -> void | ||
|
||
# instance private methods | ||
def already_build_methods?: -> bool | ||
def call_compiler: (?output: String, ?compiler: String, ?compiler_options: Array[String]) -> void | ||
def call_method: (RubyVM::AbstractSyntaxTree::Node, File, bool) -> void | ||
def comp: (String, File) -> void | ||
def compile_shared_option: () -> Array[String] | ||
def define_method_prologue: (RubyVM::AbstractSyntaxTree::Node, File) -> void | ||
def epilogue: (File) -> void | ||
def lvar: (Symbol, File) -> void | ||
def lvar_offset: (Symbol | nil) -> Integer | ||
def method: (Symbol, RubyVM::AbstractSyntaxTree::Node, File) -> void | ||
def prologue: (RubyVM::AbstractSyntaxTree::Node, File) -> void | ||
def prologue_methods: (File) -> void | ||
def register_var_and_method: (RubyVM::AbstractSyntaxTree::Node) -> void | ||
def ret: (File) -> void | ||
def to_asm: (RubyVM::AbstractSyntaxTree::Node, File, ?bool) -> void | ||
def variable_or_method?: (Symbol) -> bool | ||
end |