lang: Error parser if SetType fails to avoid a panic
Turns out we can actually cause the parser to error instead of needing to panic. It definitely seems to work, and is better than the panic. The only awkward thing is how this plumbing works in yacc world. If anyone knows why this is wrong, please let me know. Reading the generated code seems to imply that this is correct.
This commit is contained in:
@@ -31,6 +31,7 @@ const (
|
||||
ErrLexerIntegerOverflow = interfaces.Error("integer: overflow")
|
||||
ErrLexerFloatOverflow = interfaces.Error("float: overflow")
|
||||
ErrParseError = interfaces.Error("parser")
|
||||
ErrParseSetType = interfaces.Error("can't set return type in parser")
|
||||
ErrParseAdditionalEquals = interfaces.Error(errstrParseAdditionalEquals)
|
||||
ErrParseExpectingComma = interfaces.Error(errstrParseExpectingComma)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user