Sha256: 3d9d6db4845fa568a670b64c5ed3bb8e7b00f9fd317bc39d8f83d0f52f5010bd
Contents?: true
Size: 1.63 KB
Versions: 49
Compression:
Stored size: 1.63 KB
Contents
# frozen_string_literal: true class Code class Parser class String < Language def code Code end def name Name end def single_quote str("'") end def double_quote str('"') end def backslash str("\\") end def opening_curly_bracket str("{") end def closing_curly_bracket str("}") end def colon str(":") end def code_part opening_curly_bracket << code << closing_curly_bracket.maybe end def single_quoted_text_part ( backslash.ignore << opening_curly_bracket | backslash.ignore << single_quote | single_quote.absent << opening_curly_bracket.absent << any ).repeat(1) end def double_quoted_text_part ( backslash.ignore << opening_curly_bracket | backslash.ignore << double_quote | double_quote.absent << opening_curly_bracket.absent << any ).repeat(1) end def single_quoted_string single_quote.ignore << ( code_part.aka(:code) | single_quoted_text_part.aka(:text) ).repeat << single_quote.ignore.maybe end def double_quoted_string double_quote.ignore << ( code_part.aka(:code) | double_quoted_text_part.aka(:text) ).repeat << double_quote.ignore.maybe end def symbol (colon.ignore << name).aka(:text).repeat(1, 1) end def root (single_quoted_string | double_quoted_string | symbol).aka(:string) | Number end end end end
Version data entries
49 entries across 49 versions & 1 rubygems