Sha256: 5b96b089a66d48da58be39409610591fdc7b870f6fa6f744705a05ea12fa5ac2

Contents?: true

Size: 584 Bytes

Versions: 15

Compression:

Stored size: 584 Bytes

Contents

# frozen_string_literal: true

class Language
  class Atom
    class Absent < Atom
      def initialize(parent: nil)
        @parent = parent
      end

      def parse(parser)
        clone =
          Parser.new(
            root: self,
            input: parser.input,
            cursor: parser.cursor,
            buffer: parser.buffer
          )
        @parent&.parse(clone)
      rescue Parser::Interuption
      else
        raise Parser::Interuption.new(parser, self)
      end

      def to_s
        @parent ? "(#{@parent}).absent" : "absent"
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
language-ruby-1.1.2 lib/language/atom/absent.rb
language-ruby-1.1.0 lib/language/atom/absent.rb
language-ruby-1.0.1 lib/language/atom/absent.rb
language-ruby-1.0.0 lib/language/atom/absent.rb
language-ruby-0.9.3 lib/language/atom/absent.rb
language-ruby-0.9.2 lib/language/atom/absent.rb
language-ruby-0.9.0 lib/language/atom/absent.rb
language-ruby-0.8.4 lib/language/atom/absent.rb
language-ruby-0.8.3 lib/language/atom/absent.rb
language-ruby-0.8.2 lib/language/atom/absent.rb
language-ruby-0.8.1 lib/language/atom/absent.rb
language-ruby-0.8.0 lib/language/atom/absent.rb
language-ruby-0.7.0 lib/language/atom/absent.rb
language-ruby-0.6.2 lib/language/atom/absent.rb
language-ruby-0.6.1 lib/language/atom/absent.rb