Add SpanException and SpanFormatException classes to source_maps.

It's often useful to associate source range information with an
exception in a way that will get printed along with that exception but
can be pulled out and manipulated directly. It's especially useful if
there's a common superclass/interface for doing so that can be shared
across packages. This adds that superclass.

R=sigmund@google.com

Review URL: https://codereview.chromium.org//348493004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart/pkg/source_maps@37509 260f80e4-7a28-3924-810f-c04153c831b5
3 files changed
tree: 26f2ed88d5e0c02c3e6503cb02b02fcb0b2eea7e
  1. lib/
  2. test/
  3. CHANGELOG.md
  4. LICENSE
  5. pubspec.yaml
  6. README.md
README.md

Source Maps

This project implements a Dart pub package to work with source maps. The implementation is based on the source map version 3 spec which was originated from the Closure Compiler and has been implemented in Chrome and Firefox.

In this package we provide:

  • Data types defining file locations and spans: these are not part of the original source map specification. These data types are great for tracking source locations on source maps, but they can also be used by tools to reporting useful error messages that include on source locations.
  • A builder that creates a source map programatically and produces the encoded source map format.
  • A parser that reads the source map format and provides APIs to read the mapping information.

Some upcoming features we are planning to add to this package are:

  • A printer that lets you generate code, but record source map information in the process.
  • A tool that can compose source maps together. This would be useful for instance, if you have 2 tools that produce source maps and you call one with the result of the other.