microsoft/qdk
Publicmirrored from https://github.com/microsoft/qdkAvailable
source/compiler/qsc_eval/src/error.rs
19lines · modeblame
e7cc503bMine Starks2 years ago | 1 | // Copyright (c) Microsoft Corporation. |
| 2 | // Licensed under the MIT License. | |
| 3 | | |
| 4 | use miette::SourceSpan; | |
| 5 | use qsc_data_structures::span::Span; | |
| 6 | use qsc_hir::hir::PackageId; | |
| 7 | use std::fmt::Debug; | |
| 8 | | |
| 9 | #[derive(Clone, Copy, Debug)] | |
| 10 | pub struct PackageSpan { | |
| 11 | pub package: PackageId, | |
| 12 | pub span: Span, | |
| 13 | } | |
| 14 | | |
| 15 | impl From<PackageSpan> for SourceSpan { | |
| 16 | fn from(value: PackageSpan) -> Self { | |
| 17 | Self::from((value.span.lo as usize)..(value.span.hi as usize)) | |
| 18 | } | |
| 19 | } |