Skip to content

Commit

Permalink
[operators/operands] code style fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
0exp committed Jun 24, 2019
1 parent e23f866 commit 0070603
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/jaina/parser/code_converter/to_postfix_form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def call
#
# @api private
# @since 0.1.0
def to_postfix_form
def to_postfix_form # rubocop:disable Metrics/AbcSize
final_expression = []
structure_operators = []
token_series = tokens.map(&:dup)
Expand Down
10 changes: 5 additions & 5 deletions lib/jaina/parser/tokenizer/token_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def initialize(raw_token)
# @api private
# @since 0.4.0
def build
сheck_for_correctness!
check_for_correctness!

# NOTE:
# format: token [ attr1, attr2, attr3 ]
Expand All @@ -63,7 +63,7 @@ def build
# CLOSING BRAKET => parts[-1]
# ARGUMENTS => parts[2..-2]
token = parts[0]
arguments = (parts.count == 0) ? [] : parts[2..-2]
arguments = parts.count.zero? ? [] : parts[2..-2]
arguments = ArgumentTypeCaster.cast(*arguments)

Jaina::Parser::Tokenizer::Token.new(raw_token, token, *arguments)
Expand All @@ -87,7 +87,7 @@ def build
#
# @api private
# @since 0.4.0
def сheck_for_correctness!
def check_for_correctness! # rubocop:disable Metrics/AbcSize
# NOTE: parts array contains a token only
return if parts.count == 1

Expand All @@ -105,12 +105,11 @@ def сheck_for_correctness!
# CLOSING BRAKET => parts[-1]
# ARGUMENTS => parts[2..-2]

potential_token = parts[0]
opening_corner = parts[1]
closing_corner = parts[-1]
arguments = parts[2..-2]

# rubocop:disable # rubocop:disable Metrics/LineLength
# rubocop:disable Metrics/LineLength
if arguments.include?(OPENING_ATTRIBUTE_GROUP_SYMBOL) || opening_corner != OPENING_ATTRIBUTE_GROUP_SYMBOL
raise(
IncorrectTokenDefinitionError,
Expand All @@ -124,5 +123,6 @@ def сheck_for_correctness!
"Incorrect token definition `#{raw_token}`: `]` should be the last arguments closing symbol."
)
end
# rubocop:enable Metrics/LineLength
end
end

0 comments on commit 0070603

Please sign in to comment.