Class: Code::Parser::Negation

Inherits:
Language
  • Object
show all
Defined in:
lib/code/parser/negation.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

#exclamation_pointObject



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

def exclamation_point
  str("!")
end

#negationObject



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

def negation
  ::Code::Parser::Negation
end

#operatorObject



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

def operator
  exclamation_point | tilde | plus
end

#plusObject



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

def plus
  str("+")
end

#rootObject



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

def root
  (operator.aka(:operator) << negation.aka(:right)).aka(:negation) |
    ::Code::Parser::Function
end

#tildeObject



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

def tilde
  str("~")
end