lib/chusaku/parser.rb in chusaku-0.6.0 vs lib/chusaku/parser.rb in chusaku-0.6.1
- old
+ new
@@ -1,7 +1,5 @@
-# frozen_string_literal: true
-
module Chusaku
# Handles parsing a file and groups its lines into categories.
module Parser
# Primary method to call.
#
@@ -59,11 +57,11 @@
end
end
# Push the last group onto the array and return.
groups.push(group)
- { content: content, groups: groups }
+ {content: content, groups: groups}
end
# Given a line and actions, returns the line's type.
#
# A type can be one of:
@@ -83,14 +81,14 @@
def self.parse_line(line:, actions:)
comment_match = /^\s*#.*$/.match(line)
def_match = /^\s*def\s+(\w*)\s*\w*.*$/.match(line)
if !comment_match.nil?
- { type: :comment, body: line, action: nil }
+ {type: :comment, body: line, action: nil}
elsif !def_match.nil? && actions.include?(def_match[1])
- { type: :action, body: line, action: def_match[1] }
+ {type: :action, body: line, action: def_match[1]}
else
- { type: :code, body: line, action: nil }
+ {type: :code, body: line, action: nil}
end
end
end
end