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
|
||||
/// underscores into hypens.
|
||||
#[derive(Debug, Clone, Eq, PartialEq, Hash)]
|
||||
#[derive(Debug, Clone, Eq, PartialEq, Hash, PartialOrd, Ord)]
|
||||
pub(crate) struct Identifier(String);
|
||||
|
||||
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;
|
||||
|
||||
@ -12,18 +12,18 @@ use crate::{
|
||||
|
||||
#[derive(Debug, Default)]
|
||||
pub(crate) struct Scope {
|
||||
vars: HashMap<Identifier, Spanned<Value>>,
|
||||
mixins: HashMap<Identifier, Mixin>,
|
||||
functions: HashMap<Identifier, Function>,
|
||||
vars: BTreeMap<Identifier, Spanned<Value>>,
|
||||
mixins: BTreeMap<Identifier, Mixin>,
|
||||
functions: BTreeMap<Identifier, Function>,
|
||||
}
|
||||
|
||||
impl Scope {
|
||||
#[must_use]
|
||||
pub fn new() -> Self {
|
||||
Self {
|
||||
vars: HashMap::new(),
|
||||
mixins: HashMap::new(),
|
||||
functions: HashMap::new(),
|
||||
vars: BTreeMap::new(),
|
||||
mixins: BTreeMap::new(),
|
||||
functions: BTreeMap::new(),
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user