 class ASCIIMapping extends Mapping
   @title: "ASCII mapping file"
   @help: "Each line is <symbol-name><space><raw SVG or filename.svg>"
-  @parse: (data) ->
+  parse: (data) ->
     map = {}
     for line in splitIntoLines data
       separator = whitespace.exec line


class Drawings extends Input
  @filenameSeparator = '_'
  constructor: (@drawings) ->
    super()
  @load: (datas) ->
    new @ (
      for data in datas
        drawing = Drawing.load data
        drawing.subname = data.subname
        drawing
    )
  writeSVG: (mappings, filename) ->
    for drawing in @drawings
      drawing.writeSVG mappings,

class Input
  @encoding: 'utf8'
  @parseFile: (filename) ->
    ## Generic method to parse file once we're already in the right class.
    input = new @
    input.filename = filename
    input.parse fs.readFileSync filename,
      encoding: @encoding
    input
  @recognize: (filename) ->
    ## Recognize type of file and call corresponding class's `parseFile`.
    extension = extensionOf filename
    if extension of extensionMap
      extensionMap[extension].parseFile filename
