adds mom while
much like the if, difference will show later in the jump arrangement
This commit is contained in:
@ -24,6 +24,7 @@ end
|
||||
|
||||
require_relative "simple_call"
|
||||
require_relative "if_statement"
|
||||
require_relative "while_statement"
|
||||
require_relative "truth_check"
|
||||
require_relative "jump"
|
||||
require_relative "slot_load"
|
||||
|
14
lib/mom/while_statement.rb
Normal file
14
lib/mom/while_statement.rb
Normal file
@ -0,0 +1,14 @@
|
||||
|
||||
module Mom
|
||||
class WhileStatement < Instruction
|
||||
attr_reader :condition , :statements
|
||||
|
||||
attr_accessor :hoisted
|
||||
|
||||
def initialize( cond , statements)
|
||||
@condition = cond
|
||||
@statements = statements
|
||||
end
|
||||
end
|
||||
|
||||
end
|
Reference in New Issue
Block a user