view release on metacpan or search on metacpan
src/texi2pod.pl view on Meta::CPAN
s/\@sc\{([^\}]*)\}/\U$1/g;
s/\@file\{([^\}]*)\}/F<$1>/g;
s/\@w\{([^\}]*)\}/S<$1>/g;
s/\@(?:dmn|math)\{([^\}]*)\}/$1/g;
# Cross references are thrown away, as are @noindent and @refill.
# (@noindent is impossible in .pod, and @refill is unnecessary.)
# @* is also impossible in .pod; we discard it and any newline that
# follows it. Similarly, our macro @gol must be discarded.
s/\(?\@xref\{(?:[^\}]*)\}(?:[^.<]|(?:<[^<>]*>))*\.\)?//g;
view all matches for this distribution
view release on metacpan or search on metacpan
inc/inc_Module-Build/Module/Build/Compat.pm view on Meta::CPAN
=head1 DESCRIPTION
Because C<ExtUtils::MakeMaker> has been the standard way to distribute
modules for a long time, many tools (CPAN.pm, or your system
administrator) may expect to find a working F<Makefile.PL> in every
distribution they download from CPAN. If you want to throw them a
bone, you can use C<Module::Build::Compat> to automatically generate a
F<Makefile.PL> for you, in one of several different styles.
C<Module::Build::Compat> also provides some code that helps out the
F<Makefile.PL> at runtime.
view all matches for this distribution
view release on metacpan or search on metacpan
share/adapter/jquery/ext-jquery-adapter-debug.js view on Meta::CPAN
</code></pre>
* <p>See the {@link #start} method for details about how to configure a task object.</p>
* @singleton
*/
Ext.TaskMgr = new Ext.util.TaskRunner();if(typeof jQuery == "undefined"){
throw "Unable to load Ext, jQuery not found.";
}
(function(){
var libFlyweight;
view all matches for this distribution
view release on metacpan or search on metacpan
share/vendor/js/backbone.js view on Meta::CPAN
// Force the collection to re-sort itself. You don't need to call this under
// normal circumstances, as the set will maintain sort order as each item
// is added.
sort: function(options) {
if (!this.comparator) {
throw new Error('Cannot sort a set without a comparator');
}
options || (options = {});
// Run sort based on type of `comparator`.
if (_.isString(this.comparator) || this.comparator.length === 1) {
share/vendor/js/backbone.js view on Meta::CPAN
},
// Start the hash change handling, returning `true` if the current URL matches
// an existing route, and `false` otherwise.
start: function(options) {
if (History.started) throw new Error("Backbone.history has already been started");
History.started = true;
// Figure out the initial configuration. Do we need an iframe?
// Is pushState desired ... is it available?
this.options = _.extend({}, {root: '/'}, this.options, options);
share/vendor/js/backbone.js view on Meta::CPAN
if (!(events || (events = _.result(this, 'events')))) return;
this.undelegateEvents();
for (var key in events) {
var method = events[key];
if (!_.isFunction(method)) method = this[events[key]];
if (!method) throw new Error('Method "' + events[key] + '" does not exist');
var match = key.match(delegateEventSplitter);
var eventName = match[1], selector = match[2];
method = _.bind(method, this);
eventName += '.delegateEvents' + this.cid;
if (selector === '') {
share/vendor/js/backbone.js view on Meta::CPAN
// Set up inheritance for the model, collection, router, view and history.
Model.extend = Collection.extend = Router.extend = View.extend = History.extend = extend;
// Throw an error when a URL is needed, and none is supplied.
var urlError = function() {
throw new Error('A "url" property or function must be specified');
};
}).call(this);
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
# If the modification time is only slightly in the future,
# sleep briefly to remove the problem.
my $a = $s - time;
if ( $a > 0 and $a < 5 ) { sleep 5 }
# Too far in the future, throw an error.
my $t = time;
if ( $s > $t ) { die <<"END_DIE" }
Your installer $0 has a modification time in the future ($s > $t).
view all matches for this distribution
view release on metacpan or search on metacpan
xgboost/NEWS.md view on Meta::CPAN
* Changes in R library
- fixed possible problem of poisson regression.
- switched from 0 to NA for missing values.
- exposed access to additional model parameters.
* Changes in Python library
- throws exception instead of crash terminal when a parameter error happens.
- has importance plot and tree plot functions.
- accepts different learning rates for each boosting round.
- allows model training continuation from previously saved model.
- allows early stopping in CV.
- allows feval to return a list of tuples.
view all matches for this distribution
view release on metacpan or search on metacpan
include/boost/container/slist.hpp
include/boost/container/small_vector.hpp
include/boost/container/stable_vector.hpp
include/boost/container/static_vector.hpp
include/boost/container/string.hpp
include/boost/container/throw_exception.hpp
include/boost/container/uses_allocator.hpp
include/boost/container/uses_allocator_fwd.hpp
include/boost/container/vector.hpp
include/boost/container_hash/detail/float_functions.hpp
include/boost/container_hash/detail/hash_float.hpp
include/boost/random/uniform_int_distribution.hpp
include/boost/random/variate_generator.hpp
include/boost/serialization/level.hpp
include/boost/serialization/level_enum.hpp
include/boost/static_assert.hpp
include/boost/throw_exception.hpp
include/boost/tti/detail/dcomp_mem_fun.hpp
include/boost/tti/detail/ddeftype.hpp
include/boost/tti/detail/dftclass.hpp
include/boost/tti/detail/dmem_fun.hpp
include/boost/tti/detail/dnullptr.hpp
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Alien/bz2/Installer.pm view on Meta::CPAN
my @versions = Alien::bz2::Installer->versions_available;
my $latest_version = $version[-1];
Returns the list of versions of bzip2 available on the Internet.
Will throw an exception if available versions cannot be determined.
=head2 fetch
my($location, $version) = Alien::bz2::Installer->fetch(%options);
my $location = Alien::bz2::Installer->fetch(%options);
lib/Alien/bz2/Installer.pm view on Meta::CPAN
returned by the L<build_requires|Alien::bz2::Installer#build_requires>
method.
Download the bz2 source from the internet. By default it will
download the latest version t a temporary directory, which will
be removed when Perl exits. Will throw an exception on failure.
Options include:
=over 4
=item dir
lib/Alien/bz2/Installer.pm view on Meta::CPAN
B<NOTE:> using this method may (and probably does) require modules
returned by the L<build_requires|Alien::bz2::Installer>
method.
Build and install bz2 into the given directory. If there
is an error an exception will be thrown. On a successful build, an
instance of L<Alien::bz2::Installer> will be returned.
These options may be passed into build_install:
=over 4
view all matches for this distribution
view release on metacpan or search on metacpan
libcares/CMakeLists.txt view on Meta::CPAN
CARES_EXTRAINCLUDE_IFSET (HAVE_WS2TCPIP_H ws2tcpip.h)
CARES_EXTRAINCLUDE_IFSET (HAVE_WINDOWS_H windows.h)
# Check Types
# CHECK_TYPE_SIZE can't be used to see if a type exists because on Apple when
# building multi-arch, it will throw an error. So we need to wrap
# CHECK_C_SOURCE_COMPILES for our tests.
MACRO (CARES_TYPE_EXISTS type var)
SET(_CARES_C_SOURCE "
#include <stdio.h>
#include <stdlib.h>
view all matches for this distribution
view release on metacpan or search on metacpan
src/catch.hpp view on Meta::CPAN
auto makeTestInvoker( void(*testAsFunction)() ) noexcept -> ITestInvoker*;
template<typename C>
auto makeTestInvoker( void (C::*testAsMethod)() ) noexcept -> ITestInvoker* {
return new(std::nothrow) TestInvokerAsMethod<C>( testAsMethod );
}
struct NameAndTags {
NameAndTags( StringRef const& name_ = StringRef(), StringRef const& tags_ = StringRef() ) noexcept;
StringRef name;
src/catch.hpp view on Meta::CPAN
{}
std::string translate( ExceptionTranslators::const_iterator it, ExceptionTranslators::const_iterator itEnd ) const override {
try {
if( it == itEnd )
std::rethrow_exception(std::current_exception());
else
return (*it)->translate( it+1, itEnd );
}
catch( T& ex ) {
return m_translateFunction( ex );
src/catch.hpp view on Meta::CPAN
namespace Catch {
#if !defined(CATCH_CONFIG_DISABLE_EXCEPTIONS)
template <typename Ex>
[[noreturn]]
void throw_exception(Ex const& e) {
throw e;
}
#else // ^^ Exceptions are enabled // Exceptions are disabled vv
[[noreturn]]
void throw_exception(std::exception const& e);
#endif
} // namespace Catch;
#define CATCH_PREPARE_EXCEPTION( type, msg ) \
type( ( Catch::ReusableStringStream() << msg ).str() )
#define CATCH_INTERNAL_ERROR( msg ) \
Catch::throw_exception(CATCH_PREPARE_EXCEPTION( std::logic_error, CATCH_INTERNAL_LINEINFO << ": Internal Catch error: " << msg))
#define CATCH_ERROR( msg ) \
Catch::throw_exception(CATCH_PREPARE_EXCEPTION( std::domain_error, msg ))
#define CATCH_RUNTIME_ERROR( msg ) \
Catch::throw_exception(CATCH_PREPARE_EXCEPTION( std::runtime_error, msg ))
#define CATCH_ENFORCE( condition, msg ) \
do{ if( !(condition) ) CATCH_ERROR( msg ); } while(false)
// end catch_enforce.h
#include <memory>
src/catch.hpp view on Meta::CPAN
SourceLineInfo const& _lineInfo );
friend void setTags( TestCaseInfo& testCaseInfo, std::vector<std::string> tags );
bool isHidden() const;
bool throws() const;
bool okToFail() const;
bool expectedToFail() const;
std::string tagsAsString() const;
src/catch.hpp view on Meta::CPAN
if( m_reaction.shouldDebugBreak ) {
// If you find your debugger stopping you here then go one level up on the
// call-stack for the code that caused it (typically a failed assertion)
// (To go back to the test and change execution, jump over the throw, next)
CATCH_BREAK_INTO_DEBUGGER();
}
if (m_reaction.shouldThrow) {
#if !defined(CATCH_CONFIG_DISABLE_EXCEPTIONS)
throw Catch::TestFailureException();
#else
CATCH_ERROR( "Test failure requires aborting test!" );
#endif
}
}
src/catch.hpp view on Meta::CPAN
( "include successful tests in output" )
| Opt( config.shouldDebugBreak )
["-b"]["--break"]
( "break into debugger on failure" )
| Opt( config.noThrow )
["-e"]["--nothrow"]
( "skip exception tests" )
| Opt( config.showInvisibles )
["-i"]["--invisibles"]
( "show invisibles (tabs, newlines)" )
| Opt( config.outputFilename, "filename" )
src/catch.hpp view on Meta::CPAN
// start catch_enforce.cpp
namespace Catch {
#if defined(CATCH_CONFIG_DISABLE_EXCEPTIONS) && !defined(CATCH_CONFIG_DISABLE_EXCEPTIONS_CUSTOM_HANDLER)
[[noreturn]]
void throw_exception(std::exception const& e) {
Catch::cerr() << "Catch will terminate because it needed to throw an exception.\n"
<< "The message was: " << e.what() << '\n';
std::terminate();
}
#endif
} // namespace Catch;
src/catch.hpp view on Meta::CPAN
}
#else
// Compiling a mixed mode project with MSVC means that CLR
// exceptions will be caught in (...) as well. However, these
// do not fill-in std::current_exception and thus lead to crash
// when attempting rethrow.
// /EHa switch also causes structured exceptions to be caught
// here, but they fill-in current_exception properly, so
// at worst the output should be a little weird, instead of
// causing a crash.
if (std::current_exception() == nullptr) {
src/catch.hpp view on Meta::CPAN
}
return tryTranslators();
#endif
}
catch( TestFailureException& ) {
std::rethrow_exception(std::current_exception());
}
catch( std::exception& ex ) {
return ex.what();
}
catch( std::string& msg ) {
src/catch.hpp view on Meta::CPAN
}
#endif
std::string ExceptionTranslatorRegistry::tryTranslators() const {
if( m_translators.empty() )
std::rethrow_exception(std::current_exception());
else
return m_translators[0]->translate( m_translators.begin()+1, m_translators.end() );
}
}
// end catch_exception_translator_registry.cpp
src/catch.hpp view on Meta::CPAN
Colour colourGuard( Colour::Red );
Catch::cerr() << "Errors occurred during startup!" << '\n';
// iterate over all exceptions and notify user
for ( const auto& ex_ptr : exceptions ) {
try {
std::rethrow_exception(ex_ptr);
} catch ( std::exception const& ex ) {
Catch::cerr() << Column( ex.what() ).indent(2) << '\n';
}
}
}
src/catch.hpp view on Meta::CPAN
RegistrarForTagAliases::RegistrarForTagAliases(char const* alias, char const* tag, SourceLineInfo const& lineInfo) {
CATCH_TRY {
getMutableRegistryHub().registerTagAlias(alias, tag, lineInfo);
} CATCH_CATCH_ALL {
// Do not throw when constructing global objects, instead register the exception to be processed later
getMutableRegistryHub().registerStartupException();
}
}
}
src/catch.hpp view on Meta::CPAN
namespace {
TestCaseInfo::SpecialProperties parseSpecialTag( std::string const& tag ) {
if( startsWith( tag, '.' ) ||
tag == "!hide" )
return TestCaseInfo::IsHidden;
else if( tag == "!throws" )
return TestCaseInfo::Throws;
else if( tag == "!shouldfail" )
return TestCaseInfo::ShouldFail;
else if( tag == "!mayfail" )
return TestCaseInfo::MayFail;
src/catch.hpp view on Meta::CPAN
}
bool TestCaseInfo::isHidden() const {
return ( properties & IsHidden ) != 0;
}
bool TestCaseInfo::throws() const {
return ( properties & Throws ) != 0;
}
bool TestCaseInfo::okToFail() const {
return ( properties & (ShouldFail | MayFail ) ) != 0;
}
src/catch.hpp view on Meta::CPAN
break;
}
return sorted;
}
bool matchTest( TestCase const& testCase, TestSpec const& testSpec, IConfig const& config ) {
return testSpec.matches( testCase ) && ( config.allowThrows() || !testCase.throws() );
}
void enforceNoDuplicateTestCases( std::vector<TestCase> const& functions ) {
std::set<TestCase> seenFunctions;
for( auto const& function : functions ) {
src/catch.hpp view on Meta::CPAN
// start catch_test_registry.cpp
namespace Catch {
auto makeTestInvoker( void(*testAsFunction)() ) noexcept -> ITestInvoker* {
return new(std::nothrow) TestInvokerAsFunction( testAsFunction );
}
NameAndTags::NameAndTags( StringRef const& name_ , StringRef const& tags_ ) noexcept : name( name_ ), tags( tags_ ) {}
AutoReg::AutoReg( ITestInvoker* invoker, SourceLineInfo const& lineInfo, StringRef const& classOrMethod, NameAndTags const& nameAndTags ) noexcept {
src/catch.hpp view on Meta::CPAN
invoker,
extractClassName( classOrMethod ),
nameAndTags,
lineInfo));
} CATCH_CATCH_ALL {
// Do not throw when constructing global objects, instead register the exception to be processed later
getMutableRegistryHub().registerStartupException();
}
}
AutoReg::~AutoReg() = default;
src/catch.hpp view on Meta::CPAN
messageLabel = "due to a fatal error condition";
break;
case ResultWas::DidntThrowException:
colour = Colour::Error;
passOrFail = "FAILED";
messageLabel = "because no exception was thrown where one was expected";
break;
case ResultWas::Info:
messageLabel = "info";
break;
case ResultWas::Warning:
view all matches for this distribution
view release on metacpan or search on metacpan
src/panda/basic_string.h view on Meta::CPAN
struct DefaultStaticAllocator {
typedef T value_type;
static T* allocate (size_t n) {
void* mem = malloc(n * sizeof(T));
if (!mem) throw std::bad_alloc();
return (T*)mem;
}
static void deallocate (T* mem, size_t) {
free(mem);
src/panda/basic_string.h view on Meta::CPAN
operator std::basic_string<CharT,Traits> () const { return std::basic_string<CharT,Traits>(_str, _length); }
operator basic_string_view<CharT,Traits> () const { return basic_string_view<CharT,Traits>(_str, _length); }
const CharT& at (size_type pos) const {
if (pos >= _length) throw std::out_of_range("basic_string::at");
return _str[pos];
}
mutable_charref at (size_type pos) {
if (pos >= _length) throw std::out_of_range("basic_string::at");
return mutable_charref{ *this, pos };
}
constexpr const CharT& operator[] (size_type pos) const { return _str[pos]; }
mutable_charref operator[] (size_type pos) { return mutable_charref{ *this, pos }; }
src/panda/basic_string.h view on Meta::CPAN
}
void length (size_type newlen) { _length = newlen; }
void offset (size_type offset, size_type length = npos) {
if (offset > _length) throw std::out_of_range("basic_string::offset");
if (length > _length - offset) _length = _length - offset;
else _length = length;
_str += offset;
}
src/panda/basic_string.h view on Meta::CPAN
std::swap(((void**)__fill)[1], ((void**)oth.__fill)[1]);
std::swap(((void**)__fill)[2], ((void**)oth.__fill)[2]);
}
size_type copy (CharT* dest, size_type count, size_type pos = 0) const {
if (pos > _length) throw std::out_of_range("basic_string::copy");
if (count > _length - pos) count = _length - pos;
traits_type::copy(dest, _str + pos, count);
return count;
}
basic_string& erase (size_type pos = 0, size_type count = npos) {
if (pos > _length) throw std::out_of_range("basic_string::erase");
if (count > _length - pos) { // remove trail
_length = pos;
return *this;
}
src/panda/basic_string.h view on Meta::CPAN
return _compare(_str, _length, str._str, str._length);
}
template <class Alloc2>
int compare (size_type pos1, size_type count1, const basic_string<CharT, Traits, Alloc2>& str) const {
if (pos1 > _length) throw std::out_of_range("basic_string::compare");
if (count1 > _length - pos1) count1 = _length - pos1;
return _compare(_str + pos1, count1, str._str, str._length);
}
template <class Alloc2>
int compare (size_type pos1, size_type count1, const basic_string<CharT, Traits, Alloc2>& str, size_type pos2, size_type count2 = npos) const {
if (pos1 > _length || pos2 > str._length) throw std::out_of_range("basic_string::compare");
if (count1 > _length - pos1) count1 = _length - pos1;
if (count2 > str._length - pos2) count2 = str._length - pos2;
return _compare(_str + pos1, count1, str._str + pos2, count2);
}
src/panda/basic_string.h view on Meta::CPAN
int compare (size_type pos1, size_type count1, const CharT (&s)[SIZE]) const {
return compare(pos1, count1, s, SIZE-1);
}
int compare (size_type pos1, size_type count1, const CharT* ptr, size_type count2) const {
if (pos1 > _length) throw std::out_of_range("basic_string::compare");
if (count1 > _length - pos1) count1 = _length - pos1;
return _compare(_str + pos1, count1, ptr, count2);
}
int compare (basic_string_view<CharT, Traits> sv) const {
src/panda/basic_string.h view on Meta::CPAN
return *this;
}
template <class Alloc2>
basic_string& append (const basic_string<CharT, Traits, Alloc2>& str, size_type pos, size_type count = npos) {
if (pos > str._length) throw std::out_of_range("basic_string::append");
if (count > str._length - pos) count = str._length - pos;
if (count) { // can't call append(const CharT*, size_type) because otherwise if &str == this a fuckup would occur
_reserve_save(_length + count);
traits_type::copy(_str + _length, str._str + pos, count);
_length += count;
src/panda/basic_string.h view on Meta::CPAN
basic_string& insert (size_type pos, const basic_string<CharT, Traits, Alloc2>& str) {
return insert(pos, str._str, str._length);
}
basic_string& insert (size_type pos, const basic_string& str, size_type subpos, size_type sublen = npos) {
if (subpos > str._length) throw std::out_of_range("basic_string::insert");
if (sublen > str._length - subpos) sublen = str._length - subpos;
if (this == &str) {
const basic_string tmp(str);
return insert(pos, tmp._str + subpos, sublen);
}
else return insert(pos, str._str + subpos, sublen);
}
template <class Alloc2>
basic_string& insert (size_type pos, const basic_string<CharT, Traits, Alloc2>& str, size_type subpos, size_type sublen = npos) {
if (subpos > str._length) throw std::out_of_range("basic_string::insert");
if (sublen > str._length - subpos) sublen = str._length - subpos;
return insert(pos, str._str + subpos, sublen);
}
template<class _CharT, typename = typename std::enable_if<std::is_same<_CharT, CharT>::value>::type>
src/panda/basic_string.h view on Meta::CPAN
}
basic_string& insert (size_type pos, const CharT* s, size_type count) {
if (pos >= _length) {
if (pos == _length) return append(s, count);
throw std::out_of_range("basic_string::insert");
}
if (count == 0) return *this;
_reserve_middle(pos, 0, count);
traits_type::copy(_str + pos, s, count);
return *this;
}
basic_string& insert (size_type pos, size_type count, CharT ch) {
if (pos >= _length) {
if (pos == _length) return append(count, ch);
throw std::out_of_range("basic_string::insert");
}
if (count == 0) return *this;
_reserve_middle(pos, 0, count);
traits_type::assign(_str + pos, count, ch);
return *this;
src/panda/basic_string.h view on Meta::CPAN
basic_string& replace (const_iterator first, const_iterator last, const basic_string<CharT, Traits, Alloc2>& str) {
return replace(first - cbegin(), last - first, str);
}
basic_string& replace (size_type pos, size_type remove_count, const basic_string& str, size_type pos2, size_type insert_count = npos) {
if (pos2 > str._length) throw std::out_of_range("basic_string::replace");
if (insert_count > str._length - pos2) insert_count = str._length - pos2;
if (this == &str) {
const basic_string tmp(str);
return replace(pos, remove_count, tmp._str + pos2, insert_count);
}
return replace(pos, remove_count, str._str + pos2, insert_count);
}
template <class Alloc2>
basic_string& replace (size_type pos, size_type remove_count, const basic_string<CharT, Traits, Alloc2>& str, size_type pos2, size_type insert_count = npos) {
if (pos2 > str._length) throw std::out_of_range("basic_string::replace");
if (insert_count > str._length - pos2) insert_count = str._length - pos2;
return replace(pos, remove_count, str._str + pos2, insert_count);
}
basic_string& replace (size_type pos, size_type remove_count, const CharT* s, size_type insert_count) {
if (pos >= _length) {
if (pos == _length) return append(s, insert_count);
throw std::out_of_range("basic_string::replace");
}
if (remove_count >= _length - pos) {
_length = pos;
return append(s, insert_count);
}
src/panda/basic_string.h view on Meta::CPAN
}
basic_string& replace (size_type pos, size_type remove_count, size_type insert_count, CharT ch) {
if (pos >= _length) {
if (pos == _length) return append(insert_count, ch);
throw std::out_of_range("basic_string::replace");
}
if (remove_count >= _length - pos) {
_length = pos;
return append(insert_count, ch);
}
src/panda/basic_string.h view on Meta::CPAN
template <typename V>
from_chars_result to_number (V& value, int base = 10) const { return from_chars(_str, _str + _length, value, base); }
template <typename V>
from_chars_result to_number (V& value, size_type pos, size_type count = npos, int base = 10) const {
if (pos > _length) throw std::out_of_range("basic_string::to_number");
if (count > _length - pos) count = _length - pos;
return from_chars(_str + pos, _str + pos + count, value, base);
}
template <typename V>
src/panda/basic_string.h view on Meta::CPAN
void _new_auto (size_type capacity) {
if (capacity <= MAX_SSO_CHARS) {
_state = State::SSO;
_str = _sso;
} else {
if (capacity > MAX_SIZE) throw std::length_error("basic_string::_new_auto");
_state = State::INTERNAL;
_storage.internal = (Buffer*)Alloc::allocate(capacity + BUF_CHARS);
_storage.internal->capacity = capacity;
_storage.internal->refcnt = 1;
_str = _storage.internal->start;
src/panda/basic_string.h view on Meta::CPAN
}
}
template <class Alloc2>
void _cow_offset (const basic_string<CharT, Traits, Alloc2>& oth, size_type offset, size_type length) {
if (offset > oth._length) throw std::out_of_range("basic_string::assign");
if (length > oth._length - offset) length = oth._length - offset;
_cow(oth, offset, length);
}
template <class Alloc2>
src/panda/basic_string.h view on Meta::CPAN
void _internal_realloc (size_type capacity) {
// see if we can reallocate. if _str != start we should not reallocate because we would need
// either allocate more space than needed or move everything to the beginning before reallocation
if (_storage.dtor == &Alloc::deallocate && _str == _storage.internal->start) {
if (capacity > MAX_SIZE) throw std::length_error("basic_string::_internal_realloc");
_storage.internal = (Buffer*)Alloc::reallocate((CharT*)_storage.internal, capacity + BUF_CHARS, _storage.internal->capacity + BUF_CHARS);
_str = _storage.internal->start;
_storage.internal->capacity = capacity;
} else { // need to allocate/deallocate
auto old_buf = _storage.internal;
view all matches for this distribution
view release on metacpan or search on metacpan
libsecp256k1/src/modinv32_impl.h view on Meta::CPAN
md -= (modinfo->modulus_inv30 * (uint32_t)cd + md) & M30;
me -= (modinfo->modulus_inv30 * (uint32_t)ce + me) & M30;
/* Update the beginning of computation for t*[d,e]+modulus*[md,me] now md,me are known. */
cd += (int64_t)modinfo->modulus.v[0] * md;
ce += (int64_t)modinfo->modulus.v[0] * me;
/* Verify that the low 30 bits of the computation are indeed zero, and then throw them away. */
VERIFY_CHECK(((int32_t)cd & M30) == 0); cd >>= 30;
VERIFY_CHECK(((int32_t)ce & M30) == 0); ce >>= 30;
/* Now iteratively compute limb i=1..8 of t*[d,e]+modulus*[md,me], and store them in output
* limb i-1 (shifting down by 30 bits). */
for (i = 1; i < 9; ++i) {
libsecp256k1/src/modinv32_impl.h view on Meta::CPAN
/* Start computing t*[f,g]. */
fi = f->v[0];
gi = g->v[0];
cf = (int64_t)u * fi + (int64_t)v * gi;
cg = (int64_t)q * fi + (int64_t)r * gi;
/* Verify that the bottom 30 bits of the result are zero, and then throw them away. */
VERIFY_CHECK(((int32_t)cf & M30) == 0); cf >>= 30;
VERIFY_CHECK(((int32_t)cg & M30) == 0); cg >>= 30;
/* Now iteratively compute limb i=1..8 of t*[f,g], and store them in output limb i-1 (shifting
* down by 30 bits). */
for (i = 1; i < 9; ++i) {
libsecp256k1/src/modinv32_impl.h view on Meta::CPAN
/* Start computing t*[f,g]. */
fi = f->v[0];
gi = g->v[0];
cf = (int64_t)u * fi + (int64_t)v * gi;
cg = (int64_t)q * fi + (int64_t)r * gi;
/* Verify that the bottom 62 bits of the result are zero, and then throw them away. */
VERIFY_CHECK(((int32_t)cf & M30) == 0); cf >>= 30;
VERIFY_CHECK(((int32_t)cg & M30) == 0); cg >>= 30;
/* Now iteratively compute limb i=1..len of t*[f,g], and store them in output limb i-1 (shifting
* down by 30 bits). */
for (i = 1; i < len; ++i) {
view all matches for this distribution
view release on metacpan or search on metacpan
inc/bin/patch view on Meta::CPAN
$ERROR = 0;
}
sub import {
no strict 'refs';
*{caller() . '::throw'} = \&throw;
@{caller() . '::ISA'} = 'Patch';
}
# Simple throw/catch error handling.
sub throw {
$@ = join '', @_;
$@ .= sprintf " at %s line %d\n", (caller)[1..2] unless $@ =~ /\n\z/;
goto CATCH;
}
inc/bin/patch view on Meta::CPAN
# Apply a patch hunk. The default assumes a unified diff.
sub apply {
my ($self, $i_start, $o_start, @hunk) = @_;
$self->{skip} and throw 'SKIP...ignore this patch';
if ($self->{reverse}) {
my $not = { qw/ + - - + / };
s/^([+-])/$not->{$1}/ for @hunk;
}
inc/bin/patch view on Meta::CPAN
);
if (/^[nN]/) {
$self->{reverse} = 0;
$position = 0;
prompt ('Apply anyway? [n] ') =~ /^[yY]/
or throw 'SKIP...ignore this patch';
}
}
} else {
throw 'SKIP...ignore this patch' if $self->{forward};
}
} else {
unless ($position || $self->{reverse} || $self->{force}) {
$self->{reverse_check} = 1;
$self->{reverse} = 1;
shift;
return $self->apply(@_);
}
}
}
$position or throw "Couldn't find anywhere to put hunk.\n";
} else {
# No context. Use given position.
$position = [$i_start - $self->{i_lines} - 1]
}
inc/bin/patch view on Meta::CPAN
my $out = $self->{o_fh};
my $def = $self->{d_fh};
my $ifdef = $self->{ifdef};
# Make sure we're where we left off.
seek $in, $self->{i_pos}, 0 or throw "Couldn't seek INFILE: $!";
my $line = $self->{o_lines} + $position->[0] + 1;
my $off = $line - $o_start;
# Set to new position.
inc/bin/patch view on Meta::CPAN
# starting and matching positions.
sub index {
my ($self, $match, $pos, $lines) = @_;
my $in = $self->{i_fh};
seek $in, $pos, 0 or throw "Couldn't seek INFILE [$in, 0, $pos]: $!";
<$in> while $lines--;
if ($self->{'ignore-whitespace'}) {
s/\s+/ /g for @$match;
}
inc/bin/patch view on Meta::CPAN
my $line = <$in>;
$line =~ s/\s+/ /g if $self->{'ignore-whitespace'};
$line eq $match->[$_] or $fail++, last;
}
if ($fail) {
seek $in, $tell, 0 or throw "Couldn't seek INFILE: $!";
<$in>;
} else {
return ($tell, $line);
}
}
inc/bin/patch view on Meta::CPAN
# Pipe ed script to ed or try to manually process.
sub apply {
my ($self, @cmd) = @_;
$self->{skip} and throw 'SKIP...ignore this patch';
my $out = $self->{o_fh};
$self->{check} and goto PLAN_J;
inc/bin/patch view on Meta::CPAN
$self->note("Hunk #$self->{hunk} succeeded at 1.\n");
return 1;
}
# Erase any trace of magic line.
truncate $out, 0 or throw "Couldn't truncate OUT: $!";
seek $out, 0, 0 or throw "Couldn't seek OUT: $!";
# Try to apply ed script by hand.
$self->note("Pipe to ed failed. Switching to Plan J...\n");
PLAN_J:
inc/bin/patch view on Meta::CPAN
my @offset;
for (my $i = 0; $i < @cmd; $i++) {
my @hunk = @{$cmd[$i]};
shift(@hunk) =~ m!^(\d+)(?:,(\d+))?([acds])!
or throw "Unable to parse ed script.";
my ($start, $end, $cmd) = ($1, $2 || $1, $3);
# We don't parse substitution commands and assume they all mean
# s/\.\././ even if they really mean s/\s+// or such. And we
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Alister/Base/Sums.pod view on Meta::CPAN
Second argument is 'sum'.
Returns id.
Warns and returns undef on failure.
If you do not pass any argument as sum, will throw an exception.
sum_add() is designed so you can it multiple times for same sum, and will return same id.
It does not guarantee that the sum was not already in there.
lib/Alister/Base/Sums.pod view on Meta::CPAN
First argument is 'dbh'.
Second argument is either 'sum' or 'id'. If argument is sum, returns id, if is id, returns sum.
On fail, returns undef.
If you do not pass any argument as dbh and sum, will throw an exception.
sum_get($dbh, 5);
sum_get($dbh, '4446d445d6fc77b0b8d12e5e0e5da6f5');
If the sum is not there, returns
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
# If the modification time is only slightly in the future,
# sleep briefly to remove the problem.
my $a = $s - time;
if ( $a > 0 and $a < 5 ) { sleep 5 }
# Too far in the future, throw an error.
my $t = time;
if ( $s > $t ) { die <<"END_DIE" }
Your installer $0 has a modification time in the future ($s > $t).
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Inline/CPP/Config.pm view on Meta::CPAN
} ($compiler, $libs);
}
return ($compiler, $libs, $iostream_fn, $cpp_flavor_defs);
}
sub throw {
my $os = $^O;
my $msg = "Unsupported OS/Compiler for Inline::Module+Inline::CPP '$os'";
die $msg unless
$ENV{PERL5_MINISMOKEBOX} ||
$ENV{PERL_CR_SMOKER_CURRENT};
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Inline/denter.pm view on Meta::CPAN
level => 0,
tabwidth => 8,
}, $class;
}
# Prevent a taint exception being thrown by AutoLoader.pm.
# Serves no other purpose.
sub DESTROY {
}
sub undent {
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Inline/denter.pm view on Meta::CPAN
level => 0,
tabwidth => 8,
}, $class;
}
# Prevent a taint exception being thrown by AutoLoader.pm.
# Serves no other purpose.
sub DESTROY {
}
sub undent {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CWB/CQP.pm view on Meta::CPAN
my $aref = $self->{'error_message'};
return @{$aref};
}
## throw CQP error (optionally through user-defined error handler)
sub error {
my $self = shift;
if (ref $self->{'error_handler'} eq 'CODE') {
$self->{'error_handler'}->(@_); # call error handler if a suitable subref has been installed
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Devel/CallParser.xs view on Meta::CPAN
* child created during checking) uses a pad slot under threads.
* Normally this is fine, but early versions of the padrange
* mechanism make assumptions about pad slots being contiguous
* that this breaks. On the affected perl versions, therefore,
* we watch for the pad slot being consumed, and restore the
* pad's fill pointer if we throw the op away (upon declining
* to handle the keyword).
*
* The core bug was supposedly fixed in Perl 5.19.4, but actually
* that version exhibits a different bug also apparently related
* to padrange. Restoring the pad's fill pointer works around
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Inline/denter.pm view on Meta::CPAN
level => 0,
tabwidth => 8,
}, $class;
}
# Prevent a taint exception being thrown by AutoLoader.pm.
# Serves no other purpose.
sub DESTROY {
}
sub undent {
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Pegex/Parser.pm view on Meta::CPAN
defined($Pegex::Parser::Debug) ? $Pegex::Parser::Debug :
0
);
sub BUILD {
my ($self) = @_;
$self->{throw_on_error} ||= 1;
# $self->{rule} = undef;
# $self->{parent} = undef;
# $self->{error} = undef;
# $self->{position} = undef;
# $self->{farthest} = undef;
inc/Pegex/Parser.pm view on Meta::CPAN
} : $self->match_ref($start_rule_ref, {});
$self->{input}->close;
if (not $match or $self->{position} < length ${$self->{buffer}}) {
$self->throw_error("Parse document failed for some reason");
return; # In case $self->throw_on_error is off
}
if ($self->{receiver}->can("final")) {
$self->{rule} = $start_rule_ref;
$self->{parent} = {};
inc/Pegex/Parser.pm view on Meta::CPAN
return;
}
sub match_err {
my ($self, $error) = @_;
$self->throw_error($error);
}
sub trace {
my ($self, $action) = @_;
my $indent = ($action =~ /^try_/) ? 1 : 0;
inc/Pegex/Parser.pm view on Meta::CPAN
$snippet =~ s/\n/\\n/g;
print STDERR sprintf("%-30s", $action) .
($indent ? " >$snippet<\n" : "\n");
}
sub throw_error {
my ($self, $msg) = @_;
$@ = $self->{error} = $self->format_error($msg);
return undef unless $self->{throw_on_error};
require Carp;
Carp::croak($self->{error});
}
sub format_error {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Lexical/Sub.pm view on Meta::CPAN
prototype affect parsing, and it looks up the subroutine by a different
mechanism than is used to generate the call op. (Some forms of sigilless
call have other complications of a similar nature.) If an attempt
is made to call a lexical subroutine via a bareword on an older Perl,
this module will probably still be able to intercept the call op, and
will throw an exception to indicate that the parsing has gone wrong.
However, in some cases compilation goes further wrong before this
module can catch it, resulting in either a confusing parse error or
(in rare situations) silent compilation to an incorrect op sequence.
On Perl 5.11.2 and later, sigilless subroutine calls work correctly,
except for an issue noted below.
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Inline/CPP/Config.pm view on Meta::CPAN
} ($compiler, $libs);
}
return ($compiler, $libs, $iostream_fn, $cpp_flavor_defs);
}
sub throw {
my $os = $^O;
my $msg = "Unsupported OS/Compiler for Inline::Module+Inline::CPP '$os'";
die $msg unless
$ENV{PERL5_MINISMOKEBOX} ||
$ENV{PERL_CR_SMOKER_CURRENT};
view all matches for this distribution
view release on metacpan or search on metacpan
t/Test/Builder.pm view on Meta::CPAN
If all your tests passed, Test::Builder will exit with zero (which is
normal). If anything failed it will exit with how many failed. If
you run less (or more) tests than you planned, the missing (or extras)
will be considered failures. If no tests were ever run Test::Builder
will throw a warning and exit with 255. If the test died, even after
having successfully completed all its tests, it will still be
considered a failure and will exit with 255.
So the exit codes are...
view all matches for this distribution
view release on metacpan or search on metacpan
bin/alvis-zsink.pl view on Meta::CPAN
# Do nothing: this allows for a bug in ZOOM-C (as of YAZ
# version 2.1.27) whereby a no-opping call to connect() does
# not clear any old error indication.
print "ignoring re-occurrence of old error in connect()\n";
} elsif ($@) {
die $@; # re-throw
}
if (!$connected) {
print "connected to Z39.50 server\n";
$connected = 1;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Alvis/TermTagger.pm view on Meta::CPAN
while($line1 = <DESC_TERMLIST>) {
chomp $line1;
utf8::decode($line1);
$line=$line1;
# Blank and comment lines are throw away
if (($line !~ /^\s*\#/o)&&($line !~ /^\s*\/\//o)&&($line !~ /^\s*$/o)) {
# Term is split from the other information
my @tab = split / ?[\|:] ?/, $line;
if ($tab[0] !~ /^\s*$/) {
# TODO better
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Alzabo/BackCompat.pm view on Meta::CPAN
use File::Spec;
use Storable;
use Tie::IxHash;
use Params::Validate qw( :all );
Params::Validate::validation_options( on_fail => sub { Alzabo::Exception::Params->throw( error => join '', @_ ) } );
use vars qw($VERSION);
$VERSION = 2.0;
lib/Alzabo/BackCompat.pm view on Meta::CPAN
copy($file, $backup);
}
my $fh = do { local *FH; *FH };
open $fh, "<$c_file"
or Alzabo::Exception::System->throw( error => "Unable to open $c_file: $!" );
my $raw = Storable::fd_retrieve($fh)
or Alzabo::Exception::System->throw( error => "Can't read filehandle" );
close $fh
or Alzabo::Exception::System->throw( error => "Unable to close $c_file: $!" );
foreach (@cb)
{
$_->($raw);
$_->( $raw->{original} ) if $raw->{original};
}
open $fh, ">$c_file"
or Alzabo::Exception::System->throw( error => "Unable to write to $c_file: $!" );
Storable::nstore_fd( $raw, $fh )
or Alzabo::Exception::System->throw( error => "Can't store to filehandle" );
close $fh
or Alzabo::Exception::System->throw( error => "Unable to close $c_file: $!" );
my $version_file =
File::Spec->catfile( Alzabo::Config::schema_dir(),
$p{name}, "$p{name}.version" );
open $fh, ">$version_file"
or Alzabo::Exception::System->throw( error => "Unable to write to $version_file: $!" );
print $fh $Alzabo::VERSION
or Alzabo::Exception::System->throw( error => "Can't write to $version_file: $!" );
close $fh
or Alzabo::Exception::System->throw( error => "Unable to close $version_file: $!" );
Alzabo::Create::Schema->load_from_file( name => $p{name} )->save_to_file;
if ($create_loaded)
{
view all matches for this distribution