Skip to content

Commit

Permalink
Rule class doesn't need to check for initialization of id variable on…
Browse files Browse the repository at this point in the history
… each method invocation
  • Loading branch information
mjackson committed May 13, 2010
1 parent e69c08f commit e455821
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/citrus.rb
Expand Up @@ -2,7 +2,7 @@
# elegance and expressiveness of the language with the simplicity and power of
# parsing expression grammars.
#
# http://mjijackson.com/citrus
# http://github.com/mjijackson/citrus
module Citrus
VERSION = [1, 0, 0]

Expand Down Expand Up @@ -341,10 +341,11 @@ def self.create(obj)
end
end

@uniq_id = 0

# Generates a new rule id.
def self.new_id
@id ||= 0
@id += 1
@uniq_id += 1
end

# The grammar this rule belongs to.
Expand Down

0 comments on commit e455821

Please sign in to comment.