melt-umn / copper

An integrated context-aware scanner and parser generator
http://melt.cs.umn.edu/copper
GNU Lesser General Public License v3.0
18 stars 4 forks source link

Allow disambiguation functions to explicitly fail by returning -1 #46

Closed krame505 closed 4 years ago

krame505 commented 4 years ago

I've been doing a bit of work to finish some of the loose ends with my disambiguation class project last year. I have run into a case where in a disambiguation class, none of the options make sense and the most useful thing is to fail with a helpful-ish error about a lexical ambiguity. This very small change allows disambiguation functions to explicitly fail by return -1.