We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7880294 commit 5ee8d45Copy full SHA for 5ee8d45
lib/parser.rb
@@ -1,7 +1,7 @@
1
class Parser
2
- class A_COMMAND; end
3
- class C_COMMAND; end
4
- class L_COMMAND; end
+ A_COMMAND = Object.new
+ C_COMMAND = Object.new
+ L_COMMAND = Object.new
5
6
def initialize(input)
7
@lines = split_lines(input)
@@ -25,6 +25,15 @@ def command_type
25
end
26
27
28
+ def symbol
29
+ case command_type
30
+ when A_COMMAND
31
+ current[1..-1]
32
+ else
33
+ current[1..-2]
34
+ end
35
36
+
37
private
38
39
attr_reader :lines, :current
0 commit comments