conlang: Remove "Identifier" node

It never carried any extra information, and got in the way everywhere it was used.
This commit is contained in:
2024-05-19 14:41:31 -05:00
parent f330a7eaa5
commit 0cc0cb5cfb
15 changed files with 115 additions and 139 deletions

View File

@@ -64,8 +64,7 @@ impl Fold for ModuleInliner {
/// Traverses down the module tree, entering ever nested directories
fn fold_module(&mut self, m: Module) -> Module {
let Module { name, kind } = m;
let sym = name.0;
self.path.push(&*sym); // cd ./name
self.path.push(&*name); // cd ./name
let kind = self.fold_module_kind(kind);

View File

@@ -769,8 +769,8 @@ impl<'t> Parser<'t> {
self.consume_peeked();
Ok(out)
}
/// [Identifier] = [`Identifier`](TokenKind::Identifier)
pub fn identifier(&mut self) -> PResult<Identifier> {
/// [Sym] = [`Identifier`](TokenKind::Identifier)
pub fn identifier(&mut self) -> PResult<Sym> {
let tok = self.match_type(TokenKind::Identifier, Parsing::Identifier)?;
match tok.data() {
TokenData::String(ident) => Ok(ident.into()),