Partial module work
This commit is contained in:
parent
f3ecdc61cb
commit
7825ef1eb9
@ -162,6 +162,7 @@ mod test;
|
|||||||
|
|
||||||
use std::rc::Rc;
|
use std::rc::Rc;
|
||||||
use std::str::FromStr;
|
use std::str::FromStr;
|
||||||
|
use std::collections::HashMap;
|
||||||
|
|
||||||
use crate::tokenizing::*;
|
use crate::tokenizing::*;
|
||||||
use crate::tokenizing::Kw::*;
|
use crate::tokenizing::Kw::*;
|
||||||
@ -200,6 +201,11 @@ pub struct Parser {
|
|||||||
parse_level: u32,
|
parse_level: u32,
|
||||||
restrictions: ParserRestrictions,
|
restrictions: ParserRestrictions,
|
||||||
id_store: ItemIdStore,
|
id_store: ItemIdStore,
|
||||||
|
source_map: SourceMap,
|
||||||
|
}
|
||||||
|
|
||||||
|
struct SourceMap {
|
||||||
|
map: HashMap<ItemId,
|
||||||
}
|
}
|
||||||
|
|
||||||
struct ParserRestrictions {
|
struct ParserRestrictions {
|
||||||
@ -250,6 +256,7 @@ impl Parser {
|
|||||||
parse_level: 0,
|
parse_level: 0,
|
||||||
restrictions: ParserRestrictions { no_struct_literal: false },
|
restrictions: ParserRestrictions { no_struct_literal: false },
|
||||||
id_store: ItemIdStore::new(),
|
id_store: ItemIdStore::new(),
|
||||||
|
source_map: SourceMap::new(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -41,7 +41,8 @@ fn no_duplicates() {
|
|||||||
let mut symbol_table = SymbolTable::new();
|
let mut symbol_table = SymbolTable::new();
|
||||||
let ast = quick_ast(source);
|
let ast = quick_ast(source);
|
||||||
let output = symbol_table.add_top_level_symbols(&ast).unwrap_err();
|
let output = symbol_table.add_top_level_symbols(&ast).unwrap_err();
|
||||||
assert!(output.contains("Duplicate"))
|
println!("OUTPUT: {}", output);
|
||||||
|
assert!(output.contains("Duplicateq"))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
Loading…
Reference in New Issue
Block a user