Permalink
Browse files

small logic error in refactor fixed

  • Loading branch information...
bglusman
bglusman committed Jan 25, 2012
1 parent 4ce974f commit 545a98226a67e255683a0fab8436bbe8f0e959b5
Showing with 1 addition and 2 deletions.
  1. +1 −2 lib/outlaw/rule.rb
View
@@ -1,7 +1,6 @@
module Outlaw
class Rule
NoDetectionBlockProvided = Class.new(StandardError)
UnhandledParse = Class.new(StandardError)
attr_reader :message, :restriction
def initialize(message, restriction, &detection_block)
raise NoDetectionBlockProvided unless detection_block
@@ -41,7 +40,7 @@ def match_token?(code, part, parameter)
when Regexp
match = true if code.match(part)
when Symbol
raise UnhandledParse unless param_type_equal(token_type(code), part)
return false unless param_type_equal(token_type(code), part)
#check count on first and count down subseq matches
if parameter.first.nil? #history of parameter match if any
parameter[0] = code

0 comments on commit 545a982

Please sign in to comment.