Add support for compound shorthand flags (#1414)

* Break multicharacter shorthand flags into single character flags

* Remove shorthand flag test
This commit is contained in:
Corvus Corax
2020-02-29 18:20:42 -06:00
committed by GitHub
parent 2a8cb24309
commit 6d096206b6
2 changed files with 34 additions and 9 deletions

View File

@ -6,6 +6,7 @@ use derive_new::new;
use getset::Getters;
use serde::Deserialize;
use serde::Serialize;
use std::cmp::Ordering;
use std::path::{Path, PathBuf};
/// Anchors represent a location that a value originated from. The value may have been loaded from a file, fetched from a website, or parsed from some text
@ -664,6 +665,18 @@ impl Span {
}
}
impl PartialOrd<usize> for Span {
fn partial_cmp(&self, other: &usize) -> Option<Ordering> {
(self.end - self.start).partial_cmp(other)
}
}
impl PartialEq<usize> for Span {
fn eq(&self, other: &usize) -> bool {
(self.end - self.start) == *other
}
}
impl language_reporting::ReportingSpan for Span {
fn with_start(&self, start: usize) -> Self {
if self.end < start {