summaryrefslogtreecommitdiff
path: root/src/nibble
diff options
context:
space:
mode:
authorGreg Brown <gmb60@cam.ac.uk>2021-01-09 11:53:21 +0000
committerGreg Brown <gmb60@cam.ac.uk>2021-01-09 11:53:21 +0000
commit487ce4fe0fa081f58d790d7d6417bf7d2659197c (patch)
tree435dbca41a6a8c67eac0fd875599103c611349bb /src/nibble
parentae1511dc11236601da174a146b1713b9d68ddc30 (diff)
Make all ast spans optional.
Diffstat (limited to 'src/nibble')
-rw-r--r--src/nibble/convert.rs4
-rw-r--r--src/nibble/cst.rs2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/nibble/convert.rs b/src/nibble/convert.rs
index 1a175a0..422d100 100644
--- a/src/nibble/convert.rs
+++ b/src/nibble/convert.rs
@@ -73,7 +73,7 @@ impl Convert for Ident {
match context.lookup(&self)? {
Binding::Variable(index) => Some(ast::Variable::new(self.into(), index).into()),
Binding::Parameter(index) => Some(ast::Parameter::new(self.into(), index).into()),
- Binding::Global => Some(ast::Call::new(self, Vec::new(), Some(span)).into()),
+ Binding::Global => Some(ast::Call::new(self.into(), Vec::new(), Some(span)).into()),
}
}
}
@@ -86,7 +86,7 @@ impl Convert for Call {
.into_iter()
.map(|arg| arg.convert(context))
.collect::<Option<_>>()?;
- Some(ast::Call::new(self.name, args, span).into())
+ Some(ast::Call::new(self.name.into(), args, span).into())
}
}
diff --git a/src/nibble/cst.rs b/src/nibble/cst.rs
index 383eae9..2b52678 100644
--- a/src/nibble/cst.rs
+++ b/src/nibble/cst.rs
@@ -260,7 +260,7 @@ impl File {
);
names.push(stmt.name.clone());
map.push(ast::Function::new(
- stmt.name.clone(),
+ stmt.name.into(),
count,
stmt.expr.convert(&mut context)?,
span,