Sha256: 130e139eeb4830d79ac18ac3720f143749b5297c64e0ba1f2bbe46dc445af47e
Contents?: true
Size: 955 Bytes
Versions: 19
Compression:
Stored size: 955 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) end def root ( space | newline | hash_comment | double_slash_comment | multi_line_comment ).repeat(1) end end end end
Version data entries
19 entries across 19 versions & 1 rubygems