this repo has no description
at develop 977 B view raw
1/* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */ 2 3/* 4 * Main authors: 5 * Guido Tack <guido.tack@monash.edu> 6 */ 7 8/* This Source Code Form is subject to the terms of the Mozilla Public 9 * License, v. 2.0. If a copy of the MPL was not distributed with this 10 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 11 12#include <minizinc/astexception.hh> 13#include <minizinc/flatten_internal.hh> 14 15namespace MiniZinc { 16 17LocationException::LocationException(EnvI& env, const Location& loc, const std::string& msg) 18 : Exception(msg), _loc(loc) { 19 env.createErrorStack(); 20} 21 22ResultUndefinedError::ResultUndefinedError(EnvI& env, const Location& loc, const std::string& msg) 23 : LocationException(env, loc, msg) { 24 if (env.inMaybePartial == 0) { 25 std::string warning = "undefined result becomes false in Boolean context"; 26 if (!msg.empty()) { 27 warning += "\n (" + msg + ")"; 28 } 29 env.addWarning(warning); 30 } 31} 32 33} // namespace MiniZinc