 class Styles extends ArrayWrapper
   @itemClass: Style
 
+currentMapping = null
+getMapping = ->
+  ## Returns current `Mapping` object,
+  ## when used at top level of a JS/CS mapping file.
+  currentMapping
+runWithMapping = (mapping, fn) ->
+  ## Runs the specified function `fn` as if it were called
+  ## at the top level of the specified mapping.
+  oldMapping = currentMapping
+  currentMapping = mapping
+  try
+    fn()
+  finally
+    currentMapping = oldMapping
+
 class Mapping extends Input
   constructor: (...args) ->
     super ...args

svgtiler = {
  Tile, unrecognizedTile,
  Mapping, ASCIIMapping, JSMapping, CoffeeMapping,
  Drawing, ASCIIDrawing, DSVDrawing, SSVDrawing, CSVDrawing, TSVDrawing,
  Drawings, XLSXDrawings,
  Style, CSSStyle, StylusStyle,

      #@load eval code
      func = new Function \
        'exports', '__filename', '__dirname', 'svgtiler', 'preact', code
      runWithMapping @, ->
        func @module, _filename, _dirname, svgtiler,
          (if code.includes 'preact' then require 'preact')
      @load @module.default
  walkDeps: (filename) ->
    deps = new Set
    recurse = (modname) =>
