Skip to content

Commit

Permalink
Don't crash on unlinked includes, fixes #37
Browse files Browse the repository at this point in the history
  • Loading branch information
trishume committed Mar 18, 2017
1 parent 7d4eb1b commit 8ea3944
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/parsing/syntax_definition.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ impl Iterator for MatchIter {
ContextReference::Direct(ref ctx_ptr) => {
ctx_ptr.link.upgrade().unwrap()
}
_ => panic!("Can only iterate patterns after linking: {:?}", ctx_ref),
_ => return self.next(), // skip this and move onto the next one
};
self.ctx_stack.push(ctx_ptr);
self.index_stack.push(0);
Expand Down
1 change: 1 addition & 0 deletions testdata/parser_tests.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ name: Used by tests in src/parsing/parser.rs
scope: source.test
contexts:
main:
- include: test_does_not_crash_on_unlinkable_context
- match: '#infinite_seeming_loop_test'
scope: keyword.test
push: infinite_seeming_loop_c
Expand Down

0 comments on commit 8ea3944

Please sign in to comment.