Class: RubyNext::Language::PacoParsers::Comments

Inherits:
Base
  • Object
show all
Defined in:
lib/ruby-next/language/paco_parsers/comments.rb

Instance Method Summary collapse

Methods inherited from Base

#parse

Instance Method Details

#block_commentObject

Matches a Ruby block comment (from ‘=begin` till `=end`)



20
21
22
# File 'lib/ruby-next/language/paco_parsers/comments.rb', line 20

def block_comment
  anything_between(starting_string("=begin"), starting_string("=end"))
end

#defaultObject



7
8
9
10
11
12
# File 'lib/ruby-next/language/paco_parsers/comments.rb', line 7

def default
  alt(
    line_comment,
    block_comment
  )
end

#line_commentObject

Matches a Ruby line comment (from ‘#` till the end of the line)



15
16
17
# File 'lib/ruby-next/language/paco_parsers/comments.rb', line 15

def line_comment
  anything_between(string("#"), end_of_line)
end