Permalink
Browse files

simplifies a couple of regexps

  • Loading branch information...
1 parent 38dd4ee commit 01c50c6d47b173fba1ea8222b128a6792387efbc @fxn fxn committed Feb 14, 2012
Showing with 2 additions and 2 deletions.
  1. +1 −1 lib/journey/gtg/simulator.rb
  2. +1 −1 lib/journey/nfa/simulator.rb
@@ -21,7 +21,7 @@ def simulate string
input = StringScanner.new string
state = [0]
until input.eos?
- sym = input.scan(/[\/\.\?]|[^\/\.\?]+/)
+ sym = input.scan(%r([/.?]|[^/.?]+))
state = tt.move(state, sym)
end
@@ -21,7 +21,7 @@ def simulate string
input = StringScanner.new string
state = tt.eclosure 0
until input.eos?
- sym = input.scan(/[\/\.\?]|[^\/\.\?]+/)
+ sym = input.scan(%r([/.?]|[^/.?]+))
# FIXME: tt.eclosure is not needed for the GTG
state = tt.eclosure tt.move(state, sym)

0 comments on commit 01c50c6

Please sign in to comment.