code-ruby 2.0.2 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/VERSION +1 -1
- data/lib/code/format.rb +4 -2
- data/lib/code/parser.rb +1113 -6
- data/lib/code-ruby.rb +0 -1
- data/spec/code/node/call_spec.rb +1 -1
- data/spec/code/parser/boolean_spec.rb +1 -1
- data/spec/code/parser/chained_call_spec.rb +1 -1
- data/spec/code/parser/dictionary_spec.rb +1 -1
- data/spec/code/parser/function_spec.rb +1 -1
- data/spec/code/parser/group_spec.rb +1 -1
- data/spec/code/parser/if_modifier_spec.rb +1 -1
- data/spec/code/parser/list_spec.rb +1 -1
- data/spec/code/parser/number_spec.rb +1 -1
- data/spec/code/parser/string_spec.rb +1 -1
- data/spec/code_spec.rb +1 -1
- metadata +1 -42
- data/lib/code/parser/addition.rb +0 -23
- data/lib/code/parser/and_operator.rb +0 -19
- data/lib/code/parser/bitwise_and.rb +0 -23
- data/lib/code/parser/bitwise_or.rb +0 -23
- data/lib/code/parser/boolean.rb +0 -23
- data/lib/code/parser/call.rb +0 -165
- data/lib/code/parser/chained_call.rb +0 -31
- data/lib/code/parser/class.rb +0 -15
- data/lib/code/parser/code.rb +0 -27
- data/lib/code/parser/dictionary.rb +0 -76
- data/lib/code/parser/equal.rb +0 -67
- data/lib/code/parser/equality.rb +0 -42
- data/lib/code/parser/function.rb +0 -135
- data/lib/code/parser/greater.rb +0 -32
- data/lib/code/parser/group.rb +0 -58
- data/lib/code/parser/if.rb +0 -101
- data/lib/code/parser/if_modifier.rb +0 -39
- data/lib/code/parser/label_name.rb +0 -14
- data/lib/code/parser/left_operation.rb +0 -44
- data/lib/code/parser/list.rb +0 -47
- data/lib/code/parser/multiplication.rb +0 -39
- data/lib/code/parser/name.rb +0 -188
- data/lib/code/parser/negation.rb +0 -32
- data/lib/code/parser/not_keyword.rb +0 -29
- data/lib/code/parser/nothing.rb +0 -19
- data/lib/code/parser/number.rb +0 -156
- data/lib/code/parser/or_keyword.rb +0 -27
- data/lib/code/parser/or_operator.rb +0 -19
- data/lib/code/parser/power.rb +0 -19
- data/lib/code/parser/range.rb +0 -19
- data/lib/code/parser/rescue.rb +0 -19
- data/lib/code/parser/right_operation.rb +0 -44
- data/lib/code/parser/shift.rb +0 -23
- data/lib/code/parser/splat.rb +0 -33
- data/lib/code/parser/square_bracket.rb +0 -44
- data/lib/code/parser/statement.rb +0 -11
- data/lib/code/parser/string.rb +0 -85
- data/lib/code/parser/ternary.rb +0 -45
- data/lib/code/parser/unary_minus.rb +0 -33
- data/lib/code/parser/while.rb +0 -81
- data/lib/code/parser/whitespace.rb +0 -51
data/lib/code-ruby.rb
CHANGED
data/spec/code/node/call_spec.rb
CHANGED
data/spec/code_spec.rb
CHANGED
|
@@ -344,6 +344,7 @@ RSpec.describe Code do
|
|
|
344
344
|
["a = 1 a += 1 a", "2"],
|
|
345
345
|
["a = 1 a -= 1 a", "0"],
|
|
346
346
|
["a = 3 a -= 1 if false a", "3"],
|
|
347
|
+
["a = 1 a = - 1 if false a", "1"],
|
|
347
348
|
["a = 3\n(a -= 1) if false\na", "3"],
|
|
348
349
|
["a = 1 a /= 2 a", "0.5"],
|
|
349
350
|
["a = 1 a <<= 1 a", "2"],
|
|
@@ -485,7 +486,6 @@ RSpec.describe Code do
|
|
|
485
486
|
["", ""]
|
|
486
487
|
].each do |input, expected|
|
|
487
488
|
it "#{input} == #{expected}" do
|
|
488
|
-
puts input
|
|
489
489
|
formatted = format_input(input)
|
|
490
490
|
|
|
491
491
|
output = StringIO.new
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: code-ruby
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 3.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Dorian Marié
|
|
@@ -289,47 +289,6 @@ files:
|
|
|
289
289
|
- lib/code/object/time.rb
|
|
290
290
|
- lib/code/object/url.rb
|
|
291
291
|
- lib/code/parser.rb
|
|
292
|
-
- lib/code/parser/addition.rb
|
|
293
|
-
- lib/code/parser/and_operator.rb
|
|
294
|
-
- lib/code/parser/bitwise_and.rb
|
|
295
|
-
- lib/code/parser/bitwise_or.rb
|
|
296
|
-
- lib/code/parser/boolean.rb
|
|
297
|
-
- lib/code/parser/call.rb
|
|
298
|
-
- lib/code/parser/chained_call.rb
|
|
299
|
-
- lib/code/parser/class.rb
|
|
300
|
-
- lib/code/parser/code.rb
|
|
301
|
-
- lib/code/parser/dictionary.rb
|
|
302
|
-
- lib/code/parser/equal.rb
|
|
303
|
-
- lib/code/parser/equality.rb
|
|
304
|
-
- lib/code/parser/function.rb
|
|
305
|
-
- lib/code/parser/greater.rb
|
|
306
|
-
- lib/code/parser/group.rb
|
|
307
|
-
- lib/code/parser/if.rb
|
|
308
|
-
- lib/code/parser/if_modifier.rb
|
|
309
|
-
- lib/code/parser/label_name.rb
|
|
310
|
-
- lib/code/parser/left_operation.rb
|
|
311
|
-
- lib/code/parser/list.rb
|
|
312
|
-
- lib/code/parser/multiplication.rb
|
|
313
|
-
- lib/code/parser/name.rb
|
|
314
|
-
- lib/code/parser/negation.rb
|
|
315
|
-
- lib/code/parser/not_keyword.rb
|
|
316
|
-
- lib/code/parser/nothing.rb
|
|
317
|
-
- lib/code/parser/number.rb
|
|
318
|
-
- lib/code/parser/or_keyword.rb
|
|
319
|
-
- lib/code/parser/or_operator.rb
|
|
320
|
-
- lib/code/parser/power.rb
|
|
321
|
-
- lib/code/parser/range.rb
|
|
322
|
-
- lib/code/parser/rescue.rb
|
|
323
|
-
- lib/code/parser/right_operation.rb
|
|
324
|
-
- lib/code/parser/shift.rb
|
|
325
|
-
- lib/code/parser/splat.rb
|
|
326
|
-
- lib/code/parser/square_bracket.rb
|
|
327
|
-
- lib/code/parser/statement.rb
|
|
328
|
-
- lib/code/parser/string.rb
|
|
329
|
-
- lib/code/parser/ternary.rb
|
|
330
|
-
- lib/code/parser/unary_minus.rb
|
|
331
|
-
- lib/code/parser/while.rb
|
|
332
|
-
- lib/code/parser/whitespace.rb
|
|
333
292
|
- lib/code/type.rb
|
|
334
293
|
- lib/code/type/hash.rb
|
|
335
294
|
- lib/code/type/maybe.rb
|
data/lib/code/parser/addition.rb
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
class Code
|
|
4
|
-
class Parser
|
|
5
|
-
class Addition < LeftOperation
|
|
6
|
-
def statement
|
|
7
|
-
Multiplication
|
|
8
|
-
end
|
|
9
|
-
|
|
10
|
-
def plus
|
|
11
|
-
str("+")
|
|
12
|
-
end
|
|
13
|
-
|
|
14
|
-
def minus
|
|
15
|
-
str("-")
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
def operator
|
|
19
|
-
plus | minus
|
|
20
|
-
end
|
|
21
|
-
end
|
|
22
|
-
end
|
|
23
|
-
end
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
class Code
|
|
4
|
-
class Parser
|
|
5
|
-
class BitwiseAnd < LeftOperation
|
|
6
|
-
def statement
|
|
7
|
-
Shift
|
|
8
|
-
end
|
|
9
|
-
|
|
10
|
-
def whitespace?
|
|
11
|
-
whitespace
|
|
12
|
-
end
|
|
13
|
-
|
|
14
|
-
def ampersand
|
|
15
|
-
str("&")
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
def operator
|
|
19
|
-
ampersand
|
|
20
|
-
end
|
|
21
|
-
end
|
|
22
|
-
end
|
|
23
|
-
end
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
class Code
|
|
4
|
-
class Parser
|
|
5
|
-
class BitwiseOr < LeftOperation
|
|
6
|
-
def statement
|
|
7
|
-
BitwiseAnd
|
|
8
|
-
end
|
|
9
|
-
|
|
10
|
-
def pipe
|
|
11
|
-
str("|")
|
|
12
|
-
end
|
|
13
|
-
|
|
14
|
-
def caret
|
|
15
|
-
str("^")
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
def operator
|
|
19
|
-
pipe | caret
|
|
20
|
-
end
|
|
21
|
-
end
|
|
22
|
-
end
|
|
23
|
-
end
|
data/lib/code/parser/boolean.rb
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
class Code
|
|
4
|
-
class Parser
|
|
5
|
-
class Boolean < Language
|
|
6
|
-
def separator
|
|
7
|
-
Name.new.separator
|
|
8
|
-
end
|
|
9
|
-
|
|
10
|
-
def true_keyword
|
|
11
|
-
str("true") << separator.present
|
|
12
|
-
end
|
|
13
|
-
|
|
14
|
-
def false_keyword
|
|
15
|
-
str("false") << separator.present
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
def root
|
|
19
|
-
(true_keyword | false_keyword).aka(:boolean) | Nothing
|
|
20
|
-
end
|
|
21
|
-
end
|
|
22
|
-
end
|
|
23
|
-
end
|
data/lib/code/parser/call.rb
DELETED
|
@@ -1,165 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
class Code
|
|
4
|
-
class Parser
|
|
5
|
-
class Call < Language
|
|
6
|
-
def name
|
|
7
|
-
Name
|
|
8
|
-
end
|
|
9
|
-
|
|
10
|
-
def label_name
|
|
11
|
-
LabelName
|
|
12
|
-
end
|
|
13
|
-
|
|
14
|
-
def whitespace
|
|
15
|
-
Whitespace
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
def whiltespace_without_newline?
|
|
19
|
-
Whitespace.new.without_newline.maybe
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
def whitespace?
|
|
23
|
-
whitespace.maybe
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
def code
|
|
27
|
-
Code
|
|
28
|
-
end
|
|
29
|
-
|
|
30
|
-
def code_present
|
|
31
|
-
Code.new.present
|
|
32
|
-
end
|
|
33
|
-
|
|
34
|
-
def colon
|
|
35
|
-
str(":")
|
|
36
|
-
end
|
|
37
|
-
|
|
38
|
-
def comma
|
|
39
|
-
str(",")
|
|
40
|
-
end
|
|
41
|
-
|
|
42
|
-
def pipe
|
|
43
|
-
str("|")
|
|
44
|
-
end
|
|
45
|
-
|
|
46
|
-
def equal
|
|
47
|
-
str("=")
|
|
48
|
-
end
|
|
49
|
-
|
|
50
|
-
def opening_curly_bracket
|
|
51
|
-
str("{")
|
|
52
|
-
end
|
|
53
|
-
|
|
54
|
-
def closing_curly_bracket
|
|
55
|
-
str("}")
|
|
56
|
-
end
|
|
57
|
-
|
|
58
|
-
def opening_parenthesis
|
|
59
|
-
str("(")
|
|
60
|
-
end
|
|
61
|
-
|
|
62
|
-
def closing_parenthesis
|
|
63
|
-
str(")")
|
|
64
|
-
end
|
|
65
|
-
|
|
66
|
-
def separator
|
|
67
|
-
Name.new.separator
|
|
68
|
-
end
|
|
69
|
-
|
|
70
|
-
def do_keyword
|
|
71
|
-
str("do") << separator.present
|
|
72
|
-
end
|
|
73
|
-
|
|
74
|
-
def begin_keyword
|
|
75
|
-
str("do") << separator.present
|
|
76
|
-
end
|
|
77
|
-
|
|
78
|
-
def end_keyword
|
|
79
|
-
str("end") << separator.present
|
|
80
|
-
end
|
|
81
|
-
|
|
82
|
-
def asterisk
|
|
83
|
-
str("*")
|
|
84
|
-
end
|
|
85
|
-
|
|
86
|
-
def ampersand
|
|
87
|
-
str("&")
|
|
88
|
-
end
|
|
89
|
-
|
|
90
|
-
def spread_operator
|
|
91
|
-
str("...") | str("..") | str(".")
|
|
92
|
-
end
|
|
93
|
-
|
|
94
|
-
def keyword_argument
|
|
95
|
-
label_name.aka(:name) << whitespace? << colon << code.aka(:value)
|
|
96
|
-
end
|
|
97
|
-
|
|
98
|
-
def regular_argument
|
|
99
|
-
code_present.aka(:value)
|
|
100
|
-
end
|
|
101
|
-
|
|
102
|
-
def argument
|
|
103
|
-
keyword_argument | regular_argument
|
|
104
|
-
end
|
|
105
|
-
|
|
106
|
-
def arguments
|
|
107
|
-
opening_parenthesis.ignore << whitespace? <<
|
|
108
|
-
(
|
|
109
|
-
whitespace? << argument <<
|
|
110
|
-
(whitespace? << comma << whitespace?).maybe
|
|
111
|
-
).repeat << whitespace? << closing_parenthesis.ignore.maybe
|
|
112
|
-
end
|
|
113
|
-
|
|
114
|
-
def prefix
|
|
115
|
-
(asterisk << asterisk).aka(:keyword_splat) |
|
|
116
|
-
asterisk.aka(:regular_splat) | ampersand.aka(:block) |
|
|
117
|
-
spread_operator.aka(:spread)
|
|
118
|
-
end
|
|
119
|
-
|
|
120
|
-
def keyword_parameter
|
|
121
|
-
label_name.aka(:name) << whitespace? << colon.aka(:keyword) <<
|
|
122
|
-
code_present.aka(:default).maybe
|
|
123
|
-
end
|
|
124
|
-
|
|
125
|
-
def regular_parameter
|
|
126
|
-
((prefix.maybe << name.aka(:name)) | prefix) << whitespace? <<
|
|
127
|
-
(equal << whitespace? << code_present.aka(:default)).maybe
|
|
128
|
-
end
|
|
129
|
-
|
|
130
|
-
def parameter
|
|
131
|
-
keyword_parameter | regular_parameter
|
|
132
|
-
end
|
|
133
|
-
|
|
134
|
-
def parameters
|
|
135
|
-
pipe.ignore << whitespace? <<
|
|
136
|
-
(
|
|
137
|
-
whitespace? << parameter <<
|
|
138
|
-
(whitespace? << comma << whitespace?).maybe
|
|
139
|
-
).repeat << (whitespace? << pipe.ignore).maybe
|
|
140
|
-
end
|
|
141
|
-
|
|
142
|
-
def block
|
|
143
|
-
(
|
|
144
|
-
(do_keyword | begin_keyword).ignore << whitespace <<
|
|
145
|
-
parameters.aka(:parameters).maybe << whitespace? <<
|
|
146
|
-
code.aka(:body) << (whitespace? << end_keyword).maybe.ignore
|
|
147
|
-
) |
|
|
148
|
-
(
|
|
149
|
-
opening_curly_bracket.ignore << whitespace? <<
|
|
150
|
-
parameters.aka(:parameters).maybe << whitespace? <<
|
|
151
|
-
code.aka(:body) <<
|
|
152
|
-
(whitespace? << closing_curly_bracket).maybe.ignore
|
|
153
|
-
)
|
|
154
|
-
end
|
|
155
|
-
|
|
156
|
-
def root
|
|
157
|
-
(
|
|
158
|
-
name.aka(:name) <<
|
|
159
|
-
(whiltespace_without_newline? << arguments.aka(:arguments)).maybe <<
|
|
160
|
-
(whiltespace_without_newline? << block.aka(:block)).maybe
|
|
161
|
-
).aka(:call)
|
|
162
|
-
end
|
|
163
|
-
end
|
|
164
|
-
end
|
|
165
|
-
end
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
class Code
|
|
4
|
-
class Parser
|
|
5
|
-
class ChainedCall < LeftOperation
|
|
6
|
-
def statement
|
|
7
|
-
SquareBracket
|
|
8
|
-
end
|
|
9
|
-
|
|
10
|
-
def dot
|
|
11
|
-
str(".")
|
|
12
|
-
end
|
|
13
|
-
|
|
14
|
-
def ampersand
|
|
15
|
-
str("&")
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
def colon
|
|
19
|
-
str(":")
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
def right_statement
|
|
23
|
-
ChainedCall
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
def operator
|
|
27
|
-
dot | (colon << colon) | (ampersand << dot)
|
|
28
|
-
end
|
|
29
|
-
end
|
|
30
|
-
end
|
|
31
|
-
end
|
data/lib/code/parser/class.rb
DELETED
data/lib/code/parser/code.rb
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
class Code
|
|
4
|
-
class Parser
|
|
5
|
-
class Code < Language
|
|
6
|
-
def whitespace
|
|
7
|
-
Whitespace
|
|
8
|
-
end
|
|
9
|
-
|
|
10
|
-
def whitespace?
|
|
11
|
-
whitespace.maybe
|
|
12
|
-
end
|
|
13
|
-
|
|
14
|
-
def statement
|
|
15
|
-
Statement
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
def present
|
|
19
|
-
(whitespace? << statement << whitespace?).repeat(1)
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
def root
|
|
23
|
-
present | whitespace?
|
|
24
|
-
end
|
|
25
|
-
end
|
|
26
|
-
end
|
|
27
|
-
end
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
class Code
|
|
4
|
-
class Parser
|
|
5
|
-
class Dictionary < Language
|
|
6
|
-
def code_present
|
|
7
|
-
Code.new.present
|
|
8
|
-
end
|
|
9
|
-
|
|
10
|
-
def statement
|
|
11
|
-
Statement
|
|
12
|
-
end
|
|
13
|
-
|
|
14
|
-
def name
|
|
15
|
-
Name
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
def label_name
|
|
19
|
-
LabelName
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
def whitespace
|
|
23
|
-
Whitespace
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
def whitespace?
|
|
27
|
-
whitespace.maybe
|
|
28
|
-
end
|
|
29
|
-
|
|
30
|
-
def opening_curly_bracket
|
|
31
|
-
str("{")
|
|
32
|
-
end
|
|
33
|
-
|
|
34
|
-
def closing_curly_bracket
|
|
35
|
-
str("}")
|
|
36
|
-
end
|
|
37
|
-
|
|
38
|
-
def comma
|
|
39
|
-
str(",")
|
|
40
|
-
end
|
|
41
|
-
|
|
42
|
-
def colon
|
|
43
|
-
str(":")
|
|
44
|
-
end
|
|
45
|
-
|
|
46
|
-
def equal
|
|
47
|
-
str("=")
|
|
48
|
-
end
|
|
49
|
-
|
|
50
|
-
def greater
|
|
51
|
-
str(">")
|
|
52
|
-
end
|
|
53
|
-
|
|
54
|
-
def key_value
|
|
55
|
-
(label_name.aka(:name) << colon << code_present.aka(:code).maybe).aka(
|
|
56
|
-
:name_code
|
|
57
|
-
) |
|
|
58
|
-
(
|
|
59
|
-
statement.aka(:statement) << colon << code_present.aka(:code).maybe
|
|
60
|
-
).aka(:statement_code) |
|
|
61
|
-
(
|
|
62
|
-
statement.aka(:statement) << whitespace? << equal << greater <<
|
|
63
|
-
code_present.aka(:code).maybe
|
|
64
|
-
).aka(:statement_code) | code_present.aka(:code)
|
|
65
|
-
end
|
|
66
|
-
|
|
67
|
-
def root
|
|
68
|
-
(
|
|
69
|
-
opening_curly_bracket.ignore << whitespace? <<
|
|
70
|
-
(whitespace? << key_value << (whitespace? << comma).maybe).repeat <<
|
|
71
|
-
(whitespace? << closing_curly_bracket.ignore).maybe
|
|
72
|
-
).aka(:dictionnary) | List
|
|
73
|
-
end
|
|
74
|
-
end
|
|
75
|
-
end
|
|
76
|
-
end
|
data/lib/code/parser/equal.rb
DELETED
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
class Code
|
|
4
|
-
class Parser
|
|
5
|
-
class Equal < RightOperation
|
|
6
|
-
def statement
|
|
7
|
-
Rescue
|
|
8
|
-
end
|
|
9
|
-
|
|
10
|
-
def equal
|
|
11
|
-
str("=")
|
|
12
|
-
end
|
|
13
|
-
|
|
14
|
-
def plus
|
|
15
|
-
str("+")
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
def minus
|
|
19
|
-
str("-")
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
def asterisk
|
|
23
|
-
str("*")
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
def slash
|
|
27
|
-
str("/")
|
|
28
|
-
end
|
|
29
|
-
|
|
30
|
-
def percent
|
|
31
|
-
str("%")
|
|
32
|
-
end
|
|
33
|
-
|
|
34
|
-
def greater
|
|
35
|
-
str(">")
|
|
36
|
-
end
|
|
37
|
-
|
|
38
|
-
def lesser
|
|
39
|
-
str("<")
|
|
40
|
-
end
|
|
41
|
-
|
|
42
|
-
def ampersand
|
|
43
|
-
str("&")
|
|
44
|
-
end
|
|
45
|
-
|
|
46
|
-
def pipe
|
|
47
|
-
str("|")
|
|
48
|
-
end
|
|
49
|
-
|
|
50
|
-
def caret
|
|
51
|
-
str("^")
|
|
52
|
-
end
|
|
53
|
-
|
|
54
|
-
def right_statement
|
|
55
|
-
Statement
|
|
56
|
-
end
|
|
57
|
-
|
|
58
|
-
def operator
|
|
59
|
-
equal | (plus << equal) | (minus << equal) | (asterisk << equal) |
|
|
60
|
-
(slash << equal) | (percent << equal) |
|
|
61
|
-
(greater << greater << equal) | (lesser << lesser << equal) |
|
|
62
|
-
(ampersand << equal) | (pipe << equal) | (caret << equal) |
|
|
63
|
-
(pipe << pipe << equal) | (ampersand << ampersand << equal)
|
|
64
|
-
end
|
|
65
|
-
end
|
|
66
|
-
end
|
|
67
|
-
end
|