nl_tokens: / * -- module -- name : SetList description : List object set method
pl_tokens: function ( Template , expression ) { this . needs = { } ; var reListSplit = new RegExp ( '^' + Template . language . tag ( 'setalist' ) + '\\s+([^=]+)\\s*=\\s*(.+)' ) , obj , list , <mask> ; if ( ! reListSplit . test ( expression ) ) { this . skip = true ; Noodles . Utilities . warning ( Template , 'Setalist tag has bad syntax' ) ; return ; } expression = reListSplit . exec ( expression ) obj = Noodles . Utilities . parseType ( Template , expression [ 1 ] ) ; if ( obj . type !== "object" ) { this . skip = true ; Noodles . Utilities . warning ( Template , 'Setalist tag has bad syntax, the variable must be an identifier or object' ) ; return ; } this . key = obj ; if ( this . key . order . length > 1 ) { this . needs = Noodles . Utilities . mergeObjectWith ( this . needs , this . key . needs ) ; } else { this . sets = { } ; this . sets [ this . key . order [ 0 ] ] = true ; } this . modifies = { } ; this . modifies [ this . key . order [ 0 ] ] = true ; list = expression [ 2 ] . split ( ',' ) ; for ( var i = 0 , l = list . length ; i < l ; i ++ ) { list [ i ] = Noodles . Utilities . parseType ( Template , list [ i ] . trim ( ) ) ; this . needs = Noodles . Utilities . mergeObjectWith ( this . needs , list [ i ] . needs ) ; } this . value = list ; }