Skip to content
This repository has been archived by the owner on Dec 24, 2023. It is now read-only.

Commit

Permalink
Fixed bug with imports, pleased Rubocop a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
deathbeam committed May 26, 2016
1 parent 355f64d commit 0d982cf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion lib/spoon/compiler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def each(children, separator)

children.each do |child|
content << subtree(child)
content << ", " unless child.equal? children.last
content << separator unless child.equal? children.last
end

content
Expand Down
14 changes: 7 additions & 7 deletions lib/spoon/util/indent_parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,33 +50,33 @@ def fix_position(source)
NeverMatch.new "Mismatched indentation level"
end

rule (:checkdent) {
dynamic { |source, context|
rule(:checkdent) {
dynamic { |source|
check_indentation(source)
}
}

rule(:indent) {
dynamic { |source, context|
dynamic {
@current > @last ? AlwaysMatch.new : NeverMatch.new("Not an indent")
}
}

rule(:dedent) {
dynamic { |source, context|
dynamic { |source|
@current < @last ? fix_position(source) : NeverMatch.new("Not a dedent")
}
}

rule(:samedent) {
dynamic { |source, context|
dynamic {
@current == @last ? AlwaysMatch.new : NeverMatch.new("Not a samedent")
}
}
end

class AlwaysMatch < Parslet::Atoms::Base
def try(source, context, consume_all)
def try(_, _, _)
succ("")
end
end
Expand All @@ -88,7 +88,7 @@ def initialize(msg = "ignore")
self.msg = msg
end

def try(source, context, consume_all)
def try(source, context, _)
context.err(self, source, msg)
end
end
Expand Down

0 comments on commit 0d982cf

Please sign in to comment.