Sha256: 8e45f1d717131c72b4a5ed907e9c7a8fec2b54e4c88d7406d36ad5148ff8e670
Contents?: true
Size: 982 Bytes
Versions: 33
Compression:
Stored size: 982 Bytes
Contents
# frozen_string_literal: true class Code class Parser class Whitespace < Language def space str(" ") end def newline str("\n") | str("\r") end def hashtag str("#") end def slash str("/") end def asterisk str("*") end def hash_comment hashtag << (newline.absent << any).repeat << newline.maybe end def double_slash_comment slash << slash << (newline.absent << any).repeat << newline.maybe end def multi_line_comment slash << asterisk << ((asterisk << slash).absent << any).repeat << asterisk.maybe << slash.maybe end def without_newline (space | multi_line_comment).repeat(1).ignore end def root ( space | newline | hash_comment | double_slash_comment | multi_line_comment ).repeat(1).ignore | any.absent end end end end
Version data entries
33 entries across 33 versions & 1 rubygems