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



375
376
377
378
379
380
381
382
383
384
385
386
# File 'lib/feel/nodes.rb', line 375

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