From 4fb6b740e79c1942fd0bfde9b167ea273c7d0b4b Mon Sep 17 00:00:00 2001 From: Greg Brown Date: Thu, 31 Dec 2020 13:29:40 +0000 Subject: First complete working version. --- src/ast/typed.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/ast/typed.rs') 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 { - 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 R, R>( -- cgit v1.2.3