From 5572e0eebb53bb60b7fef86944cefc2048103eea Mon Sep 17 00:00:00 2001 From: greg Date: Mon, 9 Sep 2019 10:17:46 -0700 Subject: [PATCH] Make some notes about what to do next --- TODO.md | 2 ++ schala-lang/language/src/reduced_ast.rs | 4 +++- schala-lang/language/src/scope_resolution.rs | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/TODO.md b/TODO.md index 518f59c..79733ce 100644 --- a/TODO.md +++ b/TODO.md @@ -2,6 +2,8 @@ ## General code cleanup - standardize on an error type that isn't String +-give scope reduction reference to symbol_table +-turn ast reduction into methods-on-struct-returning-result format ## Reduction - make a good type for actual language builtins to avoid string comparisons diff --git a/schala-lang/language/src/reduced_ast.rs b/schala-lang/language/src/reduced_ast.rs index d9c9d60..786c0b1 100644 --- a/schala-lang/language/src/reduced_ast.rs +++ b/schala-lang/language/src/reduced_ast.rs @@ -370,7 +370,9 @@ impl Pattern { }, Ignored => Subpattern { tag: None, subpatterns: vec![], guard: None, bound_vars: vec![] }, Literal(lit) => lit.to_subpattern(symbol_table), - VarOrName(Meta { n: QualifiedName(vec), .. }) => { + VarOrName(Meta { n: QualifiedName(vec), fqsn, .. }) => { + // if fqsn is Some, then it should be a symbol pattern but isn't yet + // if it's None, then it's a variable. scope resolution makes this decision println!("Calling VarOrName reduction with : {:?}", vec); //TODO this name needs to be resolved from metadata with context let name = if vec.len() == 1 { diff --git a/schala-lang/language/src/scope_resolution.rs b/schala-lang/language/src/scope_resolution.rs index 1a3a4e0..38f1f12 100644 --- a/schala-lang/language/src/scope_resolution.rs +++ b/schala-lang/language/src/scope_resolution.rs @@ -136,6 +136,7 @@ impl ScopeResolver { Ok(()) } + //TODO add symbol table reference to make this determination /// this might be a variable or a pattern. if a variable, set to none fn qualified_name_in_pattern(&mut self, meta_qualified_name: &mut Meta, ) { let inner_name = meta_qualified_name.node();