Partial module work
This commit is contained in:
parent
f3ecdc61cb
commit
7825ef1eb9
@ -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(),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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]
|
||||
|
Loading…
Reference in New Issue
Block a user