nl_tokens: Collects information about the assets listed in srcPaths ;
pl_tokens: function ( srcPaths ) { var t = this ; var db = this . __db ; // Generate a lookup that maps the resource name to the meta file that //  contains the composite var metas = { } ; for ( var libraryName in db . resources ) { var libraryData = db . resources [ libraryName ] ; for ( var resourcePath in libraryData ) { var fileInfo = libraryData [ resourcePath ] ; if ( ! fileInfo . meta ) { continue ; } for ( var altPath in fileInfo . meta ) { metas [ altPath ] = resourcePath ; } } } // Collect a list of assets var assets = [ ] ; var assetPaths = { } ; function addAsset ( library , resourceName ) { if ( assetPaths [ resourceName ] !== undefined ) { return ; } var libraryData = db . resources [ library . getNamespace ( ) ] ; var fileInfo = libraryData [ resourceName ] ; if ( fileInfo . doNotCopy === true ) { return ; } var asset = { libraryName : library . getNamespace ( ) , filename : resourceName , fileInfo : fileInfo } ; // Does this have meta data for a composite? var metaPath = metas [ resourceName ] ; if ( metaPath !== null ) { var metaInfo = libraryData [ metaPath ] ; if ( metaInfo ) { // Extract the fragment from the meta data for this particular resource var resMetaData = metaInfo . meta [ resourceName ] ; fileInfo . composite = resMetaData [ 3 ] ; fileInfo . x = resMetaData [ 4 ] ; fileInfo . y = resMetaData [ 5 ] ; if ( ! assetPaths [ metaPath ] ) { srcPaths . push ( metaPath ) ; } } } assets . push ( asset ) ; assetPaths [ resourceName ] = assets . length - 1 ; } for ( var i = 0 ; i < srcPaths . length ; i ++ ) { var srcPath = srcPaths [ i ] ; var <mask> = t . findLibraryForResource ( srcPath ) ; if ( ! library ) { t . warn ( "Cannot find library for " + srcPath ) ; continue ; } var pos = srcPath . indexOf ( ":" ) ; if ( pos > - 1 ) { srcPath = srcPath . substring ( pos + 1 ) ; } libraryData = db . resources [ library . getNamespace ( ) ] ; pos = srcPath . indexOf ( "*" ) ; if ( pos > - 1 ) { srcPath = srcPath . substring ( 0 , pos ) ; for ( var resourceName in libraryData ) { if ( resourceName . substring ( 0 , srcPath . length ) == srcPath ) { addAsset ( library , resourceName ) ; } } } else { fileInfo = libraryData [ srcPath ] ; if ( fileInfo && ( fileInfo . doNotCopy !== true ) ) { addAsset ( library , srcPath ) ; } } } return assets ; }