Class: Code::Parser::Splat

Inherits:
Language show all
Defined in:
lib/code/parser/splat.rb

Instance Method Summary collapse

Methods inherited from Language

<<, >>, absent, aka, #any, ignore, #inspect, maybe, parse, #parse, repeat, #str, then, #to_s, |

Instance Method Details

#ampersandObject



20
21
22
# File 'lib/code/parser/splat.rb', line 20

def ampersand
  str("&")
end

#rootObject



24
25
26
27
28
# File 'lib/code/parser/splat.rb', line 24

def root
  (ampersand.aka(:operator) << whitespace? << splat.aka(:right)).aka(
    :splat
  ) | statement
end

#splatObject



8
9
10
# File 'lib/code/parser/splat.rb', line 8

def splat
  ::Code::Parser::Splat
end

#statementObject



4
5
6
# File 'lib/code/parser/splat.rb', line 4

def statement
  ::Code::Parser::Class
end

#whitespaceObject



12
13
14
# File 'lib/code/parser/splat.rb', line 12

def whitespace
  ::Code::Parser::Whitespace
end

#whitespace?Boolean

Returns:



16
17
18
# File 'lib/code/parser/splat.rb', line 16

def whitespace?
  whitespace.maybe
end