Skip to content

Commit

Permalink
Correct order of iterating with_prototypes.
Browse files Browse the repository at this point in the history
When I first wrote that code I assumed that prototypes were used from top to
bottom but I tested it and it's actually bottom to top.

This reduces the number of failing ASP tests but increases the number of
failing PHP tests. I expect the new PHP failures might just be exposing
another bug.
  • Loading branch information
trishume committed Sep 5, 2017
1 parent 906f49e commit d0b253c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/parsing/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ impl ParseState {
ctx_ref.prototype.clone()
};
let context_chain = self.stack
.iter().rev() // iterate the stack in top-down order to apply the prototypes
.iter() // Sublime applies with_prototypes from bottom to top
.filter_map(|lvl| lvl.prototype.as_ref().cloned())
.chain(prototype.into_iter())
.chain(Some(cur_level.context.clone()).into_iter());
Expand Down

0 comments on commit d0b253c

Please sign in to comment.