Class: BitClust::Preprocessor::State

Inherits:
Object
  • Object
show all
Defined in:
lib/bitclust/preprocessor.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(is_processing, label) ⇒ State

Returns a new instance of State.



284
285
286
287
# File 'lib/bitclust/preprocessor.rb', line 284

def initialize(is_processing, label)
  @is_processing = is_processing
  @label = label
end

Instance Attribute Details

#currentObject (readonly)

Returns the value of attribute current.



282
283
284
# File 'lib/bitclust/preprocessor.rb', line 282

def current
  @current
end

Instance Method Details

#next(is_processing, label) ⇒ Object



289
290
291
# File 'lib/bitclust/preprocessor.rb', line 289

def next(is_processing, label)
  State.new(@is_processing && is_processing, label)
end

#processing?Boolean

Returns:

  • (Boolean)


297
298
299
# File 'lib/bitclust/preprocessor.rb', line 297

def processing?
  @is_processing
end

#samplecode?Boolean

Returns:

  • (Boolean)


301
302
303
# File 'lib/bitclust/preprocessor.rb', line 301

def samplecode?
  @label == :samplecode
end

#toplevel?Boolean

Returns:

  • (Boolean)


293
294
295
# File 'lib/bitclust/preprocessor.rb', line 293

def toplevel?
  @label == :toplevel
end