Class: FEEL::StringLiteral

Inherits:
Treetop::Runtime::SyntaxNode
  • Object
show all
Defined in:
lib/feel/nodes.rb

Overview

  1. string literal = ‘“’ , { character – (‘”’ | vertical space) }, ‘“’ ;

Instance Method Summary collapse

Instance Method Details

#eval(context = {}) ⇒ Object



361
362
363
364
365
366
367
368
369
370
371
372
# File 'lib/feel/nodes.rb', line 361

def eval(context={})
  # Collect all characters and process escape sequences
  string_value = chars.elements.map do |char|
    if char.respond_to?(:text_value) && char.text_value.start_with?('\\')
      process_escape_sequence(char.text_value)
    else
      char.text_value
    end
  end.join

  string_value
end