oftlisp 0.1.3

A compiler and interpreter for OftLisp, in Rust.
Documentation
use gc::Gc;

use reader::SourceLocation;
use symbol::Symbol;

/// The location a [`Value`](enum.Value.html) originated from. See
/// [`WithLocation`](struct.WithLocation.html).
#[derive(Clone, Debug, Finalize, PartialEq, Trace)]
pub enum Location {
    /// The value did not come from an annotated location.
    None,

    /// The value was read from a file.
    Source(SourceLocation),

    /// The value was constructed by a macro.
    Macro {
        /// The location at which the macro was defined.
        macro_location: Gc<Location>,

        /// The name of the macro.
        macro_name: Symbol,
    },
}

impl Default for Location {
    fn default() -> Location {
        Location::None
    }
}