Partial module work

This commit is contained in:
greg 2019-10-22 19:07:42 -07:00
parent f3ecdc61cb
commit 7825ef1eb9
2 changed files with 9 additions and 1 deletions

View File

@ -162,6 +162,7 @@ mod test;
use std::rc::Rc;
use std::str::FromStr;
use std::collections::HashMap;
use crate::tokenizing::*;
use crate::tokenizing::Kw::*;
@ -200,6 +201,11 @@ pub struct Parser {
parse_level: u32,
restrictions: ParserRestrictions,
id_store: ItemIdStore,
source_map: SourceMap,
}
struct SourceMap {
map: HashMap<ItemId,
}
struct ParserRestrictions {
@ -250,6 +256,7 @@ impl Parser {
parse_level: 0,
restrictions: ParserRestrictions { no_struct_literal: false },
id_store: ItemIdStore::new(),
source_map: SourceMap::new(),
}
}

View File

@ -41,7 +41,8 @@ fn no_duplicates() {
let mut symbol_table = SymbolTable::new();
let ast = quick_ast(source);
let output = symbol_table.add_top_level_symbols(&ast).unwrap_err();
assert!(output.contains("Duplicate"))
println!("OUTPUT: {}", output);
assert!(output.contains("Duplicateq"))
}
#[test]