Sha256: 34556a44f7e69232919faf72935ba410d25fe63c1be75ed8251e76fdae68bcfb
Contents?: true
Size: 634 Bytes
Versions: 15
Compression:
Stored size: 634 Bytes
Contents
# frozen_string_literal: true class Language class Atom class Maybe < Atom def initialize(parent:) @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 parser.buffer = clone.buffer parser.cursor = clone.cursor parser.output = clone.output end def to_s @parent ? "#{@parent}.maybe" : "maybe" end end end end
Version data entries
15 entries across 15 versions & 1 rubygems