straight-shoota / crinja

Implementation of Jinja2 template language in Crystal
https://straight-shoota.github.io/crinja/
Other
122 stars 11 forks source link

Refactor `KeyError`, `IndexError` #48

Closed straight-shoota closed 2 years ago

straight-shoota commented 2 years ago

Refactor rescuing KeyError and IndexError to use nilable index accessor instead.

This is a breaking change for resolve_with_hash_accessor if the backing implementation only respond to #[] and not #[]?. But per documenation, backing implementations are expected to expose a hash-like interface, which includes #[]?.

/cc https://github.com/crystal-lang/crystal/issues/11565#issuecomment-1003040007