Sha256: 3e4d19b543e1cae24e150ffabeff46caaeb846a5861181237e4cecf6db60e6e8
Contents?: true
Size: 726 Bytes
Versions: 8
Compression:
Stored size: 726 Bytes
Contents
# frozen_string_literal: true # Released under the MIT License. # Copyright, 2020, by Samuel Williams. require_relative '../../segment' module Decode module Language module Ruby # A Ruby specific code segment. class Segment < Decode::Segment def initialize(comments, language, node, **options) super(comments, language, **options) @node = node @expression = node.location.expression end # The parser syntax tree node. attr :node def expand(node) @expression = @expression.join(node.location.expression) end # The source code trailing the comments. # @returns [String | nil] def code @expression.source end end end end end
Version data entries
8 entries across 8 versions & 1 rubygems