diff options
| author | Laurenz <laurmaedje@gmail.com> | 2020-01-18 15:58:36 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2020-01-18 15:58:36 +0100 |
| commit | 277f2d2176f5e98305870f90b16af3feae1bb3d1 (patch) | |
| tree | a267216f67ebed87cbf83f021bfb01e9b79feae4 /src/syntax/span.rs | |
| parent | 70878885f5d169f2c5d9e66d3919ee56d5f9f9ca (diff) | |
ColorToken serialization + function fix 🚧
Diffstat (limited to 'src/syntax/span.rs')
| -rw-r--r-- | src/syntax/span.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/syntax/span.rs b/src/syntax/span.rs index 546b3ad6..df9a3520 100644 --- a/src/syntax/span.rs +++ b/src/syntax/span.rs @@ -1,10 +1,11 @@ //! Spans map elements to the part of source code they originate from. use std::fmt::{self, Debug, Display, Formatter}; +use serde::Serialize; /// Annotates a value with the part of the source code it corresponds to. -#[derive(Copy, Clone, Eq, PartialEq, Hash)] +#[derive(Copy, Clone, Eq, PartialEq, Hash, Serialize)] pub struct Spanned<T> { pub v: T, pub span: Span, @@ -45,7 +46,7 @@ impl<T> Debug for Spanned<T> where T: std::fmt::Debug { } /// Describes a slice of source code. -#[derive(Copy, Clone, Eq, PartialEq, Hash)] +#[derive(Copy, Clone, Eq, PartialEq, Hash, Serialize)] pub struct Span { pub start: Position, pub end: Position, @@ -83,7 +84,7 @@ impl Display for Span { debug_display!(Span); /// A line-column position in source code. -#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)] +#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize)] pub struct Position { /// The 0-indexed line (inclusive). pub line: usize, |
