twtiger / gosecco

Go seccomp parser and compiler
GNU Lesser General Public License v3.0
53 stars 7 forks source link

Better error messages for typos with known types #45

Closed chelseakomlo closed 8 years ago

chelseakomlo commented 8 years ago

Specifically, things like 'grg1' instead of 'arg1' should raise an issue about a typo in the argument, rather than UNKNOWN_VARIABLE

olabini commented 8 years ago

How would we even do this?

chelseakomlo commented 8 years ago

I guess we could do fuzzy matching for args, if it would be worth it. I don't see how we could do anything else.

olabini commented 8 years ago

So I'm still confused why you opened this issue? What did you mean?

chelseakomlo commented 8 years ago

This issue is referred to in #40

olabini commented 8 years ago

Yes, it is. But my point is that when we create individual issues for tasks to be done, it would be great if we could have a higher standard than just copying it into a separate issue.

chelseakomlo commented 8 years ago

So, the issue is, for arguments, have a more specific error message (as the set of names for arguments is constrained) rather than having our generic "variable undefined" error.

I can look at the feasibility for this.

olabini commented 8 years ago

Hm I guess I still don't understand. Arguments can exist at any place a scalar value can exist, so we can't really know that someone wants to have an argument there. We can try doing that, but that would lead to more confusing error messages for other types of variables in some cases.

chelseakomlo commented 8 years ago

Yes, agreed.

olabini commented 8 years ago

Since we can't really do anything about this, I'll close this issue now.