Class: Code::Parser::Name

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



64
65
66
# File 'lib/code/parser/name.rb', line 64

def ampersand
  str("&")
end

#characterObject



91
92
93
# File 'lib/code/parser/name.rb', line 91

def character
  special_character.absent << any
end

#closing_curly_bracketObject



28
29
30
# File 'lib/code/parser/name.rb', line 28

def closing_curly_bracket
  str("}")
end

#closing_parenthesisObject



44
45
46
# File 'lib/code/parser/name.rb', line 44

def closing_parenthesis
  str(")")
end

#closing_square_bracketObject



36
37
38
# File 'lib/code/parser/name.rb', line 36

def closing_square_bracket
  str("]")
end

#colonObject



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

def colon
  str(":")
end

#commaObject



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

def comma
  str(",")
end

#do_keywordObject



68
69
70
# File 'lib/code/parser/name.rb', line 68

def do_keyword
  str("do")
end

#dotObject



56
57
58
# File 'lib/code/parser/name.rb', line 56

def dot
  str(".")
end

#double_quoteObject



52
53
54
# File 'lib/code/parser/name.rb', line 52

def double_quote
  str('"')
end

#else_keywordObject



80
81
82
# File 'lib/code/parser/name.rb', line 80

def else_keyword
  str("else")
end

#elsif_keywordObject



76
77
78
# File 'lib/code/parser/name.rb', line 76

def elsif_keyword
  str("elsif")
end

#end_keywordObject



72
73
74
# File 'lib/code/parser/name.rb', line 72

def end_keyword
  str("end")
end

#equalObject



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

def equal
  str("=")
end

#newlineObject



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

def newline
  str("\n")
end

#opening_curly_bracketObject



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

def opening_curly_bracket
  str("{")
end

#opening_parenthesisObject



40
41
42
# File 'lib/code/parser/name.rb', line 40

def opening_parenthesis
  str("(")
end

#opening_square_bracketObject



32
33
34
# File 'lib/code/parser/name.rb', line 32

def opening_square_bracket
  str("[")
end

#pipeObject



60
61
62
# File 'lib/code/parser/name.rb', line 60

def pipe
  str("|")
end

#rootObject



95
96
97
98
# File 'lib/code/parser/name.rb', line 95

def root
  do_keyword.absent << end_keyword.absent << elsif_keyword.absent <<
    else_keyword.absent << character.repeat(1)
end

#single_quoteObject



48
49
50
# File 'lib/code/parser/name.rb', line 48

def single_quote
  str("'")
end

#spaceObject



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

def space
  str(" ")
end

#special_characterObject



84
85
86
87
88
89
# File 'lib/code/parser/name.rb', line 84

def special_character
  ampersand | equal | pipe | dot | colon | comma | space | newline |
    opening_curly_bracket | closing_curly_bracket | opening_parenthesis |
    closing_parenthesis | opening_square_bracket |
    closing_square_bracket | single_quote | double_quote
end