Refactor QuoteKind to common.rs
This commit is contained in:
parent
8b26fabb62
commit
7fa0ee885e
@ -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 => "",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
19
src/value.rs
19
src/value.rs
@ -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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user