use btreemap to back scope
This commit is contained in:
parent
ca370eb9b0
commit
5b2cc1df77
@ -110,7 +110,7 @@ impl ListSeparator {
|
|||||||
///
|
///
|
||||||
/// This struct protects that invariant by normalizing all
|
/// This struct protects that invariant by normalizing all
|
||||||
/// underscores into hypens.
|
/// underscores into hypens.
|
||||||
#[derive(Debug, Clone, Eq, PartialEq, Hash)]
|
#[derive(Debug, Clone, Eq, PartialEq, Hash, PartialOrd, Ord)]
|
||||||
pub(crate) struct Identifier(String);
|
pub(crate) struct Identifier(String);
|
||||||
|
|
||||||
impl From<String> for Identifier {
|
impl From<String> for Identifier {
|
||||||
|
14
src/scope.rs
14
src/scope.rs
@ -1,4 +1,4 @@
|
|||||||
use std::collections::HashMap;
|
use std::collections::BTreeMap;
|
||||||
|
|
||||||
use codemap::Spanned;
|
use codemap::Spanned;
|
||||||
|
|
||||||
@ -12,18 +12,18 @@ use crate::{
|
|||||||
|
|
||||||
#[derive(Debug, Default)]
|
#[derive(Debug, Default)]
|
||||||
pub(crate) struct Scope {
|
pub(crate) struct Scope {
|
||||||
vars: HashMap<Identifier, Spanned<Value>>,
|
vars: BTreeMap<Identifier, Spanned<Value>>,
|
||||||
mixins: HashMap<Identifier, Mixin>,
|
mixins: BTreeMap<Identifier, Mixin>,
|
||||||
functions: HashMap<Identifier, Function>,
|
functions: BTreeMap<Identifier, Function>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Scope {
|
impl Scope {
|
||||||
#[must_use]
|
#[must_use]
|
||||||
pub fn new() -> Self {
|
pub fn new() -> Self {
|
||||||
Self {
|
Self {
|
||||||
vars: HashMap::new(),
|
vars: BTreeMap::new(),
|
||||||
mixins: HashMap::new(),
|
mixins: BTreeMap::new(),
|
||||||
functions: HashMap::new(),
|
functions: BTreeMap::new(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user