 class BaseEngine
   constructor: (options) ->
     extend this, options
+    # TODO(philc): Remove this implicit array weirdness. Just make child classes define this an array.
     @regexps = [ @regexps ] if "string" == typeof @regexps
     @regexps = @regexps.map (regexp) -> new RegExp regexp
 

# Several Google completion engines package responses as XML. This parses such XML.
class GoogleXMLBaseEngine extends BaseEngine
  parse: (xhr) ->
    for suggestion in xhr.responseXML.getElementsByTagName "suggestion"
      continue unless suggestion = suggestion.getAttribute "data"
      suggestion

class Google extends GoogleXMLBaseEngine
  constructor: () ->

          """

  parse: (xhr) ->
    Array.from(super(xhr))
    .filter((suggestion) => suggestion.startsWith(@prefix))
    .map((suggestion) => suggestion[@prefix.length..])

class Youtube extends GoogleXMLBaseEngine
  constructor: ->
