Sha256: 0e849154e581b804bca93d14af06d73db841310b79a2b974118e4a9f72ed73f3

Contents?: true

Size: 635 Bytes

Versions: 1

Compression:

Stored size: 635 Bytes

Contents

=begin
Copyright 2011 Shane Brinkman-Davis
See README for licence information.
http://babel-bridge.rubyforge.org/
=end

module BabelBridge

# used when a PatternElement matchs the empty string
# Example: when the PatternElement is optional and doesn't match
# not subclassed
class EmptyNode < Node
  def inspect(options={})
    "EmptyNode" unless options[:simple]
  end

  # EmptyNodes should always match at the beginning of the whitespace range
  def node_init(parent_or_parser)
    super
    self.offset = preceding_whitespace_range.first
    self.preceding_whitespace_range = match_range
  end

  def matches; [self]; end

end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
babel_bridge-0.4.0 lib/nodes/empty_node.rb