Add functions to scope
This commit is contained in:
parent
fd951dca26
commit
6271da50eb
@ -3,6 +3,7 @@ use std::convert::TryFrom;
|
|||||||
use std::default::Default;
|
use std::default::Default;
|
||||||
use std::fmt::{self, Display};
|
use std::fmt::{self, Display};
|
||||||
|
|
||||||
|
use crate::function::Function;
|
||||||
use crate::mixin::Mixin;
|
use crate::mixin::Mixin;
|
||||||
use crate::Token;
|
use crate::Token;
|
||||||
|
|
||||||
@ -340,6 +341,7 @@ impl Display for Pos {
|
|||||||
pub(crate) struct Scope {
|
pub(crate) struct Scope {
|
||||||
pub vars: HashMap<String, Vec<Token>>,
|
pub vars: HashMap<String, Vec<Token>>,
|
||||||
pub mixins: HashMap<String, Mixin>,
|
pub mixins: HashMap<String, Mixin>,
|
||||||
|
pub functions: HashMap<String, Function>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Scope {
|
impl Scope {
|
||||||
@ -348,12 +350,14 @@ impl Scope {
|
|||||||
Self {
|
Self {
|
||||||
vars: HashMap::new(),
|
vars: HashMap::new(),
|
||||||
mixins: HashMap::new(),
|
mixins: HashMap::new(),
|
||||||
|
functions: HashMap::new(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn merge(&mut self, other: Scope) {
|
pub fn merge(&mut self, other: Scope) {
|
||||||
self.vars.extend(other.vars);
|
self.vars.extend(other.vars);
|
||||||
self.mixins.extend(other.mixins);
|
self.mixins.extend(other.mixins);
|
||||||
|
self.functions.extend(other.functions);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user