Skip to content

Commit

Permalink
Report syntax error on unbalanced braces
Browse files Browse the repository at this point in the history
Rather than throwing an unhandled exception.

Fixes #740
  • Loading branch information
rodjek committed Sep 25, 2019
1 parent a344724 commit 8a9091a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/puppet-lint/lexer/token.rb
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,8 @@ def find_token_of(direction, type, opts = {})
token_iter = token_iter.send("#{direction}_token_of".to_sym, ["#{closing_token}PAREN".to_sym, opts])
end
end

return nil if token_iter.nil?
token_iter = token_iter.send("#{direction}_token".to_sym)
end
nil
Expand Down

0 comments on commit 8a9091a

Please sign in to comment.