Sha256: f9b360b83a380bf9d102ab2b8818511f791c3d5b64ad6d2c54f6992cd791572c
Contents?: true
Size: 837 Bytes
Versions: 19
Compression:
Stored size: 837 Bytes
Contents
# frozen_string_literal: true class Code class Parser class List < Language def code Code end def code_present Code.new.present end def whitespace Whitespace end def whitespace? whitespace.maybe end def opening_square_bracket str("[") end def closing_square_bracket str("]") end def comma str(",") end def element (whitespace? << code_present << (whitespace? << comma).maybe) | (whitespace? << code << whitespace? << comma) end def root ( opening_square_bracket.ignore << whitespace? << element.repeat << (whitespace? << closing_square_bracket.ignore).maybe ).aka(:list) | String end end end end
Version data entries
19 entries across 19 versions & 1 rubygems