Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
var resolve = require( 'path' ).resolve;
var writeFile = require( '@stdlib/fs/write-file' ).sync;
var readFile = require( '@stdlib/fs/read-file' ).sync;
var format = require( '@stdlib/string/format' );
var replace = require( '@stdlib/string/replace' );
var resolveStr = require( '@stdlib/strided/base/dtype-resolve-str' );
var dtypeChar = require( '@stdlib/ndarray/base/dtype-char' );
Expand All @@ -47,7 +48,7 @@
var EXCLUDE = [
'generic',
'binary',
'uint8c' // FIXME: remove once C support

Check warning on line 51 in lib/node_modules/@stdlib/math/strided/ops/add/scripts/addon.js

View workflow job for this annotation

GitHub Actions / Lint Changed Files

Unexpected 'fixme' comment: 'FIXME: remove once C support'
];

// Define regular expressions for extracting dtype signatures:
Expand Down Expand Up @@ -124,7 +125,7 @@
for ( i = 0; i < fcns.length; i++ ) {
parts = fcns[ i ].match( RE_IO_ARGS );
if ( parts === null ) {
throw new Error( 'unexpected error. Unable to resolve signature dtypes. Function: `' + fcns[ i ] + '`.' );
throw new Error( format( 'unexpected error. Unable to resolve signature dtypes. Function: `%s`.', fcns[ i ] ) );
}
tmp = [];
t1 = parts[ 1 ];
Expand All @@ -140,13 +141,13 @@
for ( i = 0; i < fcns.length; i++ ) {
parts = fcns[ i ].match( RE_CLBK_ARGS );
if ( parts === null ) {
throw new Error( 'unexpected error. Unable to resolve signature dtypes. Function: `' + fcns[ i ] + '`.' );
throw new Error( format( 'unexpected error. Unable to resolve signature dtypes. Function: `%s`.', fcns[ i ] ) );
}
t1 = parts[ 1 ];
t2 = parts[ 2 ];
t3 = parts[ 3 ];
if ( t1 !== t2 || t2 !== t3 ) {
throw new Error( 'unexpected error. Callback arguments must all be the same. Function: `' + fcns[ i ] + '`.' );
throw new Error( format( 'unexpected error. Callback arguments must all be the same. Function: `%s`.', fcns[ i ] ) );
}
if ( t1 === FLOAT64_CHAR ) {
f = 'stdlib_base_float64_'+FCN_BASENAME;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
var resolve = require( 'path' ).resolve;
var writeFile = require( '@stdlib/fs/write-file' ).sync;
var readFile = require( '@stdlib/fs/read-file' ).sync;
var format = require( '@stdlib/string/format' );
var replace = require( '@stdlib/string/replace' );
var resolveStr = require( '@stdlib/strided/base/dtype-resolve-str' );
var dtypeChar = require( '@stdlib/ndarray/base/dtype-char' );
Expand All @@ -47,7 +48,7 @@
var EXCLUDE = [
'generic',
'binary',
'uint8c' // FIXME: remove once C support

Check warning on line 51 in lib/node_modules/@stdlib/math/strided/ops/mul/scripts/addon.js

View workflow job for this annotation

GitHub Actions / Lint Changed Files

Unexpected 'fixme' comment: 'FIXME: remove once C support'
];

// Define regular expressions for extracting dtype signatures:
Expand Down Expand Up @@ -124,7 +125,7 @@
for ( i = 0; i < fcns.length; i++ ) {
parts = fcns[ i ].match( RE_IO_ARGS );
if ( parts === null ) {
throw new Error( 'unexpected error. Unable to resolve signature dtypes. Function: `' + fcns[ i ] + '`.' );
throw new Error( format( 'unexpected error. Unable to resolve signature dtypes. Function: `%s`.', fcns[ i ] ) );
}
tmp = [];
t1 = parts[ 1 ];
Expand All @@ -140,13 +141,13 @@
for ( i = 0; i < fcns.length; i++ ) {
parts = fcns[ i ].match( RE_CLBK_ARGS );
if ( parts === null ) {
throw new Error( 'unexpected error. Unable to resolve signature dtypes. Function: `' + fcns[ i ] + '`.' );
throw new Error( format( 'unexpected error. Unable to resolve signature dtypes. Function: `%s`.', fcns[ i ] ) );
}
t1 = parts[ 1 ];
t2 = parts[ 2 ];
t3 = parts[ 3 ];
if ( t1 !== t2 || t2 !== t3 ) {
throw new Error( 'unexpected error. Callback arguments must all be the same. Function: `' + fcns[ i ] + '`.' );
throw new Error( format( 'unexpected error. Callback arguments must all be the same. Function: `%s`.', fcns[ i ] ) );
}
if ( t1 === FLOAT64_CHAR ) {
f = 'stdlib_base_float64_'+FCN_BASENAME;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
var resolve = require( 'path' ).resolve;
var writeFile = require( '@stdlib/fs/write-file' ).sync;
var readFile = require( '@stdlib/fs/read-file' ).sync;
var format = require( '@stdlib/string/format' );
var replace = require( '@stdlib/string/replace' );
var resolveStr = require( '@stdlib/strided/base/dtype-resolve-str' );
var dtypeChar = require( '@stdlib/ndarray/base/dtype-char' );
Expand All @@ -47,7 +48,7 @@
var EXCLUDE = [
'generic',
'binary',
'uint8c' // FIXME: remove once C support

Check warning on line 51 in lib/node_modules/@stdlib/math/strided/ops/sub/scripts/addon.js

View workflow job for this annotation

GitHub Actions / Lint Changed Files

Unexpected 'fixme' comment: 'FIXME: remove once C support'
];

// Define regular expressions for extracting dtype signatures:
Expand Down Expand Up @@ -124,7 +125,7 @@
for ( i = 0; i < fcns.length; i++ ) {
parts = fcns[ i ].match( RE_IO_ARGS );
if ( parts === null ) {
throw new Error( 'unexpected error. Unable to resolve signature dtypes. Function: `' + fcns[ i ] + '`.' );
throw new Error( format( 'unexpected error. Unable to resolve signature dtypes. Function: `%s`.', fcns[ i ] ) );
}
tmp = [];
t1 = parts[ 1 ];
Expand All @@ -140,13 +141,13 @@
for ( i = 0; i < fcns.length; i++ ) {
parts = fcns[ i ].match( RE_CLBK_ARGS );
if ( parts === null ) {
throw new Error( 'unexpected error. Unable to resolve signature dtypes. Function: `' + fcns[ i ] + '`.' );
throw new Error( format( 'unexpected error. Unable to resolve signature dtypes. Function: `%s`.', fcns[ i ] ) );
}
t1 = parts[ 1 ];
t2 = parts[ 2 ];
t3 = parts[ 3 ];
if ( t1 !== t2 || t2 !== t3 ) {
throw new Error( 'unexpected error. Callback arguments must all be the same. Function: `' + fcns[ i ] + '`.' );
throw new Error( format( 'unexpected error. Callback arguments must all be the same. Function: `%s`.', fcns[ i ] ) );
}
if ( t1 === FLOAT64_CHAR ) {
f = 'stdlib_base_float64_'+FCN_BASENAME;
Expand Down
7 changes: 4 additions & 3 deletions lib/node_modules/@stdlib/strided/base/binary/scripts/loops.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
var readFile = require( '@stdlib/fs/read-file' ).sync;
var readJSON = require( '@stdlib/fs/read-json' ).sync;
var writeFile = require( '@stdlib/fs/write-file' ).sync;
var format = require( '@stdlib/string/format' );
var replace = require( '@stdlib/string/replace' );
var substringBefore = require( '@stdlib/string/substring-before' );
var substringAfter = require( '@stdlib/string/substring-after' );
Expand Down Expand Up @@ -340,7 +341,7 @@
* @param {string} signature - loop signature
* @throws {Error} unexpected error
*/
function createSourceFile( signature ) {

Check warning on line 344 in lib/node_modules/@stdlib/strided/base/binary/scripts/loops.js

View workflow job for this annotation

GitHub Actions / Lint Changed Files

Function 'createSourceFile' has too many statements (120). Maximum allowed is 100
var match1;
var match2;
var macro;
Expand Down Expand Up @@ -375,7 +376,7 @@
inc.push( '#include "stdlib/complex/float64/ctor.h"' );
}
if ( /x/.test( signature ) ) {
inc.push( '#include <stdbool.h>' );

Check warning on line 379 in lib/node_modules/@stdlib/strided/base/binary/scripts/loops.js

View workflow job for this annotation

GitHub Actions / Lint Changed Files

Unknown word: "stdbool"
}
if ( inc.length ) {
file = replace( file, '{{INCLUDES}}', '\n'+inc.join( '\n' ) );
Expand All @@ -395,7 +396,7 @@
inc.push( '#include "stdlib/complex/float64/ctor.h"' );
}
if ( /x/.test( tmp ) ) {
inc.push( '#include <stdbool.h>' );

Check warning on line 399 in lib/node_modules/@stdlib/strided/base/binary/scripts/loops.js

View workflow job for this annotation

GitHub Actions / Lint Changed Files

Unknown word: "stdbool"
}
if ( inc.length ) {
file = replace( file, '{{EXAMPLE_INCLUDES}}', '\n* '+inc.join( '\n* ' ) );
Expand Down Expand Up @@ -451,9 +452,9 @@
if ( match2 ) {
args = [ dtype2c( t1 ), dtype2c( t2 ), dtype2c( t3 ) ];
if ( isComplexChar( ch1 ) ) {
// WARNING: we assume that the callback signature has the same complex number dtype for all input and output values and that the output array dtype is a complex number dtype...

Check warning on line 455 in lib/node_modules/@stdlib/strided/base/binary/scripts/loops.js

View workflow job for this annotation

GitHub Actions / Lint Changed Files

Unexpected 'warning' comment: 'WARNING: we assume that the callback...'
if ( !isComplexChar( match1[ 3 ] ) ) {
throw new Error( 'unexpected error. Unable to process signature: '+signature+'.' );
throw new Error( format( 'unexpected error. Unable to process signature: %s.', signature ) );
}
macro = MACROS.acast;
if ( ch1 === 'z' ) {
Expand All @@ -470,15 +471,15 @@
args.push( 'stdlib_complex64_from_'+t3 );
}
} else if ( isComplexChar( ch2 ) || isComplexChar( ch3 ) ) {
throw new Error( 'unexpected error. Unable to process callback signature: '+ch1+ch2+'_'+ch3+'.' );
throw new Error( format( 'unexpected error. Unable to process callback signature: %s%s_%s.', ch1, ch2, ch3 ) );
} else {
macro = MACROS.cast;
args.push( ct1, ct2 );
}

Check warning on line 478 in lib/node_modules/@stdlib/strided/base/binary/scripts/loops.js

View workflow job for this annotation

GitHub Actions / Lint Changed Files

File has too many lines (546). Maximum allowed is 300
} else if ( /[cz]/.test( signature ) ) {
// E.g., zz_z, cc_c, cc_z, ff_c, dd_z, uu_z, ##_(c|z), etc. For all these signatures, the callback signature is expected to be ##_#, meaning all the same dtype (e.g., uu_u).
if ( ch1 !== ch2 ) {
throw new Error( 'unexpected error. Unable to process signature: '+ch1+ch2+'_'+ch3+'.' );
throw new Error( format( 'unexpected error. Unable to process signature: %s%s_%s.', ch1, ch2, ch3 ) );
}
if ( ch1 === ch2 && ch2 === ch3 ) { // e.g., zz_z, cc_c
macro = MACROS.nocast;
Expand Down Expand Up @@ -566,7 +567,7 @@
inc.push( '#include "stdlib/complex/float64/ctor.h"' );
}
if ( /x/.test( tmp ) ) {
inc.push( '#include <stdbool.h>' );

Check warning on line 570 in lib/node_modules/@stdlib/strided/base/binary/scripts/loops.js

View workflow job for this annotation

GitHub Actions / Lint Changed Files

Unknown word: "stdbool"
}
if ( inc.length ) {
doc = replace( doc, '{{INCLUDES}}', '\n'+inc.join( '\n' ) );
Expand Down