WhatsApp / erlfmt

An automated code formatter for Erlang
Apache License 2.0
412 stars 52 forks source link

Ensure parser always returns `erl_anno:location()` in errors #325

Open gomoripeti opened 2 years ago

gomoripeti commented 2 years ago

This way the return type matches error_info()

This is an alternative fix for https://github.com/WhatsApp/erlfmt/pull/324

michalmuskala commented 2 years ago

Hey, sorry for taking so long to reply on this

I think it would be better to do the reverse - to make sure, if possible, we always return the richer types on errors. If anything the errors are more informative with potential start & end location of the error, and not just start one.

gomoripeti commented 2 years ago

thanks for the feedback

some pros for the simple location

Which one would you prefer?