Refactor QuoteKind to common.rs

This commit is contained in:
ConnorSkees 2020-01-26 16:23:37 -05:00
parent 8b26fabb62
commit 7fa0ee885e
2 changed files with 18 additions and 18 deletions

View File

@ -359,3 +359,20 @@ impl Scope {
self.functions.extend(other.functions);
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq)]
pub(crate) enum QuoteKind {
Single,
Double,
None,
}
impl QuoteKind {
pub fn as_str(self) -> &'static str {
match self {
Self::Single => "'",
Self::Double => "\"",
Self::None => "",
}
}
}

View File

@ -6,7 +6,7 @@ use std::ops::Add;
use crate::args::eat_call_args;
use crate::builtin::GLOBAL_FUNCTIONS;
use crate::color::Color;
use crate::common::{Keyword, Op, Scope, Symbol};
use crate::common::{Keyword, Op, QuoteKind, Scope, Symbol};
use crate::units::Unit;
use crate::utils::{devour_whitespace_or_comment, eat_interpolation};
use crate::{Token, TokenKind};
@ -64,23 +64,6 @@ impl Display for ListSeparator {
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq)]
pub(crate) enum QuoteKind {
Single,
Double,
None,
}
impl QuoteKind {
pub fn as_str(self) -> &'static str {
match self {
Self::Single => "'",
Self::Double => "\"",
Self::None => "",
}
}
}
#[derive(Debug, Clone, Eq, PartialEq)]
pub(crate) enum Value {
Important,