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.



321
322
323
324
# File 'lib/bitclust/preprocessor.rb', line 321

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

Instance Attribute Details

#currentObject (readonly)

Returns the value of attribute current.



319
320
321
# File 'lib/bitclust/preprocessor.rb', line 319

def current
  @current
end

Instance Method Details

#next(is_processing, label) ⇒ Object



326
327
328
# File 'lib/bitclust/preprocessor.rb', line 326

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

#processing?Boolean

Returns:

  • (Boolean)


334
335
336
# File 'lib/bitclust/preprocessor.rb', line 334

def processing?
  @is_processing
end

#samplecode?Boolean

Returns:

  • (Boolean)


338
339
340
# File 'lib/bitclust/preprocessor.rb', line 338

def samplecode?
  @label == :samplecode
end

#toplevel?Boolean

Returns:

  • (Boolean)


330
331
332
# File 'lib/bitclust/preprocessor.rb', line 330

def toplevel?
  @label == :toplevel
end