 
   # this code was stolen and adapted from Djinn, which 
   # is why it looks so hideous.  Not that Djinn is hideous,
-  # just that you're seeing it out of context.
+  # just that you're seeing it out of context. It's a messy,
+  # arguably perverted, variant of the famous Thompson algorithm for
+  # testing NFA acceptance.
+  # See http://swtch.com/~rsc/regexp/regexp1.html, specifically the
+  # section with heading "Implementation: Simulating the NFA"
   match_request_sequence: (sequence) ->
     stage = @matchers
     current = [new MatchTracker(null, stage)]

      matches.push(out)
    matches

class MatchTracker
  constructor: (@parent, @stage, @type, @val) ->


      results
    else
      matches = @compile_matches(results)
      # first match, obviously. compile_matches is a good place
      # to sort the matches based on whatever criteria we decide
      # to use.
      match = matches[0]
      # Move the payload properties into the main object. HACKY.
      payload = match.payload
      delete match.payload
      for key, value of payload
