summaryrefslogtreecommitdiff
path: root/src/ast/typed.rs
diff options
context:
space:
mode:
authorGreg Brown <gmb60@cam.ac.uk>2020-12-31 13:29:40 +0000
committerGreg Brown <gmb60@cam.ac.uk>2020-12-31 13:29:40 +0000
commit4fb6b740e79c1942fd0bfde9b167ea273c7d0b4b (patch)
treec66b5df669e8978d9ca668f25fe03198cde78bbc /src/ast/typed.rs
parent52a1f03824d538b5886bacef67df66c22508eb07 (diff)
First complete working version.
Diffstat (limited to 'src/ast/typed.rs')
-rw-r--r--src/ast/typed.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/ast/typed.rs b/src/ast/typed.rs
index b81253e..7c3f89e 100644
--- a/src/ast/typed.rs
+++ b/src/ast/typed.rs
@@ -225,7 +225,7 @@ impl FlastContext {
}
fn is_nullable(&self, index: usize) -> Option<bool> {
- self.binds.get(index).map(|(null, _, _)| *null)
+ self.binds.get(self.binds.len() - index - 1).map(|(null, _, _)| *null)
}
fn push_nullable(&mut self, nullable: bool) {
@@ -238,7 +238,7 @@ impl FlastContext {
}
fn first_set(&self, index: usize) -> Option<&FirstSet> {
- self.binds.get(index).map(|(_, first, _)| first)
+ self.binds.get(self.binds.len() - index - 1).map(|(_, first, _)| first)
}
fn push_first_set(&mut self, nullable: bool, first_set: FirstSet) {
@@ -250,7 +250,7 @@ impl FlastContext {
}
pub fn flast_set(&self, index: usize) -> Option<&FlastSet> {
- self.binds.get(index).map(|(_, _, flast)| flast)
+ self.binds.get(self.binds.len() - index - 1).map(|(_, _, flast)| flast)
}
pub fn with_flast_set<F: FnOnce(&mut Self) -> R, R>(