// EnsurePErr returns err, if this is already a PErr.
// Otherwise, creates a new PErr this this Position, and the message string from err.
EnsurePErr returns err, if this is already a PErr.
Otherwise, creates a new PErr this this Position, and the message string from err.
// EnsurePErr returns err if this is already a PErr . // Otherwise creates a new PErr this this Position and the message string from err .
func (pos *ParserPosition) EnsurePErr(err error) *PErr {
	if perr, ok := err.(*PErr); ok {
		return perr
	}
	return &PErr{Msg: err.Error(), AfterPos: *pos}
}
func ( pos * ParserPosition ) EnsurePErr ( err error ) * PErr { if perr , ok := err . ( * PErr ) ; ok { return perr } return & PErr { Msg : err . Error ( ) , AfterPos : * pos } }
EnsurePErr returns err, if this is already a PErr.
EnsurePErr returns err if this is already a PErr .