Class: Ibex::IR::UserCodeChunk
- Inherits:
-
Object
- Object
- Ibex::IR::UserCodeChunk
- Defined in:
- lib/ibex/ir/grammar_ir.rb
Overview
One opaque user-code block and the location of its first code line.
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
: String.
-
#location ⇒ Object
readonly
: location.
Instance Method Summary collapse
-
#initialize(code:, location:) ⇒ UserCodeChunk
constructor
A new instance of UserCodeChunk.
- #to_h ⇒ Object
Constructor Details
#initialize(code:, location:) ⇒ UserCodeChunk
Returns a new instance of UserCodeChunk.
148 149 150 151 152 |
# File 'lib/ibex/ir/grammar_ir.rb', line 148 def initialize(code:, location:) @code = code.dup.freeze @location = IR.deep_freeze(location) freeze end |
Instance Attribute Details
#code ⇒ Object (readonly)
: String
144 145 146 |
# File 'lib/ibex/ir/grammar_ir.rb', line 144 def code @code end |
#location ⇒ Object (readonly)
: location
145 146 147 |
# File 'lib/ibex/ir/grammar_ir.rb', line 145 def location @location end |
Instance Method Details
#to_h ⇒ Object
155 156 157 |
# File 'lib/ibex/ir/grammar_ir.rb', line 155 def to_h { code: @code, loc: @location } end |