Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Programmatically generate better method signatures for instruction methods #211

Closed
postmodern opened this issue Mar 18, 2025 · 0 comments
Closed
Assignees
Milestone

Comments

@postmodern
Copy link
Member

postmodern commented Mar 18, 2025

Programmatically generate method signatures with required operand arguments and optional operand arguments for each instruction. This would entail finding the minimum and maximum number of operands for each instruction and building a list of arguments (ex: op1,op2,op3=nil). The generated argument list could be used in both the instructions.rb.erb file for the instruction method and the instruction.rb.erb file for the initialize method.

This will prevent accidentally calling an instruction with the wrong number of arguments.

@postmodern postmodern added this to the 1.0.0 milestone Mar 18, 2025
@postmodern postmodern self-assigned this Mar 18, 2025
@postmodern postmodern moved this from Todo to In Progress in ronin-asm refactor Mar 24, 2025
@github-project-automation github-project-automation bot moved this from In Progress to Done in ronin-asm refactor Mar 24, 2025
postmodern added a commit that referenced this issue Mar 24, 2025
* If an instruction does not accept operand, then do not generate any
  method arguments.
* If an instruction accepts a single operand, then generate a
  `operand` argument.
* If an instruction accepts exactly N operands, then generate
  `operand1,operand2,..,operandN` arguments.
* If an instruction accepts zero or more operands, then generate
  a `*operands` argument.
* If an instruction accepts N or more operands, then generate
  `operand1,operand2,...,*operands` arguments.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

No branches or pull requests

1 participant