Class: Strling::Core::IRClassLiteral

Inherits:
IRClassItem show all
Defined in:
lib/strling/core/ir.rb

Overview

Represents a literal character in a character class in the IR.

Matches the exact character.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(ch) ⇒ IRClassLiteral

Returns a new instance of IRClassLiteral.

Parameters:

  • ch (String)

    The character



154
155
156
# File 'lib/strling/core/ir.rb', line 154

def initialize(ch)
  @ch = ch
end

Instance Attribute Details

#chString

Returns The character.

Returns:

  • (String)

    The character



151
152
153
# File 'lib/strling/core/ir.rb', line 151

def ch
  @ch
end

Instance Method Details

#to_dictObject



158
159
160
# File 'lib/strling/core/ir.rb', line 158

def to_dict
  { 'ir' => 'Char', 'char' => ch }
end