Compare commits
1 Commits
antiquated
...
fix_fqsn_e
Author | SHA1 | Date | |
---|---|---|---|
|
5147a32c97 |
@ -44,7 +44,7 @@ pub enum Expr {
|
|||||||
Lit(Lit),
|
Lit(Lit),
|
||||||
Tuple(Vec<Expr>),
|
Tuple(Vec<Expr>),
|
||||||
Func(Func),
|
Func(Func),
|
||||||
Sym(Rc<String>),
|
Sym(FullyQualifiedSymbolName),
|
||||||
Constructor {
|
Constructor {
|
||||||
type_name: Rc<String>,
|
type_name: Rc<String>,
|
||||||
name: Rc<String>,
|
name: Rc<String>,
|
||||||
@ -166,21 +166,19 @@ impl<'a> Reducer<'a> {
|
|||||||
PrefixExp(op, arg) => self.prefix(op, arg),
|
PrefixExp(op, arg) => self.prefix(op, arg),
|
||||||
Value(qualified_name) => {
|
Value(qualified_name) => {
|
||||||
let ref id = qualified_name.id;
|
let ref id = qualified_name.id;
|
||||||
let ref sym_name = match symbol_table.get_fqsn_from_id(id) {
|
let ref fqsn = match symbol_table.get_fqsn_from_id(id) {
|
||||||
Some(fqsn) => fqsn,
|
Some(fqsn) => fqsn,
|
||||||
None => return Expr::ReductionError(format!("FQSN lookup for Value {:?} failed", qualified_name)),
|
None => return Expr::ReductionError(format!("FQSN lookup for Value {:?} failed", qualified_name)),
|
||||||
};
|
};
|
||||||
//TODO this probably needs to change
|
//TODO this probably needs to change
|
||||||
let FullyQualifiedSymbolName(ref v) = sym_name;
|
match symbol_table.lookup_by_fqsn(&fqsn) {
|
||||||
let name = v.last().unwrap().name.clone();
|
Some(Symbol { spec: SymbolSpec::DataConstructor { index, type_args, type_name}, local_name, .. }) => Expr::Constructor {
|
||||||
match symbol_table.lookup_by_fqsn(&sym_name) {
|
|
||||||
Some(Symbol { spec: SymbolSpec::DataConstructor { index, type_args, type_name}, .. }) => Expr::Constructor {
|
|
||||||
type_name: type_name.clone(),
|
type_name: type_name.clone(),
|
||||||
name: name.clone(),
|
name: local_name.clone(),
|
||||||
tag: index.clone(),
|
tag: index.clone(),
|
||||||
arity: type_args.len(),
|
arity: type_args.len(),
|
||||||
},
|
},
|
||||||
_ => Expr::Sym(name.clone()),
|
_ => Expr::Sym(fqsn.clone()),
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
Call { f, arguments } => self.reduce_call_expression(f, arguments),
|
Call { f, arguments } => self.reduce_call_expression(f, arguments),
|
||||||
|
Loading…
Reference in New Issue
Block a user