diff
stringlengths
41
2.03M
msg
stringlengths
1
1.5k
repo
stringlengths
5
40
sha
stringlengths
40
40
time
stringlengths
20
20
mmm a / fdbserver / VersionedBTree . actor . cpp <nl> ppp b / fdbserver / VersionedBTree . actor . cpp <nl> struct SplitStringRef { <nl> / / A BTree " page id " is actually a list of LogicalPageID ' s whose contents should be concatenated together . <nl> / / NOTE : Uses host byte order <nl> typedef VectorRef < LogicalPageID > BTreePageIDRef ; <nl> + constexpr LogicalPageID maxPageID = ( LogicalPageID ) - 1 ; <nl> <nl> std : : string toString ( BTreePageIDRef id ) { <nl> return std : : string ( " BTreePageID " ) + toString ( id . begin ( ) , id . end ( ) ) ; <nl> struct RedwoodRecordRef { <nl> <nl> inline RedwoodRecordRef withoutValue ( ) const { return RedwoodRecordRef ( key , version ) ; } <nl> <nl> + inline RedwoodRecordRef withMaxPageID ( ) const { <nl> + return RedwoodRecordRef ( key , version , StringRef ( ( uint8_t * ) & maxPageID , sizeof ( maxPageID ) ) ) ; <nl> + } <nl> + <nl> / / Truncate ( key , version , part ) tuple to len bytes . <nl> void truncate ( int len ) { <nl> ASSERT ( len < = key . size ( ) ) ; <nl> class VersionedBTree : public IVersionedStore { <nl> / / If the decode upper boundary is the subtree upper boundary the pointers will be the same <nl> / / For the lower boundary , if the pointers are not the same there is still a possibility <nl> / / that the keys are the same . This happens for the first remaining subtree of an internal page <nl> - / / after the previous first subtree was cleared . <nl> + / / after the prior subtree ( s ) were cleared . <nl> return ( decodeUpperBound = = subtreeUpperBound ) & & <nl> ( decodeLowerBound = = subtreeLowerBound | | decodeLowerBound - > sameExceptValue ( * subtreeLowerBound ) ) ; <nl> } <nl> class VersionedBTree : public IVersionedStore { <nl> Future < bool > moveLast ( ) { return move_end ( this , false ) ; } <nl> } ; <nl> <nl> + / / Cursor designed for short lifespans . <nl> + / / Holds references to all pages touched . <nl> + / / All record references returned from it are valid until the cursor is destroyed . <nl> + class BTreeCursor { <nl> + Arena arena ; <nl> + Reference < IPagerSnapshot > pager ; <nl> + std : : unordered_map < LogicalPageID , Reference < const IPage > > pages ; <nl> + VersionedBTree * btree ; <nl> + bool valid ; <nl> + <nl> + struct PathEntry { <nl> + BTreePage * btPage ; <nl> + BTreePage : : BinaryTree : : Cursor cursor ; <nl> + } ; <nl> + VectorRef < PathEntry > path ; <nl> + <nl> + public : <nl> + BTreeCursor ( ) { } <nl> + <nl> + bool isValid ( ) const { return valid ; } <nl> + <nl> + std : : string toString ( ) const { <nl> + std : : string r ; <nl> + for ( int i = 0 ; i < path . size ( ) ; + + i ) { <nl> + r + = format ( " [ % d / % d : % s ] " , i + 1 , path . size ( ) , <nl> + path [ i ] . cursor . valid ( ) ? path [ i ] . cursor . get ( ) . toString ( path [ i ] . btPage - > isLeaf ( ) ) . c_str ( ) <nl> + : " < invalid > " ) ; <nl> + } <nl> + if ( ! valid ) { <nl> + r + = " ( invalid ) " ; <nl> + } <nl> + return r ; <nl> + } <nl> + <nl> + const RedwoodRecordRef & get ( ) { return path . back ( ) . cursor . get ( ) ; } <nl> + <nl> + bool inRoot ( ) const { return path . size ( ) = = 1 ; } <nl> + <nl> + / / Pop and return the page cursor at the end of the path . <nl> + / / This is meant to enable range scans to consume the contents of a leaf page more efficiently . <nl> + / / Can only be used when inRoot ( ) is true . <nl> + BTreePage : : BinaryTree : : Cursor popPath ( ) { <nl> + BTreePage : : BinaryTree : : Cursor c = path . back ( ) . cursor ; <nl> + path . pop_back ( ) ; <nl> + return c ; <nl> + } <nl> + <nl> + Future < Void > pushPage ( BTreePageIDRef id , const RedwoodRecordRef & lowerBound , <nl> + const RedwoodRecordRef & upperBound ) { <nl> + Reference < const IPage > & page = pages [ id . front ( ) ] ; <nl> + if ( page . isValid ( ) ) { <nl> + path . push_back ( arena , { ( BTreePage * ) page - > begin ( ) , getCursor ( page ) } ) ; <nl> + return Void ( ) ; <nl> + } <nl> + <nl> + return map ( readPage ( pager , id , & lowerBound , & upperBound ) , [ this , & page , id ] ( Reference < const IPage > p ) { <nl> + page = p ; <nl> + path . push_back ( arena , { ( BTreePage * ) p - > begin ( ) , getCursor ( p ) } ) ; <nl> + return Void ( ) ; <nl> + } ) ; <nl> + } <nl> + <nl> + Future < Void > pushPage ( BTreePage : : BinaryTree : : Cursor c ) { <nl> + const RedwoodRecordRef & rec = c . get ( ) ; <nl> + auto next = c ; <nl> + next . moveNext ( ) ; <nl> + BTreePageIDRef id = rec . getChildPage ( ) ; <nl> + return pushPage ( id , rec , next . getOrUpperBound ( ) ) ; <nl> + } <nl> + <nl> + Future < Void > init ( VersionedBTree * btree_in , Reference < IPagerSnapshot > pager_in , BTreePageIDRef root ) { <nl> + btree = btree_in ; <nl> + pager = pager_in ; <nl> + path . reserve ( arena , 6 ) ; <nl> + valid = false ; <nl> + return pushPage ( root , dbBegin , dbEnd ) ; <nl> + } <nl> + <nl> + / / Seeks cursor to query if it exists , the record before or after it , or an undefined and invalid <nl> + / / position between those records <nl> + / / If 0 is returned , then <nl> + / / If the cursor is valid then it points to query <nl> + / / If the cursor is not valid then the cursor points to some place in the btree such that <nl> + / / If there is a record in the tree < query then movePrev ( ) will move to it , and <nl> + / / If there is a record in the tree > query then moveNext ( ) will move to it . <nl> + / / If non - zero is returned then the cursor is valid and the return value is logically equivalent <nl> + / / to query . compare ( cursor . get ( ) ) <nl> + ACTOR Future < int > seek_impl ( BTreeCursor * self , RedwoodRecordRef query , int prefetchBytes ) { <nl> + state RedwoodRecordRef internalPageQuery = query . withMaxPageID ( ) ; <nl> + self - > path = self - > path . slice ( 0 , 1 ) ; <nl> + debug_printf ( " seek ( % s , % d ) start cursor = % s \ n " , query . toString ( ) . c_str ( ) , prefetchBytes , <nl> + self - > toString ( ) . c_str ( ) ) ; <nl> + <nl> + loop { <nl> + auto & entry = self - > path . back ( ) ; <nl> + if ( entry . btPage - > isLeaf ( ) ) { <nl> + int cmp = entry . cursor . seek ( query ) ; <nl> + self - > valid = entry . cursor . valid ( ) & & ! entry . cursor . node - > isDeleted ( ) ; <nl> + debug_printf ( " seek ( % s , % d ) loop exit cmp = % d cursor = % s \ n " , query . toString ( ) . c_str ( ) , prefetchBytes , <nl> + cmp , self - > toString ( ) . c_str ( ) ) ; <nl> + return self - > valid ? cmp : 0 ; <nl> + } <nl> + <nl> + / / Internal page , so seek to the branch where query must be <nl> + / / Currently , after a subtree deletion internal page boundaries are still strictly adhered <nl> + / / to and will be updated if anything is inserted into the cleared range , so if the seek fails <nl> + / / or it finds an entry with a null child page then query does not exist in the BTree . <nl> + if ( entry . cursor . seekLessThan ( internalPageQuery ) & & entry . cursor . get ( ) . value . present ( ) ) { <nl> + debug_printf ( " seek ( % s , % d ) loop seek success cursor = % s \ n " , query . toString ( ) . c_str ( ) , prefetchBytes , <nl> + self - > toString ( ) . c_str ( ) ) ; <nl> + Future < Void > f = self - > pushPage ( entry . cursor ) ; <nl> + <nl> + / / Prefetch siblings , at least prefetchBytes , at level 2 but without jumping to another level 2 <nl> + / / sibling <nl> + if ( prefetchBytes ! = 0 & & entry . btPage - > height = = 2 ) { <nl> + auto c = entry . cursor ; <nl> + bool fwd = prefetchBytes > 0 ; <nl> + prefetchBytes = abs ( prefetchBytes ) ; <nl> + / / While we should still preload more bytes and a move in the target direction is successful <nl> + while ( prefetchBytes > 0 & & ( fwd ? c . moveNext ( ) : c . movePrev ( ) ) ) { <nl> + / / If there is a page link , preload it . <nl> + if ( c . get ( ) . value . present ( ) ) { <nl> + BTreePageIDRef childPage = c . get ( ) . getChildPage ( ) ; <nl> + preLoadPage ( self - > pager . getPtr ( ) , childPage ) ; <nl> + prefetchBytes - = self - > btree - > m_blockSize * childPage . size ( ) ; <nl> + } <nl> + } <nl> + } <nl> + <nl> + wait ( f ) ; <nl> + } else { <nl> + self - > valid = false ; <nl> + debug_printf ( " seek ( % s , % d ) loop exit cmp = 0 cursor = % s \ n " , query . toString ( ) . c_str ( ) , prefetchBytes , <nl> + self - > toString ( ) . c_str ( ) ) ; <nl> + return 0 ; <nl> + } <nl> + } <nl> + } <nl> + <nl> + Future < int > seek ( RedwoodRecordRef query , int prefetchBytes ) { return seek_impl ( this , query , prefetchBytes ) ; } <nl> + <nl> + ACTOR Future < Void > seekGTE_impl ( BTreeCursor * self , RedwoodRecordRef query , int prefetchBytes ) { <nl> + debug_printf ( " seekGTE ( % s , % d ) start \ n " , query . toString ( ) . c_str ( ) , prefetchBytes ) ; <nl> + int cmp = wait ( self - > seek ( query , prefetchBytes ) ) ; <nl> + if ( cmp > 0 | | ( cmp = = 0 & & ! self - > isValid ( ) ) ) { <nl> + wait ( self - > moveNext ( ) ) ; <nl> + } <nl> + return Void ( ) ; <nl> + } <nl> + <nl> + Future < Void > seekGTE ( RedwoodRecordRef query , int prefetchBytes ) { <nl> + return seekGTE_impl ( this , query , prefetchBytes ) ; <nl> + } <nl> + <nl> + ACTOR Future < Void > seekLT_impl ( BTreeCursor * self , RedwoodRecordRef query , int prefetchBytes ) { <nl> + debug_printf ( " seekLT ( % s , % d ) start \ n " , query . toString ( ) . c_str ( ) , prefetchBytes ) ; <nl> + int cmp = wait ( self - > seek ( query , prefetchBytes ) ) ; <nl> + if ( cmp < = 0 ) { <nl> + wait ( self - > movePrev ( ) ) ; <nl> + } <nl> + return Void ( ) ; <nl> + } <nl> + <nl> + Future < Void > seekLT ( RedwoodRecordRef query , int prefetchBytes ) { <nl> + return seekLT_impl ( this , query , - prefetchBytes ) ; <nl> + } <nl> + <nl> + ACTOR Future < Void > move_impl ( BTreeCursor * self , bool forward ) { <nl> + / / Try to the move cursor at the end of the path in the correct direction <nl> + debug_printf ( " move % s ( ) start cursor = % s \ n " , forward ? " Next " : " Prev " , self - > toString ( ) . c_str ( ) ) ; <nl> + while ( 1 ) { <nl> + debug_printf ( " move % s ( ) first loop cursor = % s \ n " , forward ? " Next " : " Prev " , self - > toString ( ) . c_str ( ) ) ; <nl> + auto & entry = self - > path . back ( ) ; <nl> + bool success ; <nl> + if ( entry . cursor . valid ( ) ) { <nl> + success = forward ? entry . cursor . moveNext ( ) : entry . cursor . movePrev ( ) ; <nl> + } else { <nl> + success = forward ? entry . cursor . moveFirst ( ) : false ; <nl> + } <nl> + <nl> + / / Skip over internal page entries that do not link to child pages . There should never be two in a row . <nl> + if ( success & & ! entry . btPage - > isLeaf ( ) & & ! entry . cursor . get ( ) . value . present ( ) ) { <nl> + success = forward ? entry . cursor . moveNext ( ) : entry . cursor . movePrev ( ) ; <nl> + ASSERT ( ! success | | entry . cursor . get ( ) . value . present ( ) ) ; <nl> + } <nl> + <nl> + / / Stop if successful <nl> + if ( success ) { <nl> + break ; <nl> + } <nl> + <nl> + if ( self - > path . size ( ) = = 1 ) { <nl> + self - > valid = false ; <nl> + return Void ( ) ; <nl> + } <nl> + <nl> + / / Move to parent <nl> + self - > path = self - > path . slice ( 0 , self - > path . size ( ) - 1 ) ; <nl> + } <nl> + <nl> + / / While not on a leaf page , move down to get to one . <nl> + while ( 1 ) { <nl> + debug_printf ( " move % s ( ) second loop cursor = % s \ n " , forward ? " Next " : " Prev " , self - > toString ( ) . c_str ( ) ) ; <nl> + auto & entry = self - > path . back ( ) ; <nl> + if ( entry . btPage - > isLeaf ( ) ) { <nl> + break ; <nl> + } <nl> + <nl> + / / The last entry in an internal page could be a null link , if so move back <nl> + if ( ! forward & & ! entry . cursor . get ( ) . value . present ( ) ) { <nl> + ASSERT ( entry . cursor . movePrev ( ) ) ; <nl> + ASSERT ( entry . cursor . get ( ) . value . present ( ) ) ; <nl> + } <nl> + <nl> + wait ( self - > pushPage ( entry . cursor ) ) ; <nl> + auto & newEntry = self - > path . back ( ) ; <nl> + ASSERT ( forward ? newEntry . cursor . moveFirst ( ) : newEntry . cursor . moveLast ( ) ) ; <nl> + } <nl> + <nl> + self - > valid = true ; <nl> + <nl> + debug_printf ( " move % s ( ) exit cursor = % s \ n " , forward ? " Next " : " Prev " , self - > toString ( ) . c_str ( ) ) ; <nl> + return Void ( ) ; <nl> + } <nl> + <nl> + Future < Void > moveNext ( ) { return move_impl ( this , true ) ; } <nl> + Future < Void > movePrev ( ) { return move_impl ( this , false ) ; } <nl> + } ; <nl> + <nl> + Future < Void > initBTreeCursor ( BTreeCursor * cursor , Version snapshotVersion ) { <nl> + / / Only committed versions can be read . <nl> + ASSERT ( snapshotVersion < = m_lastCommittedVersion ) ; <nl> + Reference < IPagerSnapshot > snapshot = m_pager - > getReadSnapshot ( snapshotVersion ) ; <nl> + <nl> + / / This is a ref because snapshot will continue to hold the metakey value memory <nl> + KeyRef m = snapshot - > getMetaKey ( ) ; <nl> + <nl> + return cursor - > init ( this , snapshot , ( ( MetaKey * ) m . begin ( ) ) - > root . get ( ) ) ; <nl> + } <nl> + <nl> / / Cursor is for reading and interating over user visible KV pairs at a specific version <nl> / / KeyValueRefs returned become invalid once the cursor is moved <nl> class Cursor : public IStoreCursor , public ReferenceCounted < Cursor > , public FastAllocated < Cursor > , NonCopyable { <nl> class KeyValueStoreRedwoodUnversioned : public IKeyValueStore { <nl> return result ; <nl> } <nl> <nl> - state Reference < IStoreCursor > cur = self - > m_tree - > readAtVersion ( self - > m_tree - > getLastCommittedVersion ( ) ) ; <nl> - / / Prefetch is currently only done in the forward direction <nl> - state int prefetchBytes = rowLimit > 1 ? byteLimit : 0 ; <nl> + state VersionedBTree : : BTreeCursor cur ; <nl> + wait ( self - > m_tree - > initBTreeCursor ( & cur , self - > m_tree - > getLastCommittedVersion ( ) ) ) ; <nl> + state int prefetchBytes = 0 ; <nl> <nl> if ( rowLimit > 0 ) { <nl> - wait ( cur - > findFirstEqualOrGreater ( keys . begin , prefetchBytes ) ) ; <nl> - while ( cur - > isValid ( ) & & cur - > getKey ( ) < keys . end ) { <nl> - KeyValueRef kv ( KeyRef ( result . arena ( ) , cur - > getKey ( ) ) , ValueRef ( result . arena ( ) , cur - > getValue ( ) ) ) ; <nl> - accumulatedBytes + = kv . expectedSize ( ) ; <nl> - result . push_back ( result . arena ( ) , kv ) ; <nl> - if ( - - rowLimit = = 0 | | accumulatedBytes > = byteLimit ) { <nl> + wait ( cur . seekGTE ( keys . begin , prefetchBytes ) ) ; <nl> + while ( cur . isValid ( ) ) { <nl> + / / Read page contents without using waits <nl> + bool isRoot = cur . inRoot ( ) ; <nl> + BTreePage : : BinaryTree : : Cursor leafCursor = cur . popPath ( ) ; <nl> + while ( leafCursor . valid ( ) ) { <nl> + KeyValueRef kv = leafCursor . get ( ) . toKeyValueRef ( ) ; <nl> + if ( kv . key > = keys . end ) { <nl> + break ; <nl> + } <nl> + accumulatedBytes + = kv . expectedSize ( ) ; <nl> + result . push_back_deep ( result . arena ( ) , kv ) ; <nl> + if ( - - rowLimit = = 0 | | accumulatedBytes > = byteLimit ) { <nl> + break ; <nl> + } <nl> + leafCursor . moveNext ( ) ; <nl> + } <nl> + / / Stop if the leaf cursor is still valid which means we hit a key or size limit or <nl> + / / if we started in the root page <nl> + if ( leafCursor . valid ( ) | | isRoot ) { <nl> break ; <nl> } <nl> - wait ( cur - > next ( ) ) ; <nl> + wait ( cur . moveNext ( ) ) ; <nl> } <nl> } else { <nl> - wait ( cur - > findLastLessOrEqual ( keys . end ) ) ; <nl> - if ( cur - > isValid ( ) & & cur - > getKey ( ) = = keys . end ) wait ( cur - > prev ( ) ) ; <nl> - <nl> - while ( cur - > isValid ( ) & & cur - > getKey ( ) > = keys . begin ) { <nl> - KeyValueRef kv ( KeyRef ( result . arena ( ) , cur - > getKey ( ) ) , ValueRef ( result . arena ( ) , cur - > getValue ( ) ) ) ; <nl> - accumulatedBytes + = kv . expectedSize ( ) ; <nl> - result . push_back ( result . arena ( ) , kv ) ; <nl> - if ( + + rowLimit = = 0 | | accumulatedBytes > = byteLimit ) { <nl> + wait ( cur . seekLT ( keys . end , prefetchBytes ) ) ; <nl> + while ( cur . isValid ( ) ) { <nl> + / / Read page contents without using waits <nl> + bool isRoot = cur . inRoot ( ) ; <nl> + BTreePage : : BinaryTree : : Cursor leafCursor = cur . popPath ( ) ; <nl> + while ( leafCursor . valid ( ) ) { <nl> + KeyValueRef kv = leafCursor . get ( ) . toKeyValueRef ( ) ; <nl> + if ( kv . key < keys . begin ) { <nl> + break ; <nl> + } <nl> + accumulatedBytes + = kv . expectedSize ( ) ; <nl> + result . push_back_deep ( result . arena ( ) , kv ) ; <nl> + if ( + + rowLimit = = 0 | | accumulatedBytes > = byteLimit ) { <nl> + break ; <nl> + } <nl> + leafCursor . movePrev ( ) ; <nl> + } <nl> + / / Stop if the leaf cursor is still valid which means we hit a key or size limit or <nl> + / / if we started in the root page <nl> + if ( leafCursor . valid ( ) | | isRoot ) { <nl> break ; <nl> } <nl> - wait ( cur - > prev ( ) ) ; <nl> + wait ( cur . movePrev ( ) ) ; <nl> } <nl> } <nl> <nl> class KeyValueStoreRedwoodUnversioned : public IKeyValueStore { <nl> state FlowLock : : Releaser releaser ( self - > m_concurrentReads ) ; <nl> <nl> + + g_redwoodMetrics . opGet ; <nl> - state Reference < IStoreCursor > cur = self - > m_tree - > readAtVersion ( self - > m_tree - > getLastCommittedVersion ( ) ) ; <nl> + state VersionedBTree : : BTreeCursor cur ; <nl> + wait ( self - > m_tree - > initBTreeCursor ( & cur , self - > m_tree - > getLastCommittedVersion ( ) ) ) ; <nl> <nl> - wait ( cur - > findEqual ( key ) ) ; <nl> - if ( cur - > isValid ( ) ) { <nl> - return cur - > getValue ( ) ; <nl> + wait ( cur . seekGTE ( key , 0 ) ) ; <nl> + if ( cur . isValid ( ) & & cur . get ( ) . key = = key ) { <nl> + return cur . get ( ) . value . get ( ) ; <nl> } <nl> return Optional < Value > ( ) ; <nl> } <nl> class KeyValueStoreRedwoodUnversioned : public IKeyValueStore { <nl> state FlowLock : : Releaser releaser ( self - > m_concurrentReads ) ; <nl> <nl> + + g_redwoodMetrics . opGet ; <nl> - state Reference < IStoreCursor > cur = self - > m_tree - > readAtVersion ( self - > m_tree - > getLastCommittedVersion ( ) ) ; <nl> + state VersionedBTree : : BTreeCursor cur ; <nl> + wait ( self - > m_tree - > initBTreeCursor ( & cur , self - > m_tree - > getLastCommittedVersion ( ) ) ) ; <nl> <nl> - wait ( cur - > findEqual ( key ) ) ; <nl> - if ( cur - > isValid ( ) ) { <nl> - Value v = cur - > getValue ( ) ; <nl> + wait ( cur . seekGTE ( key , 0 ) ) ; <nl> + if ( cur . isValid ( ) & & cur . get ( ) . key = = key ) { <nl> + Value v = cur . get ( ) . value . get ( ) ; <nl> int len = std : : min ( v . size ( ) , maxLength ) ; <nl> - return Value ( cur - > getValue ( ) . substr ( 0 , len ) ) ; <nl> + return Value ( v . substr ( 0 , len ) ) ; <nl> } <nl> + <nl> return Optional < Value > ( ) ; <nl> } <nl> <nl> KeyValue randomKV ( int maxKeySize = 10 , int maxValueSize = 5 ) { <nl> return kv ; <nl> } <nl> <nl> + / / Verify a range using a BTreeCursor . <nl> + / / Assumes that the BTree holds a single data version and the version is 0 . <nl> + ACTOR Future < int > verifyRangeBTreeCursor ( VersionedBTree * btree , Key start , Key end , Version v , <nl> + std : : map < std : : pair < std : : string , Version > , Optional < std : : string > > * written , <nl> + int * pErrorCount ) { <nl> + state int errors = 0 ; <nl> + if ( end < = start ) end = keyAfter ( start ) ; <nl> + <nl> + state std : : map < std : : pair < std : : string , Version > , Optional < std : : string > > : : const_iterator i = <nl> + written - > lower_bound ( std : : make_pair ( start . toString ( ) , 0 ) ) ; <nl> + state std : : map < std : : pair < std : : string , Version > , Optional < std : : string > > : : const_iterator iEnd = <nl> + written - > upper_bound ( std : : make_pair ( end . toString ( ) , 0 ) ) ; <nl> + state std : : map < std : : pair < std : : string , Version > , Optional < std : : string > > : : const_iterator iLast ; <nl> + <nl> + state VersionedBTree : : BTreeCursor cur ; <nl> + wait ( btree - > initBTreeCursor ( & cur , v ) ) ; <nl> + debug_printf ( " VerifyRange ( @ % " PRId64 " , % s , % s ) : Start \ n " , v , start . printable ( ) . c_str ( ) , end . printable ( ) . c_str ( ) ) ; <nl> + <nl> + / / Randomly use the cursor for something else first . <nl> + if ( deterministicRandom ( ) - > coinflip ( ) ) { <nl> + state Key randomKey = randomKV ( ) . key ; <nl> + debug_printf ( " VerifyRange ( @ % " PRId64 " , % s , % s ) : Dummy seek to ' % s ' \ n " , v , start . printable ( ) . c_str ( ) , <nl> + end . printable ( ) . c_str ( ) , randomKey . toString ( ) . c_str ( ) ) ; <nl> + wait ( success ( cur . seek ( randomKey , 0 ) ) ) ; <nl> + } <nl> + <nl> + debug_printf ( " VerifyRange ( @ % " PRId64 " , % s , % s ) : Actual seek \ n " , v , start . printable ( ) . c_str ( ) , <nl> + end . printable ( ) . c_str ( ) ) ; <nl> + wait ( cur . seekGTE ( start , 0 ) ) ; <nl> + <nl> + state std : : vector < KeyValue > results ; <nl> + <nl> + while ( cur . isValid ( ) & & cur . get ( ) . key < end ) { <nl> + / / Find the next written kv pair that would be present at this version <nl> + while ( 1 ) { <nl> + iLast = i ; <nl> + if ( i = = iEnd ) break ; <nl> + + + i ; <nl> + <nl> + if ( iLast - > first . second < = v & & iLast - > second . present ( ) & & <nl> + ( i = = iEnd | | i - > first . first ! = iLast - > first . first | | i - > first . second > v ) ) { <nl> + debug_printf ( " VerifyRange ( @ % " PRId64 " , % s , % s ) Found key in written map : % s \ n " , v , <nl> + start . printable ( ) . c_str ( ) , end . printable ( ) . c_str ( ) , iLast - > first . first . c_str ( ) ) ; <nl> + break ; <nl> + } <nl> + } <nl> + <nl> + if ( iLast = = iEnd ) { <nl> + + + errors ; <nl> + + + * pErrorCount ; <nl> + printf ( " VerifyRange ( @ % " PRId64 " , % s , % s ) ERROR : Tree key ' % s ' vs nothing in written map . \ n " , v , <nl> + start . printable ( ) . c_str ( ) , end . printable ( ) . c_str ( ) , cur . get ( ) . key . toString ( ) . c_str ( ) ) ; <nl> + break ; <nl> + } <nl> + <nl> + if ( cur . get ( ) . key ! = iLast - > first . first ) { <nl> + + + errors ; <nl> + + + * pErrorCount ; <nl> + printf ( " VerifyRange ( @ % " PRId64 " , % s , % s ) ERROR : Tree key ' % s ' but expected ' % s ' \ n " , v , <nl> + start . printable ( ) . c_str ( ) , end . printable ( ) . c_str ( ) , cur . get ( ) . key . toString ( ) . c_str ( ) , <nl> + iLast - > first . first . c_str ( ) ) ; <nl> + break ; <nl> + } <nl> + if ( cur . get ( ) . value . get ( ) ! = iLast - > second . get ( ) ) { <nl> + + + errors ; <nl> + + + * pErrorCount ; <nl> + printf ( " VerifyRange ( @ % " PRId64 " , % s , % s ) ERROR : Tree key ' % s ' has tree value ' % s ' but expected ' % s ' \ n " , v , <nl> + start . printable ( ) . c_str ( ) , end . printable ( ) . c_str ( ) , cur . get ( ) . key . toString ( ) . c_str ( ) , <nl> + cur . get ( ) . value . get ( ) . toString ( ) . c_str ( ) , iLast - > second . get ( ) . c_str ( ) ) ; <nl> + break ; <nl> + } <nl> + <nl> + ASSERT ( errors = = 0 ) ; <nl> + <nl> + results . push_back ( KeyValue ( KeyValueRef ( cur . get ( ) . key , cur . get ( ) . value . get ( ) ) ) ) ; <nl> + wait ( cur . moveNext ( ) ) ; <nl> + } <nl> + <nl> + / / Make sure there are no further written kv pairs that would be present at this version . <nl> + while ( 1 ) { <nl> + iLast = i ; <nl> + if ( i = = iEnd ) break ; <nl> + + + i ; <nl> + if ( iLast - > first . second < = v & & iLast - > second . present ( ) & & <nl> + ( i = = iEnd | | i - > first . first ! = iLast - > first . first | | i - > first . second > v ) ) <nl> + break ; <nl> + } <nl> + <nl> + if ( iLast ! = iEnd ) { <nl> + + + errors ; <nl> + + + * pErrorCount ; <nl> + printf ( " VerifyRange ( @ % " PRId64 " , % s , % s ) ERROR : Tree range ended but written has @ % " PRId64 " ' % s ' \ n " , v , <nl> + start . printable ( ) . c_str ( ) , end . printable ( ) . c_str ( ) , iLast - > first . second , iLast - > first . first . c_str ( ) ) ; <nl> + } <nl> + <nl> + debug_printf ( " VerifyRangeReverse ( @ % " PRId64 " , % s , % s ) : start \ n " , v , start . printable ( ) . c_str ( ) , <nl> + end . printable ( ) . c_str ( ) ) ; <nl> + <nl> + / / Randomly use a new cursor at the same version for the reverse range read , if the version is still available for <nl> + / / opening new cursors <nl> + if ( v > = btree - > getOldestVersion ( ) & & deterministicRandom ( ) - > coinflip ( ) ) { <nl> + cur = VersionedBTree : : BTreeCursor ( ) ; <nl> + wait ( btree - > initBTreeCursor ( & cur , v ) ) ; <nl> + } <nl> + <nl> + / / Now read the range from the tree in reverse order and compare to the saved results <nl> + wait ( cur . seekLT ( end , 0 ) ) ; <nl> + <nl> + state std : : vector < KeyValue > : : const_reverse_iterator r = results . rbegin ( ) ; <nl> + <nl> + while ( cur . isValid ( ) & & cur . get ( ) . key > = start ) { <nl> + if ( r = = results . rend ( ) ) { <nl> + + + errors ; <nl> + + + * pErrorCount ; <nl> + printf ( " VerifyRangeReverse ( @ % " PRId64 " , % s , % s ) ERROR : Tree key ' % s ' vs nothing in written map . \ n " , v , <nl> + start . printable ( ) . c_str ( ) , end . printable ( ) . c_str ( ) , cur . get ( ) . key . toString ( ) . c_str ( ) ) ; <nl> + break ; <nl> + } <nl> + <nl> + if ( cur . get ( ) . key ! = r - > key ) { <nl> + + + errors ; <nl> + + + * pErrorCount ; <nl> + printf ( " VerifyRangeReverse ( @ % " PRId64 " , % s , % s ) ERROR : Tree key ' % s ' but expected ' % s ' \ n " , v , <nl> + start . printable ( ) . c_str ( ) , end . printable ( ) . c_str ( ) , cur . get ( ) . key . toString ( ) . c_str ( ) , <nl> + r - > key . toString ( ) . c_str ( ) ) ; <nl> + break ; <nl> + } <nl> + if ( cur . get ( ) . value . get ( ) ! = r - > value ) { <nl> + + + errors ; <nl> + + + * pErrorCount ; <nl> + printf ( " VerifyRangeReverse ( @ % " PRId64 <nl> + " , % s , % s ) ERROR : Tree key ' % s ' has tree value ' % s ' but expected ' % s ' \ n " , <nl> + v , start . printable ( ) . c_str ( ) , end . printable ( ) . c_str ( ) , cur . get ( ) . key . toString ( ) . c_str ( ) , <nl> + cur . get ( ) . value . get ( ) . toString ( ) . c_str ( ) , r - > value . toString ( ) . c_str ( ) ) ; <nl> + break ; <nl> + } <nl> + <nl> + + + r ; <nl> + wait ( cur . movePrev ( ) ) ; <nl> + } <nl> + <nl> + if ( r ! = results . rend ( ) ) { <nl> + + + errors ; <nl> + + + * pErrorCount ; <nl> + printf ( " VerifyRangeReverse ( @ % " PRId64 " , % s , % s ) ERROR : Tree range ended but written has ' % s ' \ n " , v , <nl> + start . printable ( ) . c_str ( ) , end . printable ( ) . c_str ( ) , r - > key . toString ( ) . c_str ( ) ) ; <nl> + } <nl> + <nl> + return errors ; <nl> + } <nl> + <nl> ACTOR Future < int > verifyRange ( VersionedBTree * btree , Key start , Key end , Version v , <nl> std : : map < std : : pair < std : : string , Version > , Optional < std : : string > > * written , <nl> int * pErrorCount ) { <nl> ACTOR Future < int > seekAll ( VersionedBTree * btree , Version v , <nl> return errors ; <nl> } <nl> <nl> + / / Verify the result of point reads for every set or cleared key at the given version <nl> + ACTOR Future < int > seekAllBTreeCursor ( VersionedBTree * btree , Version v , <nl> + std : : map < std : : pair < std : : string , Version > , Optional < std : : string > > * written , int * pErrorCount ) { <nl> + state std : : map < std : : pair < std : : string , Version > , Optional < std : : string > > : : const_iterator i = written - > cbegin ( ) ; <nl> + state std : : map < std : : pair < std : : string , Version > , Optional < std : : string > > : : const_iterator iEnd = written - > cend ( ) ; <nl> + state int errors = 0 ; <nl> + state VersionedBTree : : BTreeCursor cur ; <nl> + <nl> + wait ( btree - > initBTreeCursor ( & cur , v ) ) ; <nl> + <nl> + while ( i ! = iEnd ) { <nl> + state std : : string key = i - > first . first ; <nl> + state Version ver = i - > first . second ; <nl> + if ( ver = = v ) { <nl> + state Optional < std : : string > val = i - > second ; <nl> + debug_printf ( " Verifying @ % " PRId64 " ' % s ' \ n " , ver , key . c_str ( ) ) ; <nl> + state Arena arena ; <nl> + wait ( cur . seekGTE ( RedwoodRecordRef ( KeyRef ( arena , key ) , 0 ) , 0 ) ) ; <nl> + bool foundKey = cur . isValid ( ) & & cur . get ( ) . key = = key ; <nl> + bool hasValue = foundKey & & cur . get ( ) . value . present ( ) ; <nl> + <nl> + if ( val . present ( ) ) { <nl> + bool valueMatch = hasValue & & cur . get ( ) . value . get ( ) = = val . get ( ) ; <nl> + if ( ! foundKey | | ! hasValue | | ! valueMatch ) { <nl> + + + errors ; <nl> + + + * pErrorCount ; <nl> + if ( ! foundKey ) { <nl> + printf ( " Verify ERROR : key_not_found : ' % s ' - > ' % s ' @ % " PRId64 " \ n " , key . c_str ( ) , <nl> + val . get ( ) . c_str ( ) , ver ) ; <nl> + } <nl> + else if ( ! hasValue ) { <nl> + printf ( " Verify ERROR : value_not_found : ' % s ' - > ' % s ' @ % " PRId64 " \ n " , key . c_str ( ) , <nl> + val . get ( ) . c_str ( ) , ver ) ; <nl> + } <nl> + else if ( ! valueMatch ) { <nl> + printf ( " Verify ERROR : value_incorrect : for ' % s ' found ' % s ' expected ' % s ' @ % " PRId64 " \ n " , <nl> + key . c_str ( ) , cur . get ( ) . value . get ( ) . toString ( ) . c_str ( ) , val . get ( ) . c_str ( ) , <nl> + ver ) ; <nl> + } <nl> + } <nl> + } else if ( foundKey & & hasValue ) { <nl> + + + errors ; <nl> + + + * pErrorCount ; <nl> + printf ( " Verify ERROR : cleared_key_found : ' % s ' - > ' % s ' @ % " PRId64 " \ n " , key . c_str ( ) , <nl> + cur . get ( ) . value . get ( ) . toString ( ) . c_str ( ) , ver ) ; <nl> + } <nl> + } <nl> + + + i ; <nl> + } <nl> + return errors ; <nl> + } <nl> + <nl> ACTOR Future < Void > verify ( VersionedBTree * btree , FutureStream < Version > vStream , <nl> std : : map < std : : pair < std : : string , Version > , Optional < std : : string > > * written , int * pErrorCount , <nl> bool serial ) { <nl> ACTOR Future < Void > verify ( VersionedBTree * btree , FutureStream < Version > vStream , <nl> state Reference < IStoreCursor > cur = btree - > readAtVersion ( v ) ; <nl> <nl> debug_printf ( " Verifying entire key range at version % " PRId64 " \ n " , v ) ; <nl> - fRangeAll = verifyRange ( btree , LiteralStringRef ( " " ) , LiteralStringRef ( " \ xff \ xff " ) , v , written , pErrorCount ) ; <nl> + if ( deterministicRandom ( ) - > coinflip ( ) ) { <nl> + fRangeAll = verifyRange ( btree , LiteralStringRef ( " " ) , LiteralStringRef ( " \ xff \ xff " ) , v , written , <nl> + pErrorCount ) ; <nl> + } else { <nl> + fRangeAll = verifyRangeBTreeCursor ( btree , LiteralStringRef ( " " ) , LiteralStringRef ( " \ xff \ xff " ) , v , written , <nl> + pErrorCount ) ; <nl> + } <nl> if ( serial ) { <nl> wait ( success ( fRangeAll ) ) ; <nl> } <nl> ACTOR Future < Void > verify ( VersionedBTree * btree , FutureStream < Version > vStream , <nl> Key end = randomKV ( ) . key ; <nl> debug_printf ( " Verifying range ( % s , % s ) at version % " PRId64 " \ n " , toString ( begin ) . c_str ( ) , <nl> toString ( end ) . c_str ( ) , v ) ; <nl> - fRangeRandom = verifyRange ( btree , begin , end , v , written , pErrorCount ) ; <nl> + if ( deterministicRandom ( ) - > coinflip ( ) ) { <nl> + fRangeRandom = verifyRange ( btree , begin , end , v , written , pErrorCount ) ; <nl> + } else { <nl> + fRangeRandom = verifyRangeBTreeCursor ( btree , begin , end , v , written , pErrorCount ) ; <nl> + } <nl> if ( serial ) { <nl> wait ( success ( fRangeRandom ) ) ; <nl> } <nl> <nl> debug_printf ( " Verifying seeks to each changed key at version % " PRId64 " \ n " , v ) ; <nl> - fSeekAll = seekAll ( btree , v , written , pErrorCount ) ; <nl> + if ( deterministicRandom ( ) - > coinflip ( ) ) { <nl> + fSeekAll = seekAll ( btree , v , written , pErrorCount ) ; <nl> + } else { <nl> + fSeekAll = seekAllBTreeCursor ( btree , v , written , pErrorCount ) ; <nl> + } <nl> if ( serial ) { <nl> wait ( success ( fSeekAll ) ) ; <nl> } <nl>
New low level BTree cursor class which is designed for short lifetimes , does less memory allocation , and can be used to perform getRange ( ) operations with less CPU overhead .
apple/foundationdb
949fbd914564fe46abd9e07a5937216a72cc4be3
2020-06-05T06:23:14Z
mmm a / dbms / include / DB / Storages / StorageReplicatedMergeTree . h <nl> ppp b / dbms / include / DB / Storages / StorageReplicatedMergeTree . h <nl> class StorageReplicatedMergeTree : public IStorage <nl> zkutil : : ZooKeeperPtr zookeeper ; <nl> <nl> / / / Если true , таблица в офлайновом режиме , и в нее нельзя писать . <nl> - bool is_read_only = false ; <nl> + bool is_read_only = true ; <nl> <nl> / / / Каким будет множество активных кусков после выполнения всей текущей очереди . <nl> ActiveDataPartSet virtual_parts ; <nl> mmm a / dbms / src / Storages / MergeTree / ReplicatedMergeTreeRestartingThread . cpp <nl> ppp b / dbms / src / Storages / MergeTree / ReplicatedMergeTreeRestartingThread . cpp <nl> void ReplicatedMergeTreeRestartingThread : : run ( ) <nl> <nl> try <nl> { <nl> - / / / Запуск реплики при старте сервера / создании таблицы . <nl> - while ( ! need_stop & & ! tryStartup ( ) ) <nl> - wakeup_event . tryWait ( retry_delay_ms ) ; <nl> + bool first_time = true ; <nl> <nl> - / / / Цикл перезапуска реплики при истечении сессии с ZK . <nl> + / / / Запуск реплики при старте сервера / создании таблицы . Перезапуск реплики при истечении сессии с ZK . <nl> while ( ! need_stop ) <nl> { <nl> - if ( storage . zookeeper - > expired ( ) ) <nl> + if ( first_time | | storage . zookeeper - > expired ( ) ) <nl> { <nl> - LOG_WARNING ( log , " ZooKeeper session has expired . Switching to a new session . " ) ; <nl> - storage . is_read_only = true ; <nl> + if ( first_time ) <nl> + { <nl> + LOG_DEBUG ( log , " Activating replica . " ) ; <nl> + } <nl> + else <nl> + { <nl> + LOG_WARNING ( log , " ZooKeeper session has expired . Switching to a new session . " ) ; <nl> <nl> - partialShutdown ( ) ; <nl> + storage . is_read_only = true ; <nl> + partialShutdown ( ) ; <nl> + } <nl> <nl> do <nl> { <nl> void ReplicatedMergeTreeRestartingThread : : run ( ) <nl> wakeup_event . tryWait ( retry_delay_ms ) ; <nl> continue ; <nl> } <nl> - } while ( false ) ; <nl> <nl> - while ( ! need_stop & & ! tryStartup ( ) ) <nl> - wakeup_event . tryWait ( retry_delay_ms ) ; <nl> - <nl> - if ( need_stop ) <nl> - break ; <nl> + if ( ! need_stop & & ! tryStartup ( ) ) <nl> + { <nl> + wakeup_event . tryWait ( retry_delay_ms ) ; <nl> + continue ; <nl> + } <nl> + } while ( false ) ; <nl> <nl> storage . is_read_only = false ; <nl> + first_time = false ; <nl> } <nl> <nl> wakeup_event . tryWait ( check_delay_ms ) ; <nl> bool ReplicatedMergeTreeRestartingThread : : tryStartup ( ) <nl> { <nl> activateReplica ( ) ; <nl> <nl> - storage . leader_election = new zkutil : : LeaderElection ( storage . zookeeper_path + " / leader_election " , * storage . zookeeper , <nl> - std : : bind ( & StorageReplicatedMergeTree : : becomeLeader , & storage ) , storage . replica_name ) ; <nl> + storage . leader_election = new zkutil : : LeaderElection ( <nl> + storage . zookeeper_path + " / leader_election " , <nl> + * storage . zookeeper , <nl> + [ this ] { storage . becomeLeader ( ) ; } , <nl> + storage . replica_name ) ; <nl> <nl> / / / Все , что выше , может бросить KeeperException , если что - то не так с ZK . <nl> / / / Все , что ниже , не должно бросать исключений . <nl> mmm a / dbms / src / Storages / StorageReplicatedMergeTree . cpp <nl> ppp b / dbms / src / Storages / StorageReplicatedMergeTree . cpp <nl> StorageReplicatedMergeTree : : StorageReplicatedMergeTree ( <nl> if ( ! attach ) <nl> throw Exception ( " Can ' t create replicated table without ZooKeeper " , ErrorCodes : : NO_ZOOKEEPER ) ; <nl> <nl> - is_read_only = true ; <nl> + / / / Не активируем реплику . Она будет в режиме readonly . <nl> return ; <nl> } <nl> <nl> StoragePtr StorageReplicatedMergeTree : : create ( <nl> } ; <nl> StoragePtr res_ptr = res - > thisPtr ( ) ; <nl> <nl> - if ( ! res - > is_read_only ) <nl> + if ( res - > zookeeper ) <nl> { <nl> String endpoint_name = " ReplicatedMergeTree : " + res - > replica_path ; <nl> InterserverIOEndpointPtr endpoint = new ReplicatedMergeTreePartsServer ( res - > data , * res ) ; <nl>
dbms : fixed error with re - initializing session in ZK [ # METR - 14238 ] .
ClickHouse/ClickHouse
2aa2cb18c4b1f08412a98d1ad897dc3f5358c109
2014-12-11T01:56:42Z
mmm a / src / webui / webui . qrc <nl> ppp b / src / webui / webui . qrc <nl> <nl> < RCC > <nl> < qresource prefix = " / " > <nl> + < file > www / private / about . html < / file > <nl> + < file > www / private / addtrackers . html < / file > <nl> + < file > www / private / confirmdeletion . html < / file > <nl> < file > www / private / css / Core . css < / file > <nl> < file > www / private / css / dynamicTable . css < / file > <nl> < file > www / private / css / Layout . css < / file > <nl> < file > www / private / css / style . css < / file > <nl> < file > www / private / css / Tabs . css < / file > <nl> < file > www / private / css / Window . css < / file > <nl> + < file > www / private / download . html < / file > <nl> + < file > www / private / downloadlimit . html < / file > <nl> + < file > www / private / filters . html < / file > <nl> + < file > www / private / index . html < / file > <nl> + < file > www / private / newcategory . html < / file > <nl> + < file > www / private / preferences . html < / file > <nl> + < file > www / private / preferences_content . html < / file > <nl> + < file > www / private / properties . html < / file > <nl> + < file > www / private / properties_content . html < / file > <nl> + < file > www / private / rename . html < / file > <nl> < file > www / private / scripts / client . js < / file > <nl> - < file > www / private / scripts / clipboard . min . js < / file > <nl> < file > www / private / scripts / contextmenu . js < / file > <nl> < file > www / private / scripts / download . js < / file > <nl> < file > www / private / scripts / dynamicTable . js < / file > <nl> - < file > www / private / scripts / excanvas - compressed . js < / file > <nl> + < file > www / private / scripts / lib / clipboard . min . js < / file > <nl> + < file > www / private / scripts / lib / excanvas - compressed . js < / file > <nl> + < file > www / private / scripts / lib / mocha - yc . js < / file > <nl> + < file > www / private / scripts / lib / mootools - 1 . 2 - core - yc . js < / file > <nl> + < file > www / private / scripts / lib / mootools - 1 . 2 - more . js < / file > <nl> + < file > www / private / scripts / lib / parametrics . js < / file > <nl> < file > www / private / scripts / misc . js < / file > <nl> - < file > www / private / scripts / mocha . js < / file > <nl> < file > www / private / scripts / mocha - init . js < / file > <nl> - < file > www / private / scripts / mocha - yc . js < / file > <nl> - < file > www / private / scripts / mootools - 1 . 2 - core - yc . js < / file > <nl> - < file > www / private / scripts / mootools - 1 . 2 - more . js < / file > <nl> - < file > www / private / scripts / parametrics . js < / file > <nl> < file > www / private / scripts / progressbar . js < / file > <nl> < file > www / private / scripts / prop - files . js < / file > <nl> < file > www / private / scripts / prop - general . js < / file > <nl> < file > www / private / scripts / prop - trackers . js < / file > <nl> < file > www / private / scripts / prop - webseeds . js < / file > <nl> - < file > www / private / about . html < / file > <nl> - < file > www / private / addtrackers . html < / file > <nl> - < file > www / private / confirmdeletion . html < / file > <nl> - < file > www / private / download . html < / file > <nl> - < file > www / private / downloadlimit . html < / file > <nl> - < file > www / private / filters . html < / file > <nl> - < file > www / private / index . html < / file > <nl> - < file > www / private / newcategory . html < / file > <nl> - < file > www / private / preferences . html < / file > <nl> - < file > www / private / preferences_content . html < / file > <nl> - < file > www / private / properties . html < / file > <nl> - < file > www / private / properties_content . html < / file > <nl> - < file > www / private / rename . html < / file > <nl> < file > www / private / setlocation . html < / file > <nl> < file > www / private / statistics . html < / file > <nl> < file > www / private / transferlist . html < / file > <nl> < file > www / private / upload . html < / file > <nl> < file > www / private / uploadlimit . html < / file > <nl> < file > www / public / css / style . css < / file > <nl> - < file > www / public / scripts / mootools - 1 . 2 - core - yc . js < / file > <nl> < file > www / public / login . html < / file > <nl> + < file > www / public / scripts / lib / mootools - 1 . 2 - core - yc . js < / file > <nl> < / qresource > <nl> < / RCC > <nl> mmm a / src / webui / www / private / addtrackers . html <nl> ppp b / src / webui / www / private / addtrackers . html <nl> <nl> < meta charset = " UTF - 8 " / > <nl> < title > QBT_TR ( Trackers addition dialog ) QBT_TR [ CONTEXT = TrackersAdditionDlg ] < / title > <nl> < link rel = " stylesheet " href = " css / style . css " type = " text / css " / > <nl> - < script src = " scripts / mootools - 1 . 2 - core - yc . js " > < / script > <nl> - < script src = " scripts / mootools - 1 . 2 - more . js " > < / script > <nl> + < script src = " scripts / lib / mootools - 1 . 2 - core - yc . js " > < / script > <nl> + < script src = " scripts / lib / mootools - 1 . 2 - more . js " > < / script > <nl> < script > <nl> window . addEvent ( ' domready ' , function ( ) { <nl> $ ( ' trackersUrls ' ) . focus ( ) ; <nl> mmm a / src / webui / www / private / confirmdeletion . html <nl> ppp b / src / webui / www / private / confirmdeletion . html <nl> <nl> < meta charset = " UTF - 8 " / > <nl> < title > QBT_TR ( Deletion confirmation - qBittorrent ) QBT_TR [ CONTEXT = confirmDeletionDlg ] < / title > <nl> < link rel = " stylesheet " href = " css / style . css " type = " text / css " / > <nl> - < script src = " scripts / mootools - 1 . 2 - core - yc . js " > < / script > <nl> - < script src = " scripts / mootools - 1 . 2 - more . js " > < / script > <nl> + < script src = " scripts / lib / mootools - 1 . 2 - core - yc . js " > < / script > <nl> + < script src = " scripts / lib / mootools - 1 . 2 - more . js " > < / script > <nl> < script > <nl> var hashes = new URI ( ) . getData ( ' hashes ' ) . split ( ' | ' ) ; <nl> window . addEvent ( ' domready ' , function ( ) { <nl> mmm a / src / webui / www / private / download . html <nl> ppp b / src / webui / www / private / download . html <nl> <nl> < title > QBT_TR ( Add Torrent Links ) QBT_TR [ CONTEXT = downloadFromURL ] < / title > <nl> < link rel = " stylesheet " href = " css / style . css " type = " text / css " / > <nl> < link rel = " stylesheet " href = " css / Window . css " type = " text / css " / > <nl> - < script src = " scripts / mootools - 1 . 2 - core - yc . js " > < / script > <nl> + < script src = " scripts / lib / mootools - 1 . 2 - core - yc . js " > < / script > <nl> < script src = " scripts / download . js " > < / script > <nl> < / head > <nl> < body > <nl> mmm a / src / webui / www / private / downloadlimit . html <nl> ppp b / src / webui / www / private / downloadlimit . html <nl> <nl> < meta charset = " UTF - 8 " / > <nl> < title > QBT_TR ( Torrent Download Speed Limiting ) QBT_TR [ CONTEXT = TransferListWidget ] < / title > <nl> < link rel = " stylesheet " href = " css / style . css " type = " text / css " / > <nl> - < script src = " scripts / mootools - 1 . 2 - core - yc . js " > < / script > <nl> - < script src = " scripts / mootools - 1 . 2 - more . js " > < / script > <nl> - < script src = " scripts / mocha - yc . js " > < / script > <nl> - < script src = " scripts / parametrics . js " > < / script > <nl> + < script src = " scripts / lib / mootools - 1 . 2 - core - yc . js " > < / script > <nl> + < script src = " scripts / lib / mootools - 1 . 2 - more . js " > < / script > <nl> + < script src = " scripts / lib / mocha - yc . js " > < / script > <nl> + < script src = " scripts / lib / parametrics . js " > < / script > <nl> < / head > <nl> < body > <nl> < div style = " width : 100 % ; text - align : center ; margin : 0 auto ; overflow : hidden " > <nl> mmm a / src / webui / www / private / index . html <nl> ppp b / src / webui / www / private / index . html <nl> <nl> < link rel = " stylesheet " type = " text / css " href = " css / Layout . css " / > <nl> < link rel = " stylesheet " type = " text / css " href = " css / Window . css " / > <nl> < link rel = " stylesheet " type = " text / css " href = " css / Tabs . css " / > <nl> - < script src = " scripts / mootools - 1 . 2 - core - yc . js " > < / script > <nl> - < script src = " scripts / mootools - 1 . 2 - more . js " > < / script > <nl> + < script src = " scripts / lib / mootools - 1 . 2 - core - yc . js " > < / script > <nl> + < script src = " scripts / lib / mootools - 1 . 2 - more . js " > < / script > <nl> < ! - - [ if IE ] > <nl> - < script src = " scripts / excanvas - compressed . js " > < / script > <nl> + < script src = " scripts / lib / excanvas - compressed . js " > < / script > <nl> < ! [ endif ] - - > <nl> - < script src = " scripts / mocha - yc . js " > < / script > <nl> + < script src = " scripts / lib / mocha - yc . js " > < / script > <nl> < script src = " scripts / mocha - init . js " > < / script > <nl> - < script src = " scripts / clipboard . min . js " > < / script > <nl> + < script src = " scripts / lib / clipboard . min . js " > < / script > <nl> < script src = " scripts / misc . js " > < / script > <nl> < script src = " scripts / progressbar . js " > < / script > <nl> < script src = " scripts / dynamicTable . js " > < / script > <nl> mmm a / src / webui / www / private / newcategory . html <nl> ppp b / src / webui / www / private / newcategory . html <nl> <nl> < meta charset = " UTF - 8 " / > <nl> < title > QBT_TR ( New Category ) QBT_TR [ CONTEXT = TransferListWidget ] < / title > <nl> < link rel = " stylesheet " href = " css / style . css " type = " text / css " / > <nl> - < script src = " scripts / mootools - 1 . 2 - core - yc . js " > < / script > <nl> - < script src = " scripts / mootools - 1 . 2 - more . js " > < / script > <nl> + < script src = " scripts / lib / mootools - 1 . 2 - core - yc . js " > < / script > <nl> + < script src = " scripts / lib / mootools - 1 . 2 - more . js " > < / script > <nl> < script > <nl> var newCategoryKeyboardEvents = new Keyboard ( { <nl> defaultEventType : ' keydown ' , <nl> mmm a / src / webui / www / private / preferences . html <nl> ppp b / src / webui / www / private / preferences . html <nl> <nl> < title > QBT_TR ( Download from URLs ) QBT_TR [ CONTEXT = downloadFromURL ] < / title > <nl> < link rel = " stylesheet " href = " css / style . css " type = " text / css " / > <nl> < link rel = " stylesheet " href = " css / Tabs . css " type = " text / css " / > <nl> - < script src = " scripts / mootools - 1 . 2 - core - yc . js " > < / script > <nl> - < script src = " scripts / mootools - 1 . 2 - more . js " > < / script > <nl> - < script src = " scripts / mocha - yc . js " > < / script > <nl> + < script src = " scripts / lib / mootools - 1 . 2 - core - yc . js " > < / script > <nl> + < script src = " scripts / lib / mootools - 1 . 2 - more . js " > < / script > <nl> + < script src = " scripts / lib / mocha - yc . js " > < / script > <nl> < / head > <nl> < body style = " padding : 5px ; " > <nl> < ! - - preferences - - > <nl> mmm a / src / webui / www / private / rename . html <nl> ppp b / src / webui / www / private / rename . html <nl> <nl> < meta charset = " UTF - 8 " / > <nl> < title > QBT_TR ( Rename ) QBT_TR [ CONTEXT = TransferListWidget ] < / title > <nl> < link rel = " stylesheet " href = " css / style . css " type = " text / css " / > <nl> - < script src = " scripts / mootools - 1 . 2 - core - yc . js " > < / script > <nl> - < script src = " scripts / mootools - 1 . 2 - more . js " > < / script > <nl> + < script src = " scripts / lib / mootools - 1 . 2 - core - yc . js " > < / script > <nl> + < script src = " scripts / lib / mootools - 1 . 2 - more . js " > < / script > <nl> < script src = " scripts / misc . js " > < / script > <nl> < script > <nl> var renameKeyboardEvents = new Keyboard ( { <nl> mmm a / src / webui / www / private / scripts / client . js <nl> ppp b / src / webui / www / private / scripts / client . js <nl> function setupCopyEventHandler ( ) { <nl> if ( clipboardEvent ) <nl> clipboardEvent . destroy ( ) ; <nl> <nl> - clipboardEvent = new Clipboard ( ' . copyToClipboard ' , { <nl> + clipboardEvent = new ClipboardJS ( ' . copyToClipboard ' , { <nl> text : function ( trigger ) { <nl> var textToCopy ; <nl> <nl> deleted file mode 100644 <nl> index 90fd15b1c0 . . 0000000000 <nl> mmm a / src / webui / www / private / scripts / clipboard . min . js <nl> ppp / dev / null <nl> <nl> - / * ! <nl> - * clipboard . js v1 . 7 . 1 <nl> - * https : / / zenorocha . github . io / clipboard . js <nl> - * <nl> - * Licensed MIT © Zeno Rocha <nl> - * / <nl> - ! function ( t ) { if ( " object " = = typeof exports & & " undefined " ! = typeof module ) module . exports = t ( ) ; else if ( " function " = = typeof define & & define . amd ) define ( [ ] , t ) ; else { var e ; e = " undefined " ! = typeof window ? window : " undefined " ! = typeof global ? global : " undefined " ! = typeof self ? self : this , e . Clipboard = t ( ) } } ( function ( ) { var t , e , n ; return function t ( e , n , o ) { function i ( a , c ) { if ( ! n [ a ] ) { if ( ! e [ a ] ) { var l = " function " = = typeof require & & require ; if ( ! c & & l ) return l ( a , ! 0 ) ; if ( r ) return r ( a , ! 0 ) ; var s = new Error ( " Cannot find module ' " + a + " ' " ) ; throw s . code = " MODULE_NOT_FOUND " , s } var u = n [ a ] = { exports : { } } ; e [ a ] [ 0 ] . call ( u . exports , function ( t ) { var n = e [ a ] [ 1 ] [ t ] ; return i ( n | | t ) } , u , u . exports , t , e , n , o ) } return n [ a ] . exports } for ( var r = " function " = = typeof require & & require , a = 0 ; a < o . length ; a + + ) i ( o [ a ] ) ; return i } ( { 1 : [ function ( t , e , n ) { function o ( t , e ) { for ( ; t & & t . nodeType ! = = i ; ) { if ( " function " = = typeof t . matches & & t . matches ( e ) ) return t ; t = t . parentNode } } var i = 9 ; if ( " undefined " ! = typeof Element & & ! Element . prototype . matches ) { var r = Element . prototype ; r . matches = r . matchesSelector | | r . mozMatchesSelector | | r . msMatchesSelector | | r . oMatchesSelector | | r . webkitMatchesSelector } e . exports = o } , { } ] , 2 : [ function ( t , e , n ) { function o ( t , e , n , o , r ) { var a = i . apply ( this , arguments ) ; return t . addEventListener ( n , a , r ) , { destroy : function ( ) { t . removeEventListener ( n , a , r ) } } } function i ( t , e , n , o ) { return function ( n ) { n . delegateTarget = r ( n . target , e ) , n . delegateTarget & & o . call ( t , n ) } } var r = t ( " . / closest " ) ; e . exports = o } , { " . / closest " : 1 } ] , 3 : [ function ( t , e , n ) { n . node = function ( t ) { return void 0 ! = = t & & t instanceof HTMLElement & & 1 = = = t . nodeType } , n . nodeList = function ( t ) { var e = Object . prototype . toString . call ( t ) ; return void 0 ! = = t & & ( " [ object NodeList ] " = = = e | | " [ object HTMLCollection ] " = = = e ) & & " length " in t & & ( 0 = = = t . length | | n . node ( t [ 0 ] ) ) } , n . string = function ( t ) { return " string " = = typeof t | | t instanceof String } , n . fn = function ( t ) { return " [ object Function ] " = = = Object . prototype . toString . call ( t ) } } , { } ] , 4 : [ function ( t , e , n ) { function o ( t , e , n ) { if ( ! t & & ! e & & ! n ) throw new Error ( " Missing required arguments " ) ; if ( ! c . string ( e ) ) throw new TypeError ( " Second argument must be a String " ) ; if ( ! c . fn ( n ) ) throw new TypeError ( " Third argument must be a Function " ) ; if ( c . node ( t ) ) return i ( t , e , n ) ; if ( c . nodeList ( t ) ) return r ( t , e , n ) ; if ( c . string ( t ) ) return a ( t , e , n ) ; throw new TypeError ( " First argument must be a String , HTMLElement , HTMLCollection , or NodeList " ) } function i ( t , e , n ) { return t . addEventListener ( e , n ) , { destroy : function ( ) { t . removeEventListener ( e , n ) } } } function r ( t , e , n ) { return Array . prototype . forEach . call ( t , function ( t ) { t . addEventListener ( e , n ) } ) , { destroy : function ( ) { Array . prototype . forEach . call ( t , function ( t ) { t . removeEventListener ( e , n ) } ) } } } function a ( t , e , n ) { return l ( document . body , t , e , n ) } var c = t ( " . / is " ) , l = t ( " delegate " ) ; e . exports = o } , { " . / is " : 3 , delegate : 2 } ] , 5 : [ function ( t , e , n ) { function o ( t ) { var e ; if ( " SELECT " = = = t . nodeName ) t . focus ( ) , e = t . value ; else if ( " INPUT " = = = t . nodeName | | " TEXTAREA " = = = t . nodeName ) { var n = t . hasAttribute ( " readonly " ) ; n | | t . setAttribute ( " readonly " , " " ) , t . select ( ) , t . setSelectionRange ( 0 , t . value . length ) , n | | t . removeAttribute ( " readonly " ) , e = t . value } else { t . hasAttribute ( " contenteditable " ) & & t . focus ( ) ; var o = window . getSelection ( ) , i = document . createRange ( ) ; i . selectNodeContents ( t ) , o . removeAllRanges ( ) , o . addRange ( i ) , e = o . toString ( ) } return e } e . exports = o } , { } ] , 6 : [ function ( t , e , n ) { function o ( ) { } o . prototype = { on : function ( t , e , n ) { var o = this . e | | ( this . e = { } ) ; return ( o [ t ] | | ( o [ t ] = [ ] ) ) . push ( { fn : e , ctx : n } ) , this } , once : function ( t , e , n ) { function o ( ) { i . off ( t , o ) , e . apply ( n , arguments ) } var i = this ; return o . _ = e , this . on ( t , o , n ) } , emit : function ( t ) { var e = [ ] . slice . call ( arguments , 1 ) , n = ( ( this . e | | ( this . e = { } ) ) [ t ] | | [ ] ) . slice ( ) , o = 0 , i = n . length ; for ( o ; o < i ; o + + ) n [ o ] . fn . apply ( n [ o ] . ctx , e ) ; return this } , off : function ( t , e ) { var n = this . e | | ( this . e = { } ) , o = n [ t ] , i = [ ] ; if ( o & & e ) for ( var r = 0 , a = o . length ; r < a ; r + + ) o [ r ] . fn ! = = e & & o [ r ] . fn . _ ! = = e & & i . push ( o [ r ] ) ; return i . length ? n [ t ] = i : delete n [ t ] , this } } , e . exports = o } , { } ] , 7 : [ function ( e , n , o ) { ! function ( i , r ) { if ( " function " = = typeof t & & t . amd ) t ( [ " module " , " select " ] , r ) ; else if ( void 0 ! = = o ) r ( n , e ( " select " ) ) ; else { var a = { exports : { } } ; r ( a , i . select ) , i . clipboardAction = a . exports } } ( this , function ( t , e ) { " use strict " ; function n ( t ) { return t & & t . __esModule ? t : { default : t } } function o ( t , e ) { if ( ! ( t instanceof e ) ) throw new TypeError ( " Cannot call a class as a function " ) } var i = n ( e ) , r = " function " = = typeof Symbol & & " symbol " = = typeof Symbol . iterator ? function ( t ) { return typeof t } : function ( t ) { return t & & " function " = = typeof Symbol & & t . constructor = = = Symbol & & t ! = = Symbol . prototype ? " symbol " : typeof t } , a = function ( ) { function t ( t , e ) { for ( var n = 0 ; n < e . length ; n + + ) { var o = e [ n ] ; o . enumerable = o . enumerable | | ! 1 , o . configurable = ! 0 , " value " in o & & ( o . writable = ! 0 ) , Object . defineProperty ( t , o . key , o ) } } return function ( e , n , o ) { return n & & t ( e . prototype , n ) , o & & t ( e , o ) , e } } ( ) , c = function ( ) { function t ( e ) { o ( this , t ) , this . resolveOptions ( e ) , this . initSelection ( ) } return a ( t , [ { key : " resolveOptions " , value : function t ( ) { var e = arguments . length > 0 & & void 0 ! = = arguments [ 0 ] ? arguments [ 0 ] : { } ; this . action = e . action , this . container = e . container , this . emitter = e . emitter , this . target = e . target , this . text = e . text , this . trigger = e . trigger , this . selectedText = " " } } , { key : " initSelection " , value : function t ( ) { this . text ? this . selectFake ( ) : this . target & & this . selectTarget ( ) } } , { key : " selectFake " , value : function t ( ) { var e = this , n = " rtl " = = document . documentElement . getAttribute ( " dir " ) ; this . removeFake ( ) , this . fakeHandlerCallback = function ( ) { return e . removeFake ( ) } , this . fakeHandler = this . container . addEventListener ( " click " , this . fakeHandlerCallback ) | | ! 0 , this . fakeElem = document . createElement ( " textarea " ) , this . fakeElem . style . fontSize = " 12pt " , this . fakeElem . style . border = " 0 " , this . fakeElem . style . padding = " 0 " , this . fakeElem . style . margin = " 0 " , this . fakeElem . style . position = " absolute " , this . fakeElem . style [ n ? " right " : " left " ] = " - 9999px " ; var o = window . pageYOffset | | document . documentElement . scrollTop ; this . fakeElem . style . top = o + " px " , this . fakeElem . setAttribute ( " readonly " , " " ) , this . fakeElem . value = this . text , this . container . appendChild ( this . fakeElem ) , this . selectedText = ( 0 , i . default ) ( this . fakeElem ) , this . copyText ( ) } } , { key : " removeFake " , value : function t ( ) { this . fakeHandler & & ( this . container . removeEventListener ( " click " , this . fakeHandlerCallback ) , this . fakeHandler = null , this . fakeHandlerCallback = null ) , this . fakeElem & & ( this . container . removeChild ( this . fakeElem ) , this . fakeElem = null ) } } , { key : " selectTarget " , value : function t ( ) { this . selectedText = ( 0 , i . default ) ( this . target ) , this . copyText ( ) } } , { key : " copyText " , value : function t ( ) { var e = void 0 ; try { e = document . execCommand ( this . action ) } catch ( t ) { e = ! 1 } this . handleResult ( e ) } } , { key : " handleResult " , value : function t ( e ) { this . emitter . emit ( e ? " success " : " error " , { action : this . action , text : this . selectedText , trigger : this . trigger , clearSelection : this . clearSelection . bind ( this ) } ) } } , { key : " clearSelection " , value : function t ( ) { this . trigger & & this . trigger . focus ( ) , window . getSelection ( ) . removeAllRanges ( ) } } , { key : " destroy " , value : function t ( ) { this . removeFake ( ) } } , { key : " action " , set : function t ( ) { var e = arguments . length > 0 & & void 0 ! = = arguments [ 0 ] ? arguments [ 0 ] : " copy " ; if ( this . _action = e , " copy " ! = = this . _action & & " cut " ! = = this . _action ) throw new Error ( ' Invalid " action " value , use either " copy " or " cut " ' ) } , get : function t ( ) { return this . _action } } , { key : " target " , set : function t ( e ) { if ( void 0 ! = = e ) { if ( ! e | | " object " ! = = ( void 0 = = = e ? " undefined " : r ( e ) ) | | 1 ! = = e . nodeType ) throw new Error ( ' Invalid " target " value , use a valid Element ' ) ; if ( " copy " = = = this . action & & e . hasAttribute ( " disabled " ) ) throw new Error ( ' Invalid " target " attribute . Please use " readonly " instead of " disabled " attribute ' ) ; if ( " cut " = = = this . action & & ( e . hasAttribute ( " readonly " ) | | e . hasAttribute ( " disabled " ) ) ) throw new Error ( ' Invalid " target " attribute . You can \ ' t cut text from elements with " readonly " or " disabled " attributes ' ) ; this . _target = e } } , get : function t ( ) { return this . _target } } ] ) , t } ( ) ; t . exports = c } ) } , { select : 5 } ] , 8 : [ function ( e , n , o ) { ! function ( i , r ) { if ( " function " = = typeof t & & t . amd ) t ( [ " module " , " . / clipboard - action " , " tiny - emitter " , " good - listener " ] , r ) ; else if ( void 0 ! = = o ) r ( n , e ( " . / clipboard - action " ) , e ( " tiny - emitter " ) , e ( " good - listener " ) ) ; else { var a = { exports : { } } ; r ( a , i . clipboardAction , i . tinyEmitter , i . goodListener ) , i . clipboard = a . exports } } ( this , function ( t , e , n , o ) { " use strict " ; function i ( t ) { return t & & t . __esModule ? t : { default : t } } function r ( t , e ) { if ( ! ( t instanceof e ) ) throw new TypeError ( " Cannot call a class as a function " ) } function a ( t , e ) { if ( ! t ) throw new ReferenceError ( " this hasn ' t been initialised - super ( ) hasn ' t been called " ) ; return ! e | | " object " ! = typeof e & & " function " ! = typeof e ? t : e } function c ( t , e ) { if ( " function " ! = typeof e & & null ! = = e ) throw new TypeError ( " Super expression must either be null or a function , not " + typeof e ) ; t . prototype = Object . create ( e & & e . prototype , { constructor : { value : t , enumerable : ! 1 , writable : ! 0 , configurable : ! 0 } } ) , e & & ( Object . setPrototypeOf ? Object . setPrototypeOf ( t , e ) : t . __proto__ = e ) } function l ( t , e ) { var n = " data - clipboard - " + t ; if ( e . hasAttribute ( n ) ) return e . getAttribute ( n ) } var s = i ( e ) , u = i ( n ) , f = i ( o ) , d = " function " = = typeof Symbol & & " symbol " = = typeof Symbol . iterator ? function ( t ) { return typeof t } : function ( t ) { return t & & " function " = = typeof Symbol & & t . constructor = = = Symbol & & t ! = = Symbol . prototype ? " symbol " : typeof t } , h = function ( ) { function t ( t , e ) { for ( var n = 0 ; n < e . length ; n + + ) { var o = e [ n ] ; o . enumerable = o . enumerable | | ! 1 , o . configurable = ! 0 , " value " in o & & ( o . writable = ! 0 ) , Object . defineProperty ( t , o . key , o ) } } return function ( e , n , o ) { return n & & t ( e . prototype , n ) , o & & t ( e , o ) , e } } ( ) , p = function ( t ) { function e ( t , n ) { r ( this , e ) ; var o = a ( this , ( e . __proto__ | | Object . getPrototypeOf ( e ) ) . call ( this ) ) ; return o . resolveOptions ( n ) , o . listenClick ( t ) , o } return c ( e , t ) , h ( e , [ { key : " resolveOptions " , value : function t ( ) { var e = arguments . length > 0 & & void 0 ! = = arguments [ 0 ] ? arguments [ 0 ] : { } ; this . action = " function " = = typeof e . action ? e . action : this . defaultAction , this . target = " function " = = typeof e . target ? e . target : this . defaultTarget , this . text = " function " = = typeof e . text ? e . text : this . defaultText , this . container = " object " = = = d ( e . container ) ? e . container : document . body } } , { key : " listenClick " , value : function t ( e ) { var n = this ; this . listener = ( 0 , f . default ) ( e , " click " , function ( t ) { return n . onClick ( t ) } ) } } , { key : " onClick " , value : function t ( e ) { var n = e . delegateTarget | | e . currentTarget ; this . clipboardAction & & ( this . clipboardAction = null ) , this . clipboardAction = new s . default ( { action : this . action ( n ) , target : this . target ( n ) , text : this . text ( n ) , container : this . container , trigger : n , emitter : this } ) } } , { key : " defaultAction " , value : function t ( e ) { return l ( " action " , e ) } } , { key : " defaultTarget " , value : function t ( e ) { var n = l ( " target " , e ) ; if ( n ) return document . querySelector ( n ) } } , { key : " defaultText " , value : function t ( e ) { return l ( " text " , e ) } } , { key : " destroy " , value : function t ( ) { this . listener . destroy ( ) , this . clipboardAction & & ( this . clipboardAction . destroy ( ) , this . clipboardAction = null ) } } ] , [ { key : " isSupported " , value : function t ( ) { var e = arguments . length > 0 & & void 0 ! = = arguments [ 0 ] ? arguments [ 0 ] : [ " copy " , " cut " ] , n = " string " = = typeof e ? [ e ] : e , o = ! ! document . queryCommandSupported ; return n . forEach ( function ( t ) { o = o & & ! ! document . queryCommandSupported ( t ) } ) , o } } ] ) , e } ( u . default ) ; t . exports = p } ) } , { " . / clipboard - action " : 7 , " good - listener " : 4 , " tiny - emitter " : 6 } ] } , { } , [ 8 ] ) ( 8 ) } ) ; <nl> \ No newline at end of file <nl> new file mode 100644 <nl> index 0000000000 . . 03ff493711 <nl> mmm / dev / null <nl> ppp b / src / webui / www / private / scripts / lib / clipboard . min . js <nl> <nl> + / * ! <nl> + * clipboard . js v2 . 0 . 0 <nl> + * https : / / zenorocha . github . io / clipboard . js <nl> + * <nl> + * Licensed MIT © Zeno Rocha <nl> + * / <nl> + ! function ( t , e ) { " object " = = typeof exports & & " object " = = typeof module ? module . exports = e ( ) : " function " = = typeof define & & define . amd ? define ( [ ] , e ) : " object " = = typeof exports ? exports . ClipboardJS = e ( ) : t . ClipboardJS = e ( ) } ( this , function ( ) { return function ( t ) { function e ( o ) { if ( n [ o ] ) return n [ o ] . exports ; var r = n [ o ] = { i : o , l : ! 1 , exports : { } } ; return t [ o ] . call ( r . exports , r , r . exports , e ) , r . l = ! 0 , r . exports } var n = { } ; return e . m = t , e . c = n , e . i = function ( t ) { return t } , e . d = function ( t , n , o ) { e . o ( t , n ) | | Object . defineProperty ( t , n , { configurable : ! 1 , enumerable : ! 0 , get : o } ) } , e . n = function ( t ) { var n = t & & t . __esModule ? function ( ) { return t . default } : function ( ) { return t } ; return e . d ( n , " a " , n ) , n } , e . o = function ( t , e ) { return Object . prototype . hasOwnProperty . call ( t , e ) } , e . p = " " , e ( e . s = 3 ) } ( [ function ( t , e , n ) { var o , r , i ; ! function ( a , c ) { r = [ t , n ( 7 ) ] , o = c , void 0 ! = = ( i = " function " = = typeof o ? o . apply ( e , r ) : o ) & & ( t . exports = i ) } ( 0 , function ( t , e ) { " use strict " ; function n ( t , e ) { if ( ! ( t instanceof e ) ) throw new TypeError ( " Cannot call a class as a function " ) } var o = function ( t ) { return t & & t . __esModule ? t : { default : t } } ( e ) , r = " function " = = typeof Symbol & & " symbol " = = typeof Symbol . iterator ? function ( t ) { return typeof t } : function ( t ) { return t & & " function " = = typeof Symbol & & t . constructor = = = Symbol & & t ! = = Symbol . prototype ? " symbol " : typeof t } , i = function ( ) { function t ( t , e ) { for ( var n = 0 ; n < e . length ; n + + ) { var o = e [ n ] ; o . enumerable = o . enumerable | | ! 1 , o . configurable = ! 0 , " value " in o & & ( o . writable = ! 0 ) , Object . defineProperty ( t , o . key , o ) } } return function ( e , n , o ) { return n & & t ( e . prototype , n ) , o & & t ( e , o ) , e } } ( ) , a = function ( ) { function t ( e ) { n ( this , t ) , this . resolveOptions ( e ) , this . initSelection ( ) } return i ( t , [ { key : " resolveOptions " , value : function ( ) { var t = arguments . length > 0 & & void 0 ! = = arguments [ 0 ] ? arguments [ 0 ] : { } ; this . action = t . action , this . container = t . container , this . emitter = t . emitter , this . target = t . target , this . text = t . text , this . trigger = t . trigger , this . selectedText = " " } } , { key : " initSelection " , value : function ( ) { this . text ? this . selectFake ( ) : this . target & & this . selectTarget ( ) } } , { key : " selectFake " , value : function ( ) { var t = this , e = " rtl " = = document . documentElement . getAttribute ( " dir " ) ; this . removeFake ( ) , this . fakeHandlerCallback = function ( ) { return t . removeFake ( ) } , this . fakeHandler = this . container . addEventListener ( " click " , this . fakeHandlerCallback ) | | ! 0 , this . fakeElem = document . createElement ( " textarea " ) , this . fakeElem . style . fontSize = " 12pt " , this . fakeElem . style . border = " 0 " , this . fakeElem . style . padding = " 0 " , this . fakeElem . style . margin = " 0 " , this . fakeElem . style . position = " absolute " , this . fakeElem . style [ e ? " right " : " left " ] = " - 9999px " ; var n = window . pageYOffset | | document . documentElement . scrollTop ; this . fakeElem . style . top = n + " px " , this . fakeElem . setAttribute ( " readonly " , " " ) , this . fakeElem . value = this . text , this . container . appendChild ( this . fakeElem ) , this . selectedText = ( 0 , o . default ) ( this . fakeElem ) , this . copyText ( ) } } , { key : " removeFake " , value : function ( ) { this . fakeHandler & & ( this . container . removeEventListener ( " click " , this . fakeHandlerCallback ) , this . fakeHandler = null , this . fakeHandlerCallback = null ) , this . fakeElem & & ( this . container . removeChild ( this . fakeElem ) , this . fakeElem = null ) } } , { key : " selectTarget " , value : function ( ) { this . selectedText = ( 0 , o . default ) ( this . target ) , this . copyText ( ) } } , { key : " copyText " , value : function ( ) { var t = void 0 ; try { t = document . execCommand ( this . action ) } catch ( e ) { t = ! 1 } this . handleResult ( t ) } } , { key : " handleResult " , value : function ( t ) { this . emitter . emit ( t ? " success " : " error " , { action : this . action , text : this . selectedText , trigger : this . trigger , clearSelection : this . clearSelection . bind ( this ) } ) } } , { key : " clearSelection " , value : function ( ) { this . trigger & & this . trigger . focus ( ) , window . getSelection ( ) . removeAllRanges ( ) } } , { key : " destroy " , value : function ( ) { this . removeFake ( ) } } , { key : " action " , set : function ( ) { var t = arguments . length > 0 & & void 0 ! = = arguments [ 0 ] ? arguments [ 0 ] : " copy " ; if ( this . _action = t , " copy " ! = = this . _action & & " cut " ! = = this . _action ) throw new Error ( ' Invalid " action " value , use either " copy " or " cut " ' ) } , get : function ( ) { return this . _action } } , { key : " target " , set : function ( t ) { if ( void 0 ! = = t ) { if ( ! t | | " object " ! = = ( void 0 = = = t ? " undefined " : r ( t ) ) | | 1 ! = = t . nodeType ) throw new Error ( ' Invalid " target " value , use a valid Element ' ) ; if ( " copy " = = = this . action & & t . hasAttribute ( " disabled " ) ) throw new Error ( ' Invalid " target " attribute . Please use " readonly " instead of " disabled " attribute ' ) ; if ( " cut " = = = this . action & & ( t . hasAttribute ( " readonly " ) | | t . hasAttribute ( " disabled " ) ) ) throw new Error ( ' Invalid " target " attribute . You can \ ' t cut text from elements with " readonly " or " disabled " attributes ' ) ; this . _target = t } } , get : function ( ) { return this . _target } } ] ) , t } ( ) ; t . exports = a } ) } , function ( t , e , n ) { function o ( t , e , n ) { if ( ! t & & ! e & & ! n ) throw new Error ( " Missing required arguments " ) ; if ( ! c . string ( e ) ) throw new TypeError ( " Second argument must be a String " ) ; if ( ! c . fn ( n ) ) throw new TypeError ( " Third argument must be a Function " ) ; if ( c . node ( t ) ) return r ( t , e , n ) ; if ( c . nodeList ( t ) ) return i ( t , e , n ) ; if ( c . string ( t ) ) return a ( t , e , n ) ; throw new TypeError ( " First argument must be a String , HTMLElement , HTMLCollection , or NodeList " ) } function r ( t , e , n ) { return t . addEventListener ( e , n ) , { destroy : function ( ) { t . removeEventListener ( e , n ) } } } function i ( t , e , n ) { return Array . prototype . forEach . call ( t , function ( t ) { t . addEventListener ( e , n ) } ) , { destroy : function ( ) { Array . prototype . forEach . call ( t , function ( t ) { t . removeEventListener ( e , n ) } ) } } } function a ( t , e , n ) { return u ( document . body , t , e , n ) } var c = n ( 6 ) , u = n ( 5 ) ; t . exports = o } , function ( t , e ) { function n ( ) { } n . prototype = { on : function ( t , e , n ) { var o = this . e | | ( this . e = { } ) ; return ( o [ t ] | | ( o [ t ] = [ ] ) ) . push ( { fn : e , ctx : n } ) , this } , once : function ( t , e , n ) { function o ( ) { r . off ( t , o ) , e . apply ( n , arguments ) } var r = this ; return o . _ = e , this . on ( t , o , n ) } , emit : function ( t ) { var e = [ ] . slice . call ( arguments , 1 ) , n = ( ( this . e | | ( this . e = { } ) ) [ t ] | | [ ] ) . slice ( ) , o = 0 , r = n . length ; for ( o ; o < r ; o + + ) n [ o ] . fn . apply ( n [ o ] . ctx , e ) ; return this } , off : function ( t , e ) { var n = this . e | | ( this . e = { } ) , o = n [ t ] , r = [ ] ; if ( o & & e ) for ( var i = 0 , a = o . length ; i < a ; i + + ) o [ i ] . fn ! = = e & & o [ i ] . fn . _ ! = = e & & r . push ( o [ i ] ) ; return r . length ? n [ t ] = r : delete n [ t ] , this } } , t . exports = n } , function ( t , e , n ) { var o , r , i ; ! function ( a , c ) { r = [ t , n ( 0 ) , n ( 2 ) , n ( 1 ) ] , o = c , void 0 ! = = ( i = " function " = = typeof o ? o . apply ( e , r ) : o ) & & ( t . exports = i ) } ( 0 , function ( t , e , n , o ) { " use strict " ; function r ( t ) { return t & & t . __esModule ? t : { default : t } } function i ( t , e ) { if ( ! ( t instanceof e ) ) throw new TypeError ( " Cannot call a class as a function " ) } function a ( t , e ) { if ( ! t ) throw new ReferenceError ( " this hasn ' t been initialised - super ( ) hasn ' t been called " ) ; return ! e | | " object " ! = typeof e & & " function " ! = typeof e ? t : e } function c ( t , e ) { if ( " function " ! = typeof e & & null ! = = e ) throw new TypeError ( " Super expression must either be null or a function , not " + typeof e ) ; t . prototype = Object . create ( e & & e . prototype , { constructor : { value : t , enumerable : ! 1 , writable : ! 0 , configurable : ! 0 } } ) , e & & ( Object . setPrototypeOf ? Object . setPrototypeOf ( t , e ) : t . __proto__ = e ) } function u ( t , e ) { var n = " data - clipboard - " + t ; if ( e . hasAttribute ( n ) ) return e . getAttribute ( n ) } var l = r ( e ) , s = r ( n ) , f = r ( o ) , d = " function " = = typeof Symbol & & " symbol " = = typeof Symbol . iterator ? function ( t ) { return typeof t } : function ( t ) { return t & & " function " = = typeof Symbol & & t . constructor = = = Symbol & & t ! = = Symbol . prototype ? " symbol " : typeof t } , h = function ( ) { function t ( t , e ) { for ( var n = 0 ; n < e . length ; n + + ) { var o = e [ n ] ; o . enumerable = o . enumerable | | ! 1 , o . configurable = ! 0 , " value " in o & & ( o . writable = ! 0 ) , Object . defineProperty ( t , o . key , o ) } } return function ( e , n , o ) { return n & & t ( e . prototype , n ) , o & & t ( e , o ) , e } } ( ) , p = function ( t ) { function e ( t , n ) { i ( this , e ) ; var o = a ( this , ( e . __proto__ | | Object . getPrototypeOf ( e ) ) . call ( this ) ) ; return o . resolveOptions ( n ) , o . listenClick ( t ) , o } return c ( e , t ) , h ( e , [ { key : " resolveOptions " , value : function ( ) { var t = arguments . length > 0 & & void 0 ! = = arguments [ 0 ] ? arguments [ 0 ] : { } ; this . action = " function " = = typeof t . action ? t . action : this . defaultAction , this . target = " function " = = typeof t . target ? t . target : this . defaultTarget , this . text = " function " = = typeof t . text ? t . text : this . defaultText , this . container = " object " = = = d ( t . container ) ? t . container : document . body } } , { key : " listenClick " , value : function ( t ) { var e = this ; this . listener = ( 0 , f . default ) ( t , " click " , function ( t ) { return e . onClick ( t ) } ) } } , { key : " onClick " , value : function ( t ) { var e = t . delegateTarget | | t . currentTarget ; this . clipboardAction & & ( this . clipboardAction = null ) , this . clipboardAction = new l . default ( { action : this . action ( e ) , target : this . target ( e ) , text : this . text ( e ) , container : this . container , trigger : e , emitter : this } ) } } , { key : " defaultAction " , value : function ( t ) { return u ( " action " , t ) } } , { key : " defaultTarget " , value : function ( t ) { var e = u ( " target " , t ) ; if ( e ) return document . querySelector ( e ) } } , { key : " defaultText " , value : function ( t ) { return u ( " text " , t ) } } , { key : " destroy " , value : function ( ) { this . listener . destroy ( ) , this . clipboardAction & & ( this . clipboardAction . destroy ( ) , this . clipboardAction = null ) } } ] , [ { key : " isSupported " , value : function ( ) { var t = arguments . length > 0 & & void 0 ! = = arguments [ 0 ] ? arguments [ 0 ] : [ " copy " , " cut " ] , e = " string " = = typeof t ? [ t ] : t , n = ! ! document . queryCommandSupported ; return e . forEach ( function ( t ) { n = n & & ! ! document . queryCommandSupported ( t ) } ) , n } } ] ) , e } ( s . default ) ; t . exports = p } ) } , function ( t , e ) { function n ( t , e ) { for ( ; t & & t . nodeType ! = = o ; ) { if ( " function " = = typeof t . matches & & t . matches ( e ) ) return t ; t = t . parentNode } } var o = 9 ; if ( " undefined " ! = typeof Element & & ! Element . prototype . matches ) { var r = Element . prototype ; r . matches = r . matchesSelector | | r . mozMatchesSelector | | r . msMatchesSelector | | r . oMatchesSelector | | r . webkitMatchesSelector } t . exports = n } , function ( t , e , n ) { function o ( t , e , n , o , r ) { var a = i . apply ( this , arguments ) ; return t . addEventListener ( n , a , r ) , { destroy : function ( ) { t . removeEventListener ( n , a , r ) } } } function r ( t , e , n , r , i ) { return " function " = = typeof t . addEventListener ? o . apply ( null , arguments ) : " function " = = typeof n ? o . bind ( null , document ) . apply ( null , arguments ) : ( " string " = = typeof t & & ( t = document . querySelectorAll ( t ) ) , Array . prototype . map . call ( t , function ( t ) { return o ( t , e , n , r , i ) } ) ) } function i ( t , e , n , o ) { return function ( n ) { n . delegateTarget = a ( n . target , e ) , n . delegateTarget & & o . call ( t , n ) } } var a = n ( 4 ) ; t . exports = r } , function ( t , e ) { e . node = function ( t ) { return void 0 ! = = t & & t instanceof HTMLElement & & 1 = = = t . nodeType } , e . nodeList = function ( t ) { var n = Object . prototype . toString . call ( t ) ; return void 0 ! = = t & & ( " [ object NodeList ] " = = = n | | " [ object HTMLCollection ] " = = = n ) & & " length " in t & & ( 0 = = = t . length | | e . node ( t [ 0 ] ) ) } , e . string = function ( t ) { return " string " = = typeof t | | t instanceof String } , e . fn = function ( t ) { return " [ object Function ] " = = = Object . prototype . toString . call ( t ) } } , function ( t , e ) { function n ( t ) { var e ; if ( " SELECT " = = = t . nodeName ) t . focus ( ) , e = t . value ; else if ( " INPUT " = = = t . nodeName | | " TEXTAREA " = = = t . nodeName ) { var n = t . hasAttribute ( " readonly " ) ; n | | t . setAttribute ( " readonly " , " " ) , t . select ( ) , t . setSelectionRange ( 0 , t . value . length ) , n | | t . removeAttribute ( " readonly " ) , e = t . value } else { t . hasAttribute ( " contenteditable " ) & & t . focus ( ) ; var o = window . getSelection ( ) , r = document . createRange ( ) ; r . selectNodeContents ( t ) , o . removeAllRanges ( ) , o . addRange ( r ) , e = o . toString ( ) } return e } t . exports = n } ] ) } ) ; <nl> similarity index 100 % <nl> rename from src / webui / www / private / scripts / excanvas - compressed . js <nl> rename to src / webui / www / private / scripts / lib / excanvas - compressed . js <nl> similarity index 100 % <nl> rename from src / webui / www / private / scripts / mocha - yc . js <nl> rename to src / webui / www / private / scripts / lib / mocha - yc . js <nl> similarity index 100 % <nl> rename from src / webui / www / private / scripts / mootools - 1 . 2 - core - yc . js <nl> rename to src / webui / www / private / scripts / lib / mootools - 1 . 2 - core - yc . js <nl> similarity index 100 % <nl> rename from src / webui / www / private / scripts / mootools - 1 . 2 - more . js <nl> rename to src / webui / www / private / scripts / lib / mootools - 1 . 2 - more . js <nl> similarity index 100 % <nl> rename from src / webui / www / private / scripts / parametrics . js <nl> rename to src / webui / www / private / scripts / lib / parametrics . js <nl> deleted file mode 100644 <nl> index 279c57b07f . . 0000000000 <nl> mmm a / src / webui / www / private / scripts / mocha . js <nl> ppp / dev / null <nl> <nl> - / * <nl> - <nl> - Script : Core . js <nl> - MUI - A Web Applications User Interface Framework . <nl> - <nl> - Copyright : <nl> - Copyright ( c ) 2007 - 2009 Greg Houston , < http : / / greghoustondesign . com / > . <nl> - <nl> - License : <nl> - MIT - style license . <nl> - <nl> - Contributors : <nl> - - Scott F . Frederick <nl> - - Joel Lindau <nl> - <nl> - Note : <nl> - This documentation is taken directly from the javascript source files . It is built using Natural Docs . <nl> - <nl> - * / <nl> - <nl> - var MUI = MochaUI = new Hash ( { <nl> - <nl> - version : ' 0 . 9 . 6 development ' , <nl> - <nl> - options : new Hash ( { <nl> - theme : ' default ' , <nl> - advancedEffects : false , / / Effects that require fast browsers and are cpu intensive . <nl> - standardEffects : true / / Basic effects that tend to run smoothly . <nl> - } ) , <nl> - <nl> - path : { <nl> - source : ' scripts / source / ' , / / Path to MochaUI source JavaScript <nl> - themes : ' themes / ' , / / Path to MochaUI Themes <nl> - plugins : ' plugins / ' / / Path to Plugins <nl> - } , <nl> - <nl> - / / Returns the path to the current theme directory <nl> - themePath : function ( ) { <nl> - return MUI . path . themes + MUI . options . theme + ' / ' ; <nl> - } , <nl> - <nl> - files : new Hash ( ) <nl> - <nl> - } ) ; <nl> - <nl> - MUI . files [ MUI . path . source + ' Core / Core . js ' ] = ' loaded ' ; <nl> - <nl> - MUI . extend ( { <nl> - <nl> - Windows : { <nl> - instances : new Hash ( ) <nl> - } , <nl> - <nl> - ieSupport : ' excanvas ' , / / Makes it easier to switch between Excanvas and Moocanvas for testing <nl> - <nl> - ieLegacySupport : Browser . Engine . trident & & Browser . version < 9 , <nl> - <nl> - / * <nl> - <nl> - Function : updateContent <nl> - Replace the content of a window or panel . <nl> - <nl> - Arguments : <nl> - updateOptions - ( object ) <nl> - <nl> - updateOptions : <nl> - element - The parent window or panel . <nl> - childElement - The child element of the window or panel receiving the content . <nl> - method - ( ' get ' , or ' post ' ) The way data is transmitted . <nl> - data - ( hash ) Data to be transmitted <nl> - title - ( string ) Change this if you want to change the title of the window or panel . <nl> - content - ( string or element ) An html loadMethod option . <nl> - loadMethod - ( ' html ' , ' xhr ' , or ' iframe ' ) <nl> - url - Used if loadMethod is set to ' xhr ' or ' iframe ' . <nl> - scrollbars - ( boolean ) <nl> - padding - ( object ) <nl> - onContentLoaded - ( function ) <nl> - <nl> - * / <nl> - updateContent : function ( options ) { <nl> - <nl> - var options = $ extend ( { <nl> - element : null , <nl> - childElement : null , <nl> - method : null , <nl> - data : null , <nl> - title : null , <nl> - content : null , <nl> - loadMethod : null , <nl> - url : null , <nl> - scrollbars : null , <nl> - padding : null , <nl> - require : { } , <nl> - onContentLoaded : $ empty <nl> - } , options ) ; <nl> - <nl> - options . require = $ extend ( { <nl> - css : [ ] , images : [ ] , js : [ ] , onload : null <nl> - } , options . require ) ; <nl> - <nl> - var args = { } ; <nl> - <nl> - if ( ! options . element ) return ; <nl> - var element = options . element ; <nl> - <nl> - if ( MUI . Windows . instances . get ( element . id ) ) { <nl> - args . recipient = ' window ' ; <nl> - } <nl> - else { <nl> - args . recipient = ' panel ' ; <nl> - } <nl> - <nl> - var instance = element . retrieve ( ' instance ' ) ; <nl> - if ( options . title ) instance . titleEl . set ( ' html ' , options . title ) ; <nl> - <nl> - var contentEl = instance . contentEl ; <nl> - args . contentContainer = options . childElement ! = null ? options . childElement : instance . contentEl ; <nl> - var contentWrapperEl = instance . contentWrapperEl ; <nl> - <nl> - if ( ! options . loadMethod ) { <nl> - if ( ! instance . options . loadMethod ) { <nl> - if ( ! options . url ) { <nl> - options . loadMethod = ' html ' ; <nl> - } <nl> - else { <nl> - options . loadMethod = ' xhr ' ; <nl> - } <nl> - } <nl> - else { <nl> - options . loadMethod = instance . options . loadMethod ; <nl> - } <nl> - } <nl> - <nl> - / / Set scrollbars if loading content in main content container . <nl> - / / Always use ' hidden ' for iframe windows <nl> - var scrollbars = options . scrollbars | | instance . options . scrollbars ; <nl> - if ( args . contentContainer = = instance . contentEl ) { <nl> - contentWrapperEl . setStyles ( { <nl> - ' overflow ' : scrollbars ! = false & & options . loadMethod ! = ' iframe ' ? ' auto ' : ' hidden ' <nl> - } ) ; <nl> - } <nl> - <nl> - if ( options . padding ! = null ) { <nl> - contentEl . setStyles ( { <nl> - ' padding - top ' : options . padding . top , <nl> - ' padding - bottom ' : options . padding . bottom , <nl> - ' padding - left ' : options . padding . left , <nl> - ' padding - right ' : options . padding . right <nl> - } ) ; <nl> - } <nl> - <nl> - / / Remove old content . <nl> - if ( args . contentContainer = = contentEl ) { <nl> - contentEl . empty ( ) . show ( ) ; <nl> - / / Panels are not loaded into the padding div , so we remove them separately . <nl> - contentEl . getAllNext ( ' . column ' ) . destroy ( ) ; <nl> - contentEl . getAllNext ( ' . columnHandle ' ) . destroy ( ) ; <nl> - } <nl> - <nl> - args . onContentLoaded = function ( ) { <nl> - <nl> - if ( options . require . js . length | | typeof options . require . onload = = ' function ' ) { <nl> - new MUI . Require ( { <nl> - js : options . require . js , <nl> - onload : function ( ) { <nl> - if ( ! $ defined ( options . require . onload ) ) <nl> - return ; <nl> - if ( Browser . Engine . presto ) { <nl> - options . require . onload . delay ( 100 ) ; <nl> - } <nl> - else { <nl> - options . require . onload ( ) ; <nl> - } <nl> - options . onContentLoaded ? options . onContentLoaded ( ) : instance . fireEvent ( ' onContentLoaded ' , element ) ; <nl> - } . bind ( this ) <nl> - } ) ; <nl> - } <nl> - else { <nl> - options . onContentLoaded ? options . onContentLoaded ( ) : instance . fireEvent ( ' onContentLoaded ' , element ) ; <nl> - } <nl> - <nl> - } ; <nl> - <nl> - if ( options . require . css . length | | options . require . images . length ) { <nl> - new MUI . Require ( { <nl> - css : options . require . css , <nl> - images : options . require . images , <nl> - onload : function ( ) { <nl> - this . loadSelect ( instance , options , args ) ; <nl> - } . bind ( this ) <nl> - } ) ; <nl> - } <nl> - else { <nl> - this . loadSelect ( instance , options , args ) ; <nl> - } <nl> - } , <nl> - <nl> - loadSelect : function ( instance , options , args ) { <nl> - <nl> - / / Load new content . <nl> - switch ( options . loadMethod ) { <nl> - case ' xhr ' : <nl> - this . updateContentXHR ( instance , options , args ) ; <nl> - break ; <nl> - case ' iframe ' : <nl> - this . updateContentIframe ( instance , options , args ) ; <nl> - break ; <nl> - case ' html ' : <nl> - default : <nl> - this . updateContentHTML ( instance , options , args ) ; <nl> - break ; <nl> - } <nl> - <nl> - } , <nl> - <nl> - updateContentXHR : function ( instance , options , args ) { <nl> - var contentEl = instance . contentEl ; <nl> - var contentContainer = args . contentContainer ; <nl> - var onContentLoaded = args . onContentLoaded ; <nl> - new Request . HTML ( { <nl> - url : options . url , <nl> - update : contentContainer , <nl> - method : options . method ! = null ? options . method : ' get ' , <nl> - data : options . data ! = null ? new Hash ( options . data ) . toQueryString ( ) : ' ' , <nl> - evalScripts : instance . options . evalScripts , <nl> - evalResponse : instance . options . evalResponse , <nl> - onRequest : function ( ) { <nl> - if ( args . recipient = = ' window ' & & contentContainer = = contentEl ) { <nl> - instance . showSpinner ( ) ; <nl> - } <nl> - else if ( args . recipient = = ' panel ' & & contentContainer = = contentEl & & $ ( ' spinner ' ) ) { <nl> - $ ( ' spinner ' ) . show ( ) ; <nl> - } <nl> - } . bind ( this ) , <nl> - onFailure : function ( response ) { <nl> - if ( contentContainer = = contentEl ) { <nl> - var getTitle = new RegExp ( " < title > [ \ n \ r \ s ] * ( . * ) [ \ n \ r \ s ] * < / title > " , " gmi " ) ; <nl> - var error = getTitle . exec ( response . responseText ) ; <nl> - if ( ! error ) error = ' Unknown ' ; <nl> - contentContainer . set ( ' html ' , ' < h3 > Error : ' + error + ' < / h3 > ' ) ; <nl> - if ( args . recipient = = ' window ' ) { <nl> - instance . hideSpinner ( ) ; <nl> - } <nl> - else if ( args . recipient = = ' panel ' & & $ ( ' spinner ' ) ) { <nl> - $ ( ' spinner ' ) . hide ( ) ; <nl> - } <nl> - } <nl> - } . bind ( this ) , <nl> - onSuccess : function ( ) { <nl> - if ( contentContainer = = contentEl ) { <nl> - if ( args . recipient = = ' window ' ) instance . hideSpinner ( ) ; <nl> - else if ( args . recipient = = ' panel ' & & $ ( ' spinner ' ) ) $ ( ' spinner ' ) . hide ( ) ; <nl> - } <nl> - Browser . Engine . trident4 ? onContentLoaded . delay ( 750 ) : onContentLoaded ( ) ; <nl> - } . bind ( this ) , <nl> - onComplete : function ( ) { } . bind ( this ) <nl> - } ) . send ( ) ; <nl> - } , <nl> - <nl> - updateContentIframe : function ( instance , options , args ) { <nl> - var contentEl = instance . contentEl ; <nl> - var contentContainer = args . contentContainer ; <nl> - var contentWrapperEl = instance . contentWrapperEl ; <nl> - var onContentLoaded = args . onContentLoaded ; <nl> - if ( instance . options . contentURL = = ' ' | | contentContainer ! = contentEl ) { <nl> - return ; <nl> - } <nl> - instance . iframeEl = new Element ( ' iframe ' , { <nl> - ' id ' : instance . options . id + ' _iframe ' , <nl> - ' name ' : instance . options . id + ' _iframe ' , <nl> - ' class ' : ' mochaIframe ' , <nl> - ' src ' : options . url , <nl> - ' marginwidth ' : 0 , <nl> - ' marginheight ' : 0 , <nl> - ' frameBorder ' : 0 , <nl> - ' scrolling ' : ' auto ' , <nl> - ' styles ' : { <nl> - ' height ' : contentWrapperEl . offsetHeight - contentWrapperEl . getStyle ( ' margin - top ' ) . toInt ( ) - contentWrapperEl . getStyle ( ' margin - bottom ' ) . toInt ( ) , <nl> - ' width ' : instance . panelEl ? contentWrapperEl . offsetWidth - contentWrapperEl . getStyle ( ' margin - left ' ) . toInt ( ) - contentWrapperEl . getStyle ( ' margin - right ' ) . toInt ( ) : ' 100 % ' <nl> - } <nl> - } ) . injectInside ( contentEl ) ; <nl> - <nl> - / / Add onload event to iframe so we can hide the spinner and run onContentLoaded ( ) <nl> - instance . iframeEl . addEvent ( ' load ' , function ( e ) { <nl> - if ( args . recipient = = ' window ' ) instance . hideSpinner ( ) ; <nl> - else if ( args . recipient = = ' panel ' & & contentContainer = = contentEl & & $ ( ' spinner ' ) ) $ ( ' spinner ' ) . hide ( ) ; <nl> - Browser . Engine . trident4 ? onContentLoaded . delay ( 50 ) : onContentLoaded ( ) ; <nl> - } . bind ( this ) ) ; <nl> - if ( args . recipient = = ' window ' ) instance . showSpinner ( ) ; <nl> - else if ( args . recipient = = ' panel ' & & contentContainer = = contentEl & & $ ( ' spinner ' ) ) $ ( ' spinner ' ) . show ( ) ; <nl> - } , <nl> - <nl> - updateContentHTML : function ( instance , options , args ) { <nl> - var contentEl = instance . contentEl ; <nl> - var contentContainer = args . contentContainer ; <nl> - var onContentLoaded = args . onContentLoaded ; <nl> - var elementTypes = new Array ( ' element ' , ' textnode ' , ' whitespace ' , ' collection ' ) ; <nl> - <nl> - if ( elementTypes . contains ( $ type ( options . content ) ) ) { <nl> - options . content . inject ( contentContainer ) ; <nl> - } else { <nl> - contentContainer . set ( ' html ' , options . content ) ; <nl> - } <nl> - if ( contentContainer = = contentEl ) { <nl> - if ( args . recipient = = ' window ' ) instance . hideSpinner ( ) ; <nl> - else if ( args . recipient = = ' panel ' & & $ ( ' spinner ' ) ) $ ( ' spinner ' ) . hide ( ) ; <nl> - } <nl> - Browser . Engine . trident4 ? onContentLoaded . delay ( 50 ) : onContentLoaded ( ) ; <nl> - } , <nl> - <nl> - / * <nl> - <nl> - Function : reloadIframe <nl> - Reload an iframe . Fixes an issue in Firefox when trying to use location . reload on an iframe that has been destroyed and recreated . <nl> - <nl> - Arguments : <nl> - iframe - This should be both the name and the id of the iframe . <nl> - <nl> - Syntax : <nl> - ( start code ) <nl> - MUI . reloadIframe ( element ) ; <nl> - ( end ) <nl> - <nl> - Example : <nl> - To reload an iframe from within another iframe : <nl> - ( start code ) <nl> - parent . MUI . reloadIframe ( ' myIframeName ' ) ; <nl> - ( end ) <nl> - <nl> - * / <nl> - reloadIframe : function ( iframe ) { <nl> - Browser . Engine . gecko ? $ ( iframe ) . src = $ ( iframe ) . src : top . frames [ iframe ] . location . reload ( true ) ; <nl> - } , <nl> - <nl> - roundedRect : function ( ctx , x , y , width , height , radius , rgb , a ) { <nl> - ctx . fillStyle = ' rgba ( ' + rgb . join ( ' , ' ) + ' , ' + a + ' ) ' ; <nl> - ctx . beginPath ( ) ; <nl> - ctx . moveTo ( x , y + radius ) ; <nl> - ctx . lineTo ( x , y + height - radius ) ; <nl> - ctx . quadraticCurveTo ( x , y + height , x + radius , y + height ) ; <nl> - ctx . lineTo ( x + width - radius , y + height ) ; <nl> - ctx . quadraticCurveTo ( x + width , y + height , x + width , y + height - radius ) ; <nl> - ctx . lineTo ( x + width , y + radius ) ; <nl> - ctx . quadraticCurveTo ( x + width , y , x + width - radius , y ) ; <nl> - ctx . lineTo ( x + radius , y ) ; <nl> - ctx . quadraticCurveTo ( x , y , x , y + radius ) ; <nl> - ctx . fill ( ) ; <nl> - } , <nl> - <nl> - triangle : function ( ctx , x , y , width , height , rgb , a ) { <nl> - ctx . beginPath ( ) ; <nl> - ctx . moveTo ( x + width , y ) ; <nl> - ctx . lineTo ( x , y + height ) ; <nl> - ctx . lineTo ( x + width , y + height ) ; <nl> - ctx . closePath ( ) ; <nl> - ctx . fillStyle = ' rgba ( ' + rgb . join ( ' , ' ) + ' , ' + a + ' ) ' ; <nl> - ctx . fill ( ) ; <nl> - } , <nl> - <nl> - circle : function ( ctx , x , y , diameter , rgb , a ) { <nl> - ctx . beginPath ( ) ; <nl> - ctx . arc ( x , y , diameter , 0 , Math . PI * 2 , true ) ; <nl> - ctx . fillStyle = ' rgba ( ' + rgb . join ( ' , ' ) + ' , ' + a + ' ) ' ; <nl> - ctx . fill ( ) ; <nl> - } , <nl> - <nl> - notification : function ( message ) { <nl> - new MUI . Window ( { <nl> - loadMethod : ' html ' , <nl> - closeAfter : 1500 , <nl> - type : ' notification ' , <nl> - addClass : ' notification ' , <nl> - content : message , <nl> - width : 220 , <nl> - height : 40 , <nl> - y : 53 , <nl> - padding : { top : 10 , right : 12 , bottom : 10 , left : 12 } , <nl> - shadowBlur : 5 <nl> - } ) ; <nl> - } , <nl> - <nl> - / * <nl> - <nl> - Function : toggleEffects <nl> - Turn effects on and off <nl> - <nl> - * / <nl> - toggleAdvancedEffects : function ( link ) { <nl> - if ( MUI . options . advancedEffects = = false ) { <nl> - MUI . options . advancedEffects = true ; <nl> - if ( link ) { <nl> - this . toggleAdvancedEffectsLink = new Element ( ' div ' , { <nl> - ' class ' : ' check ' , <nl> - ' id ' : ' toggleAdvancedEffects_check ' <nl> - } ) . inject ( link ) ; <nl> - } <nl> - } <nl> - else { <nl> - MUI . options . advancedEffects = false ; <nl> - if ( this . toggleAdvancedEffectsLink ) { <nl> - this . toggleAdvancedEffectsLink . destroy ( ) ; <nl> - } <nl> - } <nl> - } , <nl> - / * <nl> - <nl> - Function : toggleStandardEffects <nl> - Turn standard effects on and off <nl> - <nl> - * / <nl> - toggleStandardEffects : function ( link ) { <nl> - if ( MUI . options . standardEffects = = false ) { <nl> - MUI . options . standardEffects = true ; <nl> - if ( link ) { <nl> - this . toggleStandardEffectsLink = new Element ( ' div ' , { <nl> - ' class ' : ' check ' , <nl> - ' id ' : ' toggleStandardEffects_check ' <nl> - } ) . inject ( link ) ; <nl> - } <nl> - } <nl> - else { <nl> - MUI . options . standardEffects = false ; <nl> - if ( this . toggleStandardEffectsLink ) { <nl> - this . toggleStandardEffectsLink . destroy ( ) ; <nl> - } <nl> - } <nl> - } , <nl> - <nl> - / * <nl> - <nl> - The underlay is inserted directly under windows when they are being dragged or resized <nl> - so that the cursor is not captured by iframes or other plugins ( such as Flash ) <nl> - underneath the window . <nl> - <nl> - * / <nl> - underlayInitialize : function ( ) { <nl> - var windowUnderlay = new Element ( ' div ' , { <nl> - ' id ' : ' windowUnderlay ' , <nl> - ' styles ' : { <nl> - ' height ' : parent . getCoordinates ( ) . height , <nl> - ' opacity ' : . 01 , <nl> - ' display ' : ' none ' <nl> - } <nl> - } ) . inject ( document . body ) ; <nl> - } , <nl> - setUnderlaySize : function ( ) { <nl> - $ ( ' windowUnderlay ' ) . setStyle ( ' height ' , parent . getCoordinates ( ) . height ) ; <nl> - } <nl> - } ) ; <nl> - <nl> - / * <nl> - <nl> - function : fixPNG <nl> - Bob Osola ' s PngFix for IE6 . <nl> - <nl> - example : <nl> - ( begin code ) <nl> - < img src = " xyz . png " alt = " foo " width = " 10 " height = " 20 " onload = " fixPNG ( this ) " > <nl> - ( end ) <nl> - <nl> - note : <nl> - You must have the image height and width attributes specified in the markup . <nl> - <nl> - * / <nl> - <nl> - function fixPNG ( myImage ) { <nl> - if ( Browser . Engine . trident4 & & document . body . filters ) { <nl> - var imgID = ( myImage . id ) ? " id = ' " + myImage . id + " ' " : " " ; <nl> - var imgClass = ( myImage . className ) ? " class = ' " + myImage . className + " ' " : " " ; <nl> - var imgTitle = ( myImage . title ) ? " title = ' " + myImage . title + " ' " : " title = ' " + myImage . alt + " ' " ; <nl> - var imgStyle = " display : inline - block ; " + myImage . style . cssText ; <nl> - var strNewHTML = " < span " + imgID + imgClass + imgTitle <nl> - + " style = \ " " + " width : " + myImage . width <nl> - + " px ; height : " + myImage . height <nl> - + " px ; " + imgStyle + " ; " <nl> - + " filter : progid : DXImageTransform . Microsoft . AlphaImageLoader " <nl> - + " ( src = \ ' " + myImage . src + " \ ' , sizingMethod = ' scale ' ) ; \ " > < / span > " ; <nl> - myImage . outerHTML = strNewHTML ; <nl> - } <nl> - } <nl> - <nl> - / / Blur all windows if user clicks anywhere else on the page <nl> - document . addEvent ( ' mousedown ' , function ( event ) { <nl> - MUI . blurAll . delay ( 50 ) ; <nl> - } ) ; <nl> - <nl> - window . addEvent ( ' domready ' , function ( ) { <nl> - MUI . underlayInitialize ( ) ; <nl> - } ) ; <nl> - <nl> - window . addEvent ( ' resize ' , function ( ) { <nl> - if ( $ ( ' windowUnderlay ' ) ) { <nl> - MUI . setUnderlaySize ( ) ; <nl> - } <nl> - else { <nl> - MUI . underlayInitialize ( ) ; <nl> - } <nl> - } ) ; <nl> - <nl> - Element . implement ( { <nl> - hide : function ( ) { <nl> - this . setStyle ( ' display ' , ' none ' ) ; <nl> - return this ; <nl> - } , <nl> - show : function ( ) { <nl> - this . setStyle ( ' display ' , ' block ' ) ; <nl> - return this ; <nl> - } <nl> - } ) ; <nl> - <nl> - / * <nl> - <nl> - Shake effect by Uvumi Tools <nl> - http : / / tools . uvumi . com / element - shake . html <nl> - <nl> - Function : shake <nl> - <nl> - Example : <nl> - Shake a window . <nl> - ( start code ) <nl> - $ ( ' parametrics ' ) . shake ( ) <nl> - ( end ) <nl> - <nl> - * / <nl> - <nl> - Element . implement ( { <nl> - shake : function ( radius , duration ) { <nl> - radius = radius | | 3 ; <nl> - duration = duration | | 500 ; <nl> - duration = ( duration / 50 ) . toInt ( ) - 1 ; <nl> - var parent = this . getParent ( ) ; <nl> - if ( parent ! = $ ( document . body ) & & parent . getStyle ( ' position ' ) = = ' static ' ) { <nl> - parent . setStyle ( ' position ' , ' relative ' ) ; <nl> - } <nl> - var position = this . getStyle ( ' position ' ) ; <nl> - if ( position = = ' static ' ) { <nl> - this . setStyle ( ' position ' , ' relative ' ) ; <nl> - position = ' relative ' ; <nl> - } <nl> - if ( MUI . ieLegacySupport ) { <nl> - parent . setStyle ( ' height ' , parent . getStyle ( ' height ' ) ) ; <nl> - } <nl> - var coords = this . getPosition ( parent ) ; <nl> - if ( position = = ' relative ' & & ! Browser . Engine . presto ) { <nl> - coords . x - = parent . getStyle ( ' paddingLeft ' ) . toInt ( ) ; <nl> - coords . y - = parent . getStyle ( ' paddingTop ' ) . toInt ( ) ; <nl> - } <nl> - var morph = this . retrieve ( ' morph ' ) ; <nl> - if ( morph ) { <nl> - morph . cancel ( ) ; <nl> - var oldOptions = morph . options ; <nl> - } <nl> - var morph = this . get ( ' morph ' , { <nl> - duration : 50 , <nl> - link : ' chain ' <nl> - } ) ; <nl> - for ( var i = 0 ; i < duration ; i + + ) { <nl> - morph . start ( { <nl> - top : coords . y + $ random ( - radius , radius ) , <nl> - left : coords . x + $ random ( - radius , radius ) <nl> - } ) ; <nl> - } <nl> - morph . start ( { <nl> - top : coords . y , <nl> - left : coords . x <nl> - } ) . chain ( function ( ) { <nl> - if ( oldOptions ) { <nl> - this . set ( ' morph ' , oldOptions ) ; <nl> - } <nl> - } . bind ( this ) ) ; <nl> - return this ; <nl> - } <nl> - } ) ; <nl> - <nl> - String . implement ( { <nl> - <nl> - parseQueryString : function ( ) { <nl> - var vars = this . split ( / [ & ; ] / ) ; <nl> - var rs = { } ; <nl> - if ( vars . length ) vars . each ( function ( val ) { <nl> - var keys = val . split ( ' = ' ) ; <nl> - if ( keys . length & & keys . length = = 2 ) rs [ decodeURIComponent ( keys [ 0 ] ) ] = decodeURIComponent ( keys [ 1 ] ) ; <nl> - } ) ; <nl> - return rs ; <nl> - } <nl> - <nl> - } ) ; <nl> - <nl> - / / Mootools Patch : Fixes issues in Safari , Chrome , and Internet Explorer caused by processing text as XML . <nl> - Request . HTML . implement ( { <nl> - <nl> - processHTML : function ( text ) { <nl> - var match = text . match ( / < body [ ^ > ] * > ( [ \ s \ S ] * ? ) < \ / body > / i ) ; <nl> - text = ( match ) ? match [ 1 ] : text ; <nl> - var container = new Element ( ' div ' ) ; <nl> - return container . set ( ' html ' , text ) ; <nl> - } <nl> - <nl> - } ) ; <nl> - <nl> - / * <nl> - <nl> - Examples : <nl> - ( start code ) <nl> - getCSSRule ( ' . myRule ' ) ; <nl> - getCSSRule ( ' # myRule ' ) ; <nl> - ( end ) <nl> - <nl> - * / <nl> - MUI . getCSSRule = function ( selector ) { <nl> - for ( var ii = 0 ; ii < document . styleSheets . length ; ii + + ) { <nl> - var mysheet = document . styleSheets [ ii ] ; <nl> - var myrules = mysheet . cssRules ? mysheet . cssRules : mysheet . rules ; <nl> - for ( i = 0 ; i < myrules . length ; i + + ) { <nl> - if ( myrules [ i ] . selectorText = = selector ) { <nl> - return myrules [ i ] ; <nl> - } <nl> - } <nl> - } <nl> - return false ; <nl> - } <nl> - <nl> - / / This makes it so Request will work to some degree locally <nl> - if ( location . protocol = = " file : " ) { <nl> - <nl> - Request . implement ( { <nl> - isSuccess : function ( status ) { <nl> - return ( status = = 0 | | ( status > = 200 ) & & ( status < 300 ) ) ; <nl> - } <nl> - } ) ; <nl> - <nl> - Browser . Request = function ( ) { <nl> - return $ try ( function ( ) { <nl> - return new ActiveXObject ( ' MSXML2 . XMLHTTP ' ) ; <nl> - } , function ( ) { <nl> - return new XMLHttpRequest ( ) ; <nl> - } ) ; <nl> - } ; <nl> - <nl> - } <nl> - <nl> - MUI . Require = new Class ( { <nl> - <nl> - Implements : [ Options ] , <nl> - <nl> - options : { <nl> - css : [ ] , <nl> - images : [ ] , <nl> - js : [ ] , <nl> - onload : $ empty <nl> - } , <nl> - <nl> - initialize : function ( options ) { <nl> - this . setOptions ( options ) ; <nl> - var options = this . options ; <nl> - <nl> - this . assetsToLoad = options . css . length + options . images . length + options . js . length ; <nl> - this . assetsLoaded = 0 ; <nl> - <nl> - var cssLoaded = 0 ; <nl> - <nl> - / / Load CSS before images and JavaScript <nl> - <nl> - if ( options . css . length ) { <nl> - options . css . each ( function ( sheet ) { <nl> - <nl> - this . getAsset ( sheet , function ( ) { <nl> - if ( cssLoaded = = options . css . length - 1 ) { <nl> - <nl> - if ( this . assetsLoaded = = this . assetsToLoad - 1 ) { <nl> - this . requireOnload ( ) ; <nl> - } <nl> - else { <nl> - / / Add a little delay since we are relying on cached CSS from XHR request . <nl> - this . assetsLoaded + + ; <nl> - this . requireContinue . delay ( 50 , this ) ; <nl> - } <nl> - } <nl> - else { <nl> - cssLoaded + + ; <nl> - this . assetsLoaded + + ; <nl> - } <nl> - } . bind ( this ) ) ; <nl> - } . bind ( this ) ) ; <nl> - } <nl> - else if ( ! options . js . length & & ! options . images . length ) { <nl> - this . options . onload ( ) ; <nl> - return true ; <nl> - } <nl> - else { <nl> - this . requireContinue . delay ( 50 , this ) ; / / Delay is for Safari <nl> - } <nl> - <nl> - } , <nl> - <nl> - requireOnload : function ( ) { <nl> - this . assetsLoaded + + ; <nl> - if ( this . assetsLoaded = = this . assetsToLoad ) { <nl> - this . options . onload ( ) ; <nl> - return true ; <nl> - } <nl> - <nl> - } , <nl> - <nl> - requireContinue : function ( ) { <nl> - <nl> - var options = this . options ; <nl> - if ( options . images . length ) { <nl> - options . images . each ( function ( image ) { <nl> - this . getAsset ( image , this . requireOnload . bind ( this ) ) ; <nl> - } . bind ( this ) ) ; <nl> - } <nl> - <nl> - if ( options . js . length ) { <nl> - options . js . each ( function ( script ) { <nl> - this . getAsset ( script , this . requireOnload . bind ( this ) ) ; <nl> - } . bind ( this ) ) ; <nl> - } <nl> - <nl> - } , <nl> - <nl> - getAsset : function ( source , onload ) { <nl> - <nl> - / / If the asset is loaded , fire the onload function . <nl> - if ( MUI . files [ source ] = = ' loaded ' ) { <nl> - if ( typeof onload = = ' function ' ) { <nl> - onload ( ) ; <nl> - } <nl> - return true ; <nl> - } <nl> - <nl> - / / If the asset is loading , wait until it is loaded and then fire the onload function . <nl> - / / If asset doesn ' t load by a number of tries , fire onload anyway . <nl> - else if ( MUI . files [ source ] = = ' loading ' ) { <nl> - var tries = 0 ; <nl> - var checker = ( function ( ) { <nl> - tries + + ; <nl> - if ( MUI . files [ source ] = = ' loading ' & & tries < ' 100 ' ) return ; <nl> - $ clear ( checker ) ; <nl> - if ( typeof onload = = ' function ' ) { <nl> - onload ( ) ; <nl> - } <nl> - } ) . periodical ( 50 ) ; <nl> - } <nl> - <nl> - / / If the asset is not yet loaded or loading , start loading the asset . <nl> - else { <nl> - MUI . files [ source ] = ' loading ' ; <nl> - <nl> - properties = { <nl> - ' onload ' : onload ! = ' undefined ' ? onload : $ empty <nl> - } ; <nl> - <nl> - / / Add to the onload function <nl> - var oldonload = properties . onload ; <nl> - properties . onload = function ( ) { <nl> - MUI . files [ source ] = ' loaded ' ; <nl> - if ( oldonload ) { <nl> - oldonload ( ) ; <nl> - } <nl> - } . bind ( this ) ; <nl> - <nl> - switch ( source . match ( / \ . \ w + $ / ) [ 0 ] ) { <nl> - case ' . js ' : return Asset . javascript ( source , properties ) ; <nl> - case ' . css ' : return Asset . css ( source , properties ) ; <nl> - case ' . jpg ' : <nl> - case ' . png ' : <nl> - case ' . gif ' : return Asset . image ( source , properties ) ; <nl> - } <nl> - <nl> - alert ( ' The required file " ' + source + ' " could not be loaded ' ) ; <nl> - } <nl> - } <nl> - <nl> - } ) ; <nl> - <nl> - $ extend ( Asset , { <nl> - <nl> - / * Fix an Opera bug in Mootools 1 . 2 * / <nl> - javascript : function ( source , properties ) { <nl> - properties = $ extend ( { <nl> - onload : $ empty , <nl> - document : document , <nl> - check : $ lambda ( true ) <nl> - } , properties ) ; <nl> - <nl> - if ( $ ( properties . id ) ) { <nl> - properties . onload ( ) ; <nl> - return $ ( properties . id ) ; <nl> - } <nl> - <nl> - var script = new Element ( ' script ' , { ' src ' : source , ' type ' : ' text / javascript ' } ) ; <nl> - <nl> - var load = properties . onload . bind ( script ) , check = properties . check , doc = properties . document ; <nl> - delete properties . onload ; delete properties . check ; delete properties . document ; <nl> - <nl> - if ( ! Browser . Engine . webkit419 & & ! Browser . Engine . presto ) { <nl> - script . addEvents ( { <nl> - load : load , <nl> - readystatechange : function ( ) { <nl> - if ( MUI . ieLegacySupport & & [ ' loaded ' , ' complete ' ] . contains ( this . readyState ) ) <nl> - load ( ) ; <nl> - } <nl> - } ) . setProperties ( properties ) ; <nl> - } <nl> - else { <nl> - var checker = ( function ( ) { <nl> - if ( ! $ try ( check ) ) return ; <nl> - $ clear ( checker ) ; <nl> - / / Opera has difficulty with multiple scripts being injected into the head simultaneously . We need to give it time to catch up . <nl> - Browser . Engine . presto ? load . delay ( 500 ) : load ( ) ; <nl> - } ) . periodical ( 50 ) ; <nl> - } <nl> - return script . inject ( doc . head ) ; <nl> - } , <nl> - <nl> - / / Get the CSS with XHR before appending it to document . head so that we can have an onload callback . <nl> - css : function ( source , properties ) { <nl> - <nl> - properties = $ extend ( { <nl> - id : null , <nl> - media : ' screen ' , <nl> - onload : $ empty <nl> - } , properties ) ; <nl> - <nl> - new Request ( { <nl> - method : ' get ' , <nl> - url : source , <nl> - onComplete : function ( response ) { <nl> - var newSheet = new Element ( ' link ' , { <nl> - ' id ' : properties . id , <nl> - ' rel ' : ' stylesheet ' , <nl> - ' media ' : properties . media , <nl> - ' type ' : ' text / css ' , <nl> - ' href ' : source <nl> - } ) . inject ( document . head ) ; <nl> - properties . onload ( ) ; <nl> - } . bind ( this ) , <nl> - onFailure : function ( response ) { <nl> - } , <nl> - onSuccess : function ( ) { <nl> - } . bind ( this ) <nl> - } ) . send ( ) ; <nl> - } <nl> - <nl> - } ) ; <nl> - <nl> - / * <nl> - <nl> - REGISTER PLUGINS <nl> - <nl> - Register Components and Plugins for Lazy Loading <nl> - <nl> - How this works may take a moment to grasp . Take a look at MUI . Window below . <nl> - If we try to create a new Window and Window . js has not been loaded then the function <nl> - below will run . It will load the CSS required by the MUI . Window Class and then <nl> - then it will load Window . js . Here is the interesting part . When Window . js loads , <nl> - it will overwrite the function below , and new MUI . Window ( arg ) will be ran <nl> - again . This time it will create a new MUI . Window instance , and any future calls <nl> - to new MUI . Window ( arg ) will immediately create new windows since the assets <nl> - have already been loaded and our temporary function below has been overwritten . <nl> - <nl> - Example : <nl> - <nl> - MyPlugins . extend ( { <nl> - <nl> - MyGadget : function ( arg ) { <nl> - new MUI . Require ( { <nl> - css : [ MUI . path . plugins + ' myGadget / css / style . css ' ] , <nl> - images : [ MUI . path . plugins + ' myGadget / images / background . gif ' ] <nl> - js : [ MUI . path . plugins + ' myGadget / scripts / myGadget . js ' ] , <nl> - onload : function ( ) { <nl> - new MyPlguins . MyGadget ( arg ) ; <nl> - } <nl> - } ) ; <nl> - } <nl> - <nl> - } ) ; <nl> - <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm * / <nl> - <nl> - MUI . extend ( { <nl> - <nl> - newWindowsFromJSON : function ( arg ) { <nl> - new MUI . Require ( { <nl> - js : [ MUI . path . source + ' Window / Windows - from - json . js ' ] , <nl> - onload : function ( ) { <nl> - new MUI . newWindowsFromJSON ( arg ) ; <nl> - } <nl> - } ) ; <nl> - } , <nl> - <nl> - arrangeCascade : function ( ) { <nl> - new MUI . Require ( { <nl> - js : [ MUI . path . source + ' Window / Arrange - cascade . js ' ] , <nl> - onload : function ( ) { <nl> - new MUI . arrangeCascade ( ) ; <nl> - } <nl> - } ) ; <nl> - } , <nl> - <nl> - arrangeTile : function ( ) { <nl> - new MUI . Require ( { <nl> - js : [ MUI . path . source + ' Window / Arrange - tile . js ' ] , <nl> - onload : function ( ) { <nl> - new MUI . arrangeTile ( ) ; <nl> - } <nl> - } ) ; <nl> - } , <nl> - <nl> - saveWorkspace : function ( ) { <nl> - new MUI . Require ( { <nl> - js : [ MUI . path . source + ' Layout / Workspaces . js ' ] , <nl> - onload : function ( ) { <nl> - new MUI . saveWorkspace ( ) ; <nl> - } <nl> - } ) ; <nl> - } , <nl> - <nl> - loadWorkspace : function ( ) { <nl> - new MUI . Require ( { <nl> - js : [ MUI . path . source + ' Layout / Workspaces . js ' ] , <nl> - onload : function ( ) { <nl> - new MUI . loadWorkspace ( ) ; <nl> - } <nl> - } ) ; <nl> - } , <nl> - <nl> - Themes : { <nl> - init : function ( arg ) { <nl> - new MUI . Require ( { <nl> - js : [ MUI . path . source + ' Utilities / Themes . js ' ] , <nl> - onload : function ( ) { <nl> - MUI . Themes . init ( arg ) ; <nl> - } <nl> - } ) ; <nl> - } <nl> - } <nl> - <nl> - } ) ; <nl> - / * <nl> - <nl> - Script : Themes . js <nl> - Allows for switching themes dynamically . <nl> - <nl> - Copyright : <nl> - Copyright ( c ) 2007 - 2009 Greg Houston , < http : / / greghoustondesign . com / > . <nl> - <nl> - License : <nl> - MIT - style license . <nl> - <nl> - Requires : <nl> - Core . js <nl> - <nl> - Notes : <nl> - Themes are new and experimental . <nl> - <nl> - Syntax : <nl> - ( start code ) <nl> - new MUI . Themes . init ( newTheme ) ; <nl> - ( end ) <nl> - <nl> - Example : <nl> - ( start code ) <nl> - new MUI . Themes . init ( ' charcoal ' ) ; <nl> - ( end ) <nl> - <nl> - Arguments : <nl> - newTheme - ( string ) The theme name <nl> - <nl> - * / <nl> - <nl> - MUI . files [ MUI . path . source + ' Utilities / Themes . js ' ] = 1 ; <nl> - <nl> - MUI . Themes = { <nl> - <nl> - / * <nl> - <nl> - Function : themeInit <nl> - Initialize a theme . This is experimental and not fully implemented yet . <nl> - <nl> - * / <nl> - init : function ( newTheme ) { <nl> - this . newTheme = newTheme . toLowerCase ( ) ; <nl> - if ( ! this . newTheme | | this . newTheme = = null | | this . newTheme = = MUI . options . theme . toLowerCase ( ) ) return ; <nl> - <nl> - if ( $ ( ' spinner ' ) ) $ ( ' spinner ' ) . show ( ) ; <nl> - <nl> - this . oldURIs = [ ] ; <nl> - this . oldSheets = [ ] ; <nl> - <nl> - $ $ ( ' link ' ) . each ( function ( link ) { <nl> - var href = link . get ( ' href ' ) ; <nl> - if ( href . contains ( MUI . path . themes + MUI . options . theme ) ) { <nl> - this . oldURIs . push ( href ) ; <nl> - this . oldSheets . push ( link ) ; <nl> - } <nl> - } . bind ( this ) ) ; <nl> - <nl> - / * <nl> - MUI . files . each ( function ( value , key , hash ) { <nl> - if ( key . contains ( MUI . path . themes + MUI . options . theme ) ) { <nl> - this . oldURIs . push ( key ) ; <nl> - } <nl> - } . bind ( this ) ) ; <nl> - * / <nl> - <nl> - this . newSheetURLs = this . oldURIs . map ( function ( item , index ) { <nl> - return item . replace ( " / " + MUI . options . theme + " / " , " / " + MUI . Themes . newTheme + " / " ) ; <nl> - } . bind ( this ) ) ; <nl> - <nl> - this . sheetsToLoad = this . oldURIs . length ; <nl> - this . sheetsLoaded = 0 ; <nl> - <nl> - / / Download new stylesheets and add them to an array <nl> - this . newSheets = [ ] ; <nl> - this . newSheetURLs . each ( function ( link ) { <nl> - var href = link ; <nl> - <nl> - / / var id = link . id ; <nl> - <nl> - var cssRequest = new Request ( { <nl> - method : ' get ' , <nl> - url : href , <nl> - onComplete : function ( response ) { <nl> - var newSheet = new Element ( ' link ' , { <nl> - / / ' id ' : id , <nl> - ' rel ' : ' stylesheet ' , <nl> - ' media ' : ' screen ' , <nl> - ' type ' : ' text / css ' , <nl> - ' href ' : href <nl> - } ) ; <nl> - this . newSheets . push ( newSheet ) ; <nl> - } . bind ( this ) , <nl> - onFailure : function ( response ) { <nl> - this . themeLoadSuccess = false ; <nl> - if ( $ ( ' spinner ' ) ) $ ( ' spinner ' ) . hide ( ) ; <nl> - MUI . notification ( ' Stylesheets did not load . ' ) ; <nl> - } , <nl> - onSuccess : function ( ) { <nl> - this . sheetsLoaded + + ; <nl> - if ( this . sheetsLoaded = = this . sheetsToLoad ) { <nl> - this . updateThemeStylesheets ( ) ; <nl> - this . themeLoadSuccess = true ; <nl> - } <nl> - } . bind ( this ) <nl> - } ) ; <nl> - cssRequest . send ( ) ; <nl> - <nl> - } . bind ( this ) ) ; <nl> - <nl> - } , <nl> - updateThemeStylesheets : function ( ) { <nl> - <nl> - this . oldSheets . each ( function ( sheet ) { <nl> - sheet . destroy ( ) ; <nl> - } ) ; <nl> - <nl> - this . newSheets . each ( function ( sheet ) { <nl> - MUI . files [ sheet . get ( ' href ' ) ] = 1 ; <nl> - sheet . inject ( document . head ) ; <nl> - } ) ; <nl> - <nl> - / / Delay gives the stylesheets time to take effect . IE6 needs more delay . <nl> - if ( MUI . ieLegacySupport ) { <nl> - this . redraw . delay ( 1250 , this ) ; <nl> - } <nl> - else { <nl> - this . redraw . delay ( 250 , this ) ; <nl> - } <nl> - <nl> - } , <nl> - redraw : function ( ) { <nl> - <nl> - $ $ ( ' . replaced ' ) . removeClass ( ' replaced ' ) ; <nl> - <nl> - / / Redraw open windows <nl> - $ $ ( ' . mocha ' ) . each ( function ( element ) { <nl> - var instance = element . retrieve ( ' instance ' ) ; <nl> - <nl> - / / Convert CSS colors to Canvas colors . <nl> - instance . setColors ( ) ; <nl> - instance . drawWindow ( ) ; <nl> - } ) ; <nl> - <nl> - if ( MUI . Dock ) { <nl> - if ( MUI . Dock . options . useControls ) { <nl> - MUI . Dock . setDockColors ( ) ; <nl> - MUI . Dock . renderDockControls ( ) ; <nl> - } <nl> - } <nl> - <nl> - / / Reformat layout <nl> - if ( MUI . Desktop . desktop ) { <nl> - var checker = ( function ( ) { <nl> - / / Make sure the style sheets are really ready . <nl> - if ( MUI . Desktop . desktop . getStyle ( ' overflow ' ) ! = ' hidden ' ) { <nl> - return ; <nl> - } <nl> - $ clear ( checker ) ; <nl> - MUI . Desktop . setDesktopSize ( ) ; <nl> - } ) . periodical ( 50 ) ; <nl> - } <nl> - <nl> - if ( $ ( ' spinner ' ) ) $ ( ' spinner ' ) . hide ( ) ; <nl> - MUI . options . theme = this . newTheme ; <nl> - <nl> - / * <nl> - this . cookie = new Hash . Cookie ( ' mochaUIthemeCookie ' , { duration : 3600 } ) ; <nl> - this . cookie . empty ( ) ; <nl> - this . cookie . set ( ' theme ' , MUI . options . theme ) ; <nl> - this . cookie . save ( ) ; <nl> - * / <nl> - <nl> - } <nl> - } ; <nl> - <nl> - window . addEvent ( ' load ' , function ( ) { <nl> - / * <nl> - / / Load theme the user was last using . This needs work . <nl> - var cookie = new Hash . Cookie ( ' mochaUIthemeCookie ' , { duration : 3600 } ) ; <nl> - var themeCookie = cookie . load ( ) ; <nl> - if ( cookie . getKeys ( ) . length ) { <nl> - if ( themeCookie . get ( ' theme ' ) ! = MUI . Themes . options . theme ) { <nl> - MUI . Themes . init . delay ( 1000 , MUI . Themes , themeCookie . get ( ' theme ' ) ) ; <nl> - } <nl> - } <nl> - * / <nl> - <nl> - if ( $ ( ' themeControl ' ) ) { <nl> - $ ( ' themeControl ' ) . getElements ( ' option ' ) . setProperty ( ' selected ' , ' false ' ) ; <nl> - if ( $ ( ' chooseTheme ' ) ) { <nl> - $ ( ' chooseTheme ' ) . setProperty ( ' selected ' , ' true ' ) ; <nl> - } <nl> - } <nl> - } ) ; <nl> - / * <nl> - <nl> - Script : Window . js <nl> - Build windows . <nl> - <nl> - Copyright : <nl> - Copyright ( c ) 2007 - 2009 Greg Houston , < http : / / greghoustondesign . com / > . <nl> - <nl> - License : <nl> - MIT - style license . <nl> - <nl> - Requires : <nl> - Core . js <nl> - <nl> - * / <nl> - <nl> - MUI . files [ MUI . path . source + ' Window / Window . js ' ] = ' loading ' ; <nl> - / / $ require ( MUI . themePath ( ) + ' / css / Dock . css ' ) ; <nl> - <nl> - / * <nl> - Class : Window <nl> - Creates a single MochaUI window . <nl> - <nl> - Syntax : <nl> - ( start code ) <nl> - new MUI . Window ( options ) ; <nl> - ( end ) <nl> - <nl> - Arguments : <nl> - options <nl> - <nl> - Options : <nl> - id - The ID of the window . If not defined , it will be set to ' win ' + windowIDCount . <nl> - title - The title of the window . <nl> - icon - Place an icon in the window ' s titlebar . This is either set to false or to the url of the icon . It is set up for icons that are 16 x 16px . <nl> - type - ( ' window ' , ' modal ' , ' modal2 ' , or ' notification ' ) Defaults to ' window ' . Modals should be created with new MUI . Modal ( options ) . <nl> - loadMethod - ( ' html ' , ' xhr ' , or ' iframe ' ) Defaults to ' html ' if there is no contentURL . Defaults to ' xhr ' if there is a contentURL . You only really need to set this if using the ' iframe ' method . <nl> - contentURL - Used if loadMethod is set to ' xhr ' or ' iframe ' . <nl> - closeAfter - Either false or time in milliseconds . Closes the window after a certain period of time in milliseconds . This is particularly useful for notifications . <nl> - evalScripts - ( boolean ) An xhr loadMethod option . Defaults to true . <nl> - evalResponse - ( boolean ) An xhr loadMethod option . Defaults to false . <nl> - content - ( string or element ) An html loadMethod option . <nl> - toolbar - ( boolean ) Create window toolbar . Defaults to false . This can be used for tabs , media controls , and so forth . <nl> - toolbarPosition - ( ' top ' or ' bottom ' ) Defaults to top . <nl> - toolbarHeight - ( number ) <nl> - toolbarURL - ( url ) Defaults to ' pages / lipsum . html ' . <nl> - toolbarContent - ( string ) <nl> - toolbarOnload - ( function ) <nl> - toolbar2 - ( boolean ) Create window toolbar . Defaults to false . This can be used for tabs , media controls , and so forth . <nl> - toolbar2Position - ( ' top ' or ' bottom ' ) Defaults to top . <nl> - toolbar2Height - ( number ) <nl> - toolbar2URL - ( url ) Defaults to ' pages / lipsum . html ' . <nl> - toolbar2Content - ( string ) <nl> - toolbar2Onload - ( function ) <nl> - container - ( element ID ) Element the window is injected in . The container defaults to ' desktop ' . If no desktop then to document . body . Use ' pageWrapper ' if you don ' t want the windows to overlap the toolbars . <nl> - restrict - ( boolean ) Restrict window to container when dragging . <nl> - shape - ( ' box ' or ' gauge ' ) Shape of window . Defaults to ' box ' . <nl> - collapsible - ( boolean ) Defaults to true . <nl> - minimizable - ( boolean ) Requires MUI . Desktop and MUI . Dock . Defaults to true if dependenices are met . <nl> - maximizable - ( boolean ) Requires MUI . Desktop . Defaults to true if dependenices are met . <nl> - closable - ( boolean ) Defaults to true . <nl> - storeOnClose - ( boolean ) Hides a window and it ' s dock tab rather than destroying them on close . If you try to create the window again it will unhide the window and dock tab . <nl> - modalOverlayClose - ( boolean ) Whether or not you can close a modal by clicking on the modal overlay . Defaults to true . <nl> - draggable - ( boolean ) Defaults to false for modals ; otherwise true . <nl> - draggableGrid - ( false or number ) Distance in pixels for snap - to - grid dragging . Defaults to false . <nl> - draggableLimit - ( false or number ) An object with x and y properties used to limit the movement of the Window . Defaults to false . <nl> - draggableSnap - ( boolean ) The distance to drag before the Window starts to respond to the drag . Defaults to false . <nl> - resizable - ( boolean ) Defaults to false for modals , notifications and gauges ; otherwise true . <nl> - resizeLimit - ( object ) Minimum and maximum width and height of window when resized . <nl> - addClass - ( string ) Add a class to the window for more control over styling . <nl> - width - ( number ) Width of content area . <nl> - height - ( number ) Height of content area . <nl> - headerHeight - ( number ) Height of window titlebar . <nl> - footerHeight - ( number ) Height of window footer . <nl> - cornerRadius - ( number ) <nl> - x - ( number ) If x and y are left undefined the window is centered on the page . <nl> - y - ( number ) <nl> - scrollbars - ( boolean ) <nl> - padding - ( object ) <nl> - shadowBlur - ( number ) Width of shadows . <nl> - shadowOffset - Should be positive and not be greater than the ShadowBlur . <nl> - controlsOffset - Change this if you want to reposition the window controls . <nl> - useCanvas - ( boolean ) Set this to false if you don ' t want a canvas body . <nl> - useCanvasControls - ( boolean ) Set this to false if you wish to use images for the buttons . <nl> - useSpinner - ( boolean ) Toggles whether or not the ajax spinners are displayed in window footers . Defaults to true . <nl> - headerStartColor - ( [ r , g , b , ] ) Titlebar gradient ' s top color <nl> - headerStopColor - ( [ r , g , b , ] ) Titlebar gradient ' s bottom color <nl> - bodyBgColor - ( [ r , g , b , ] ) Background color of the main canvas shape <nl> - minimizeBgColor - ( [ r , g , b , ] ) Minimize button background color <nl> - minimizeColor - ( [ r , g , b , ] ) Minimize button color <nl> - maximizeBgColor - ( [ r , g , b , ] ) Maximize button background color <nl> - maximizeColor - ( [ r , g , b , ] ) Maximize button color <nl> - closeBgColor - ( [ r , g , b , ] ) Close button background color <nl> - closeColor - ( [ r , g , b , ] ) Close button color <nl> - resizableColor - ( [ r , g , b , ] ) Resizable icon color <nl> - onBeforeBuild - ( function ) Fired just before the window is built . <nl> - onContentLoaded - ( function ) Fired when content is successfully loaded via XHR or Iframe . <nl> - onFocus - ( function ) Fired when the window is focused . <nl> - onBlur - ( function ) Fired when window loses focus . <nl> - onResize - ( function ) Fired when the window is resized . <nl> - onMinimize - ( function ) Fired when the window is minimized . <nl> - onMaximize - ( function ) Fired when the window is maximized . <nl> - onRestore - ( function ) Fired when a window is restored from minimized or maximized . <nl> - onClose - ( function ) Fired just before the window is closed . <nl> - onCloseComplete - ( function ) Fired after the window is closed . <nl> - <nl> - Returns : <nl> - Window object . <nl> - <nl> - Example : <nl> - Define a window . It is suggested you name the function the same as your window ID + " Window " . <nl> - ( start code ) <nl> - var mywindowWindow = function ( ) { <nl> - new MUI . Window ( { <nl> - id : ' mywindow ' , <nl> - title : ' My Window ' , <nl> - loadMethod : ' xhr ' , <nl> - contentURL : ' pages / lipsum . html ' , <nl> - width : 340 , <nl> - height : 150 <nl> - } ) ; <nl> - } <nl> - ( end ) <nl> - <nl> - Example : <nl> - Create window onDomReady . <nl> - ( start code ) <nl> - window . addEvent ( ' domready ' , function ( ) { <nl> - mywindow ( ) ; <nl> - } ) ; <nl> - ( end ) <nl> - <nl> - Example : <nl> - Add link events to build future windows . It is suggested you give your anchor the same ID as your window + " WindowLink " or + " WindowLinkCheck " . Use the latter if it is a link in the menu toolbar . <nl> - <nl> - If you wish to add links in windows that open other windows remember to add events to those links when the windows are created . <nl> - <nl> - ( start code ) <nl> - / / Javascript : <nl> - if ( $ ( ' mywindowLink ' ) ) { <nl> - $ ( ' mywindowLink ' ) . addEvent ( ' click ' , function ( e ) { <nl> - new Event ( e ) . stop ( ) ; <nl> - mywindow ( ) ; <nl> - } ) ; <nl> - } <nl> - <nl> - / / HTML : <nl> - < a id = " mywindowLink " href = " pages / lipsum . html " > My Window < / a > <nl> - ( end ) <nl> - <nl> - <nl> - Loading Content with an XMLHttpRequest ( xhr ) : <nl> - For content to load via xhr all the files must be online and in the same domain . If you need to load content from another domain or wish to have it work offline , load the content in an iframe instead of using the xhr option . <nl> - <nl> - Iframes : <nl> - If you use the iframe loadMethod your iframe will automatically be resized when the window it is in is resized . If you want this same functionality when using one of the other load options simply add class = " mochaIframe " to those iframes and they will be resized for you as well . <nl> - <nl> - * / <nl> - <nl> - / / Having these options outside of the Class allows us to add , change , and remove <nl> - / / individual options without rewriting all of them . <nl> - <nl> - MUI . extend ( { <nl> - Windows : { <nl> - instances : new Hash ( ) , <nl> - indexLevel : 100 , / / Used for window z - Index <nl> - windowIDCount : 0 , / / Used for windows without an ID defined by the user <nl> - windowsVisible : true , / / Ctrl - Alt - Q to toggle window visibility <nl> - focusingWindow : false <nl> - } <nl> - } ) ; <nl> - <nl> - MUI . Windows . windowOptions = { <nl> - id : null , <nl> - title : ' New Window ' , <nl> - icon : false , <nl> - type : ' window ' , <nl> - require : { <nl> - css : [ ] , <nl> - images : [ ] , <nl> - js : [ ] , <nl> - onload : null <nl> - } , <nl> - loadMethod : null , <nl> - method : ' get ' , <nl> - contentURL : null , <nl> - data : null , <nl> - <nl> - closeAfter : false , <nl> - <nl> - / / xhr options <nl> - evalScripts : true , <nl> - evalResponse : false , <nl> - <nl> - / / html options <nl> - content : ' Window content ' , <nl> - <nl> - / / Toolbar <nl> - toolbar : false , <nl> - toolbarPosition : ' top ' , <nl> - toolbarHeight : 29 , <nl> - toolbarURL : ' pages / lipsum . html ' , <nl> - toolbarData : null , <nl> - toolbarContent : ' ' , <nl> - toolbarOnload : $ empty , <nl> - <nl> - / / Toolbar <nl> - toolbar2 : false , <nl> - toolbar2Position : ' bottom ' , <nl> - toolbar2Height : 29 , <nl> - toolbar2URL : ' pages / lipsum . html ' , <nl> - toolbar2Data : null , <nl> - toolbar2Content : ' ' , <nl> - toolbar2Onload : $ empty , <nl> - <nl> - / / Container options <nl> - container : null , <nl> - restrict : true , <nl> - shape : ' box ' , <nl> - <nl> - / / Window Controls <nl> - collapsible : true , <nl> - minimizable : true , <nl> - maximizable : true , <nl> - closable : true , <nl> - <nl> - / / Close options <nl> - storeOnClose : false , <nl> - <nl> - / / Modal options <nl> - modalOverlayClose : true , <nl> - <nl> - / / Draggable <nl> - draggable : null , <nl> - draggableGrid : false , <nl> - draggableLimit : false , <nl> - draggableSnap : false , <nl> - <nl> - / / Resizable <nl> - resizable : null , <nl> - resizeLimit : { ' x ' : [ 250 , 2500 ] , ' y ' : [ 125 , 2000 ] } , <nl> - <nl> - / / Style options : <nl> - addClass : ' ' , <nl> - width : 300 , <nl> - height : 125 , <nl> - headerHeight : 25 , <nl> - footerHeight : 25 , <nl> - cornerRadius : 8 , <nl> - x : null , <nl> - y : null , <nl> - scrollbars : true , <nl> - padding : { top : 10 , right : 12 , bottom : 10 , left : 12 } , <nl> - shadowBlur : 5 , <nl> - shadowOffset : { ' x ' : 0 , ' y ' : 1 } , <nl> - controlsOffset : { ' right ' : 6 , ' top ' : 6 } , <nl> - useCanvas : true , <nl> - useCanvasControls : true , <nl> - useSpinner : true , <nl> - <nl> - / / Color options : <nl> - headerStartColor : [ 250 , 250 , 250 ] , <nl> - headerStopColor : [ 229 , 229 , 229 ] , <nl> - bodyBgColor : [ 229 , 229 , 229 ] , <nl> - minimizeBgColor : [ 255 , 255 , 255 ] , <nl> - minimizeColor : [ 0 , 0 , 0 ] , <nl> - maximizeBgColor : [ 255 , 255 , 255 ] , <nl> - maximizeColor : [ 0 , 0 , 0 ] , <nl> - closeBgColor : [ 255 , 255 , 255 ] , <nl> - closeColor : [ 0 , 0 , 0 ] , <nl> - resizableColor : [ 254 , 254 , 254 ] , <nl> - <nl> - / / Events <nl> - onBeforeBuild : $ empty , <nl> - onContentLoaded : $ empty , <nl> - onFocus : $ empty , <nl> - onBlur : $ empty , <nl> - onResize : $ empty , <nl> - onMinimize : $ empty , <nl> - onMaximize : $ empty , <nl> - onRestore : $ empty , <nl> - onClose : $ empty , <nl> - onCloseComplete : $ empty <nl> - } ; <nl> - <nl> - MUI . Windows . windowOptionsOriginal = $ merge ( MUI . Windows . windowOptions ) ; <nl> - <nl> - MUI . Window = new Class ( { <nl> - <nl> - Implements : [ Events , Options ] , <nl> - <nl> - options : MUI . Windows . windowOptions , <nl> - <nl> - initialize : function ( options ) { <nl> - this . setOptions ( options ) ; <nl> - <nl> - / / Shorten object chain <nl> - var options = this . options ; <nl> - <nl> - $ extend ( this , { <nl> - mochaControlsWidth : 0 , <nl> - minimizebuttonX : 0 , / / Minimize button horizontal position <nl> - maximizebuttonX : 0 , / / Maximize button horizontal position <nl> - closebuttonX : 0 , / / Close button horizontal position <nl> - headerFooterShadow : options . headerHeight + options . footerHeight + ( options . shadowBlur * 2 ) , <nl> - oldTop : 0 , <nl> - oldLeft : 0 , <nl> - isMaximized : false , <nl> - isMinimized : false , <nl> - isCollapsed : false , <nl> - timestamp : $ time ( ) <nl> - } ) ; <nl> - <nl> - if ( options . type ! = ' window ' ) { <nl> - options . container = document . body ; <nl> - options . minimizable = false ; <nl> - } <nl> - if ( ! options . container ) { <nl> - options . container = MUI . Desktop & & MUI . Desktop . desktop ? MUI . Desktop . desktop : document . body ; <nl> - } <nl> - <nl> - / / Set this . options . resizable to default if it was not defined <nl> - if ( options . resizable = = null ) { <nl> - if ( options . type ! = ' window ' | | options . shape = = ' gauge ' ) { <nl> - options . resizable = false ; <nl> - } <nl> - else { <nl> - options . resizable = true ; <nl> - } <nl> - } <nl> - <nl> - / / Set this . options . draggable if it was not defined <nl> - if ( options . draggable = = null ) { <nl> - options . draggable = options . type ! = ' window ' ? false : true ; <nl> - } <nl> - <nl> - / / Gauges are not maximizable or resizable <nl> - if ( options . shape = = ' gauge ' | | options . type = = ' notification ' ) { <nl> - options . collapsible = false ; <nl> - options . maximizable = false ; <nl> - options . contentBgColor = ' transparent ' ; <nl> - options . scrollbars = false ; <nl> - options . footerHeight = 0 ; <nl> - } <nl> - if ( options . type = = ' notification ' ) { <nl> - options . closable = false ; <nl> - options . headerHeight = 0 ; <nl> - } <nl> - <nl> - / / Minimizable , dock is required and window cannot be modal <nl> - if ( MUI . Dock & & $ ( MUI . options . dock ) ) { <nl> - if ( MUI . Dock . dock & & options . type ! = ' modal ' & & options . type ! = ' modal2 ' ) { <nl> - options . minimizable = options . minimizable ; <nl> - } <nl> - } <nl> - else { <nl> - options . minimizable = false ; <nl> - } <nl> - <nl> - / / Maximizable , desktop is required <nl> - options . maximizable = MUI . Desktop & & MUI . Desktop . desktop & & options . maximizable & & options . type ! = ' modal ' & & options . type ! = ' modal2 ' ; <nl> - <nl> - if ( this . options . type = = ' modal2 ' ) { <nl> - this . options . shadowBlur = 0 ; <nl> - this . options . shadowOffset = { ' x ' : 0 , ' y ' : 0 } ; <nl> - this . options . useSpinner = false ; <nl> - this . options . useCanvas = false ; <nl> - this . options . footerHeight = 0 ; <nl> - this . options . headerHeight = 0 ; <nl> - } <nl> - <nl> - / / If window has no ID , give it one . <nl> - options . id = options . id | | ' win ' + ( + + MUI . Windows . windowIDCount ) ; <nl> - <nl> - this . windowEl = $ ( options . id ) ; <nl> - <nl> - if ( options . require . css . length | | options . require . images . length ) { <nl> - new MUI . Require ( { <nl> - css : options . require . css , <nl> - images : options . require . images , <nl> - onload : function ( ) { <nl> - this . newWindow ( ) ; <nl> - } . bind ( this ) <nl> - } ) ; <nl> - } <nl> - else { <nl> - this . newWindow ( ) ; <nl> - } <nl> - <nl> - / / Return window object <nl> - return this ; <nl> - } , <nl> - saveValues : function ( ) { <nl> - var coordinates = this . windowEl . getCoordinates ( ) ; <nl> - this . options . x = coordinates . left . toInt ( ) ; <nl> - this . options . y = coordinates . top . toInt ( ) ; <nl> - } , <nl> - <nl> - / * <nl> - <nl> - Internal Function : newWindow <nl> - <nl> - Arguments : <nl> - properties <nl> - <nl> - * / <nl> - newWindow : function ( properties ) { / / options is not doing anything <nl> - <nl> - / / Shorten object chain <nl> - var instances = MUI . Windows . instances ; <nl> - var instanceID = MUI . Windows . instances . get ( this . options . id ) ; <nl> - var options = this . options ; <nl> - <nl> - / / Here we check to see if there is already a class instance for this window <nl> - if ( instanceID ) var instance = instanceID ; <nl> - <nl> - / / Check if window already exists and is not in progress of closing <nl> - if ( this . windowEl & & ! this . isClosing ) { <nl> - / / Restore if minimized <nl> - if ( instance . isMinimized ) { <nl> - MUI . Dock . restoreMinimized ( this . windowEl ) ; <nl> - } <nl> - / / Expand and focus if collapsed <nl> - else if ( instance . isCollapsed ) { <nl> - MUI . collapseToggle ( this . windowEl ) ; <nl> - setTimeout ( MUI . focusWindow . pass ( this . windowEl , this ) , 10 ) ; <nl> - } <nl> - else if ( this . windowEl . hasClass ( ' windowClosed ' ) ) { <nl> - <nl> - if ( instance . check ) instance . check . show ( ) ; <nl> - <nl> - this . windowEl . removeClass ( ' windowClosed ' ) ; <nl> - this . windowEl . setStyle ( ' opacity ' , 0 ) ; <nl> - this . windowEl . addClass ( ' mocha ' ) ; <nl> - <nl> - if ( MUI . Dock & & $ ( MUI . options . dock ) & & instance . options . type = = ' window ' ) { <nl> - var currentButton = $ ( instance . options . id + ' _dockTab ' ) ; <nl> - if ( currentButton ! = null ) { <nl> - currentButton . show ( ) ; <nl> - } <nl> - MUI . Desktop . setDesktopSize ( ) ; <nl> - } <nl> - <nl> - instance . displayNewWindow ( ) ; <nl> - <nl> - } <nl> - / / Else focus <nl> - else { <nl> - var coordinates = document . getCoordinates ( ) ; <nl> - if ( this . windowEl . getStyle ( ' left ' ) . toInt ( ) > coordinates . width | | this . windowEl . getStyle ( ' top ' ) . toInt ( ) > coordinates . height ) { <nl> - MUI . centerWindow ( this . windowEl ) ; <nl> - } <nl> - setTimeout ( MUI . focusWindow . pass ( this . windowEl , this ) , 10 ) ; <nl> - if ( MUI . options . standardEffects = = true ) { <nl> - this . windowEl . shake ( ) ; <nl> - } <nl> - } <nl> - return ; <nl> - } <nl> - else { <nl> - instances . set ( options . id , this ) ; <nl> - } <nl> - <nl> - this . isClosing = false ; <nl> - this . fireEvent ( ' onBeforeBuild ' ) ; <nl> - <nl> - / / Create window div <nl> - MUI . Windows . indexLevel + + ; <nl> - this . windowEl = new Element ( ' div ' , { <nl> - ' class ' : ' mocha ' , <nl> - ' id ' : options . id , <nl> - ' styles ' : { <nl> - ' position ' : ' absolute ' , <nl> - ' width ' : options . width , <nl> - ' height ' : options . height , <nl> - ' display ' : ' block ' , <nl> - ' opacity ' : 0 , <nl> - ' zIndex ' : MUI . Windows . indexLevel + = 2 <nl> - } <nl> - } ) ; <nl> - <nl> - this . windowEl . store ( ' instance ' , this ) ; <nl> - <nl> - this . windowEl . addClass ( options . addClass ) ; <nl> - <nl> - if ( options . type = = ' modal2 ' ) { <nl> - this . windowEl . addClass ( ' modal2 ' ) ; <nl> - } <nl> - <nl> - / / Fix a mouseover issue with gauges in IE7 <nl> - if ( MUI . ieLegacySupport & & options . shape = = ' gauge ' ) { <nl> - this . windowEl . setStyle ( ' backgroundImage ' , ' url ( . . / images / skin / spacer . gif ) ' ) ; <nl> - } <nl> - <nl> - if ( options . loadMethod = = ' iframe ' ) { <nl> - options . padding = { top : 0 , right : 0 , bottom : 0 , left : 0 } ; <nl> - } <nl> - <nl> - / / Insert sub elements inside windowEl <nl> - this . insertWindowElements ( ) ; <nl> - <nl> - / / Set title <nl> - this . titleEl . set ( ' html ' , options . title ) ; <nl> - <nl> - this . contentWrapperEl . setStyle ( ' overflow ' , ' hidden ' ) ; <nl> - <nl> - this . contentEl . setStyles ( { <nl> - ' padding - top ' : options . padding . top , <nl> - ' padding - bottom ' : options . padding . bottom , <nl> - ' padding - left ' : options . padding . left , <nl> - ' padding - right ' : options . padding . right <nl> - } ) ; <nl> - <nl> - if ( options . shape = = ' gauge ' ) { <nl> - if ( options . useCanvasControls ) { <nl> - this . canvasControlsEl . setStyle ( ' visibility ' , ' hidden ' ) ; <nl> - } <nl> - else { <nl> - this . controlsEl . setStyle ( ' visibility ' , ' hidden ' ) ; <nl> - } <nl> - this . windowEl . addEvent ( ' mouseover ' , function ( ) { <nl> - this . mouseover = true ; <nl> - var showControls = function ( ) { <nl> - if ( this . mouseover ! = false ) { <nl> - if ( options . useCanvasControls ) { <nl> - this . canvasControlsEl . setStyle ( ' visibility ' , ' visible ' ) ; <nl> - } <nl> - else { <nl> - this . controlsEl . setStyle ( ' visibility ' , ' visible ' ) ; <nl> - } <nl> - this . canvasHeaderEl . setStyle ( ' visibility ' , ' visible ' ) ; <nl> - this . titleEl . show ( ) ; <nl> - } <nl> - } ; <nl> - showControls . delay ( 0 , this ) ; <nl> - <nl> - } . bind ( this ) ) ; <nl> - this . windowEl . addEvent ( ' mouseleave ' , function ( ) { <nl> - this . mouseover = false ; <nl> - if ( this . options . useCanvasControls ) { <nl> - this . canvasControlsEl . setStyle ( ' visibility ' , ' hidden ' ) ; <nl> - } <nl> - else { <nl> - this . controlsEl . setStyle ( ' visibility ' , ' hidden ' ) ; <nl> - } <nl> - this . canvasHeaderEl . setStyle ( ' visibility ' , ' hidden ' ) ; <nl> - this . titleEl . hide ( ) ; <nl> - } . bind ( this ) ) ; <nl> - } <nl> - <nl> - / / Inject window into DOM <nl> - this . windowEl . inject ( options . container ) ; <nl> - <nl> - / / Convert CSS colors to Canvas colors . <nl> - this . setColors ( ) ; <nl> - <nl> - if ( options . type ! = ' notification ' ) { <nl> - this . setMochaControlsWidth ( ) ; <nl> - } <nl> - <nl> - / / Add content to window . <nl> - MUI . updateContent ( { <nl> - ' element ' : this . windowEl , <nl> - ' content ' : options . content , <nl> - ' method ' : options . method , <nl> - ' url ' : options . contentURL , <nl> - ' data ' : options . data , <nl> - ' onContentLoaded ' : null , <nl> - ' require ' : { <nl> - js : options . require . js , <nl> - onload : options . require . onload <nl> - } <nl> - } ) ; <nl> - <nl> - / / Add content to window toolbar . <nl> - if ( this . options . toolbar = = true ) { <nl> - MUI . updateContent ( { <nl> - ' element ' : this . windowEl , <nl> - ' childElement ' : this . toolbarEl , <nl> - ' content ' : options . toolbarContent , <nl> - ' loadMethod ' : ' xhr ' , <nl> - ' method ' : options . method , <nl> - ' url ' : options . toolbarURL , <nl> - ' data ' : options . toolbarData , <nl> - ' onContentLoaded ' : options . toolbarOnload <nl> - } ) ; <nl> - } <nl> - <nl> - / / Add content to window toolbar . <nl> - if ( this . options . toolbar2 = = true ) { <nl> - MUI . updateContent ( { <nl> - ' element ' : this . windowEl , <nl> - ' childElement ' : this . toolbar2El , <nl> - ' content ' : options . toolbar2Content , <nl> - ' loadMethod ' : ' xhr ' , <nl> - ' method ' : options . method , <nl> - ' url ' : options . toolbar2URL , <nl> - ' data ' : options . toolbar2Data , <nl> - ' onContentLoaded ' : options . toolbar2Onload <nl> - } ) ; <nl> - } <nl> - <nl> - this . drawWindow ( ) ; <nl> - <nl> - / / Attach events to the window <nl> - this . attachDraggable ( ) ; <nl> - this . attachResizable ( ) ; <nl> - this . setupEvents ( ) ; <nl> - <nl> - if ( options . resizable ) { <nl> - this . adjustHandles ( ) ; <nl> - } <nl> - <nl> - / / Position window . If position not specified by user then center the window on the page . <nl> - if ( options . container = = document . body | | options . container = = MUI . Desktop . desktop ) { <nl> - var dimensions = window . getSize ( ) ; <nl> - } <nl> - else { <nl> - var dimensions = $ ( this . options . container ) . getSize ( ) ; <nl> - } <nl> - <nl> - if ( ! options . y ) { <nl> - if ( MUI . Desktop & & MUI . Desktop . desktop ) { <nl> - var y = ( dimensions . y * . 5 ) - ( this . windowEl . offsetHeight * . 5 ) ; <nl> - if ( y < - options . shadowBlur ) y = - options . shadowBlur ; <nl> - } <nl> - else { <nl> - var y = window . getScroll ( ) . y + ( window . getSize ( ) . y * . 5 ) - ( this . windowEl . offsetHeight * . 5 ) ; <nl> - if ( y < - options . shadowBlur ) y = - options . shadowBlur ; <nl> - } <nl> - } <nl> - else { <nl> - var y = options . y - options . shadowBlur ; <nl> - } <nl> - <nl> - if ( ! this . options . x ) { <nl> - var x = ( dimensions . x * . 5 ) - ( this . windowEl . offsetWidth * . 5 ) ; <nl> - if ( x < - options . shadowBlur ) x = - options . shadowBlur ; <nl> - } <nl> - else { <nl> - var x = options . x - options . shadowBlur ; <nl> - } <nl> - <nl> - this . windowEl . setStyles ( { <nl> - ' top ' : y , <nl> - ' left ' : x <nl> - } ) ; <nl> - <nl> - / / Create opacityMorph <nl> - <nl> - this . opacityMorph = new Fx . Morph ( this . windowEl , { <nl> - ' duration ' : 350 , <nl> - transition : Fx . Transitions . Sine . easeInOut , <nl> - onComplete : function ( ) { <nl> - if ( MUI . ieLegacySupport ) { <nl> - this . drawWindow ( ) ; <nl> - } <nl> - } . bind ( this ) <nl> - } ) ; <nl> - <nl> - this . displayNewWindow ( ) ; <nl> - <nl> - / / This is a generic morph that can be reused later by functions like centerWindow ( ) <nl> - / / It returns the windowEl element rather than this Class . <nl> - this . morph = new Fx . Morph ( this . windowEl , { <nl> - ' duration ' : 200 <nl> - } ) ; <nl> - this . windowEl . store ( ' morph ' , this . morph ) ; <nl> - <nl> - this . resizeMorph = new Fx . Elements ( [ this . contentWrapperEl , this . windowEl ] , { <nl> - duration : 400 , <nl> - transition : Fx . Transitions . Sine . easeInOut , <nl> - onStart : function ( ) { <nl> - this . resizeAnimation = this . drawWindow . periodical ( 20 , this ) ; <nl> - } . bind ( this ) , <nl> - onComplete : function ( ) { <nl> - $ clear ( this . resizeAnimation ) ; <nl> - this . drawWindow ( ) ; <nl> - / / Show iframe <nl> - if ( this . iframeEl ) { <nl> - this . iframeEl . setStyle ( ' visibility ' , ' visible ' ) ; <nl> - } <nl> - } . bind ( this ) <nl> - } ) ; <nl> - this . windowEl . store ( ' resizeMorph ' , this . resizeMorph ) ; <nl> - <nl> - / / Add check mark to menu if link exists in menu <nl> - / / Need to make sure the check mark is not added to links not in menu <nl> - if ( $ ( this . windowEl . id + ' LinkCheck ' ) ) { <nl> - this . check = new Element ( ' div ' , { <nl> - ' class ' : ' check ' , <nl> - ' id ' : this . options . id + ' _check ' <nl> - } ) . inject ( this . windowEl . id + ' LinkCheck ' ) ; <nl> - } <nl> - <nl> - if ( this . options . closeAfter ! = false ) { <nl> - MUI . closeWindow . delay ( this . options . closeAfter , this , this . windowEl ) ; <nl> - } <nl> - <nl> - if ( MUI . Dock & & $ ( MUI . options . dock ) & & this . options . type = = ' window ' ) { <nl> - MUI . Dock . createDockTab ( this . windowEl ) ; <nl> - } <nl> - <nl> - } , <nl> - displayNewWindow : function ( ) { <nl> - <nl> - options = this . options ; <nl> - if ( options . type = = ' modal ' | | options . type = = ' modal2 ' ) { <nl> - MUI . currentModal = this . windowEl ; <nl> - if ( Browser . Engine . trident4 ) { <nl> - $ ( ' modalFix ' ) . show ( ) ; <nl> - } <nl> - $ ( ' modalOverlay ' ) . show ( ) ; <nl> - if ( MUI . options . advancedEffects = = false ) { <nl> - $ ( ' modalOverlay ' ) . setStyle ( ' opacity ' , . 6 ) ; <nl> - this . windowEl . setStyles ( { <nl> - ' zIndex ' : 11000 , <nl> - ' opacity ' : 1 <nl> - } ) ; <nl> - } <nl> - else { <nl> - MUI . Modal . modalOverlayCloseMorph . cancel ( ) ; <nl> - MUI . Modal . modalOverlayOpenMorph . start ( { <nl> - ' opacity ' : . 6 <nl> - } ) ; <nl> - this . windowEl . setStyles ( { <nl> - ' zIndex ' : 11000 <nl> - } ) ; <nl> - this . opacityMorph . start ( { <nl> - ' opacity ' : 1 <nl> - } ) ; <nl> - } <nl> - <nl> - $ $ ( ' . dockTab ' ) . removeClass ( ' activeDockTab ' ) ; <nl> - $ $ ( ' . mocha ' ) . removeClass ( ' isFocused ' ) ; <nl> - this . windowEl . addClass ( ' isFocused ' ) ; <nl> - <nl> - } <nl> - else if ( MUI . options . advancedEffects = = false ) { <nl> - this . windowEl . setStyle ( ' opacity ' , 1 ) ; <nl> - setTimeout ( MUI . focusWindow . pass ( this . windowEl , this ) , 10 ) ; <nl> - } <nl> - else { <nl> - / / IE cannot handle both element opacity and VML alpha at the same time . <nl> - if ( MUI . ieLegacySupport ) { <nl> - this . drawWindow ( false ) ; <nl> - } <nl> - this . opacityMorph . start ( { <nl> - ' opacity ' : 1 <nl> - } ) ; <nl> - setTimeout ( MUI . focusWindow . pass ( this . windowEl , this ) , 10 ) ; <nl> - } <nl> - <nl> - } , <nl> - setupEvents : function ( ) { <nl> - var windowEl = this . windowEl ; <nl> - / / Set events <nl> - / / Note : if a button does not exist , its due to properties passed to newWindow ( ) stating otherwise <nl> - if ( this . closeButtonEl ) { <nl> - this . closeButtonEl . addEvent ( ' click ' , function ( e ) { <nl> - new Event ( e ) . stop ( ) ; <nl> - MUI . closeWindow ( windowEl ) ; <nl> - } . bind ( this ) ) ; <nl> - } <nl> - <nl> - if ( this . options . type = = ' window ' ) { <nl> - windowEl . addEvent ( ' mousedown ' , function ( e ) { <nl> - if ( MUI . ieLegacySupport ) { <nl> - new Event ( e ) . stop ( ) ; <nl> - } <nl> - MUI . focusWindow ( windowEl ) ; <nl> - if ( windowEl . getStyle ( ' top ' ) . toInt ( ) < - this . options . shadowBlur ) { <nl> - windowEl . setStyle ( ' top ' , - this . options . shadowBlur ) ; <nl> - } <nl> - } . bind ( this ) ) ; <nl> - } <nl> - <nl> - if ( this . minimizeButtonEl ) { <nl> - this . minimizeButtonEl . addEvent ( ' click ' , function ( e ) { <nl> - new Event ( e ) . stop ( ) ; <nl> - MUI . Dock . minimizeWindow ( windowEl ) ; <nl> - } . bind ( this ) ) ; <nl> - } <nl> - <nl> - if ( this . maximizeButtonEl ) { <nl> - this . maximizeButtonEl . addEvent ( ' click ' , function ( e ) { <nl> - new Event ( e ) . stop ( ) ; <nl> - if ( this . isMaximized ) { <nl> - MUI . Desktop . restoreWindow ( windowEl ) ; <nl> - } else { <nl> - MUI . Desktop . maximizeWindow ( windowEl ) ; <nl> - } <nl> - } . bind ( this ) ) ; <nl> - } <nl> - <nl> - if ( this . options . collapsible = = true ) { <nl> - / / Keep titlebar text from being selected on double click in Safari . <nl> - this . titleEl . addEvent ( ' selectstart ' , function ( e ) { <nl> - e = new Event ( e ) . stop ( ) ; <nl> - } . bind ( this ) ) ; <nl> - <nl> - if ( MUI . ieLegacySupport ) { <nl> - this . titleBarEl . addEvent ( ' mousedown ' , function ( e ) { <nl> - this . titleEl . setCapture ( ) ; <nl> - } . bind ( this ) ) ; <nl> - this . titleBarEl . addEvent ( ' mouseup ' , function ( e ) { <nl> - this . titleEl . releaseCapture ( ) ; <nl> - } . bind ( this ) ) ; <nl> - } <nl> - <nl> - this . titleBarEl . addEvent ( ' dblclick ' , function ( e ) { <nl> - e = new Event ( e ) . stop ( ) ; <nl> - MUI . collapseToggle ( this . windowEl ) ; <nl> - } . bind ( this ) ) ; <nl> - } <nl> - <nl> - } , <nl> - / * <nl> - <nl> - Internal Function : attachDraggable ( ) <nl> - Make window draggable . <nl> - <nl> - * / <nl> - attachDraggable : function ( ) { <nl> - var windowEl = this . windowEl ; <nl> - if ( ! this . options . draggable ) return ; <nl> - this . windowDrag = new Drag . Move ( windowEl , { <nl> - handle : this . titleBarEl , <nl> - container : this . options . restrict = = true ? $ ( this . options . container ) : false , <nl> - grid : this . options . draggableGrid , <nl> - limit : this . options . draggableLimit , <nl> - snap : this . options . draggableSnap , <nl> - onStart : function ( ) { <nl> - if ( this . options . type ! = ' modal ' & & this . options . type ! = ' modal2 ' ) { <nl> - MUI . focusWindow ( windowEl ) ; <nl> - $ ( ' windowUnderlay ' ) . show ( ) ; <nl> - } <nl> - if ( this . iframeEl ) { <nl> - if ( ! MUI . ieLegacySupport ) { <nl> - this . iframeEl . setStyle ( ' visibility ' , ' hidden ' ) ; <nl> - } <nl> - else { <nl> - this . iframeEl . hide ( ) ; <nl> - } <nl> - } <nl> - } . bind ( this ) , <nl> - onComplete : function ( ) { <nl> - if ( this . options . type ! = ' modal ' & & this . options . type ! = ' modal2 ' ) { <nl> - $ ( ' windowUnderlay ' ) . hide ( ) ; <nl> - } <nl> - if ( this . iframeEl ) { <nl> - if ( ! MUI . ieLegacySupport ) { <nl> - this . iframeEl . setStyle ( ' visibility ' , ' visible ' ) ; <nl> - } <nl> - else { <nl> - this . iframeEl . show ( ) ; <nl> - } <nl> - } <nl> - / / Store new position in options . <nl> - this . saveValues ( ) ; <nl> - } . bind ( this ) <nl> - } ) ; <nl> - } , <nl> - / * <nl> - <nl> - Internal Function : attachResizable <nl> - Make window resizable . <nl> - <nl> - * / <nl> - attachResizable : function ( ) { <nl> - var windowEl = this . windowEl ; <nl> - if ( ! this . options . resizable ) return ; <nl> - this . resizable1 = this . windowEl . makeResizable ( { <nl> - handle : [ this . n , this . ne , this . nw ] , <nl> - limit : { <nl> - y : [ <nl> - function ( ) { <nl> - return this . windowEl . getStyle ( ' top ' ) . toInt ( ) + this . windowEl . getStyle ( ' height ' ) . toInt ( ) - this . options . resizeLimit . y [ 1 ] ; <nl> - } . bind ( this ) , <nl> - function ( ) { <nl> - return this . windowEl . getStyle ( ' top ' ) . toInt ( ) + this . windowEl . getStyle ( ' height ' ) . toInt ( ) - this . options . resizeLimit . y [ 0 ] ; <nl> - } . bind ( this ) <nl> - ] <nl> - } , <nl> - modifiers : { x : false , y : ' top ' } , <nl> - onStart : function ( ) { <nl> - this . resizeOnStart ( ) ; <nl> - this . coords = this . contentWrapperEl . getCoordinates ( ) ; <nl> - this . y2 = this . coords . top . toInt ( ) + this . contentWrapperEl . offsetHeight ; <nl> - } . bind ( this ) , <nl> - onDrag : function ( ) { <nl> - this . coords = this . contentWrapperEl . getCoordinates ( ) ; <nl> - this . contentWrapperEl . setStyle ( ' height ' , this . y2 - this . coords . top . toInt ( ) ) ; <nl> - this . resizeOnDrag ( ) ; <nl> - } . bind ( this ) , <nl> - onComplete : function ( ) { <nl> - this . resizeOnComplete ( ) ; <nl> - } . bind ( this ) <nl> - } ) ; <nl> - <nl> - this . resizable2 = this . contentWrapperEl . makeResizable ( { <nl> - handle : [ this . e , this . ne ] , <nl> - limit : { <nl> - x : [ this . options . resizeLimit . x [ 0 ] - ( this . options . shadowBlur * 2 ) , this . options . resizeLimit . x [ 1 ] - ( this . options . shadowBlur * 2 ) ] <nl> - } , <nl> - modifiers : { x : ' width ' , y : false } , <nl> - onStart : function ( ) { <nl> - this . resizeOnStart ( ) ; <nl> - } . bind ( this ) , <nl> - onDrag : function ( ) { <nl> - this . resizeOnDrag ( ) ; <nl> - } . bind ( this ) , <nl> - onComplete : function ( ) { <nl> - this . resizeOnComplete ( ) ; <nl> - } . bind ( this ) <nl> - } ) ; <nl> - <nl> - this . resizable3 = this . contentWrapperEl . makeResizable ( { <nl> - container : this . options . restrict = = true ? $ ( this . options . container ) : false , <nl> - handle : this . se , <nl> - limit : { <nl> - x : [ this . options . resizeLimit . x [ 0 ] - ( this . options . shadowBlur * 2 ) , this . options . resizeLimit . x [ 1 ] - ( this . options . shadowBlur * 2 ) ] , <nl> - y : [ this . options . resizeLimit . y [ 0 ] - this . headerFooterShadow , this . options . resizeLimit . y [ 1 ] - this . headerFooterShadow ] <nl> - } , <nl> - modifiers : { x : ' width ' , y : ' height ' } , <nl> - onStart : function ( ) { <nl> - this . resizeOnStart ( ) ; <nl> - } . bind ( this ) , <nl> - onDrag : function ( ) { <nl> - this . resizeOnDrag ( ) ; <nl> - } . bind ( this ) , <nl> - onComplete : function ( ) { <nl> - this . resizeOnComplete ( ) ; <nl> - } . bind ( this ) <nl> - } ) ; <nl> - <nl> - this . resizable4 = this . contentWrapperEl . makeResizable ( { <nl> - handle : [ this . s , this . sw ] , <nl> - limit : { <nl> - y : [ this . options . resizeLimit . y [ 0 ] - this . headerFooterShadow , this . options . resizeLimit . y [ 1 ] - this . headerFooterShadow ] <nl> - } , <nl> - modifiers : { x : false , y : ' height ' } , <nl> - onStart : function ( ) { <nl> - this . resizeOnStart ( ) ; <nl> - } . bind ( this ) , <nl> - onDrag : function ( ) { <nl> - this . resizeOnDrag ( ) ; <nl> - } . bind ( this ) , <nl> - onComplete : function ( ) { <nl> - this . resizeOnComplete ( ) ; <nl> - } . bind ( this ) <nl> - } ) ; <nl> - <nl> - this . resizable5 = this . windowEl . makeResizable ( { <nl> - handle : [ this . w , this . sw , this . nw ] , <nl> - limit : { <nl> - x : [ <nl> - function ( ) { <nl> - return this . windowEl . getStyle ( ' left ' ) . toInt ( ) + this . windowEl . getStyle ( ' width ' ) . toInt ( ) - this . options . resizeLimit . x [ 1 ] ; <nl> - } . bind ( this ) , <nl> - function ( ) { <nl> - return this . windowEl . getStyle ( ' left ' ) . toInt ( ) + this . windowEl . getStyle ( ' width ' ) . toInt ( ) - this . options . resizeLimit . x [ 0 ] ; <nl> - } . bind ( this ) <nl> - ] <nl> - } , <nl> - modifiers : { x : ' left ' , y : false } , <nl> - onStart : function ( ) { <nl> - this . resizeOnStart ( ) ; <nl> - this . coords = this . contentWrapperEl . getCoordinates ( ) ; <nl> - this . x2 = this . coords . left . toInt ( ) + this . contentWrapperEl . offsetWidth ; <nl> - } . bind ( this ) , <nl> - onDrag : function ( ) { <nl> - this . coords = this . contentWrapperEl . getCoordinates ( ) ; <nl> - this . contentWrapperEl . setStyle ( ' width ' , this . x2 - this . coords . left . toInt ( ) ) ; <nl> - this . resizeOnDrag ( ) ; <nl> - } . bind ( this ) , <nl> - onComplete : function ( ) { <nl> - this . resizeOnComplete ( ) ; <nl> - } . bind ( this ) <nl> - } ) ; <nl> - <nl> - } , <nl> - resizeOnStart : function ( ) { <nl> - $ ( ' windowUnderlay ' ) . show ( ) ; <nl> - if ( this . iframeEl ) { <nl> - if ( ! MUI . ieLegacySupport ) { <nl> - this . iframeEl . setStyle ( ' visibility ' , ' hidden ' ) ; <nl> - } <nl> - else { <nl> - this . iframeEl . hide ( ) ; <nl> - } <nl> - } <nl> - } , <nl> - resizeOnDrag : function ( ) { <nl> - this . drawWindow ( ) ; <nl> - this . adjustHandles ( ) ; <nl> - } , <nl> - resizeOnComplete : function ( ) { <nl> - $ ( ' windowUnderlay ' ) . hide ( ) ; <nl> - if ( this . iframeEl ) { <nl> - if ( ! MUI . ieLegacySupport ) { <nl> - this . iframeEl . setStyle ( ' visibility ' , ' visible ' ) ; <nl> - } <nl> - else { <nl> - this . iframeEl . show ( ) ; <nl> - / / The following hack is to get IE8 RC1 IE8 Standards Mode to properly resize an iframe <nl> - / / when only the vertical dimension is changed . <nl> - this . iframeEl . setStyle ( ' width ' , ' 99 % ' ) ; <nl> - this . iframeEl . setStyle ( ' height ' , this . contentWrapperEl . offsetHeight ) ; <nl> - this . iframeEl . setStyle ( ' width ' , ' 100 % ' ) ; <nl> - this . iframeEl . setStyle ( ' height ' , this . contentWrapperEl . offsetHeight ) ; <nl> - } <nl> - } <nl> - <nl> - / / Resize panels if there are any <nl> - if ( this . contentWrapperEl . getChildren ( ' . column ' ) ! = null ) { <nl> - MUI . rWidth ( this . contentWrapperEl ) ; <nl> - this . contentWrapperEl . getChildren ( ' . column ' ) . each ( function ( column ) { <nl> - MUI . panelHeight ( column ) ; <nl> - } ) ; <nl> - } <nl> - <nl> - this . fireEvent ( ' onResize ' , this . windowEl ) ; <nl> - } , <nl> - adjustHandles : function ( ) { <nl> - <nl> - var shadowBlur = this . options . shadowBlur ; <nl> - var shadowBlur2x = shadowBlur * 2 ; <nl> - var shadowOffset = this . options . shadowOffset ; <nl> - var top = shadowBlur - shadowOffset . y - 1 ; <nl> - var right = shadowBlur + shadowOffset . x - 1 ; <nl> - var bottom = shadowBlur + shadowOffset . y - 1 ; <nl> - var left = shadowBlur - shadowOffset . x - 1 ; <nl> - <nl> - var coordinates = this . windowEl . getCoordinates ( ) ; <nl> - var width = coordinates . width - shadowBlur2x + 2 ; <nl> - var height = coordinates . height - shadowBlur2x + 2 ; <nl> - <nl> - this . n . setStyles ( { <nl> - ' top ' : top , <nl> - ' left ' : left + 10 , <nl> - ' width ' : width - 20 <nl> - } ) ; <nl> - this . e . setStyles ( { <nl> - ' top ' : top + 10 , <nl> - ' right ' : right , <nl> - ' height ' : height - 30 <nl> - } ) ; <nl> - this . s . setStyles ( { <nl> - ' bottom ' : bottom , <nl> - ' left ' : left + 10 , <nl> - ' width ' : width - 30 <nl> - } ) ; <nl> - this . w . setStyles ( { <nl> - ' top ' : top + 10 , <nl> - ' left ' : left , <nl> - ' height ' : height - 20 <nl> - } ) ; <nl> - this . ne . setStyles ( { <nl> - ' top ' : top , <nl> - ' right ' : right <nl> - } ) ; <nl> - this . se . setStyles ( { <nl> - ' bottom ' : bottom , <nl> - ' right ' : right <nl> - } ) ; <nl> - this . sw . setStyles ( { <nl> - ' bottom ' : bottom , <nl> - ' left ' : left <nl> - } ) ; <nl> - this . nw . setStyles ( { <nl> - ' top ' : top , <nl> - ' left ' : left <nl> - } ) ; <nl> - } , <nl> - detachResizable : function ( ) { <nl> - this . resizable1 . detach ( ) ; <nl> - this . resizable2 . detach ( ) ; <nl> - this . resizable3 . detach ( ) ; <nl> - this . resizable4 . detach ( ) ; <nl> - this . resizable5 . detach ( ) ; <nl> - this . windowEl . getElements ( ' . handle ' ) . hide ( ) ; <nl> - } , <nl> - reattachResizable : function ( ) { <nl> - this . resizable1 . attach ( ) ; <nl> - this . resizable2 . attach ( ) ; <nl> - this . resizable3 . attach ( ) ; <nl> - this . resizable4 . attach ( ) ; <nl> - this . resizable5 . attach ( ) ; <nl> - this . windowEl . getElements ( ' . handle ' ) . show ( ) ; <nl> - } , <nl> - / * <nl> - <nl> - Internal Function : insertWindowElements <nl> - <nl> - Arguments : <nl> - windowEl <nl> - <nl> - * / <nl> - insertWindowElements : function ( ) { <nl> - <nl> - var options = this . options ; <nl> - var height = options . height ; <nl> - var width = options . width ; <nl> - var id = options . id ; <nl> - <nl> - var cache = { } ; <nl> - <nl> - if ( Browser . Engine . trident4 ) { <nl> - cache . zIndexFixEl = new Element ( ' iframe ' , { <nl> - ' id ' : id + ' _zIndexFix ' , <nl> - ' class ' : ' zIndexFix ' , <nl> - ' scrolling ' : ' no ' , <nl> - ' marginWidth ' : 0 , <nl> - ' marginHeight ' : 0 , <nl> - ' src ' : ' ' , <nl> - ' styles ' : { <nl> - ' position ' : ' absolute ' / / This is set here to make theme transitions smoother <nl> - } <nl> - } ) . inject ( this . windowEl ) ; <nl> - } <nl> - <nl> - cache . overlayEl = new Element ( ' div ' , { <nl> - ' id ' : id + ' _overlay ' , <nl> - ' class ' : ' mochaOverlay ' , <nl> - ' styles ' : { <nl> - ' position ' : ' absolute ' , / / This is set here to make theme transitions smoother <nl> - ' top ' : 0 , <nl> - ' left ' : 0 <nl> - } <nl> - } ) . inject ( this . windowEl ) ; <nl> - <nl> - cache . titleBarEl = new Element ( ' div ' , { <nl> - ' id ' : id + ' _titleBar ' , <nl> - ' class ' : ' mochaTitlebar ' , <nl> - ' styles ' : { <nl> - ' cursor ' : options . draggable ? ' move ' : ' default ' <nl> - } <nl> - } ) . inject ( cache . overlayEl , ' top ' ) ; <nl> - <nl> - cache . titleEl = new Element ( ' h3 ' , { <nl> - ' id ' : id + ' _title ' , <nl> - ' class ' : ' mochaTitle ' <nl> - } ) . inject ( cache . titleBarEl ) ; <nl> - <nl> - if ( options . icon ! = false ) { <nl> - cache . titleEl . setStyles ( { <nl> - ' padding - left ' : 28 , <nl> - ' background ' : ' url ( ' + options . icon + ' ) 5px 4px no - repeat ' <nl> - } ) ; <nl> - } <nl> - <nl> - cache . contentBorderEl = new Element ( ' div ' , { <nl> - ' id ' : id + ' _contentBorder ' , <nl> - ' class ' : ' mochaContentBorder ' <nl> - } ) . inject ( cache . overlayEl ) ; <nl> - <nl> - if ( options . toolbar ) { <nl> - cache . toolbarWrapperEl = new Element ( ' div ' , { <nl> - ' id ' : id + ' _toolbarWrapper ' , <nl> - ' class ' : ' mochaToolbarWrapper ' , <nl> - ' styles ' : { ' height ' : options . toolbarHeight } <nl> - } ) . inject ( cache . contentBorderEl , options . toolbarPosition = = ' bottom ' ? ' after ' : ' before ' ) ; <nl> - <nl> - if ( options . toolbarPosition = = ' bottom ' ) { <nl> - cache . toolbarWrapperEl . addClass ( ' bottom ' ) ; <nl> - } <nl> - cache . toolbarEl = new Element ( ' div ' , { <nl> - ' id ' : id + ' _toolbar ' , <nl> - ' class ' : ' mochaToolbar ' , <nl> - ' styles ' : { ' height ' : options . toolbarHeight } <nl> - } ) . inject ( cache . toolbarWrapperEl ) ; <nl> - } <nl> - <nl> - if ( options . toolbar2 ) { <nl> - cache . toolbar2WrapperEl = new Element ( ' div ' , { <nl> - ' id ' : id + ' _toolbar2Wrapper ' , <nl> - ' class ' : ' mochaToolbarWrapper ' , <nl> - ' styles ' : { ' height ' : options . toolbar2Height } <nl> - } ) . inject ( cache . contentBorderEl , options . toolbar2Position = = ' bottom ' ? ' after ' : ' before ' ) ; <nl> - <nl> - if ( options . toolbar2Position = = ' bottom ' ) { <nl> - cache . toolbar2WrapperEl . addClass ( ' bottom ' ) ; <nl> - } <nl> - cache . toolbar2El = new Element ( ' div ' , { <nl> - ' id ' : id + ' _toolbar2 ' , <nl> - ' class ' : ' mochaToolbar ' , <nl> - ' styles ' : { ' height ' : options . toolbar2Height } <nl> - } ) . inject ( cache . toolbar2WrapperEl ) ; <nl> - } <nl> - <nl> - cache . contentWrapperEl = new Element ( ' div ' , { <nl> - ' id ' : id + ' _contentWrapper ' , <nl> - ' class ' : ' mochaContentWrapper ' , <nl> - ' styles ' : { <nl> - ' width ' : width + ' px ' , <nl> - ' height ' : height + ' px ' <nl> - } <nl> - } ) . inject ( cache . contentBorderEl ) ; <nl> - <nl> - if ( this . options . shape = = ' gauge ' ) { <nl> - cache . contentBorderEl . setStyle ( ' borderWidth ' , 0 ) ; <nl> - } <nl> - <nl> - cache . contentEl = new Element ( ' div ' , { <nl> - ' id ' : id + ' _content ' , <nl> - ' class ' : ' mochaContent ' <nl> - } ) . inject ( cache . contentWrapperEl ) ; <nl> - <nl> - if ( this . options . useCanvas = = true & & ! MUI . ieLegacySupport ) { <nl> - cache . canvasEl = new Element ( ' canvas ' , { <nl> - ' id ' : id + ' _canvas ' , <nl> - ' class ' : ' mochaCanvas ' , <nl> - ' width ' : 10 , <nl> - ' height ' : 10 <nl> - } ) . inject ( this . windowEl ) ; <nl> - } <nl> - <nl> - if ( this . options . useCanvas = = true & & MUI . ieLegacySupport ) { <nl> - cache . canvasEl = new Element ( ' canvas ' , { <nl> - ' id ' : id + ' _canvas ' , <nl> - ' class ' : ' mochaCanvas ' , <nl> - ' width ' : 50000 , / / IE8 excanvas requires these large numbers <nl> - ' height ' : 20000 , <nl> - ' styles ' : { <nl> - ' position ' : ' absolute ' , <nl> - ' top ' : 0 , <nl> - ' left ' : 0 <nl> - } <nl> - } ) . inject ( this . windowEl ) ; <nl> - <nl> - if ( MUI . ieLegacySupport & & MUI . ieSupport = = ' excanvas ' ) { <nl> - G_vmlCanvasManager . initElement ( cache . canvasEl ) ; <nl> - cache . canvasEl = this . windowEl . getElement ( ' . mochaCanvas ' ) ; <nl> - } <nl> - } <nl> - <nl> - cache . controlsEl = new Element ( ' div ' , { <nl> - ' id ' : id + ' _controls ' , <nl> - ' class ' : ' mochaControls ' <nl> - } ) . inject ( cache . overlayEl , ' after ' ) ; <nl> - <nl> - if ( options . useCanvasControls = = true ) { <nl> - cache . canvasControlsEl = new Element ( ' canvas ' , { <nl> - ' id ' : id + ' _canvasControls ' , <nl> - ' class ' : ' mochaCanvasControls ' , <nl> - ' width ' : 14 , <nl> - ' height ' : 14 <nl> - } ) . inject ( this . windowEl ) ; <nl> - <nl> - if ( MUI . ieLegacySupport & & MUI . ieSupport = = ' excanvas ' ) { <nl> - G_vmlCanvasManager . initElement ( cache . canvasControlsEl ) ; <nl> - cache . canvasControlsEl = this . windowEl . getElement ( ' . mochaCanvasControls ' ) ; <nl> - } <nl> - } <nl> - <nl> - if ( options . closable ) { <nl> - cache . closeButtonEl = new Element ( ' div ' , { <nl> - ' id ' : id + ' _closeButton ' , <nl> - ' class ' : ' mochaCloseButton mochaWindowButton ' , <nl> - ' title ' : ' Close ' <nl> - } ) . inject ( cache . controlsEl ) ; <nl> - } <nl> - <nl> - if ( options . maximizable ) { <nl> - cache . maximizeButtonEl = new Element ( ' div ' , { <nl> - ' id ' : id + ' _maximizeButton ' , <nl> - ' class ' : ' mochaMaximizeButton mochaWindowButton ' , <nl> - ' title ' : ' Maximize ' <nl> - } ) . inject ( cache . controlsEl ) ; <nl> - } <nl> - <nl> - if ( options . minimizable ) { <nl> - cache . minimizeButtonEl = new Element ( ' div ' , { <nl> - ' id ' : id + ' _minimizeButton ' , <nl> - ' class ' : ' mochaMinimizeButton mochaWindowButton ' , <nl> - ' title ' : ' Minimize ' <nl> - } ) . inject ( cache . controlsEl ) ; <nl> - } <nl> - <nl> - if ( options . useSpinner = = true & & options . shape ! = ' gauge ' & & options . type ! = ' notification ' ) { <nl> - cache . spinnerEl = new Element ( ' div ' , { <nl> - ' id ' : id + ' _spinner ' , <nl> - ' class ' : ' mochaSpinner ' , <nl> - ' width ' : 16 , <nl> - ' height ' : 16 <nl> - } ) . inject ( this . windowEl , ' bottom ' ) ; <nl> - } <nl> - <nl> - if ( this . options . shape = = ' gauge ' ) { <nl> - cache . canvasHeaderEl = new Element ( ' canvas ' , { <nl> - ' id ' : id + ' _canvasHeader ' , <nl> - ' class ' : ' mochaCanvasHeader ' , <nl> - ' width ' : this . options . width , <nl> - ' height ' : 26 <nl> - } ) . inject ( this . windowEl , ' bottom ' ) ; <nl> - <nl> - if ( MUI . ieLegacySupport & & MUI . ieSupport = = ' excanvas ' ) { <nl> - G_vmlCanvasManager . initElement ( cache . canvasHeaderEl ) ; <nl> - cache . canvasHeaderEl = this . windowEl . getElement ( ' . mochaCanvasHeader ' ) ; <nl> - } <nl> - } <nl> - <nl> - if ( MUI . ieLegacySupport ) { <nl> - cache . overlayEl . setStyle ( ' zIndex ' , 2 ) ; <nl> - } <nl> - <nl> - if ( options . resizable ) { <nl> - cache . n = new Element ( ' div ' , { <nl> - ' id ' : id + ' _resizeHandle_n ' , <nl> - ' class ' : ' handle ' , <nl> - ' styles ' : { <nl> - ' top ' : 0 , <nl> - ' left ' : 10 , <nl> - ' cursor ' : ' n - resize ' <nl> - } <nl> - } ) . inject ( cache . overlayEl , ' after ' ) ; <nl> - <nl> - cache . ne = new Element ( ' div ' , { <nl> - ' id ' : id + ' _resizeHandle_ne ' , <nl> - ' class ' : ' handle corner ' , <nl> - ' styles ' : { <nl> - ' top ' : 0 , <nl> - ' right ' : 0 , <nl> - ' cursor ' : ' ne - resize ' <nl> - } <nl> - } ) . inject ( cache . overlayEl , ' after ' ) ; <nl> - <nl> - cache . e = new Element ( ' div ' , { <nl> - ' id ' : id + ' _resizeHandle_e ' , <nl> - ' class ' : ' handle ' , <nl> - ' styles ' : { <nl> - ' top ' : 10 , <nl> - ' right ' : 0 , <nl> - ' cursor ' : ' e - resize ' <nl> - } <nl> - } ) . inject ( cache . overlayEl , ' after ' ) ; <nl> - <nl> - cache . se = new Element ( ' div ' , { <nl> - ' id ' : id + ' _resizeHandle_se ' , <nl> - ' class ' : ' handle cornerSE ' , <nl> - ' styles ' : { <nl> - ' bottom ' : 0 , <nl> - ' right ' : 0 , <nl> - ' cursor ' : ' se - resize ' <nl> - } <nl> - } ) . inject ( cache . overlayEl , ' after ' ) ; <nl> - <nl> - cache . s = new Element ( ' div ' , { <nl> - ' id ' : id + ' _resizeHandle_s ' , <nl> - ' class ' : ' handle ' , <nl> - ' styles ' : { <nl> - ' bottom ' : 0 , <nl> - ' left ' : 10 , <nl> - ' cursor ' : ' s - resize ' <nl> - } <nl> - } ) . inject ( cache . overlayEl , ' after ' ) ; <nl> - <nl> - cache . sw = new Element ( ' div ' , { <nl> - ' id ' : id + ' _resizeHandle_sw ' , <nl> - ' class ' : ' handle corner ' , <nl> - ' styles ' : { <nl> - ' bottom ' : 0 , <nl> - ' left ' : 0 , <nl> - ' cursor ' : ' sw - resize ' <nl> - } <nl> - } ) . inject ( cache . overlayEl , ' after ' ) ; <nl> - <nl> - cache . w = new Element ( ' div ' , { <nl> - ' id ' : id + ' _resizeHandle_w ' , <nl> - ' class ' : ' handle ' , <nl> - ' styles ' : { <nl> - ' top ' : 10 , <nl> - ' left ' : 0 , <nl> - ' cursor ' : ' w - resize ' <nl> - } <nl> - } ) . inject ( cache . overlayEl , ' after ' ) ; <nl> - <nl> - cache . nw = new Element ( ' div ' , { <nl> - ' id ' : id + ' _resizeHandle_nw ' , <nl> - ' class ' : ' handle corner ' , <nl> - ' styles ' : { <nl> - ' top ' : 0 , <nl> - ' left ' : 0 , <nl> - ' cursor ' : ' nw - resize ' <nl> - } <nl> - } ) . inject ( cache . overlayEl , ' after ' ) ; <nl> - } <nl> - $ extend ( this , cache ) ; <nl> - <nl> - } , <nl> - / * <nl> - <nl> - Convert CSS colors to Canvas colors . <nl> - <nl> - * / <nl> - setColors : function ( ) { <nl> - <nl> - if ( this . options . useCanvas = = true ) { <nl> - <nl> - / / Set TitlebarColor <nl> - var pattern = / \ ? ( . * ? ) \ ) / ; <nl> - if ( this . titleBarEl . getStyle ( ' backgroundImage ' ) ! = ' none ' ) { <nl> - var gradient = this . titleBarEl . getStyle ( ' backgroundImage ' ) ; <nl> - gradient = gradient . match ( pattern ) [ 1 ] ; <nl> - gradient = gradient . parseQueryString ( ) ; <nl> - var gradientFrom = gradient . from ; <nl> - var gradientTo = gradient . to . replace ( / \ " / , ' ' ) ; / / IE7 was adding a quotation mark in . No idea why . <nl> - <nl> - this . options . headerStartColor = new Color ( gradientFrom ) ; <nl> - this . options . headerStopColor = new Color ( gradientTo ) ; <nl> - this . titleBarEl . addClass ( ' replaced ' ) ; <nl> - } <nl> - else if ( this . titleBarEl . getStyle ( ' background - color ' ) ! = = ' ' & & this . titleBarEl . getStyle ( ' background - color ' ) ! = = ' transparent ' ) { <nl> - this . options . headerStartColor = new Color ( this . titleBarEl . getStyle ( ' background - color ' ) ) . mix ( ' # fff ' , 20 ) ; <nl> - this . options . headerStopColor = new Color ( this . titleBarEl . getStyle ( ' background - color ' ) ) . mix ( ' # 000 ' , 20 ) ; <nl> - this . titleBarEl . addClass ( ' replaced ' ) ; <nl> - } <nl> - <nl> - / / Set BodyBGColor <nl> - if ( this . windowEl . getStyle ( ' background - color ' ) ! = = ' ' & & this . windowEl . getStyle ( ' background - color ' ) ! = = ' transparent ' ) { <nl> - this . options . bodyBgColor = new Color ( this . windowEl . getStyle ( ' background - color ' ) ) ; <nl> - this . windowEl . addClass ( ' replaced ' ) ; <nl> - } <nl> - <nl> - / / Set resizableColor , the color of the SE corner resize handle <nl> - if ( this . options . resizable & & this . se . getStyle ( ' background - color ' ) ! = = ' ' & & this . se . getStyle ( ' background - color ' ) ! = = ' transparent ' ) { <nl> - this . options . resizableColor = new Color ( this . se . getStyle ( ' background - color ' ) ) ; <nl> - this . se . addClass ( ' replaced ' ) ; <nl> - } <nl> - <nl> - } <nl> - <nl> - if ( this . options . useCanvasControls = = true ) { <nl> - <nl> - if ( this . minimizeButtonEl ) { <nl> - <nl> - / / Set Minimize Button Foreground Color <nl> - if ( this . minimizeButtonEl . getStyle ( ' color ' ) ! = = ' ' & & this . minimizeButtonEl . getStyle ( ' color ' ) ! = = ' transparent ' ) { <nl> - this . options . minimizeColor = new Color ( this . minimizeButtonEl . getStyle ( ' color ' ) ) ; <nl> - } <nl> - <nl> - / / Set Minimize Button Background Color <nl> - if ( this . minimizeButtonEl . getStyle ( ' background - color ' ) ! = = ' ' & & this . minimizeButtonEl . getStyle ( ' background - color ' ) ! = = ' transparent ' ) { <nl> - this . options . minimizeBgColor = new Color ( this . minimizeButtonEl . getStyle ( ' background - color ' ) ) ; <nl> - this . minimizeButtonEl . addClass ( ' replaced ' ) ; <nl> - } <nl> - <nl> - } <nl> - <nl> - if ( this . maximizeButtonEl ) { <nl> - <nl> - / / Set Maximize Button Foreground Color <nl> - if ( this . maximizeButtonEl . getStyle ( ' color ' ) ! = = ' ' & & this . maximizeButtonEl . getStyle ( ' color ' ) ! = = ' transparent ' ) { <nl> - this . options . maximizeColor = new Color ( this . maximizeButtonEl . getStyle ( ' color ' ) ) ; <nl> - } <nl> - <nl> - / / Set Maximize Button Background Color <nl> - if ( this . maximizeButtonEl . getStyle ( ' background - color ' ) ! = = ' ' & & this . maximizeButtonEl . getStyle ( ' background - color ' ) ! = = ' transparent ' ) { <nl> - this . options . maximizeBgColor = new Color ( this . maximizeButtonEl . getStyle ( ' background - color ' ) ) ; <nl> - this . maximizeButtonEl . addClass ( ' replaced ' ) ; <nl> - } <nl> - <nl> - } <nl> - <nl> - if ( this . closeButtonEl ) { <nl> - <nl> - / / Set Close Button Foreground Color <nl> - if ( this . closeButtonEl . getStyle ( ' color ' ) ! = = ' ' & & this . closeButtonEl . getStyle ( ' color ' ) ! = = ' transparent ' ) { <nl> - this . options . closeColor = new Color ( this . closeButtonEl . getStyle ( ' color ' ) ) ; <nl> - } <nl> - <nl> - / / Set Close Button Background Color <nl> - if ( this . closeButtonEl . getStyle ( ' background - color ' ) ! = = ' ' & & this . closeButtonEl . getStyle ( ' background - color ' ) ! = = ' transparent ' ) { <nl> - this . options . closeBgColor = new Color ( this . closeButtonEl . getStyle ( ' background - color ' ) ) ; <nl> - this . closeButtonEl . addClass ( ' replaced ' ) ; <nl> - } <nl> - <nl> - } <nl> - } <nl> - } , <nl> - / * <nl> - <nl> - Internal function : drawWindow <nl> - This is where we create the canvas GUI <nl> - <nl> - Arguments : <nl> - windowEl : the $ ( window ) <nl> - shadows : ( boolean ) false will draw a window without shadows <nl> - <nl> - * / <nl> - drawWindow : function ( shadows ) { <nl> - <nl> - if ( this . drawingWindow = = true ) return ; <nl> - this . drawingWindow = true ; <nl> - <nl> - if ( this . isCollapsed ) { <nl> - this . drawWindowCollapsed ( shadows ) ; <nl> - return ; <nl> - } <nl> - <nl> - var windowEl = this . windowEl ; <nl> - <nl> - var options = this . options ; <nl> - var shadowBlur = options . shadowBlur ; <nl> - var shadowBlur2x = shadowBlur * 2 ; <nl> - var shadowOffset = this . options . shadowOffset ; <nl> - <nl> - this . overlayEl . setStyles ( { <nl> - ' width ' : this . contentWrapperEl . offsetWidth <nl> - } ) ; <nl> - <nl> - / / Resize iframe when window is resized <nl> - if ( this . iframeEl ) { <nl> - this . iframeEl . setStyle ( ' height ' , this . contentWrapperEl . offsetHeight ) ; <nl> - } <nl> - <nl> - var borderHeight = this . contentBorderEl . getStyle ( ' margin - top ' ) . toInt ( ) + this . contentBorderEl . getStyle ( ' margin - bottom ' ) . toInt ( ) ; <nl> - var toolbarHeight = this . toolbarWrapperEl ? this . toolbarWrapperEl . getStyle ( ' height ' ) . toInt ( ) + this . toolbarWrapperEl . getStyle ( ' margin - top ' ) . toInt ( ) : 0 ; <nl> - var toolbar2Height = this . toolbar2WrapperEl ? this . toolbar2WrapperEl . getStyle ( ' height ' ) . toInt ( ) + this . toolbar2WrapperEl . getStyle ( ' margin - top ' ) . toInt ( ) : 0 ; <nl> - <nl> - this . headerFooterShadow = options . headerHeight + options . footerHeight + shadowBlur2x ; <nl> - var height = this . contentWrapperEl . getStyle ( ' height ' ) . toInt ( ) + this . headerFooterShadow + toolbarHeight + toolbar2Height + borderHeight ; <nl> - var width = this . contentWrapperEl . getStyle ( ' width ' ) . toInt ( ) + shadowBlur2x ; <nl> - this . windowEl . setStyles ( { <nl> - ' height ' : height , <nl> - ' width ' : width <nl> - } ) ; <nl> - <nl> - this . overlayEl . setStyles ( { <nl> - ' height ' : height , <nl> - ' top ' : shadowBlur - shadowOffset . y , <nl> - ' left ' : shadowBlur - shadowOffset . x <nl> - } ) ; <nl> - <nl> - if ( this . options . useCanvas = = true ) { <nl> - if ( MUI . ieLegacySupport ) { <nl> - this . canvasEl . height = 20000 ; <nl> - this . canvasEl . width = 50000 ; <nl> - } <nl> - this . canvasEl . height = height ; <nl> - this . canvasEl . width = width ; <nl> - } <nl> - <nl> - / / Part of the fix for IE6 select z - index bug <nl> - if ( Browser . Engine . trident4 ) { <nl> - this . zIndexFixEl . setStyles ( { <nl> - ' width ' : width , <nl> - ' height ' : height <nl> - } ) <nl> - } <nl> - <nl> - this . titleBarEl . setStyles ( { <nl> - ' width ' : width - shadowBlur2x , <nl> - ' height ' : options . headerHeight <nl> - } ) ; <nl> - <nl> - / / Make sure loading icon is placed correctly . <nl> - if ( options . useSpinner = = true & & options . shape ! = ' gauge ' & & options . type ! = ' notification ' ) { <nl> - this . spinnerEl . setStyles ( { <nl> - ' left ' : shadowBlur - shadowOffset . x + 3 , <nl> - ' bottom ' : shadowBlur + shadowOffset . y + 4 <nl> - } ) ; <nl> - } <nl> - <nl> - if ( this . options . useCanvas ! = false ) { <nl> - <nl> - / / Draw Window <nl> - var ctx = this . canvasEl . getContext ( ' 2d ' ) ; <nl> - ctx . clearRect ( 0 , 0 , width , height ) ; <nl> - <nl> - switch ( options . shape ) { <nl> - case ' box ' : <nl> - this . drawBox ( ctx , width , height , shadowBlur , shadowOffset , shadows ) ; <nl> - break ; <nl> - case ' gauge ' : <nl> - this . drawGauge ( ctx , width , height , shadowBlur , shadowOffset , shadows ) ; <nl> - break ; <nl> - } <nl> - <nl> - if ( options . resizable ) { <nl> - MUI . triangle ( <nl> - ctx , <nl> - width - ( shadowBlur + shadowOffset . x + 17 ) , <nl> - height - ( shadowBlur + shadowOffset . y + 18 ) , <nl> - 11 , <nl> - 11 , <nl> - options . resizableColor , <nl> - 1 . 0 <nl> - ) ; <nl> - } <nl> - <nl> - / / Invisible dummy object . The last element drawn is not rendered consistently while resizing in IE6 and IE7 <nl> - if ( MUI . ieLegacySupport ) { <nl> - MUI . triangle ( ctx , 0 , 0 , 10 , 10 , options . resizableColor , 0 ) ; <nl> - } <nl> - } <nl> - <nl> - if ( options . type ! = ' notification ' & & options . useCanvasControls = = true ) { <nl> - this . drawControls ( width , height , shadows ) ; <nl> - } <nl> - <nl> - / / Resize panels if there are any <nl> - if ( MUI . Desktop & & this . contentWrapperEl . getChildren ( ' . column ' ) . length ! = 0 ) { <nl> - MUI . rWidth ( this . contentWrapperEl ) ; <nl> - this . contentWrapperEl . getChildren ( ' . column ' ) . each ( function ( column ) { <nl> - MUI . panelHeight ( column ) ; <nl> - } ) ; <nl> - } <nl> - <nl> - this . drawingWindow = false ; <nl> - return this ; <nl> - <nl> - } , <nl> - drawWindowCollapsed : function ( shadows ) { <nl> - <nl> - var windowEl = this . windowEl ; <nl> - <nl> - var options = this . options ; <nl> - var shadowBlur = options . shadowBlur ; <nl> - var shadowBlur2x = shadowBlur * 2 ; <nl> - var shadowOffset = options . shadowOffset ; <nl> - <nl> - var headerShadow = options . headerHeight + shadowBlur2x + 2 ; <nl> - var height = headerShadow ; <nl> - var width = this . contentWrapperEl . getStyle ( ' width ' ) . toInt ( ) + shadowBlur2x ; <nl> - this . windowEl . setStyle ( ' height ' , height ) ; <nl> - <nl> - this . overlayEl . setStyles ( { <nl> - ' height ' : height , <nl> - ' top ' : shadowBlur - shadowOffset . y , <nl> - ' left ' : shadowBlur - shadowOffset . x <nl> - } ) ; <nl> - <nl> - / / Part of the fix for IE6 select z - index bug <nl> - if ( Browser . Engine . trident4 ) { <nl> - this . zIndexFixEl . setStyles ( { <nl> - ' width ' : width , <nl> - ' height ' : height <nl> - } ) ; <nl> - } <nl> - <nl> - / / Set width <nl> - this . windowEl . setStyle ( ' width ' , width ) ; <nl> - this . overlayEl . setStyle ( ' width ' , width ) ; <nl> - this . titleBarEl . setStyles ( { <nl> - ' width ' : width - shadowBlur2x , <nl> - ' height ' : options . headerHeight <nl> - } ) ; <nl> - <nl> - / / Draw Window <nl> - if ( this . options . useCanvas ! = false ) { <nl> - this . canvasEl . height = height ; <nl> - this . canvasEl . width = width ; <nl> - <nl> - var ctx = this . canvasEl . getContext ( ' 2d ' ) ; <nl> - ctx . clearRect ( 0 , 0 , width , height ) ; <nl> - <nl> - this . drawBoxCollapsed ( ctx , width , height , shadowBlur , shadowOffset , shadows ) ; <nl> - if ( options . useCanvasControls = = true ) { <nl> - this . drawControls ( width , height , shadows ) ; <nl> - } <nl> - <nl> - / / Invisible dummy object . The last element drawn is not rendered consistently while resizing in IE6 and IE7 <nl> - if ( MUI . ieLegacySupport ) { <nl> - MUI . triangle ( ctx , 0 , 0 , 10 , 10 , options . resizableColor , 0 ) ; <nl> - } <nl> - } <nl> - <nl> - this . drawingWindow = false ; <nl> - return this ; <nl> - <nl> - } , <nl> - drawControls : function ( width , height , shadows ) { <nl> - var options = this . options ; <nl> - var shadowBlur = options . shadowBlur ; <nl> - var shadowOffset = options . shadowOffset ; <nl> - var controlsOffset = options . controlsOffset ; <nl> - <nl> - / / Make sure controls are placed correctly . <nl> - this . controlsEl . setStyles ( { <nl> - ' right ' : shadowBlur + shadowOffset . x + controlsOffset . right , <nl> - ' top ' : shadowBlur - shadowOffset . y + controlsOffset . top <nl> - } ) ; <nl> - <nl> - this . canvasControlsEl . setStyles ( { <nl> - ' right ' : shadowBlur + shadowOffset . x + controlsOffset . right , <nl> - ' top ' : shadowBlur - shadowOffset . y + controlsOffset . top <nl> - } ) ; <nl> - <nl> - / / Calculate X position for controlbuttons <nl> - / / var mochaControlsWidth = 52 ; <nl> - this . closebuttonX = options . closable ? this . mochaControlsWidth - 7 : this . mochaControlsWidth + 12 ; <nl> - this . maximizebuttonX = this . closebuttonX - ( options . maximizable ? 19 : 0 ) ; <nl> - this . minimizebuttonX = this . maximizebuttonX - ( options . minimizable ? 19 : 0 ) ; <nl> - <nl> - var ctx2 = this . canvasControlsEl . getContext ( ' 2d ' ) ; <nl> - ctx2 . clearRect ( 0 , 0 , 100 , 100 ) ; <nl> - <nl> - if ( this . options . closable ) { <nl> - this . closebutton ( <nl> - ctx2 , <nl> - this . closebuttonX , <nl> - 7 , <nl> - options . closeBgColor , <nl> - 1 . 0 , <nl> - options . closeColor , <nl> - 1 . 0 <nl> - ) ; <nl> - } <nl> - if ( this . options . maximizable ) { <nl> - this . maximizebutton ( <nl> - ctx2 , <nl> - this . maximizebuttonX , <nl> - 7 , <nl> - options . maximizeBgColor , <nl> - 1 . 0 , <nl> - options . maximizeColor , <nl> - 1 . 0 <nl> - ) ; <nl> - } <nl> - if ( this . options . minimizable ) { <nl> - this . minimizebutton ( <nl> - ctx2 , <nl> - this . minimizebuttonX , <nl> - 7 , <nl> - options . minimizeBgColor , <nl> - 1 . 0 , <nl> - options . minimizeColor , <nl> - 1 . 0 <nl> - ) ; <nl> - } <nl> - / / Invisible dummy object . The last element drawn is not rendered consistently while resizing in IE6 and IE7 <nl> - if ( MUI . ieLegacySupport ) { <nl> - MUI . circle ( ctx2 , 0 , 0 , 3 , this . options . resizableColor , 0 ) ; <nl> - } <nl> - <nl> - } , <nl> - drawBox : function ( ctx , width , height , shadowBlur , shadowOffset , shadows ) { <nl> - <nl> - var options = this . options ; <nl> - var shadowBlur2x = shadowBlur * 2 ; <nl> - var cornerRadius = this . options . cornerRadius ; <nl> - <nl> - / / This is the drop shadow . It is created onion style . <nl> - if ( shadows ! = false ) { <nl> - for ( var x = 0 ; x < = shadowBlur ; x + + ) { <nl> - MUI . roundedRect ( <nl> - ctx , <nl> - shadowOffset . x + x , <nl> - shadowOffset . y + x , <nl> - width - ( x * 2 ) - shadowOffset . x , <nl> - height - ( x * 2 ) - shadowOffset . y , <nl> - cornerRadius + ( shadowBlur - x ) , <nl> - [ 0 , 0 , 0 ] , <nl> - x = = shadowBlur ? . 29 : . 065 + ( x * . 01 ) <nl> - ) ; <nl> - } <nl> - } <nl> - / / Window body . <nl> - this . bodyRoundedRect ( <nl> - ctx , / / context <nl> - shadowBlur - shadowOffset . x , / / x <nl> - shadowBlur - shadowOffset . y , / / y <nl> - width - shadowBlur2x , / / width <nl> - height - shadowBlur2x , / / height <nl> - cornerRadius , / / corner radius <nl> - options . bodyBgColor / / Footer color <nl> - ) ; <nl> - <nl> - if ( this . options . type ! = ' notification ' ) { <nl> - / / Window header . <nl> - this . topRoundedRect ( <nl> - ctx , / / context <nl> - shadowBlur - shadowOffset . x , / / x <nl> - shadowBlur - shadowOffset . y , / / y <nl> - width - shadowBlur2x , / / width <nl> - options . headerHeight , / / height <nl> - cornerRadius , / / corner radius <nl> - options . headerStartColor , / / Header gradient ' s top color <nl> - options . headerStopColor / / Header gradient ' s bottom color <nl> - ) ; <nl> - } <nl> - } , <nl> - drawBoxCollapsed : function ( ctx , width , height , shadowBlur , shadowOffset , shadows ) { <nl> - <nl> - var options = this . options ; <nl> - var shadowBlur2x = shadowBlur * 2 ; <nl> - var cornerRadius = options . cornerRadius ; <nl> - <nl> - / / This is the drop shadow . It is created onion style . <nl> - if ( shadows ! = false ) { <nl> - for ( var x = 0 ; x < = shadowBlur ; x + + ) { <nl> - MUI . roundedRect ( <nl> - ctx , <nl> - shadowOffset . x + x , <nl> - shadowOffset . y + x , <nl> - width - ( x * 2 ) - shadowOffset . x , <nl> - height - ( x * 2 ) - shadowOffset . y , <nl> - cornerRadius + ( shadowBlur - x ) , <nl> - [ 0 , 0 , 0 ] , <nl> - x = = shadowBlur ? . 3 : . 06 + ( x * . 01 ) <nl> - ) ; <nl> - } <nl> - } <nl> - <nl> - / / Window header <nl> - this . topRoundedRect2 ( <nl> - ctx , / / context <nl> - shadowBlur - shadowOffset . x , / / x <nl> - shadowBlur - shadowOffset . y , / / y <nl> - width - shadowBlur2x , / / width <nl> - options . headerHeight + 2 , / / height <nl> - cornerRadius , / / corner radius <nl> - options . headerStartColor , / / Header gradient ' s top color <nl> - options . headerStopColor / / Header gradient ' s bottom color <nl> - ) ; <nl> - <nl> - } , <nl> - drawGauge : function ( ctx , width , height , shadowBlur , shadowOffset , shadows ) { <nl> - var options = this . options ; <nl> - var radius = ( width * . 5 ) - ( shadowBlur ) + 16 ; <nl> - if ( shadows ! = false ) { <nl> - for ( var x = 0 ; x < = shadowBlur ; x + + ) { <nl> - MUI . circle ( <nl> - ctx , <nl> - width * . 5 + shadowOffset . x , <nl> - ( height + options . headerHeight ) * . 5 + shadowOffset . x , <nl> - ( width * . 5 ) - ( x * 2 ) - shadowOffset . x , <nl> - [ 0 , 0 , 0 ] , <nl> - x = = shadowBlur ? . 75 : . 075 + ( x * . 04 ) <nl> - ) ; <nl> - } <nl> - } <nl> - MUI . circle ( <nl> - ctx , <nl> - width * . 5 - shadowOffset . x , <nl> - ( height + options . headerHeight ) * . 5 - shadowOffset . y , <nl> - ( width * . 5 ) - shadowBlur , <nl> - options . bodyBgColor , <nl> - 1 <nl> - ) ; <nl> - <nl> - / / Draw gauge header <nl> - this . canvasHeaderEl . setStyles ( { <nl> - ' top ' : shadowBlur - shadowOffset . y , <nl> - ' left ' : shadowBlur - shadowOffset . x <nl> - } ) ; <nl> - var ctx = this . canvasHeaderEl . getContext ( ' 2d ' ) ; <nl> - ctx . clearRect ( 0 , 0 , width , 100 ) ; <nl> - ctx . beginPath ( ) ; <nl> - ctx . lineWidth = 24 ; <nl> - ctx . lineCap = ' round ' ; <nl> - ctx . moveTo ( 13 , 13 ) ; <nl> - ctx . lineTo ( width - ( shadowBlur * 2 ) - 13 , 13 ) ; <nl> - ctx . strokeStyle = ' rgba ( 0 , 0 , 0 , . 65 ) ' ; <nl> - ctx . stroke ( ) ; <nl> - } , <nl> - bodyRoundedRect : function ( ctx , x , y , width , height , radius , rgb ) { <nl> - ctx . fillStyle = ' rgba ( ' + rgb . join ( ' , ' ) + ' , 1 ) ' ; <nl> - ctx . beginPath ( ) ; <nl> - ctx . moveTo ( x , y + radius ) ; <nl> - ctx . lineTo ( x , y + height - radius ) ; <nl> - ctx . quadraticCurveTo ( x , y + height , x + radius , y + height ) ; <nl> - ctx . lineTo ( x + width - radius , y + height ) ; <nl> - ctx . quadraticCurveTo ( x + width , y + height , x + width , y + height - radius ) ; <nl> - ctx . lineTo ( x + width , y + radius ) ; <nl> - ctx . quadraticCurveTo ( x + width , y , x + width - radius , y ) ; <nl> - ctx . lineTo ( x + radius , y ) ; <nl> - ctx . quadraticCurveTo ( x , y , x , y + radius ) ; <nl> - ctx . fill ( ) ; <nl> - <nl> - } , <nl> - topRoundedRect : function ( ctx , x , y , width , height , radius , headerStartColor , headerStopColor ) { <nl> - var lingrad = ctx . createLinearGradient ( 0 , 0 , 0 , height ) ; <nl> - lingrad . addColorStop ( 0 , ' rgb ( ' + headerStartColor . join ( ' , ' ) + ' ) ' ) ; <nl> - lingrad . addColorStop ( 1 , ' rgb ( ' + headerStopColor . join ( ' , ' ) + ' ) ' ) ; <nl> - ctx . fillStyle = lingrad ; <nl> - ctx . beginPath ( ) ; <nl> - ctx . moveTo ( x , y ) ; <nl> - ctx . lineTo ( x , y + height ) ; <nl> - ctx . lineTo ( x + width , y + height ) ; <nl> - ctx . lineTo ( x + width , y + radius ) ; <nl> - ctx . quadraticCurveTo ( x + width , y , x + width - radius , y ) ; <nl> - ctx . lineTo ( x + radius , y ) ; <nl> - ctx . quadraticCurveTo ( x , y , x , y + radius ) ; <nl> - ctx . fill ( ) ; <nl> - <nl> - } , <nl> - topRoundedRect2 : function ( ctx , x , y , width , height , radius , headerStartColor , headerStopColor ) { <nl> - / / Chrome is having trouble rendering the LinearGradient in this particular case <nl> - if ( navigator . userAgent . toLowerCase ( ) . indexOf ( ' chrome ' ) > - 1 ) { <nl> - ctx . fillStyle = ' rgba ( ' + headerStopColor . join ( ' , ' ) + ' , 1 ) ' ; <nl> - } <nl> - else { <nl> - var lingrad = ctx . createLinearGradient ( 0 , this . options . shadowBlur - 1 , 0 , height + this . options . shadowBlur + 3 ) ; <nl> - lingrad . addColorStop ( 0 , ' rgb ( ' + headerStartColor . join ( ' , ' ) + ' ) ' ) ; <nl> - lingrad . addColorStop ( 1 , ' rgb ( ' + headerStopColor . join ( ' , ' ) + ' ) ' ) ; <nl> - ctx . fillStyle = lingrad ; <nl> - } <nl> - ctx . beginPath ( ) ; <nl> - ctx . moveTo ( x , y + radius ) ; <nl> - ctx . lineTo ( x , y + height - radius ) ; <nl> - ctx . quadraticCurveTo ( x , y + height , x + radius , y + height ) ; <nl> - ctx . lineTo ( x + width - radius , y + height ) ; <nl> - ctx . quadraticCurveTo ( x + width , y + height , x + width , y + height - radius ) ; <nl> - ctx . lineTo ( x + width , y + radius ) ; <nl> - ctx . quadraticCurveTo ( x + width , y , x + width - radius , y ) ; <nl> - ctx . lineTo ( x + radius , y ) ; <nl> - ctx . quadraticCurveTo ( x , y , x , y + radius ) ; <nl> - ctx . fill ( ) ; <nl> - } , <nl> - maximizebutton : function ( ctx , x , y , rgbBg , aBg , rgb , a ) { <nl> - / / Circle <nl> - ctx . beginPath ( ) ; <nl> - ctx . arc ( x , y , 7 , 0 , Math . PI * 2 , true ) ; <nl> - ctx . fillStyle = ' rgba ( ' + rgbBg . join ( ' , ' ) + ' , ' + aBg + ' ) ' ; <nl> - ctx . fill ( ) ; <nl> - / / X sign <nl> - ctx . strokeStyle = ' rgba ( ' + rgb . join ( ' , ' ) + ' , ' + a + ' ) ' ; <nl> - ctx . lineWidth = 2 ; <nl> - ctx . beginPath ( ) ; <nl> - ctx . moveTo ( x , y - 3 . 5 ) ; <nl> - ctx . lineTo ( x , y + 3 . 5 ) ; <nl> - ctx . moveTo ( x - 3 . 5 , y ) ; <nl> - ctx . lineTo ( x + 3 . 5 , y ) ; <nl> - ctx . stroke ( ) ; <nl> - } , <nl> - closebutton : function ( ctx , x , y , rgbBg , aBg , rgb , a ) { <nl> - / / Circle <nl> - ctx . beginPath ( ) ; <nl> - ctx . arc ( x , y , 7 , 0 , Math . PI * 2 , true ) ; <nl> - ctx . fillStyle = ' rgba ( ' + rgbBg . join ( ' , ' ) + ' , ' + aBg + ' ) ' ; <nl> - ctx . fill ( ) ; <nl> - / / Plus sign <nl> - ctx . strokeStyle = ' rgba ( ' + rgb . join ( ' , ' ) + ' , ' + a + ' ) ' ; <nl> - ctx . lineWidth = 2 ; <nl> - ctx . beginPath ( ) ; <nl> - ctx . moveTo ( x - 3 , y - 3 ) ; <nl> - ctx . lineTo ( x + 3 , y + 3 ) ; <nl> - ctx . moveTo ( x + 3 , y - 3 ) ; <nl> - ctx . lineTo ( x - 3 , y + 3 ) ; <nl> - ctx . stroke ( ) ; <nl> - } , <nl> - minimizebutton : function ( ctx , x , y , rgbBg , aBg , rgb , a ) { <nl> - / / Circle <nl> - ctx . beginPath ( ) ; <nl> - ctx . arc ( x , y , 7 , 0 , Math . PI * 2 , true ) ; <nl> - ctx . fillStyle = ' rgba ( ' + rgbBg . join ( ' , ' ) + ' , ' + aBg + ' ) ' ; <nl> - ctx . fill ( ) ; <nl> - / / Minus sign <nl> - ctx . strokeStyle = ' rgba ( ' + rgb . join ( ' , ' ) + ' , ' + a + ' ) ' ; <nl> - ctx . lineWidth = 2 ; <nl> - ctx . beginPath ( ) ; <nl> - ctx . moveTo ( x - 3 . 5 , y ) ; <nl> - ctx . lineTo ( x + 3 . 5 , y ) ; <nl> - ctx . stroke ( ) ; <nl> - } , <nl> - setMochaControlsWidth : function ( ) { <nl> - this . mochaControlsWidth = 0 ; <nl> - var options = this . options ; <nl> - if ( options . minimizable ) { <nl> - this . mochaControlsWidth + = ( this . minimizeButtonEl . getStyle ( ' margin - left ' ) . toInt ( ) + this . minimizeButtonEl . getStyle ( ' width ' ) . toInt ( ) ) ; <nl> - } <nl> - if ( options . maximizable ) { <nl> - this . mochaControlsWidth + = ( this . maximizeButtonEl . getStyle ( ' margin - left ' ) . toInt ( ) + this . maximizeButtonEl . getStyle ( ' width ' ) . toInt ( ) ) ; <nl> - } <nl> - if ( options . closable ) { <nl> - this . mochaControlsWidth + = ( this . closeButtonEl . getStyle ( ' margin - left ' ) . toInt ( ) + this . closeButtonEl . getStyle ( ' width ' ) . toInt ( ) ) ; <nl> - } <nl> - this . controlsEl . setStyle ( ' width ' , this . mochaControlsWidth ) ; <nl> - if ( options . useCanvasControls = = true ) { <nl> - this . canvasControlsEl . setProperty ( ' width ' , this . mochaControlsWidth ) ; <nl> - } <nl> - } , <nl> - / * <nl> - <nl> - Function : hideSpinner <nl> - Hides the spinner . <nl> - <nl> - Example : <nl> - ( start code ) <nl> - $ ( ' myWindow ' ) . retrieve ( ' instance ' ) . hideSpinner ( ) ; <nl> - ( end ) <nl> - <nl> - * / <nl> - hideSpinner : function ( ) { <nl> - if ( this . spinnerEl ) this . spinnerEl . hide ( ) ; <nl> - return this ; <nl> - } , <nl> - / * <nl> - <nl> - Function : showSpinner <nl> - Shows the spinner . <nl> - <nl> - Example : <nl> - ( start code ) <nl> - $ ( ' myWindow ' ) . retrieve ( ' instance ' ) . showSpinner ( ) ; <nl> - ( end ) <nl> - <nl> - * / <nl> - showSpinner : function ( ) { <nl> - if ( this . spinnerEl ) this . spinnerEl . show ( ) ; <nl> - return this ; <nl> - } , <nl> - / * <nl> - <nl> - Function : close <nl> - Closes the window . This is an alternative to using MUI . Core . closeWindow ( ) . <nl> - <nl> - Example : <nl> - ( start code ) <nl> - $ ( ' myWindow ' ) . retrieve ( ' instance ' ) . close ( ) ; <nl> - ( end ) <nl> - <nl> - * / <nl> - close : function ( ) { <nl> - if ( ! this . isClosing ) MUI . closeWindow ( this . windowEl ) ; <nl> - return this ; <nl> - } , <nl> - / * <nl> - <nl> - Function : minimize <nl> - Minimizes the window . <nl> - <nl> - Example : <nl> - ( start code ) <nl> - $ ( ' myWindow ' ) . retrieve ( ' instance ' ) . minimize ( ) ; <nl> - ( end ) <nl> - <nl> - * / <nl> - minimize : function ( ) { <nl> - MUI . Dock . minimizeWindow ( this . windowEl ) ; <nl> - return this ; <nl> - } , <nl> - / * <nl> - <nl> - Function : maximize <nl> - Maximizes the window . <nl> - <nl> - Example : <nl> - ( start code ) <nl> - $ ( ' myWindow ' ) . retrieve ( ' instance ' ) . maximize ( ) ; <nl> - ( end ) <nl> - <nl> - * / <nl> - maximize : function ( ) { <nl> - if ( this . isMinimized ) { <nl> - MUI . Dock . restoreMinimized ( this . windowEl ) ; <nl> - } <nl> - MUI . Desktop . maximizeWindow ( this . windowEl ) ; <nl> - return this ; <nl> - } , <nl> - / * <nl> - <nl> - Function : restore <nl> - Restores a minimized / maximized window to its original size . <nl> - <nl> - Example : <nl> - ( start code ) <nl> - $ ( ' myWindow ' ) . retrieve ( ' instance ' ) . restore ( ) ; <nl> - ( end ) <nl> - <nl> - * / <nl> - restore : function ( ) { <nl> - if ( this . isMinimized ) <nl> - MUI . Dock . restoreMinimized ( this . windowEl ) ; <nl> - else if ( this . isMaximized ) <nl> - MUI . Desktop . restoreWindow ( this . windowEl ) ; <nl> - return this ; <nl> - } , <nl> - / * <nl> - <nl> - Function : resize <nl> - Resize a window . <nl> - <nl> - Notes : <nl> - If Advanced Effects are on the resize is animated . If centered is set to true the window remains centered as it resizes . <nl> - <nl> - Example : <nl> - ( start code ) <nl> - $ ( ' myWindow ' ) . retrieve ( ' instance ' ) . resize ( { width : 500 , height : 300 , centered : true } ) ; <nl> - ( end ) <nl> - <nl> - * / <nl> - resize : function ( options ) { <nl> - MUI . resizeWindow ( this . windowEl , options ) ; <nl> - return this ; <nl> - } , <nl> - / * <nl> - <nl> - Function : center <nl> - Center a window . <nl> - <nl> - Example : <nl> - ( start code ) <nl> - $ ( ' myWindow ' ) . retrieve ( ' instance ' ) . center ( ) ; <nl> - ( end ) <nl> - <nl> - * / <nl> - center : function ( ) { <nl> - MUI . centerWindow ( this . windowEl ) ; <nl> - return this ; <nl> - } , <nl> - <nl> - hide : function ( ) { <nl> - this . windowEl . setStyle ( ' display ' , ' none ' ) ; <nl> - return this ; <nl> - } , <nl> - <nl> - show : function ( ) { <nl> - this . windowEl . setStyle ( ' display ' , ' block ' ) ; <nl> - return this ; <nl> - } <nl> - <nl> - } ) ; <nl> - <nl> - MUI . extend ( { <nl> - / * <nl> - <nl> - Function : closeWindow <nl> - Closes a window . <nl> - <nl> - Syntax : <nl> - ( start code ) <nl> - MUI . closeWindow ( ) ; <nl> - ( end ) <nl> - <nl> - Arguments : <nl> - windowEl - the ID of the window to be closed <nl> - <nl> - Returns : <nl> - true - the window was closed <nl> - false - the window was not closed <nl> - <nl> - * / <nl> - closeWindow : function ( windowEl ) { <nl> - <nl> - var instance = windowEl . retrieve ( ' instance ' ) ; <nl> - <nl> - / / Does window exist and is not already in process of closing ? <nl> - if ( windowEl ! = $ ( windowEl ) | | instance . isClosing ) return ; <nl> - <nl> - instance . isClosing = true ; <nl> - instance . fireEvent ( ' onClose ' , windowEl ) ; <nl> - <nl> - if ( instance . options . storeOnClose ) { <nl> - this . storeOnClose ( instance , windowEl ) ; <nl> - return ; <nl> - } <nl> - if ( instance . check ) instance . check . destroy ( ) ; <nl> - <nl> - if ( ( instance . options . type = = ' modal ' | | instance . options . type = = ' modal2 ' ) & & Browser . Engine . trident4 ) { <nl> - $ ( ' modalFix ' ) . hide ( ) ; <nl> - } <nl> - <nl> - if ( MUI . options . advancedEffects = = false ) { <nl> - if ( instance . options . type = = ' modal ' | | instance . options . type = = ' modal2 ' ) { <nl> - $ ( ' modalOverlay ' ) . setStyle ( ' opacity ' , 0 ) ; <nl> - } <nl> - MUI . closingJobs ( windowEl ) ; <nl> - return true ; <nl> - } <nl> - else { <nl> - / / Redraws IE windows without shadows since IE messes up canvas alpha when you change element opacity <nl> - if ( MUI . ieLegacySupport ) instance . drawWindow ( false ) ; <nl> - if ( instance . options . type = = ' modal ' | | instance . options . type = = ' modal2 ' ) { <nl> - MUI . Modal . modalOverlayCloseMorph . start ( { <nl> - ' opacity ' : 0 <nl> - } ) ; <nl> - } <nl> - var closeMorph = new Fx . Morph ( windowEl , { <nl> - duration : 120 , <nl> - onComplete : function ( ) { <nl> - MUI . closingJobs ( windowEl ) ; <nl> - return true ; <nl> - } . bind ( this ) <nl> - } ) ; <nl> - closeMorph . start ( { <nl> - ' opacity ' : . 4 <nl> - } ) ; <nl> - } <nl> - <nl> - } , <nl> - closingJobs : function ( windowEl ) { <nl> - <nl> - var instances = MUI . Windows . instances ; <nl> - var instance = instances . get ( windowEl . id ) ; <nl> - windowEl . setStyle ( ' visibility ' , ' hidden ' ) ; <nl> - / / Destroy throws an error in IE8 <nl> - if ( MUI . ieLegacySupport ) { <nl> - windowEl . dispose ( ) ; <nl> - } <nl> - else { <nl> - windowEl . destroy ( ) ; <nl> - } <nl> - instance . fireEvent ( ' onCloseComplete ' ) ; <nl> - <nl> - if ( instance . options . type ! = ' notification ' ) { <nl> - var newFocus = this . getWindowWithHighestZindex ( ) ; <nl> - this . focusWindow ( newFocus ) ; <nl> - } <nl> - <nl> - instances . erase ( instance . options . id ) ; <nl> - if ( this . loadingWorkspace = = true ) { <nl> - this . windowUnload ( ) ; <nl> - } <nl> - <nl> - if ( MUI . Dock & & $ ( MUI . options . dock ) & & instance . options . type = = ' window ' ) { <nl> - var currentButton = $ ( instance . options . id + ' _dockTab ' ) ; <nl> - if ( currentButton ! = null ) { <nl> - MUI . Dock . dockSortables . removeItems ( currentButton ) . destroy ( ) ; <nl> - } <nl> - / / Need to resize everything in case the dock becomes smaller when a tab is removed <nl> - MUI . Desktop . setDesktopSize ( ) ; <nl> - } <nl> - } , <nl> - storeOnClose : function ( instance , windowEl ) { <nl> - <nl> - if ( instance . check ) instance . check . hide ( ) ; <nl> - <nl> - windowEl . setStyles ( { <nl> - zIndex : - 1 <nl> - } ) ; <nl> - windowEl . addClass ( ' windowClosed ' ) ; <nl> - windowEl . removeClass ( ' mocha ' ) ; <nl> - <nl> - if ( MUI . Dock & & $ ( MUI . options . dock ) & & instance . options . type = = ' window ' ) { <nl> - var currentButton = $ ( instance . options . id + ' _dockTab ' ) ; <nl> - if ( currentButton ! = null ) { <nl> - currentButton . hide ( ) ; <nl> - } <nl> - MUI . Desktop . setDesktopSize ( ) ; <nl> - } <nl> - <nl> - instance . fireEvent ( ' onCloseComplete ' ) ; <nl> - <nl> - if ( instance . options . type ! = ' notification ' ) { <nl> - var newFocus = this . getWindowWithHighestZindex ( ) ; <nl> - this . focusWindow ( newFocus ) ; <nl> - } <nl> - <nl> - instance . isClosing = false ; <nl> - <nl> - } , <nl> - / * <nl> - <nl> - Function : closeAll <nl> - Close all open windows . <nl> - <nl> - * / <nl> - closeAll : function ( ) { <nl> - $ $ ( ' . mocha ' ) . each ( function ( windowEl ) { <nl> - this . closeWindow ( windowEl ) ; <nl> - } . bind ( this ) ) ; <nl> - } , <nl> - / * <nl> - <nl> - Function : collapseToggle <nl> - Collapses an expanded window . Expands a collapsed window . <nl> - <nl> - * / <nl> - collapseToggle : function ( windowEl ) { <nl> - var instance = windowEl . retrieve ( ' instance ' ) ; <nl> - var handles = windowEl . getElements ( ' . handle ' ) ; <nl> - if ( instance . isMaximized = = true ) return ; <nl> - if ( instance . isCollapsed = = false ) { <nl> - instance . isCollapsed = true ; <nl> - handles . hide ( ) ; <nl> - if ( instance . iframeEl ) { <nl> - instance . iframeEl . setStyle ( ' visibility ' , ' hidden ' ) ; <nl> - } <nl> - instance . contentBorderEl . setStyles ( { <nl> - visibility : ' hidden ' , <nl> - position : ' absolute ' , <nl> - top : - 10000 , <nl> - left : - 10000 <nl> - } ) ; <nl> - if ( instance . toolbarWrapperEl ) { <nl> - instance . toolbarWrapperEl . setStyles ( { <nl> - visibility : ' hidden ' , <nl> - position : ' absolute ' , <nl> - top : - 10000 , <nl> - left : - 10000 <nl> - } ) ; <nl> - } <nl> - instance . drawWindowCollapsed ( ) ; <nl> - } <nl> - else { <nl> - instance . isCollapsed = false ; <nl> - instance . drawWindow ( ) ; <nl> - instance . contentBorderEl . setStyles ( { <nl> - visibility : ' visible ' , <nl> - position : null , <nl> - top : null , <nl> - left : null <nl> - } ) ; <nl> - if ( instance . toolbarWrapperEl ) { <nl> - instance . toolbarWrapperEl . setStyles ( { <nl> - visibility : ' visible ' , <nl> - position : null , <nl> - top : null , <nl> - left : null <nl> - } ) ; <nl> - } <nl> - if ( instance . iframeEl ) { <nl> - instance . iframeEl . setStyle ( ' visibility ' , ' visible ' ) ; <nl> - } <nl> - handles . show ( ) ; <nl> - } <nl> - } , <nl> - / * <nl> - <nl> - Function : toggleWindowVisibility <nl> - Toggle window visibility with Ctrl - Alt - Q . <nl> - <nl> - * / <nl> - toggleWindowVisibility : function ( ) { <nl> - MUI . Windows . instances . each ( function ( instance ) { <nl> - if ( instance . options . type = = ' modal ' | | instance . options . type = = ' modal2 ' | | instance . isMinimized = = true ) return ; <nl> - var id = $ ( instance . options . id ) ; <nl> - if ( id . getStyle ( ' visibility ' ) = = ' visible ' ) { <nl> - if ( instance . iframe ) { <nl> - instance . iframeEl . setStyle ( ' visibility ' , ' hidden ' ) ; <nl> - } <nl> - if ( instance . toolbarEl ) { <nl> - instance . toolbarWrapperEl . setStyle ( ' visibility ' , ' hidden ' ) ; <nl> - } <nl> - instance . contentBorderEl . setStyle ( ' visibility ' , ' hidden ' ) ; <nl> - id . setStyle ( ' visibility ' , ' hidden ' ) ; <nl> - MUI . Windows . windowsVisible = false ; <nl> - } <nl> - else { <nl> - id . setStyle ( ' visibility ' , ' visible ' ) ; <nl> - instance . contentBorderEl . setStyle ( ' visibility ' , ' visible ' ) ; <nl> - if ( instance . iframe ) { <nl> - instance . iframeEl . setStyle ( ' visibility ' , ' visible ' ) ; <nl> - } <nl> - if ( instance . toolbarEl ) { <nl> - instance . toolbarWrapperEl . setStyle ( ' visibility ' , ' visible ' ) ; <nl> - } <nl> - MUI . Windows . windowsVisible = true ; <nl> - } <nl> - } . bind ( this ) ) ; <nl> - <nl> - } , <nl> - focusWindow : function ( windowEl , fireEvent ) { <nl> - <nl> - / / This is used with blurAll <nl> - MUI . Windows . focusingWindow = true ; <nl> - var windowClicked = function ( ) { <nl> - MUI . Windows . focusingWindow = false ; <nl> - } ; <nl> - windowClicked . delay ( 170 , this ) ; <nl> - <nl> - / / Only focus when needed <nl> - if ( $ $ ( ' . mocha ' ) . length = = 0 ) return ; <nl> - if ( windowEl ! = $ ( windowEl ) | | windowEl . hasClass ( ' isFocused ' ) ) return ; <nl> - <nl> - var instances = MUI . Windows . instances ; <nl> - var instance = instances . get ( windowEl . id ) ; <nl> - <nl> - if ( instance . options . type = = ' notification ' ) { <nl> - windowEl . setStyle ( ' zIndex ' , 11001 ) ; <nl> - return ; <nl> - } ; <nl> - <nl> - MUI . Windows . indexLevel + = 2 ; <nl> - windowEl . setStyle ( ' zIndex ' , MUI . Windows . indexLevel ) ; <nl> - <nl> - / / Used when dragging and resizing windows <nl> - $ ( ' windowUnderlay ' ) . setStyle ( ' zIndex ' , MUI . Windows . indexLevel - 1 ) . inject ( $ ( windowEl ) , ' after ' ) ; <nl> - <nl> - / / Fire onBlur for the window that lost focus . <nl> - instances . each ( function ( instance ) { <nl> - if ( instance . windowEl . hasClass ( ' isFocused ' ) ) { <nl> - instance . fireEvent ( ' onBlur ' , instance . windowEl ) ; <nl> - } <nl> - instance . windowEl . removeClass ( ' isFocused ' ) ; <nl> - } ) ; <nl> - <nl> - if ( MUI . Dock & & $ ( MUI . options . dock ) & & instance . options . type = = ' window ' ) { <nl> - MUI . Dock . makeActiveTab ( ) ; <nl> - } <nl> - windowEl . addClass ( ' isFocused ' ) ; <nl> - <nl> - if ( fireEvent ! = false ) { <nl> - instance . fireEvent ( ' onFocus ' , windowEl ) ; <nl> - } <nl> - <nl> - } , <nl> - getWindowWithHighestZindex : function ( ) { <nl> - this . highestZindex = 0 ; <nl> - $ $ ( ' . mocha ' ) . each ( function ( element ) { <nl> - this . zIndex = element . getStyle ( ' zIndex ' ) ; <nl> - if ( this . zIndex > = this . highestZindex ) { <nl> - this . highestZindex = this . zIndex ; <nl> - } <nl> - } . bind ( this ) ) ; <nl> - $ $ ( ' . mocha ' ) . each ( function ( element ) { <nl> - if ( element . getStyle ( ' zIndex ' ) = = this . highestZindex ) { <nl> - this . windowWithHighestZindex = element ; <nl> - } <nl> - } . bind ( this ) ) ; <nl> - return this . windowWithHighestZindex ; <nl> - } , <nl> - blurAll : function ( ) { <nl> - if ( MUI . Windows . focusingWindow = = false ) { <nl> - $ $ ( ' . mocha ' ) . each ( function ( windowEl ) { <nl> - var instance = windowEl . retrieve ( ' instance ' ) ; <nl> - if ( instance . options . type ! = ' modal ' & & instance . options . type ! = ' modal2 ' ) { <nl> - windowEl . removeClass ( ' isFocused ' ) ; <nl> - } <nl> - } ) ; <nl> - $ $ ( ' . dockTab ' ) . removeClass ( ' activeDockTab ' ) ; <nl> - } <nl> - } , <nl> - centerWindow : function ( windowEl ) { <nl> - <nl> - if ( ! windowEl ) { <nl> - MUI . Windows . instances . each ( function ( instance ) { <nl> - if ( instance . windowEl . hasClass ( ' isFocused ' ) ) { <nl> - windowEl = instance . windowEl ; <nl> - } <nl> - } ) ; <nl> - } <nl> - <nl> - var instance = windowEl . retrieve ( ' instance ' ) ; <nl> - var options = instance . options ; <nl> - var dimensions = options . container . getCoordinates ( ) ; <nl> - <nl> - var windowPosTop = window . getScroll ( ) . y + ( window . getSize ( ) . y * . 5 ) - ( windowEl . offsetHeight * . 5 ) ; <nl> - if ( windowPosTop < - instance . options . shadowBlur ) { <nl> - windowPosTop = - instance . options . shadowBlur ; <nl> - } <nl> - var windowPosLeft = ( dimensions . width * . 5 ) - ( windowEl . offsetWidth * . 5 ) ; <nl> - if ( windowPosLeft < - instance . options . shadowBlur ) { <nl> - windowPosLeft = - instance . options . shadowBlur ; <nl> - } <nl> - if ( MUI . options . advancedEffects = = true ) { <nl> - instance . morph . start ( { <nl> - ' top ' : windowPosTop , <nl> - ' left ' : windowPosLeft <nl> - } ) ; <nl> - } <nl> - else { <nl> - windowEl . setStyles ( { <nl> - ' top ' : windowPosTop , <nl> - ' left ' : windowPosLeft <nl> - } ) ; <nl> - } <nl> - } , <nl> - resizeWindow : function ( windowEl , options ) { <nl> - var instance = windowEl . retrieve ( ' instance ' ) ; <nl> - <nl> - $ extend ( { <nl> - width : null , <nl> - height : null , <nl> - top : null , <nl> - left : null , <nl> - centered : true <nl> - } , options ) ; <nl> - <nl> - var oldWidth = windowEl . getStyle ( ' width ' ) . toInt ( ) ; <nl> - var oldHeight = windowEl . getStyle ( ' height ' ) . toInt ( ) ; <nl> - var oldTop = windowEl . getStyle ( ' top ' ) . toInt ( ) ; <nl> - var oldLeft = windowEl . getStyle ( ' left ' ) . toInt ( ) ; <nl> - <nl> - if ( options . centered ) { <nl> - var top = options . top | | oldTop - ( ( options . height - oldHeight ) * . 5 ) ; <nl> - var left = options . left | | oldLeft - ( ( options . width - oldWidth ) * . 5 ) ; <nl> - } <nl> - else { <nl> - var top = options . top | | oldTop ; <nl> - var left = options . left | | oldLeft ; <nl> - } <nl> - <nl> - if ( MUI . options . advancedEffects = = false ) { <nl> - windowEl . setStyles ( { <nl> - ' top ' : top , <nl> - ' left ' : left <nl> - } ) ; <nl> - instance . contentWrapperEl . setStyles ( { <nl> - ' height ' : options . height , <nl> - ' width ' : options . width <nl> - } ) ; <nl> - instance . drawWindow ( ) ; <nl> - / / Show iframe <nl> - if ( instance . iframeEl ) { <nl> - if ( ! MUI . ieLegacySupport ) { <nl> - instance . iframeEl . setStyle ( ' visibility ' , ' visible ' ) ; <nl> - } <nl> - else { <nl> - instance . iframeEl . show ( ) ; <nl> - } <nl> - } <nl> - } <nl> - else { <nl> - windowEl . retrieve ( ' resizeMorph ' ) . start ( { <nl> - ' 0 ' : { ' height ' : options . height , <nl> - ' width ' : options . width <nl> - } , <nl> - ' 1 ' : { ' top ' : top , <nl> - ' left ' : left <nl> - } <nl> - } ) ; <nl> - } <nl> - return instance ; <nl> - } , <nl> - / * <nl> - <nl> - Internal Function : dynamicResize <nl> - Use with a timer to resize a window as the window ' s content size changes , such as with an accordion . <nl> - <nl> - * / <nl> - dynamicResize : function ( windowEl ) { <nl> - var instance = windowEl . retrieve ( ' instance ' ) ; <nl> - var contentWrapperEl = instance . contentWrapperEl ; <nl> - var contentEl = instance . contentEl ; <nl> - <nl> - contentWrapperEl . setStyles ( { <nl> - ' height ' : contentEl . offsetHeight , <nl> - ' width ' : contentEl . offsetWidth <nl> - } ) ; <nl> - instance . drawWindow ( ) ; <nl> - } <nl> - } ) ; <nl> - <nl> - / / Toggle window visibility with Ctrl - Alt - Q <nl> - document . addEvent ( ' keydown ' , function ( event ) { <nl> - if ( event . key = = ' q ' & & event . control & & event . alt ) { <nl> - MUI . toggleWindowVisibility ( ) ; <nl> - } <nl> - } ) ; <nl> - / * <nl> - <nl> - Script : Modal . js <nl> - Create modal dialog windows . <nl> - <nl> - Copyright : <nl> - Copyright ( c ) 2007 - 2009 Greg Houston , < http : / / greghoustondesign . com / > . <nl> - <nl> - License : <nl> - MIT - style license . <nl> - <nl> - Requires : <nl> - Core . js , Window . js <nl> - <nl> - See Also : <nl> - < Window > <nl> - <nl> - * / <nl> - <nl> - MUI . files [ MUI . path . source + ' Window / Modal . js ' ] = ' loaded ' ; <nl> - <nl> - MUI . Modal = new Class ( { <nl> - <nl> - Extends : MUI . Window , <nl> - <nl> - options : { <nl> - type : ' modal ' <nl> - } , <nl> - <nl> - initialize : function ( options ) { <nl> - <nl> - if ( ! $ ( ' modalOverlay ' ) ) { <nl> - this . modalInitialize ( ) ; <nl> - <nl> - window . addEvent ( ' resize ' , function ( ) { <nl> - this . setModalSize ( ) ; <nl> - } . bind ( this ) ) ; <nl> - } <nl> - this . parent ( options ) ; <nl> - <nl> - } , <nl> - modalInitialize : function ( ) { <nl> - var modalOverlay = new Element ( ' div ' , { <nl> - ' id ' : ' modalOverlay ' , <nl> - ' styles ' : { <nl> - ' height ' : document . getCoordinates ( ) . height , <nl> - ' opacity ' : . 6 <nl> - } <nl> - } ) . inject ( document . body ) ; <nl> - <nl> - modalOverlay . setStyles ( { <nl> - ' position ' : Browser . Engine . trident4 ? ' absolute ' : ' fixed ' <nl> - } ) ; <nl> - <nl> - modalOverlay . addEvent ( ' click ' , function ( e ) { <nl> - var instance = MUI . Windows . instances . get ( MUI . currentModal . id ) ; <nl> - if ( instance . options . modalOverlayClose = = true ) { <nl> - MUI . closeWindow ( MUI . currentModal ) ; <nl> - } <nl> - } ) ; <nl> - <nl> - if ( Browser . Engine . trident4 ) { <nl> - var modalFix = new Element ( ' iframe ' , { <nl> - ' id ' : ' modalFix ' , <nl> - ' scrolling ' : ' no ' , <nl> - ' marginWidth ' : 0 , <nl> - ' marginHeight ' : 0 , <nl> - ' src ' : ' ' , <nl> - ' styles ' : { <nl> - ' height ' : document . getCoordinates ( ) . height <nl> - } <nl> - } ) . inject ( document . body ) ; <nl> - } <nl> - <nl> - MUI . Modal . modalOverlayOpenMorph = new Fx . Morph ( $ ( ' modalOverlay ' ) , { <nl> - ' duration ' : 150 <nl> - } ) ; <nl> - MUI . Modal . modalOverlayCloseMorph = new Fx . Morph ( $ ( ' modalOverlay ' ) , { <nl> - ' duration ' : 150 , <nl> - onComplete : function ( ) { <nl> - $ ( ' modalOverlay ' ) . hide ( ) ; <nl> - if ( Browser . Engine . trident4 ) { <nl> - $ ( ' modalFix ' ) . hide ( ) ; <nl> - } <nl> - } . bind ( this ) <nl> - } ) ; <nl> - } , <nl> - setModalSize : function ( ) { <nl> - $ ( ' modalOverlay ' ) . setStyle ( ' height ' , document . getCoordinates ( ) . height ) ; <nl> - if ( Browser . Engine . trident4 ) { <nl> - $ ( ' modalFix ' ) . setStyle ( ' height ' , document . getCoordinates ( ) . height ) ; <nl> - } <nl> - } <nl> - <nl> - } ) ; <nl> - / * <nl> - <nl> - Script : Windows - from - html . js <nl> - Create windows from html markup in page . <nl> - <nl> - Copyright : <nl> - Copyright ( c ) 2007 - 2009 Greg Houston , < http : / / greghoustondesign . com / > . <nl> - <nl> - License : <nl> - MIT - style license . <nl> - <nl> - Requires : <nl> - Core . js , Window . js <nl> - <nl> - Example : <nl> - HTML markup . <nl> - ( start code ) <nl> - < div class = " mocha " id = " mywindow " style = " width : 300px ; height : 255px ; top : 50px ; left : 350px " > <nl> - < h3 class = " mochaTitle " > My Window < / h3 > <nl> - < p > My Window Content < / p > <nl> - < / div > <nl> - ( end ) <nl> - <nl> - See Also : <nl> - < Window > <nl> - <nl> - * / <nl> - <nl> - MUI . files [ MUI . path . source + ' Window / Windows - from - html . js ' ] = ' loaded ' ; <nl> - <nl> - MUI . extend ( { <nl> - NewWindowsFromHTML : function ( ) { <nl> - $ $ ( ' . mocha ' ) . each ( function ( el ) { <nl> - / / Get the window title and destroy that element , so it does not end up in window content <nl> - if ( Browser . Engine . presto | | Browser . Engine . trident5 ) { <nl> - el . hide ( ) ; / / Required by Opera , and probably IE7 <nl> - } <nl> - var title = el . getElement ( ' h3 . mochaTitle ' ) ; <nl> - <nl> - if ( Browser . Engine . presto ) el . show ( ) ; <nl> - <nl> - var elDimensions = el . getStyles ( ' height ' , ' width ' ) ; <nl> - var properties = { <nl> - id : el . getProperty ( ' id ' ) , <nl> - height : elDimensions . height . toInt ( ) , <nl> - width : elDimensions . width . toInt ( ) , <nl> - x : el . getStyle ( ' left ' ) . toInt ( ) , <nl> - y : el . getStyle ( ' top ' ) . toInt ( ) <nl> - } ; <nl> - / / If there is a title element , set title and destroy the element so it does not end up in window content <nl> - if ( title ) { <nl> - properties . title = title . innerHTML ; <nl> - title . destroy ( ) ; <nl> - } <nl> - <nl> - / / Get content and destroy the element <nl> - properties . content = el . innerHTML ; <nl> - el . destroy ( ) ; <nl> - <nl> - / / Create window <nl> - new MUI . Window ( properties , true ) ; <nl> - } . bind ( this ) ) ; <nl> - } <nl> - } ) ; <nl> - / * <nl> - <nl> - Script : Windows - from - json . js <nl> - Create one or more windows from JSON data . You can define all the same properties as you can for new MUI . Window ( ) . Undefined properties are set to their defaults . <nl> - <nl> - Copyright : <nl> - Copyright ( c ) 2007 - 2009 Greg Houston , < http : / / greghoustondesign . com / > . <nl> - <nl> - License : <nl> - MIT - style license . <nl> - <nl> - Syntax : <nl> - ( start code ) <nl> - MUI . newWindowsFromJSON ( properties ) ; <nl> - ( end ) <nl> - <nl> - Example : <nl> - ( start code ) <nl> - MUI . jsonWindows = function ( ) { <nl> - var url = ' data / json - windows - data . js ' ; <nl> - var request = new Request . JSON ( { <nl> - url : url , <nl> - method : ' get ' , <nl> - onComplete : function ( properties ) { <nl> - MUI . newWindowsFromJSON ( properties . windows ) ; <nl> - } <nl> - } ) . send ( ) ; <nl> - } <nl> - ( end ) <nl> - <nl> - Note : <nl> - Windows created from JSON are not compatible with the current cookie based version <nl> - of Save and Load Workspace . <nl> - <nl> - See Also : <nl> - < Window > <nl> - <nl> - * / <nl> - <nl> - MUI . files [ MUI . path . source + ' Window / Windows - from - json . js ' ] = ' loaded ' ; <nl> - <nl> - MUI . extend ( { <nl> - newWindowsFromJSON : function ( newWindows ) { <nl> - newWindows . each ( function ( options ) { <nl> - var temp = new Hash ( options ) ; <nl> - temp . each ( function ( value , key , hash ) { <nl> - if ( $ type ( value ) ! = ' string ' ) return ; <nl> - if ( value . substring ( 0 , 8 ) = = ' function ' ) { <nl> - eval ( " options . " + key + " = " + value ) ; <nl> - } <nl> - } ) ; <nl> - new MUI . Window ( options ) ; <nl> - } ) ; <nl> - } <nl> - } ) ; <nl> - / * <nl> - <nl> - Script : Arrange - cascade . js <nl> - Cascade windows . <nl> - <nl> - Copyright : <nl> - Copyright ( c ) 2007 - 2009 Greg Houston , < http : / / greghoustondesign . com / > . <nl> - <nl> - License : <nl> - MIT - style license . <nl> - <nl> - Requires : <nl> - Core . js , Window . js <nl> - <nl> - Syntax : <nl> - ( start code ) <nl> - MUI . arrangeCascade ( ) ; <nl> - ( end ) <nl> - <nl> - * / <nl> - <nl> - MUI . files [ MUI . path . source + ' Window / Arrange - cascade . js ' ] = ' loaded ' ; <nl> - <nl> - MUI . extend ( { <nl> - arrangeCascade : function ( ) { <nl> - <nl> - var viewportTopOffset = 30 ; / / Use a negative number if necessary to place first window where you want it <nl> - var viewportLeftOffset = 20 ; <nl> - var windowTopOffset = 50 ; / / Initial vertical spacing of each window <nl> - var windowLeftOffset = 40 ; <nl> - <nl> - / / See how much space we have to work with <nl> - var coordinates = document . getCoordinates ( ) ; <nl> - <nl> - var openWindows = 0 ; <nl> - MUI . Windows . instances . each ( function ( instance ) { <nl> - if ( ! instance . isMinimized & & instance . options . draggable ) openWindows + + ; <nl> - } ) ; <nl> - <nl> - if ( ( windowTopOffset * ( openWindows + 1 ) ) > = ( coordinates . height - viewportTopOffset ) ) { <nl> - var topOffset = ( coordinates . height - viewportTopOffset ) / ( openWindows + 1 ) ; <nl> - } <nl> - else { <nl> - var topOffset = windowTopOffset ; <nl> - } <nl> - <nl> - if ( ( windowLeftOffset * ( openWindows + 1 ) ) > = ( coordinates . width - viewportLeftOffset - 20 ) ) { <nl> - var leftOffset = ( coordinates . width - viewportLeftOffset - 20 ) / ( openWindows + 1 ) ; <nl> - } <nl> - else { <nl> - var leftOffset = windowLeftOffset ; <nl> - } <nl> - <nl> - var x = viewportLeftOffset ; <nl> - var y = viewportTopOffset ; <nl> - $ $ ( ' . mocha ' ) . each ( function ( windowEl ) { <nl> - var instance = windowEl . retrieve ( ' instance ' ) ; <nl> - if ( ! instance . isMinimized & & ! instance . isMaximized & & instance . options . draggable ) { <nl> - id = windowEl . id ; <nl> - MUI . focusWindow ( windowEl ) ; <nl> - x + = leftOffset ; <nl> - y + = topOffset ; <nl> - <nl> - if ( MUI . options . advancedEffects = = false ) { <nl> - windowEl . setStyles ( { <nl> - ' top ' : y , <nl> - ' left ' : x <nl> - } ) ; <nl> - } <nl> - else { <nl> - var cascadeMorph = new Fx . Morph ( windowEl , { <nl> - ' duration ' : 550 <nl> - } ) ; <nl> - cascadeMorph . start ( { <nl> - ' top ' : y , <nl> - ' left ' : x <nl> - } ) ; <nl> - } <nl> - } <nl> - } . bind ( this ) ) ; <nl> - } <nl> - } ) ; <nl> - / * <nl> - <nl> - Script : Arrange - tile . js <nl> - Cascade windows . <nl> - <nl> - Copyright : <nl> - Copyright ( c ) 2007 - 2009 Greg Houston , < http : / / greghoustondesign . com / > . <nl> - <nl> - Authors : <nl> - Harry Roberts and Greg Houston <nl> - <nl> - License : <nl> - MIT - style license . <nl> - <nl> - Requires : <nl> - Core . js , Window . js <nl> - <nl> - Syntax : <nl> - ( start code ) <nl> - MUI . arrangeTile ( ) ; <nl> - ( end ) <nl> - <nl> - * / <nl> - <nl> - MUI . files [ MUI . path . source + ' Window / Arrange - tile . js ' ] = ' loaded ' ; <nl> - <nl> - MUI . extend ( { <nl> - arrangeTile : function ( ) { <nl> - <nl> - var viewportTopOffset = 30 ; / / Use a negative number if necessary to place first window where you want it <nl> - var viewportLeftOffset = 20 ; <nl> - <nl> - var x = 10 ; <nl> - var y = 80 ; <nl> - <nl> - var instances = MUI . Windows . instances ; <nl> - <nl> - var windowsNum = 0 ; <nl> - <nl> - instances . each ( function ( instance ) { <nl> - if ( ! instance . isMinimized & & ! instance . isMaximized ) { <nl> - windowsNum + + ; <nl> - } <nl> - } ) ; <nl> - <nl> - var cols = 3 ; <nl> - var rows = Math . ceil ( windowsNum / cols ) ; <nl> - <nl> - var coordinates = document . getCoordinates ( ) ; <nl> - <nl> - var col_width = ( ( coordinates . width - viewportLeftOffset ) / cols ) ; <nl> - var col_height = ( ( coordinates . height - viewportTopOffset ) / rows ) ; <nl> - <nl> - var row = 0 ; <nl> - var col = 0 ; <nl> - <nl> - instances . each ( function ( instance ) { <nl> - if ( ! instance . isMinimized & & ! instance . isMaximized & & instance . options . draggable ) { <nl> - <nl> - var content = instance . contentWrapperEl ; <nl> - var content_coords = content . getCoordinates ( ) ; <nl> - var window_coords = instance . windowEl . getCoordinates ( ) ; <nl> - <nl> - / / Calculate the amount of padding around the content window <nl> - var padding_top = content_coords . top - window_coords . top ; <nl> - var padding_bottom = window_coords . height - content_coords . height - padding_top ; <nl> - var padding_left = content_coords . left - window_coords . left ; <nl> - var padding_right = window_coords . width - content_coords . width - padding_left ; <nl> - <nl> - / * <nl> - <nl> - / / This resizes the windows <nl> - if ( instance . options . shape ! = ' gauge ' & & instance . options . resizable = = true ) { <nl> - var width = ( col_width - 3 - padding_left - padding_right ) ; <nl> - var height = ( col_height - 3 - padding_top - padding_bottom ) ; <nl> - <nl> - if ( width > instance . options . resizeLimit . x [ 0 ] & & width < instance . options . resizeLimit . x [ 1 ] ) { <nl> - content . setStyle ( ' width ' , width ) ; <nl> - } <nl> - if ( height > instance . options . resizeLimit . y [ 0 ] & & height < instance . options . resizeLimit . y [ 1 ] ) { <nl> - content . setStyle ( ' height ' , height ) ; <nl> - } <nl> - <nl> - } * / <nl> - <nl> - var left = ( x + ( col * col_width ) ) ; <nl> - var top = ( y + ( row * col_height ) ) ; <nl> - <nl> - instance . drawWindow ( ) ; <nl> - <nl> - MUI . focusWindow ( instance . windowEl ) ; <nl> - <nl> - if ( MUI . options . advancedEffects = = false ) { <nl> - instance . windowEl . setStyles ( { <nl> - ' top ' : top , <nl> - ' left ' : left <nl> - } ) ; <nl> - } <nl> - else { <nl> - var tileMorph = new Fx . Morph ( instance . windowEl , { <nl> - ' duration ' : 550 <nl> - } ) ; <nl> - tileMorph . start ( { <nl> - ' top ' : top , <nl> - ' left ' : left <nl> - } ) ; <nl> - } <nl> - <nl> - if ( + + col = = = cols ) { <nl> - row + + ; <nl> - col = 0 ; <nl> - } <nl> - } <nl> - } . bind ( this ) ) ; <nl> - } <nl> - } ) ; <nl> - / * <nl> - <nl> - Script : Tabs . js <nl> - Functionality for window tabs . <nl> - <nl> - Copyright : <nl> - Copyright ( c ) 2007 - 2009 Greg Houston , < http : / / greghoustondesign . com / > . <nl> - <nl> - License : <nl> - MIT - style license . <nl> - <nl> - Requires : <nl> - Core . js , Window . js ( for tabbed windows ) or Layout . js ( for tabbed panels ) <nl> - <nl> - * / <nl> - <nl> - MUI . files [ MUI . path . source + ' Components / Tabs . js ' ] = ' loaded ' ; <nl> - <nl> - MUI . extend ( { <nl> - / * <nl> - <nl> - Function : initializeTabs <nl> - Add click event to each list item that fires the selected function . <nl> - <nl> - * / <nl> - initializeTabs : function ( el ) { <nl> - $ ( el ) . setStyle ( ' list - style ' , ' none ' ) ; / / This is to fix a glitch that occurs in IE8 RC1 when dynamically switching themes <nl> - $ ( el ) . getElements ( ' li ' ) . addEvent ( ' click ' , function ( e ) { <nl> - MUI . selected ( this , el ) ; <nl> - } ) ; <nl> - } , <nl> - / * <nl> - <nl> - Function : selected <nl> - Add " selected " class to current list item and remove it from sibling list items . <nl> - <nl> - Syntax : <nl> - ( start code ) <nl> - selected ( el , parent ) ; <nl> - ( end ) <nl> - <nl> - Arguments : <nl> - el - the list item <nl> - parent - the ul <nl> - <nl> - * / <nl> - selected : function ( el , parent ) { <nl> - $ ( parent ) . getChildren ( ) . each ( function ( listitem ) { <nl> - listitem . removeClass ( ' selected ' ) ; <nl> - } ) ; <nl> - el . addClass ( ' selected ' ) ; <nl> - } <nl> - } ) ; <nl> - <nl> - / * <nl> - <nl> - Script : Layout . js <nl> - Create web application layouts . Enables window maximize . <nl> - <nl> - Copyright : <nl> - Copyright ( c ) 2007 - 2009 Greg Houston , < http : / / greghoustondesign . com / > . <nl> - <nl> - License : <nl> - MIT - style license . <nl> - <nl> - Requires : <nl> - Core . js <nl> - <nl> - * / <nl> - <nl> - MUI . files [ MUI . path . source + ' Layout / Layout . js ' ] = ' loaded ' ; <nl> - <nl> - MUI . extend ( { <nl> - Columns : { <nl> - instances : new Hash ( ) , <nl> - columnIDCount : 0 / / Used for columns without an ID defined by the user <nl> - } , <nl> - Panels : { <nl> - instances : new Hash ( ) , <nl> - panelIDCount : 0 / / Used for panels without an ID defined by the user <nl> - } <nl> - } ) ; <nl> - <nl> - MUI . Desktop = { <nl> - <nl> - options : { <nl> - / / Naming options : <nl> - / / If you change the IDs of the MochaUI Desktop containers in your HTML , you need to change them here as well . <nl> - desktop : ' desktop ' , <nl> - desktopHeader : ' desktopHeader ' , <nl> - desktopFooter : ' desktopFooter ' , <nl> - desktopNavBar : ' desktopNavbar ' , <nl> - pageWrapper : ' pageWrapper ' , <nl> - page : ' page ' , <nl> - desktopFooter : ' desktopFooterWrapper ' <nl> - } , <nl> - initialize : function ( ) { <nl> - <nl> - this . desktop = $ ( this . options . desktop ) ; <nl> - this . desktopHeader = $ ( this . options . desktopHeader ) ; <nl> - this . desktopNavBar = $ ( this . options . desktopNavBar ) ; <nl> - this . pageWrapper = $ ( this . options . pageWrapper ) ; <nl> - this . page = $ ( this . options . page ) ; <nl> - this . desktopFooter = $ ( this . options . desktopFooter ) ; <nl> - <nl> - if ( this . desktop ) { <nl> - ( $ $ ( ' body ' ) ) . setStyles ( { <nl> - overflow : ' hidden ' , <nl> - height : ' 100 % ' , <nl> - margin : 0 <nl> - } ) ; <nl> - ( $ $ ( ' html ' ) ) . setStyles ( { <nl> - overflow : ' hidden ' , <nl> - height : ' 100 % ' <nl> - } ) ; <nl> - } <nl> - <nl> - / / This is run on dock initialize so no need to do it twice . <nl> - if ( ! MUI . Dock ) { <nl> - this . setDesktopSize ( ) ; <nl> - } <nl> - this . menuInitialize ( ) ; <nl> - <nl> - / / Resize desktop , page wrapper , modal overlay , and maximized windows when browser window is resized <nl> - window . addEvent ( ' resize ' , function ( e ) { <nl> - this . onBrowserResize ( ) ; <nl> - } . bind ( this ) ) ; <nl> - <nl> - if ( MUI . myChain ) { <nl> - MUI . myChain . callChain ( ) ; <nl> - } <nl> - <nl> - } , <nl> - menuInitialize : function ( ) { <nl> - / / Fix for dropdown menus in IE6 <nl> - if ( Browser . Engine . trident4 & & this . desktopNavBar ) { <nl> - this . desktopNavBar . getElements ( ' li ' ) . each ( function ( element ) { <nl> - element . addEvent ( ' mouseenter ' , function ( ) { <nl> - this . addClass ( ' ieHover ' ) ; <nl> - } ) ; <nl> - element . addEvent ( ' mouseleave ' , function ( ) { <nl> - this . removeClass ( ' ieHover ' ) ; <nl> - } ) ; <nl> - } ) ; <nl> - } ; <nl> - } , <nl> - onBrowserResize : function ( ) { <nl> - this . setDesktopSize ( ) ; <nl> - / / Resize maximized windows to fit new browser window size <nl> - setTimeout ( function ( ) { <nl> - MUI . Windows . instances . each ( function ( instance ) { <nl> - if ( instance . isMaximized ) { <nl> - <nl> - / / Hide iframe while resize for better performance <nl> - if ( instance . iframeEl ) { <nl> - instance . iframeEl . setStyle ( ' visibility ' , ' hidden ' ) ; <nl> - } <nl> - <nl> - var coordinates = document . getCoordinates ( ) ; <nl> - var borderHeight = instance . contentBorderEl . getStyle ( ' margin - top ' ) . toInt ( ) + instance . contentBorderEl . getStyle ( ' margin - bottom ' ) . toInt ( ) ; <nl> - var toolbarHeight = instance . toolbarWrapperEl ? instance . toolbarWrapperEl . getStyle ( ' height ' ) . toInt ( ) + instance . toolbarWrapperEl . getStyle ( ' margin - top ' ) . toInt ( ) : 0 ; <nl> - instance . contentWrapperEl . setStyles ( { <nl> - ' height ' : coordinates . height - instance . options . headerHeight - instance . options . footerHeight - borderHeight - toolbarHeight , <nl> - ' width ' : coordinates . width <nl> - } ) ; <nl> - <nl> - instance . drawWindow ( ) ; <nl> - if ( instance . iframeEl ) { <nl> - instance . iframeEl . setStyles ( { <nl> - ' height ' : instance . contentWrapperEl . getStyle ( ' height ' ) <nl> - } ) ; <nl> - instance . iframeEl . setStyle ( ' visibility ' , ' visible ' ) ; <nl> - } <nl> - <nl> - } <nl> - } . bind ( this ) ) ; <nl> - } . bind ( this ) , 100 ) ; <nl> - } , <nl> - setDesktopSize : function ( ) { <nl> - var windowDimensions = window . getCoordinates ( ) ; <nl> - <nl> - / / var dock = $ ( MUI . options . dock ) ; <nl> - var dockWrapper = $ ( MUI . options . dockWrapper ) ; <nl> - <nl> - / / Setting the desktop height may only be needed by IE7 <nl> - if ( this . desktop ) { <nl> - this . desktop . setStyle ( ' height ' , windowDimensions . height ) ; <nl> - } <nl> - <nl> - / / Set pageWrapper height so the dock doesn ' t cover the pageWrapper scrollbars . <nl> - if ( this . pageWrapper ) { <nl> - var dockOffset = MUI . dockVisible ? dockWrapper . offsetHeight : 0 ; <nl> - var pageWrapperHeight = windowDimensions . height ; <nl> - pageWrapperHeight - = this . pageWrapper . getStyle ( ' margin - top ' ) . toInt ( ) ; <nl> - pageWrapperHeight - = this . pageWrapper . getStyle ( ' margin - bottom ' ) . toInt ( ) ; <nl> - if ( this . desktopHeader ) { pageWrapperHeight - = this . desktopHeader . offsetHeight ; } <nl> - if ( this . desktopFooter ) { pageWrapperHeight - = this . desktopFooter . offsetHeight ; } <nl> - pageWrapperHeight - = dockOffset ; <nl> - <nl> - if ( pageWrapperHeight < 0 ) { <nl> - pageWrapperHeight = 0 ; <nl> - } <nl> - this . pageWrapper . setStyle ( ' height ' , pageWrapperHeight ) ; <nl> - } <nl> - <nl> - if ( MUI . Columns . instances . getKeys ( ) . length > 0 ) { / / Conditional is a fix for a bug in IE6 in the no toolbars demo . <nl> - MUI . Desktop . resizePanels ( ) ; <nl> - } <nl> - } , <nl> - resizePanels : function ( ) { <nl> - MUI . panelHeight ( ) ; <nl> - MUI . rWidth ( ) ; <nl> - } , <nl> - / * <nl> - <nl> - Function : maximizeWindow <nl> - Maximize a window . <nl> - <nl> - Syntax : <nl> - ( start code ) <nl> - MUI . Desktop . maximizeWindow ( windowEl ) ; <nl> - ( end ) <nl> - <nl> - * / <nl> - maximizeWindow : function ( windowEl ) { <nl> - <nl> - var instance = MUI . Windows . instances . get ( windowEl . id ) ; <nl> - var options = instance . options ; <nl> - var windowDrag = instance . windowDrag ; <nl> - <nl> - / / If window no longer exists or is maximized , stop <nl> - if ( windowEl ! = $ ( windowEl ) | | instance . isMaximized ) return ; <nl> - <nl> - if ( instance . isCollapsed ) { <nl> - MUI . collapseToggle ( windowEl ) ; <nl> - } <nl> - <nl> - instance . isMaximized = true ; <nl> - <nl> - / / If window is restricted to a container , it should not be draggable when maximized . <nl> - if ( instance . options . restrict ) { <nl> - windowDrag . detach ( ) ; <nl> - if ( options . resizable ) { <nl> - instance . detachResizable ( ) ; <nl> - } <nl> - instance . titleBarEl . setStyle ( ' cursor ' , ' default ' ) ; <nl> - } <nl> - <nl> - / / If the window has a container that is not the desktop <nl> - / / temporarily move the window to the desktop while it is minimized . <nl> - if ( options . container ! = this . desktop ) { <nl> - this . desktop . grab ( windowEl ) ; <nl> - if ( this . options . restrict ) { <nl> - windowDrag . container = this . desktop ; <nl> - } <nl> - } <nl> - <nl> - / / Save original position <nl> - instance . oldTop = windowEl . getStyle ( ' top ' ) ; <nl> - instance . oldLeft = windowEl . getStyle ( ' left ' ) ; <nl> - <nl> - var contentWrapperEl = instance . contentWrapperEl ; <nl> - <nl> - / / Save original dimensions <nl> - contentWrapperEl . oldWidth = contentWrapperEl . getStyle ( ' width ' ) ; <nl> - contentWrapperEl . oldHeight = contentWrapperEl . getStyle ( ' height ' ) ; <nl> - <nl> - / / Hide iframe <nl> - / / Iframe should be hidden when minimizing , maximizing , and moving for performance and Flash issues <nl> - if ( instance . iframeEl ) { <nl> - if ( ! MUI . ieLegacySupport ) { <nl> - instance . iframeEl . setStyle ( ' visibility ' , ' hidden ' ) ; <nl> - } <nl> - else { <nl> - instance . iframeEl . hide ( ) ; <nl> - } <nl> - } <nl> - <nl> - var windowDimensions = document . getCoordinates ( ) ; <nl> - var options = instance . options ; <nl> - var shadowBlur = options . shadowBlur ; <nl> - var shadowOffset = options . shadowOffset ; <nl> - var newHeight = windowDimensions . height - options . headerHeight - options . footerHeight ; <nl> - newHeight - = instance . contentBorderEl . getStyle ( ' margin - top ' ) . toInt ( ) ; <nl> - newHeight - = instance . contentBorderEl . getStyle ( ' margin - bottom ' ) . toInt ( ) ; <nl> - newHeight - = ( instance . toolbarWrapperEl ? instance . toolbarWrapperEl . getStyle ( ' height ' ) . toInt ( ) + instance . toolbarWrapperEl . getStyle ( ' margin - top ' ) . toInt ( ) : 0 ) ; <nl> - <nl> - MUI . resizeWindow ( windowEl , { <nl> - width : windowDimensions . width , <nl> - height : newHeight , <nl> - top : shadowOffset . y - shadowBlur , <nl> - left : shadowOffset . x - shadowBlur <nl> - } ) ; <nl> - instance . fireEvent ( ' onMaximize ' , windowEl ) ; <nl> - <nl> - if ( instance . maximizeButtonEl ) { <nl> - instance . maximizeButtonEl . setProperty ( ' title ' , ' Restore ' ) ; <nl> - } <nl> - MUI . focusWindow ( windowEl ) ; <nl> - <nl> - } , <nl> - / * <nl> - <nl> - Function : restoreWindow <nl> - Restore a maximized window . <nl> - <nl> - Syntax : <nl> - ( start code ) <nl> - MUI . Desktop . restoreWindow ( windowEl ) ; <nl> - ( end ) <nl> - <nl> - * / <nl> - restoreWindow : function ( windowEl ) { <nl> - <nl> - var instance = windowEl . retrieve ( ' instance ' ) ; <nl> - <nl> - / / Window exists and is maximized ? <nl> - if ( windowEl ! = $ ( windowEl ) | | ! instance . isMaximized ) return ; <nl> - <nl> - var options = instance . options ; <nl> - instance . isMaximized = false ; <nl> - <nl> - if ( options . restrict ) { <nl> - instance . windowDrag . attach ( ) ; <nl> - if ( options . resizable ) { <nl> - instance . reattachResizable ( ) ; <nl> - } <nl> - instance . titleBarEl . setStyle ( ' cursor ' , ' move ' ) ; <nl> - } <nl> - <nl> - / / Hide iframe <nl> - / / Iframe should be hidden when minimizing , maximizing , and moving for performance and Flash issues <nl> - if ( instance . iframeEl ) { <nl> - if ( ! MUI . ieLegacySupport ) { <nl> - instance . iframeEl . setStyle ( ' visibility ' , ' hidden ' ) ; <nl> - } <nl> - else { <nl> - instance . iframeEl . hide ( ) ; <nl> - } <nl> - } <nl> - <nl> - var contentWrapperEl = instance . contentWrapperEl ; <nl> - <nl> - MUI . resizeWindow ( windowEl , { <nl> - width : contentWrapperEl . oldWidth , <nl> - height : contentWrapperEl . oldHeight , <nl> - top : instance . oldTop , <nl> - left : instance . oldLeft <nl> - } ) ; <nl> - instance . fireEvent ( ' onRestore ' , windowEl ) ; <nl> - <nl> - if ( instance . maximizeButtonEl ) { <nl> - instance . maximizeButtonEl . setProperty ( ' title ' , ' Maximize ' ) ; <nl> - } <nl> - } <nl> - } ; <nl> - <nl> - / * <nl> - <nl> - Class : Column <nl> - Create a column . Columns should be created from left to right . <nl> - <nl> - Syntax : <nl> - ( start code ) <nl> - MUI . Column ( ) ; <nl> - ( end ) <nl> - <nl> - Arguments : <nl> - options <nl> - <nl> - Options : <nl> - id - The ID of the column . This must be set when creating the column . <nl> - container - Defaults to MUI . Desktop . pageWrapper . <nl> - placement - Can be ' right ' , ' main ' , or ' left ' . There must be at least one column with the ' main ' option . <nl> - width - ' main ' column is fluid and should not be given a width . <nl> - resizeLimit - resizelimit of a ' right ' or ' left ' column . <nl> - sortable - ( boolean ) Whether the panels can be reordered via drag and drop . <nl> - onResize - ( function ) Fired when the column is resized . <nl> - onCollapse - ( function ) Fired when the column is collapsed . <nl> - onExpand - ( function ) Fired when the column is expanded . <nl> - <nl> - * / <nl> - MUI . Column = new Class ( { <nl> - <nl> - Implements : [ Events , Options ] , <nl> - <nl> - options : { <nl> - id : null , <nl> - container : null , <nl> - placement : null , <nl> - width : null , <nl> - resizeLimit : [ ] , <nl> - sortable : true , <nl> - <nl> - / / Events <nl> - onResize : $ empty , <nl> - onCollapse : $ empty , <nl> - onExpand : $ empty <nl> - <nl> - } , <nl> - <nl> - initialize : function ( options ) { <nl> - this . setOptions ( options ) ; <nl> - <nl> - $ extend ( this , { <nl> - timestamp : $ time ( ) , <nl> - isCollapsed : false , <nl> - oldWidth : 0 <nl> - } ) ; <nl> - <nl> - / / If column has no ID , give it one . <nl> - if ( this . options . id = = null ) { <nl> - this . options . id = ' column ' + ( + + MUI . Columns . columnIDCount ) ; <nl> - } <nl> - <nl> - / / Shorten object chain <nl> - var options = this . options ; <nl> - var instances = MUI . Columns . instances ; <nl> - var instanceID = instances . get ( options . id ) ; <nl> - <nl> - if ( options . container = = null ) { <nl> - options . container = MUI . Desktop . pageWrapper <nl> - } <nl> - else { <nl> - $ ( options . container ) . setStyle ( ' overflow ' , ' hidden ' ) ; <nl> - } <nl> - <nl> - if ( typeof this . options . container = = ' string ' ) { <nl> - this . options . container = $ ( this . options . container ) ; <nl> - } <nl> - <nl> - / / Check to see if there is already a class instance for this Column <nl> - if ( instanceID ) { <nl> - var instance = instanceID ; <nl> - } <nl> - <nl> - / / Check if column already exists <nl> - if ( this . columnEl ) { <nl> - return ; <nl> - } <nl> - else { <nl> - instances . set ( options . id , this ) ; <nl> - } <nl> - <nl> - / / If loading columns into a panel , hide the regular content container . <nl> - if ( $ ( options . container ) . getElement ( ' . pad ' ) ! = null ) { <nl> - $ ( options . container ) . getElement ( ' . pad ' ) . hide ( ) ; <nl> - } <nl> - <nl> - / / If loading columns into a window , hide the regular content container . <nl> - if ( $ ( options . container ) . getElement ( ' . mochaContent ' ) ! = null ) { <nl> - $ ( options . container ) . getElement ( ' . mochaContent ' ) . hide ( ) ; <nl> - } <nl> - <nl> - this . columnEl = new Element ( ' div ' , { <nl> - ' id ' : this . options . id , <nl> - ' class ' : ' column expanded ' , <nl> - ' styles ' : { <nl> - ' width ' : options . placement = = ' main ' ? null : options . width <nl> - } <nl> - } ) . inject ( $ ( options . container ) ) ; <nl> - <nl> - this . columnEl . store ( ' instance ' , this ) ; <nl> - <nl> - var parent = this . columnEl . getParent ( ) ; <nl> - var columnHeight = parent . getStyle ( ' height ' ) . toInt ( ) ; <nl> - this . columnEl . setStyle ( ' height ' , columnHeight ) ; <nl> - <nl> - if ( this . options . sortable ) { <nl> - if ( ! this . options . container . retrieve ( ' sortables ' ) ) { <nl> - var sortables = new Sortables ( this . columnEl , { <nl> - opacity : 1 , <nl> - handle : ' . panel - header ' , <nl> - constrain : false , <nl> - revert : false , <nl> - onSort : function ( ) { <nl> - $ $ ( ' . column ' ) . each ( function ( column ) { <nl> - column . getChildren ( ' . panelWrapper ' ) . each ( function ( panelWrapper ) { <nl> - panelWrapper . getElement ( ' . panel ' ) . removeClass ( ' bottomPanel ' ) ; <nl> - } ) ; <nl> - if ( column . getChildren ( ' . panelWrapper ' ) . getLast ( ) ) { <nl> - column . getChildren ( ' . panelWrapper ' ) . getLast ( ) . getElement ( ' . panel ' ) . addClass ( ' bottomPanel ' ) ; <nl> - } <nl> - MUI . panelHeight ( ) ; <nl> - } . bind ( this ) ) ; <nl> - } . bind ( this ) <nl> - } ) ; <nl> - this . options . container . store ( ' sortables ' , sortables ) ; <nl> - } <nl> - else { <nl> - this . options . container . retrieve ( ' sortables ' ) . addLists ( this . columnEl ) ; <nl> - } <nl> - } <nl> - <nl> - if ( options . placement = = ' main ' ) { <nl> - this . columnEl . addClass ( ' rWidth ' ) ; <nl> - } <nl> - <nl> - switch ( this . options . placement ) { <nl> - case ' left ' : <nl> - this . handleEl = new Element ( ' div ' , { <nl> - ' id ' : this . options . id + ' _handle ' , <nl> - ' class ' : ' columnHandle ' <nl> - } ) . inject ( this . columnEl , ' after ' ) ; <nl> - <nl> - this . handleIconEl = new Element ( ' div ' , { <nl> - ' id ' : options . id + ' _handle_icon ' , <nl> - ' class ' : ' handleIcon ' <nl> - } ) . inject ( this . handleEl ) ; <nl> - <nl> - addResizeRight ( this . columnEl , options . resizeLimit [ 0 ] , options . resizeLimit [ 1 ] ) ; <nl> - break ; <nl> - case ' right ' : <nl> - this . handleEl = new Element ( ' div ' , { <nl> - ' id ' : this . options . id + ' _handle ' , <nl> - ' class ' : ' columnHandle ' <nl> - } ) . inject ( this . columnEl , ' before ' ) ; <nl> - <nl> - this . handleIconEl = new Element ( ' div ' , { <nl> - ' id ' : options . id + ' _handle_icon ' , <nl> - ' class ' : ' handleIcon ' <nl> - } ) . inject ( this . handleEl ) ; <nl> - addResizeLeft ( this . columnEl , options . resizeLimit [ 0 ] , options . resizeLimit [ 1 ] ) ; <nl> - break ; <nl> - } <nl> - <nl> - if ( this . handleEl ! = null ) { <nl> - this . handleEl . addEvent ( ' dblclick ' , function ( ) { <nl> - this . columnToggle ( ) ; <nl> - } . bind ( this ) ) ; <nl> - } <nl> - <nl> - MUI . rWidth ( ) ; <nl> - <nl> - } , <nl> - columnToggle : function ( ) { <nl> - var column = this . columnEl ; <nl> - <nl> - / / Collapse <nl> - if ( this . isCollapsed = = false ) { <nl> - this . oldWidth = column . getStyle ( ' width ' ) . toInt ( ) ; <nl> - <nl> - this . resize . detach ( ) ; <nl> - this . handleEl . removeEvents ( ' dblclick ' ) ; <nl> - this . handleEl . addEvent ( ' click ' , function ( ) { <nl> - this . columnToggle ( ) ; <nl> - } . bind ( this ) ) ; <nl> - this . handleEl . setStyle ( ' cursor ' , ' pointer ' ) . addClass ( ' detached ' ) ; <nl> - <nl> - column . setStyle ( ' width ' , 0 ) ; <nl> - this . isCollapsed = true ; <nl> - column . addClass ( ' collapsed ' ) ; <nl> - column . removeClass ( ' expanded ' ) ; <nl> - MUI . rWidth ( ) ; <nl> - this . fireEvent ( ' onCollapse ' ) ; <nl> - } <nl> - / / Expand <nl> - else { <nl> - column . setStyle ( ' width ' , this . oldWidth ) ; <nl> - this . isCollapsed = false ; <nl> - column . addClass ( ' expanded ' ) ; <nl> - column . removeClass ( ' collapsed ' ) ; <nl> - <nl> - this . handleEl . removeEvents ( ' click ' ) ; <nl> - this . handleEl . addEvent ( ' dblclick ' , function ( ) { <nl> - this . columnToggle ( ) ; <nl> - } . bind ( this ) ) ; <nl> - this . resize . attach ( ) ; <nl> - this . handleEl . setStyle ( ' cursor ' , ( Browser . Engine . webkit | | Browser . Engine . gecko ) ? ' col - resize ' : ' e - resize ' ) . addClass ( ' attached ' ) ; <nl> - <nl> - MUI . rWidth ( ) ; <nl> - this . fireEvent ( ' onExpand ' ) ; <nl> - } <nl> - } <nl> - } ) ; <nl> - MUI . Column . implement ( new Options , new Events ) ; <nl> - <nl> - / * <nl> - <nl> - Class : Panel <nl> - Create a panel . Panels go one on top of another in columns . Create your columns first and then add your panels . Panels should be created from top to bottom , left to right . <nl> - <nl> - Syntax : <nl> - ( start code ) <nl> - MUI . Panel ( ) ; <nl> - ( end ) <nl> - <nl> - Arguments : <nl> - options <nl> - <nl> - Options : <nl> - id - The ID of the panel . This must be set when creating the panel . <nl> - column - Where to inject the panel . This must be set when creating the panel . <nl> - loadMethod - ( ' html ' , ' xhr ' , or ' iframe ' ) Defaults to ' html ' if there is no contentURL . Defaults to ' xhr ' if there is a contentURL . You only really need to set this if using the ' iframe ' method . May create a ' panel ' loadMethod in the future . <nl> - contentURL - Used if loadMethod is set to ' xhr ' or ' iframe ' . <nl> - method - ( ' get ' , or ' post ' ) The method used to get the data . Defaults to ' get ' . <nl> - data - ( hash ) Data to send with the URL . Defaults to null . <nl> - evalScripts - ( boolean ) An xhr loadMethod option . Defaults to true . <nl> - evalResponse - ( boolean ) An xhr loadMethod option . Defaults to false . <nl> - content - ( string or element ) An html loadMethod option . <nl> - tabsURL - ( url ) <nl> - tabsData - ( hash ) Data to send with the URL . Defaults to null . <nl> - tabsOnload - ( function ) <nl> - header - ( boolean ) Display the panel header or not <nl> - headerToolbox : ( boolean ) <nl> - headerToolboxURL : ( url ) <nl> - headerToolboxOnload : ( function ) <nl> - height - ( number ) Height of content area . <nl> - addClass - ( string ) Add a class to the panel . <nl> - scrollbars - ( boolean ) <nl> - padding - ( object ) <nl> - collapsible - ( boolean ) <nl> - onBeforeBuild - ( function ) Fired before the panel is created . <nl> - onContentLoaded - ( function ) Fired after the panel ' s conten is loaded . <nl> - onResize - ( function ) Fired when the panel is resized . <nl> - onCollapse - ( function ) Fired when the panel is collapsed . <nl> - onExpand - ( function ) Fired when the panel is expanded . <nl> - <nl> - * / <nl> - MUI . Panel = new Class ( { <nl> - <nl> - Implements : [ Events , Options ] , <nl> - <nl> - options : { <nl> - id : null , <nl> - title : ' New Panel ' , <nl> - column : null , <nl> - require : { <nl> - css : [ ] , <nl> - images : [ ] , <nl> - js : [ ] , <nl> - onload : null <nl> - } , <nl> - loadMethod : null , <nl> - contentURL : null , <nl> - <nl> - / / xhr options <nl> - method : ' get ' , <nl> - data : null , <nl> - evalScripts : true , <nl> - evalResponse : false , <nl> - <nl> - / / html options <nl> - content : ' Panel content ' , <nl> - <nl> - / / Tabs <nl> - tabsURL : null , <nl> - tabsData : null , <nl> - tabsOnload : $ empty , <nl> - <nl> - header : true , <nl> - headerToolbox : false , <nl> - headerToolboxURL : ' pages / lipsum . html ' , <nl> - headerToolboxOnload : $ empty , <nl> - <nl> - / / Style options : <nl> - height : 125 , <nl> - addClass : ' ' , <nl> - scrollbars : true , <nl> - padding : { top : 8 , right : 8 , bottom : 8 , left : 8 } , <nl> - <nl> - / / Other : <nl> - collapsible : true , <nl> - <nl> - / / Events <nl> - onBeforeBuild : $ empty , <nl> - onContentLoaded : $ empty , <nl> - onResize : $ empty , <nl> - onCollapse : $ empty , <nl> - onExpand : $ empty <nl> - <nl> - } , <nl> - initialize : function ( options ) { <nl> - this . setOptions ( options ) ; <nl> - <nl> - $ extend ( this , { <nl> - timestamp : $ time ( ) , <nl> - isCollapsed : false , / / This is probably redundant since we can check for the class <nl> - oldHeight : 0 , <nl> - partner : null <nl> - } ) ; <nl> - <nl> - / / If panel has no ID , give it one . <nl> - if ( this . options . id = = null ) { <nl> - this . options . id = ' panel ' + ( + + MUI . Panels . panelIDCount ) ; <nl> - } <nl> - <nl> - / / Shorten object chain <nl> - var instances = MUI . Panels . instances ; <nl> - var instanceID = instances . get ( this . options . id ) ; <nl> - var options = this . options ; <nl> - <nl> - / / Check to see if there is already a class instance for this panel <nl> - if ( instanceID ) { <nl> - var instance = instanceID ; <nl> - } <nl> - <nl> - / / Check if panel already exists <nl> - if ( this . panelEl ) { <nl> - return ; <nl> - } <nl> - else { <nl> - instances . set ( this . options . id , this ) ; <nl> - } <nl> - <nl> - this . fireEvent ( ' onBeforeBuild ' ) ; <nl> - <nl> - if ( options . loadMethod = = ' iframe ' ) { <nl> - / / Iframes have their own padding . <nl> - options . padding = { top : 0 , right : 0 , bottom : 0 , left : 0 } ; <nl> - } <nl> - <nl> - this . showHandle = true ; <nl> - if ( $ ( options . column ) . getChildren ( ) . length = = 0 ) { <nl> - this . showHandle = false ; <nl> - } <nl> - <nl> - this . panelWrapperEl = new Element ( ' div ' , { <nl> - ' id ' : this . options . id + ' _wrapper ' , <nl> - ' class ' : ' panelWrapper expanded ' <nl> - } ) . inject ( $ ( options . column ) ) ; <nl> - <nl> - this . panelEl = new Element ( ' div ' , { <nl> - ' id ' : this . options . id , <nl> - ' class ' : ' panel expanded ' , <nl> - ' styles ' : { <nl> - ' height ' : options . height <nl> - } <nl> - } ) . inject ( this . panelWrapperEl ) ; <nl> - <nl> - this . panelEl . store ( ' instance ' , this ) ; <nl> - <nl> - this . panelEl . addClass ( options . addClass ) ; <nl> - <nl> - this . contentEl = new Element ( ' div ' , { <nl> - ' id ' : options . id + ' _pad ' , <nl> - ' class ' : ' pad ' <nl> - } ) . inject ( this . panelEl ) ; <nl> - <nl> - / / This is in order to use the same variable as the windows do in updateContent . <nl> - / / May rethink this . <nl> - this . contentWrapperEl = this . panelEl ; <nl> - <nl> - this . contentEl . setStyles ( { <nl> - ' padding - top ' : options . padding . top , <nl> - ' padding - bottom ' : options . padding . bottom , <nl> - ' padding - left ' : options . padding . left , <nl> - ' padding - right ' : options . padding . right <nl> - } ) ; <nl> - <nl> - this . panelHeaderEl = new Element ( ' div ' , { <nl> - ' id ' : this . options . id + ' _header ' , <nl> - ' class ' : ' panel - header ' , <nl> - ' styles ' : { <nl> - ' display ' : options . header ? ' block ' : ' none ' <nl> - } <nl> - } ) . inject ( this . panelEl , ' before ' ) ; <nl> - <nl> - var columnInstances = MUI . Columns . instances ; <nl> - var columnInstance = columnInstances . get ( this . options . column ) ; <nl> - <nl> - if ( columnInstance . options . sortable ) { <nl> - this . panelHeaderEl . setStyle ( ' cursor ' , ' move ' ) ; <nl> - columnInstance . options . container . retrieve ( ' sortables ' ) . addItems ( this . panelWrapperEl ) ; <nl> - } <nl> - <nl> - if ( this . options . collapsible ) { <nl> - this . collapseToggleInit ( ) ; <nl> - } <nl> - <nl> - if ( this . options . headerToolbox ) { <nl> - this . panelHeaderToolboxEl = new Element ( ' div ' , { <nl> - ' id ' : options . id + ' _headerToolbox ' , <nl> - ' class ' : ' panel - header - toolbox ' <nl> - } ) . inject ( this . panelHeaderEl ) ; <nl> - } <nl> - <nl> - this . panelHeaderContentEl = new Element ( ' div ' , { <nl> - ' id ' : options . id + ' _headerContent ' , <nl> - ' class ' : ' panel - headerContent ' <nl> - } ) . inject ( this . panelHeaderEl ) ; <nl> - <nl> - this . titleEl = new Element ( ' h2 ' , { <nl> - ' id ' : options . id + ' _title ' <nl> - } ) . inject ( this . panelHeaderContentEl ) ; <nl> - <nl> - this . handleEl = new Element ( ' div ' , { <nl> - ' id ' : options . id + ' _handle ' , <nl> - ' class ' : ' horizontalHandle ' , <nl> - ' styles ' : { <nl> - ' display ' : this . showHandle = = true ? ' block ' : ' none ' <nl> - } <nl> - } ) . inject ( this . panelEl , ' after ' ) ; <nl> - <nl> - this . handleIconEl = new Element ( ' div ' , { <nl> - ' id ' : options . id + ' _handle_icon ' , <nl> - ' class ' : ' handleIcon ' <nl> - } ) . inject ( this . handleEl ) ; <nl> - <nl> - addResizeBottom ( options . id ) ; <nl> - <nl> - if ( options . require . css . length | | options . require . images . length ) { <nl> - new MUI . Require ( { <nl> - css : options . require . css , <nl> - images : options . require . images , <nl> - onload : function ( ) { <nl> - this . newPanel ( ) ; <nl> - } . bind ( this ) <nl> - } ) ; <nl> - } <nl> - else { <nl> - this . newPanel ( ) ; <nl> - } <nl> - } , <nl> - newPanel : function ( ) { <nl> - <nl> - options = this . options ; <nl> - <nl> - if ( this . options . headerToolbox ) { <nl> - MUI . updateContent ( { <nl> - ' element ' : this . panelEl , <nl> - ' childElement ' : this . panelHeaderToolboxEl , <nl> - ' loadMethod ' : ' xhr ' , <nl> - ' url ' : options . headerToolboxURL , <nl> - ' onContentLoaded ' : options . headerToolboxOnload <nl> - } ) ; <nl> - } <nl> - <nl> - if ( options . tabsURL = = null ) { <nl> - this . titleEl . set ( ' html ' , options . title ) ; <nl> - } else { <nl> - this . panelHeaderContentEl . addClass ( ' tabs ' ) ; <nl> - MUI . updateContent ( { <nl> - ' element ' : this . panelEl , <nl> - ' childElement ' : this . panelHeaderContentEl , <nl> - ' loadMethod ' : ' xhr ' , <nl> - ' url ' : options . tabsURL , <nl> - ' data ' : options . tabsData , <nl> - ' onContentLoaded ' : options . tabsOnload <nl> - } ) ; <nl> - } <nl> - <nl> - / / Add content to panel . <nl> - MUI . updateContent ( { <nl> - ' element ' : this . panelEl , <nl> - ' content ' : options . content , <nl> - ' method ' : options . method , <nl> - ' data ' : options . data , <nl> - ' url ' : options . contentURL , <nl> - ' onContentLoaded ' : null , <nl> - ' require ' : { <nl> - js : options . require . js , <nl> - onload : options . require . onload <nl> - } <nl> - } ) ; <nl> - <nl> - / / Do this when creating and removing panels <nl> - $ ( options . column ) . getChildren ( ' . panelWrapper ' ) . each ( function ( panelWrapper ) { <nl> - panelWrapper . getElement ( ' . panel ' ) . removeClass ( ' bottomPanel ' ) ; <nl> - } ) ; <nl> - $ ( options . column ) . getChildren ( ' . panelWrapper ' ) . getLast ( ) . getElement ( ' . panel ' ) . addClass ( ' bottomPanel ' ) ; <nl> - <nl> - MUI . panelHeight ( options . column , this . panelEl , ' new ' ) ; <nl> - <nl> - } , <nl> - collapseToggleInit : function ( options ) { <nl> - <nl> - var options = this . options ; <nl> - <nl> - this . panelHeaderCollapseBoxEl = new Element ( ' div ' , { <nl> - ' id ' : options . id + ' _headerCollapseBox ' , <nl> - ' class ' : ' toolbox ' <nl> - } ) . inject ( this . panelHeaderEl ) ; <nl> - <nl> - if ( options . headerToolbox ) { <nl> - this . panelHeaderCollapseBoxEl . addClass ( ' divider ' ) ; <nl> - } <nl> - <nl> - this . collapseToggleEl = new Element ( ' div ' , { <nl> - ' id ' : options . id + ' _collapseToggle ' , <nl> - ' class ' : ' panel - collapse icon16 ' , <nl> - ' styles ' : { <nl> - ' width ' : 16 , <nl> - ' height ' : 16 <nl> - } , <nl> - ' title ' : ' Collapse Panel ' <nl> - } ) . inject ( this . panelHeaderCollapseBoxEl ) ; <nl> - <nl> - this . collapseToggleEl . addEvent ( ' click ' , function ( event ) { <nl> - var panel = this . panelEl ; <nl> - var panelWrapper = this . panelWrapperEl <nl> - <nl> - / / Get siblings and make sure they are not all collapsed . <nl> - / / If they are all collapsed and the current panel is collapsing <nl> - / / Then collapse the column . <nl> - var instances = MUI . Panels . instances ; <nl> - var expandedSiblings = [ ] ; <nl> - <nl> - panelWrapper . getAllPrevious ( ' . panelWrapper ' ) . each ( function ( sibling ) { <nl> - var instance = instances . get ( sibling . getElement ( ' . panel ' ) . id ) ; <nl> - if ( instance . isCollapsed = = false ) { <nl> - expandedSiblings . push ( sibling . getElement ( ' . panel ' ) . id ) ; <nl> - } <nl> - } ) ; <nl> - <nl> - panelWrapper . getAllNext ( ' . panelWrapper ' ) . each ( function ( sibling ) { <nl> - var instance = instances . get ( sibling . getElement ( ' . panel ' ) . id ) ; <nl> - if ( instance . isCollapsed = = false ) { <nl> - expandedSiblings . push ( sibling . getElement ( ' . panel ' ) . id ) ; <nl> - } <nl> - } ) ; <nl> - <nl> - / / Collapse Panel <nl> - if ( this . isCollapsed = = false ) { <nl> - var currentColumn = MUI . Columns . instances . get ( $ ( options . column ) . id ) ; <nl> - <nl> - if ( expandedSiblings . length = = 0 & & currentColumn . options . placement ! = ' main ' ) { <nl> - var currentColumn = MUI . Columns . instances . get ( $ ( options . column ) . id ) ; <nl> - currentColumn . columnToggle ( ) ; <nl> - return ; <nl> - } <nl> - else if ( expandedSiblings . length = = 0 & & currentColumn . options . placement = = ' main ' ) { <nl> - return ; <nl> - } <nl> - this . oldHeight = panel . getStyle ( ' height ' ) . toInt ( ) ; <nl> - if ( this . oldHeight < 10 ) this . oldHeight = 20 ; <nl> - this . contentEl . setStyle ( ' position ' , ' absolute ' ) ; / / This is so IE6 and IE7 will collapse the panel all the way <nl> - panel . setStyle ( ' height ' , 0 ) ; <nl> - this . isCollapsed = true ; <nl> - panelWrapper . addClass ( ' collapsed ' ) ; <nl> - panelWrapper . removeClass ( ' expanded ' ) ; <nl> - MUI . panelHeight ( options . column , panel , ' collapsing ' ) ; <nl> - MUI . panelHeight ( ) ; / / Run this a second time for panels within panels <nl> - this . collapseToggleEl . removeClass ( ' panel - collapsed ' ) ; <nl> - this . collapseToggleEl . addClass ( ' panel - expand ' ) ; <nl> - this . collapseToggleEl . setProperty ( ' title ' , ' Expand Panel ' ) ; <nl> - this . fireEvent ( ' onCollapse ' ) ; <nl> - } <nl> - <nl> - / / Expand Panel <nl> - else { <nl> - this . contentEl . setStyle ( ' position ' , null ) ; / / This is so IE6 and IE7 will collapse the panel all the way <nl> - panel . setStyle ( ' height ' , this . oldHeight ) ; <nl> - this . isCollapsed = false ; <nl> - panelWrapper . addClass ( ' expanded ' ) ; <nl> - panelWrapper . removeClass ( ' collapsed ' ) ; <nl> - MUI . panelHeight ( this . options . column , panel , ' expanding ' ) ; <nl> - MUI . panelHeight ( ) ; / / Run this a second time for panels within panels <nl> - this . collapseToggleEl . removeClass ( ' panel - expand ' ) ; <nl> - this . collapseToggleEl . addClass ( ' panel - collapsed ' ) ; <nl> - this . collapseToggleEl . setProperty ( ' title ' , ' Collapse Panel ' ) ; <nl> - this . fireEvent ( ' onExpand ' ) ; <nl> - } <nl> - } . bind ( this ) ) ; <nl> - } <nl> - } ) ; <nl> - MUI . Panel . implement ( new Options , new Events ) ; <nl> - <nl> - / * <nl> - arguments : <nl> - column - The column to resize the panels in <nl> - changing - The panel that is collapsing , expanding , or new <nl> - action - collapsing , expanding , or new <nl> - <nl> - * / <nl> - <nl> - MUI . extend ( { <nl> - / / Panel Height <nl> - panelHeight : function ( column , changing , action ) { <nl> - if ( column ! = null ) { <nl> - MUI . panelHeight2 ( $ ( column ) , changing , action ) ; <nl> - } <nl> - else { <nl> - $ $ ( ' . column ' ) . each ( function ( column ) { <nl> - MUI . panelHeight2 ( column ) ; <nl> - } . bind ( this ) ) ; <nl> - } <nl> - } , <nl> - / * <nl> - <nl> - actions can be new , collapsing or expanding . <nl> - <nl> - * / <nl> - panelHeight2 : function ( column , changing , action ) { <nl> - <nl> - var instances = MUI . Panels . instances ; <nl> - <nl> - var parent = column . getParent ( ) ; <nl> - var columnHeight = parent . getStyle ( ' height ' ) . toInt ( ) ; <nl> - if ( Browser . Engine . trident4 & & parent = = MUI . Desktop . pageWrapper ) { <nl> - columnHeight - = 1 ; <nl> - } <nl> - column . setStyle ( ' height ' , columnHeight ) ; <nl> - <nl> - / / Get column panels <nl> - var panels = [ ] ; <nl> - column . getChildren ( ' . panelWrapper ' ) . each ( function ( panelWrapper ) { <nl> - panels . push ( panelWrapper . getElement ( ' . panel ' ) ) ; <nl> - } . bind ( this ) ) ; <nl> - <nl> - / / Get expanded column panels <nl> - var panelsExpanded = [ ] ; <nl> - column . getChildren ( ' . expanded ' ) . each ( function ( panelWrapper ) { <nl> - panelsExpanded . push ( panelWrapper . getElement ( ' . panel ' ) ) ; <nl> - } . bind ( this ) ) ; <nl> - <nl> - / / All the panels in the column whose height will be effected . <nl> - var panelsToResize = [ ] ; <nl> - <nl> - / / The panel with the greatest height . Remainders will be added to this panel <nl> - var tallestPanel ; <nl> - var tallestPanelHeight = 0 ; <nl> - <nl> - this . panelsTotalHeight = 0 ; / / Height of all the panels in the column <nl> - this . height = 0 ; / / Height of all the elements in the column <nl> - <nl> - / / Set panel resize partners <nl> - panels . each ( function ( panel ) { <nl> - instance = instances . get ( panel . id ) ; <nl> - if ( panel . getParent ( ) . hasClass ( ' expanded ' ) & & panel . getParent ( ) . getNext ( ' . expanded ' ) ) { <nl> - instance . partner = panel . getParent ( ) . getNext ( ' . expanded ' ) . getElement ( ' . panel ' ) ; <nl> - instance . resize . attach ( ) ; <nl> - instance . handleEl . setStyles ( { <nl> - ' display ' : ' block ' , <nl> - ' cursor ' : ( Browser . Engine . webkit | | Browser . Engine . gecko ) ? ' row - resize ' : ' n - resize ' <nl> - } ) . removeClass ( ' detached ' ) ; <nl> - } else { <nl> - instance . resize . detach ( ) ; <nl> - instance . handleEl . setStyles ( { <nl> - ' display ' : ' none ' , <nl> - ' cursor ' : null <nl> - } ) . addClass ( ' detached ' ) ; <nl> - } <nl> - if ( panel . getParent ( ) . getNext ( ' . panelWrapper ' ) = = null ) { <nl> - instance . handleEl . hide ( ) ; <nl> - } <nl> - } . bind ( this ) ) ; <nl> - <nl> - / / Add panels to panelsToResize <nl> - / / Get the total height of all the resizable panels <nl> - / / Get the total height of all the column ' s children <nl> - column . getChildren ( ) . each ( function ( panelWrapper ) { <nl> - <nl> - panelWrapper . getChildren ( ) . each ( function ( el ) { <nl> - <nl> - if ( el . hasClass ( ' panel ' ) ) { <nl> - var instance = instances . get ( el . id ) ; <nl> - <nl> - / / Are any next siblings Expanded ? <nl> - anyNextSiblingsExpanded = function ( el ) { <nl> - var test ; <nl> - el . getParent ( ) . getAllNext ( ' . panelWrapper ' ) . each ( function ( sibling ) { <nl> - var siblingInstance = instances . get ( sibling . getElement ( ' . panel ' ) . id ) ; <nl> - if ( siblingInstance . isCollapsed = = false ) { <nl> - test = true ; <nl> - } <nl> - } . bind ( this ) ) ; <nl> - return test ; <nl> - } . bind ( this ) ; <nl> - <nl> - / / If a next sibling is expanding , are any of the nexts siblings of the expanding sibling Expanded ? <nl> - anyExpandingNextSiblingsExpanded = function ( el ) { <nl> - var test ; <nl> - changing . getParent ( ) . getAllNext ( ' . panelWrapper ' ) . each ( function ( sibling ) { <nl> - var siblingInstance = instances . get ( sibling . getElement ( ' . panel ' ) . id ) ; <nl> - if ( siblingInstance . isCollapsed = = false ) { <nl> - test = true ; <nl> - } <nl> - } . bind ( this ) ) ; <nl> - return test ; <nl> - } . bind ( this ) ; <nl> - <nl> - / / Is the panel that is collapsing , expanding , or new located after this panel ? <nl> - anyNextContainsChanging = function ( el ) { <nl> - var allNext = [ ] ; <nl> - el . getParent ( ) . getAllNext ( ' . panelWrapper ' ) . each ( function ( panelWrapper ) { <nl> - allNext . push ( panelWrapper . getElement ( ' . panel ' ) ) ; <nl> - } . bind ( this ) ) ; <nl> - var test = allNext . contains ( changing ) ; <nl> - return test ; <nl> - } . bind ( this ) ; <nl> - <nl> - nextExpandedChanging = function ( el ) { <nl> - var test ; <nl> - if ( el . getParent ( ) . getNext ( ' . expanded ' ) ) { <nl> - if ( el . getParent ( ) . getNext ( ' . expanded ' ) . getElement ( ' . panel ' ) = = changing ) test = true ; <nl> - } <nl> - return test ; <nl> - } <nl> - <nl> - / / NEW PANEL <nl> - / / Resize panels that are " new " or not collapsed <nl> - if ( action = = ' new ' ) { <nl> - if ( ! instance . isCollapsed & & el ! = changing ) { <nl> - panelsToResize . push ( el ) ; <nl> - this . panelsTotalHeight + = el . offsetHeight . toInt ( ) ; <nl> - } <nl> - } <nl> - <nl> - / / COLLAPSING PANELS and CURRENTLY EXPANDED PANELS <nl> - / / Resize panels that are not collapsed . <nl> - / / If a panel is collapsing resize any expanded panels below . <nl> - / / If there are no expanded panels below it , resize the expanded panels above it . <nl> - else if ( action = = null | | action = = ' collapsing ' ) { <nl> - if ( ! instance . isCollapsed & & ( ! anyNextContainsChanging ( el ) | | ! anyNextSiblingsExpanded ( el ) ) ) { <nl> - panelsToResize . push ( el ) ; <nl> - this . panelsTotalHeight + = el . offsetHeight . toInt ( ) ; <nl> - } <nl> - } <nl> - <nl> - / / EXPANDING PANEL <nl> - / / Resize panels that are not collapsed and are not expanding . <nl> - / / Resize any expanded panels below the expanding panel . <nl> - / / If there are no expanded panels below the expanding panel , resize the first expanded panel above it . <nl> - else if ( action = = ' expanding ' & & ! instance . isCollapsed & & el ! = changing ) { <nl> - if ( ! anyNextContainsChanging ( el ) | | ( ! anyExpandingNextSiblingsExpanded ( el ) & & nextExpandedChanging ( el ) ) ) { <nl> - panelsToResize . push ( el ) ; <nl> - this . panelsTotalHeight + = el . offsetHeight . toInt ( ) ; <nl> - } <nl> - } <nl> - <nl> - if ( el . style . height ) { <nl> - this . height + = el . getStyle ( ' height ' ) . toInt ( ) ; <nl> - } <nl> - } <nl> - else { <nl> - this . height + = el . offsetHeight . toInt ( ) ; <nl> - } <nl> - } . bind ( this ) ) ; <nl> - <nl> - } . bind ( this ) ) ; <nl> - <nl> - / / Get the remaining height <nl> - var remainingHeight = column . offsetHeight . toInt ( ) - this . height ; <nl> - <nl> - this . height = 0 ; <nl> - <nl> - / / Get height of all the column ' s children <nl> - column . getChildren ( ) . each ( function ( el ) { <nl> - this . height + = el . offsetHeight . toInt ( ) ; <nl> - } . bind ( this ) ) ; <nl> - <nl> - var remainingHeight = column . offsetHeight . toInt ( ) - this . height ; <nl> - <nl> - panelsToResize . each ( function ( panel ) { <nl> - var ratio = this . panelsTotalHeight / panel . offsetHeight . toInt ( ) ; <nl> - var panelHeight = panel . getStyle ( ' height ' ) . toInt ( ) ; <nl> - var newPanelHeight = remainingHeight / ratio ; <nl> - if ( ! isNaN ( panelHeight ) ) <nl> - newPanelHeight + = panelHeight ; <nl> - if ( newPanelHeight < 1 ) { <nl> - newPanelHeight = 0 ; <nl> - } <nl> - panel . setStyle ( ' height ' , newPanelHeight ) ; <nl> - } . bind ( this ) ) ; <nl> - <nl> - / / Make sure the remaining height is 0 . If not add / subtract the <nl> - / / remaining height to the tallest panel . This makes up for browser resizing , <nl> - / / off ratios , and users trying to give panels too much height . <nl> - <nl> - / / Get height of all the column ' s children <nl> - this . height = 0 ; <nl> - column . getChildren ( ) . each ( function ( panelWrapper ) { <nl> - panelWrapper . getChildren ( ) . each ( function ( el ) { <nl> - this . height + = el . offsetHeight . toInt ( ) ; <nl> - if ( el . hasClass ( ' panel ' ) & & el . getStyle ( ' height ' ) . toInt ( ) > tallestPanelHeight ) { <nl> - tallestPanel = el ; <nl> - tallestPanelHeight = el . getStyle ( ' height ' ) . toInt ( ) ; <nl> - } <nl> - } . bind ( this ) ) ; <nl> - } . bind ( this ) ) ; <nl> - <nl> - var remainingHeight = column . offsetHeight . toInt ( ) - this . height ; <nl> - <nl> - if ( remainingHeight ! = 0 & & tallestPanelHeight > 0 ) { <nl> - tallestPanel . setStyle ( ' height ' , tallestPanel . getStyle ( ' height ' ) . toInt ( ) + remainingHeight ) ; <nl> - if ( tallestPanel . getStyle ( ' height ' ) < 1 ) { <nl> - tallestPanel . setStyle ( ' height ' , 0 ) ; <nl> - } <nl> - } <nl> - <nl> - parent . getChildren ( ' . columnHandle ' ) . each ( function ( handle ) { <nl> - var parent = handle . getParent ( ) ; <nl> - if ( parent . getStyle ( ' height ' ) . toInt ( ) < 1 ) return ; / / Keeps IE7 and 8 from throwing an error when collapsing a panel within a panel <nl> - var handleHeight = parent . getStyle ( ' height ' ) . toInt ( ) - handle . getStyle ( ' margin - top ' ) . toInt ( ) - handle . getStyle ( ' margin - bottom ' ) . toInt ( ) ; <nl> - if ( Browser . Engine . trident4 & & parent = = MUI . Desktop . pageWrapper ) { <nl> - handleHeight - = 1 ; <nl> - } <nl> - handle . setStyle ( ' height ' , handleHeight ) ; <nl> - } ) ; <nl> - <nl> - panelsExpanded . each ( function ( panel ) { <nl> - MUI . resizeChildren ( panel ) ; <nl> - } . bind ( this ) ) ; <nl> - <nl> - } , <nl> - / / May rename this resizeIframeEl ( ) <nl> - resizeChildren : function ( panel ) { <nl> - var instances = MUI . Panels . instances ; <nl> - var instance = instances . get ( panel . id ) ; <nl> - var contentWrapperEl = instance . contentWrapperEl ; <nl> - <nl> - if ( instance . iframeEl ) { <nl> - if ( ! MUI . ieLegacySupport ) { <nl> - instance . iframeEl . setStyles ( { <nl> - ' height ' : contentWrapperEl . getStyle ( ' height ' ) , <nl> - ' width ' : contentWrapperEl . offsetWidth - contentWrapperEl . getStyle ( ' margin - left ' ) . toInt ( ) - contentWrapperEl . getStyle ( ' margin - right ' ) . toInt ( ) <nl> - } ) ; <nl> - } <nl> - else { <nl> - / / The following hack is to get IE8 RC1 IE8 Standards Mode to properly resize an iframe <nl> - / / when only the vertical dimension is changed . <nl> - instance . iframeEl . setStyles ( { <nl> - ' height ' : contentWrapperEl . getStyle ( ' height ' ) , <nl> - ' width ' : contentWrapperEl . offsetWidth - contentWrapperEl . getStyle ( ' margin - left ' ) . toInt ( ) - contentWrapperEl . getStyle ( ' margin - right ' ) . toInt ( ) - 1 <nl> - } ) ; <nl> - instance . iframeEl . setStyles ( { <nl> - ' width ' : contentWrapperEl . offsetWidth - contentWrapperEl . getStyle ( ' margin - left ' ) . toInt ( ) - contentWrapperEl . getStyle ( ' margin - right ' ) . toInt ( ) <nl> - } ) ; <nl> - } <nl> - } <nl> - <nl> - } , <nl> - / / Remaining Width <nl> - rWidth : function ( container ) { <nl> - if ( container = = null ) { <nl> - var container = MUI . Desktop . desktop ; <nl> - } <nl> - container . getElements ( ' . rWidth ' ) . each ( function ( column ) { <nl> - var currentWidth = column . offsetWidth . toInt ( ) ; <nl> - currentWidth - = column . getStyle ( ' margin - left ' ) . toInt ( ) ; <nl> - currentWidth - = column . getStyle ( ' margin - right ' ) . toInt ( ) ; <nl> - var parent = column . getParent ( ) ; <nl> - this . width = 0 ; <nl> - <nl> - / / Get the total width of all the parent element ' s children <nl> - parent . getChildren ( ) . each ( function ( el ) { <nl> - if ( el . hasClass ( ' mocha ' ) ! = true ) { <nl> - this . width + = el . offsetWidth . toInt ( ) ; <nl> - } <nl> - } . bind ( this ) ) ; <nl> - <nl> - / / Add the remaining width to the current element <nl> - var remainingWidth = parent . offsetWidth . toInt ( ) - this . width ; <nl> - var newWidth = currentWidth + remainingWidth ; <nl> - if ( newWidth < 1 ) newWidth = 0 ; <nl> - column . setStyle ( ' width ' , newWidth ) ; <nl> - column . getChildren ( ' . panel ' ) . each ( function ( panel ) { <nl> - panel . setStyle ( ' width ' , newWidth - panel . getStyle ( ' margin - left ' ) . toInt ( ) - panel . getStyle ( ' margin - right ' ) . toInt ( ) ) ; <nl> - MUI . resizeChildren ( panel ) ; <nl> - } . bind ( this ) ) ; <nl> - <nl> - } ) ; <nl> - } <nl> - <nl> - } ) ; <nl> - <nl> - function addResizeRight ( element , min , max ) { <nl> - if ( ! $ ( element ) ) return ; <nl> - element = $ ( element ) ; <nl> - <nl> - var instances = MUI . Columns . instances ; <nl> - var instance = instances . get ( element . id ) ; <nl> - <nl> - var handle = element . getNext ( ' . columnHandle ' ) ; <nl> - handle . setStyle ( ' cursor ' , ( Browser . Engine . webkit | | Browser . Engine . gecko ) ? ' col - resize ' : ' e - resize ' ) ; <nl> - if ( ! min ) min = 50 ; <nl> - if ( ! max ) max = 250 ; <nl> - if ( MUI . ieLegacySupport ) { <nl> - handle . addEvents ( { <nl> - ' mousedown ' : function ( ) { <nl> - handle . setCapture ( ) ; <nl> - } , <nl> - ' mouseup ' : function ( ) { <nl> - handle . releaseCapture ( ) ; <nl> - } <nl> - } ) ; <nl> - } <nl> - instance . resize = element . makeResizable ( { <nl> - handle : handle , <nl> - modifiers : { <nl> - x : ' width ' , <nl> - y : false <nl> - } , <nl> - limit : { <nl> - x : [ min , max ] <nl> - } , <nl> - onStart : function ( ) { <nl> - element . getElements ( ' iframe ' ) . setStyle ( ' visibility ' , ' hidden ' ) ; <nl> - element . getNext ( ' . column ' ) . getElements ( ' iframe ' ) . setStyle ( ' visibility ' , ' hidden ' ) ; <nl> - } . bind ( this ) , <nl> - onDrag : function ( ) { <nl> - MUI . rWidth ( element . getParent ( ) ) ; <nl> - if ( Browser . Engine . trident4 ) { <nl> - element . getChildren ( ) . each ( function ( el ) { <nl> - var width = $ ( element ) . getStyle ( ' width ' ) . toInt ( ) ; <nl> - width - = el . getStyle ( ' margin - right ' ) . toInt ( ) ; <nl> - width - = el . getStyle ( ' margin - left ' ) . toInt ( ) ; <nl> - width - = el . getStyle ( ' padding - right ' ) . toInt ( ) ; <nl> - width - = el . getStyle ( ' padding - left ' ) . toInt ( ) ; <nl> - el . setStyle ( ' width ' , width ) ; <nl> - } . bind ( this ) ) ; <nl> - } <nl> - } . bind ( this ) , <nl> - onComplete : function ( ) { <nl> - MUI . rWidth ( element . getParent ( ) ) ; <nl> - element . getElements ( ' iframe ' ) . setStyle ( ' visibility ' , ' visible ' ) ; <nl> - element . getNext ( ' . column ' ) . getElements ( ' iframe ' ) . setStyle ( ' visibility ' , ' visible ' ) ; <nl> - instance . fireEvent ( ' onResize ' ) ; <nl> - } . bind ( this ) <nl> - } ) ; <nl> - } <nl> - <nl> - function addResizeLeft ( element , min , max ) { <nl> - if ( ! $ ( element ) ) return ; <nl> - element = $ ( element ) ; <nl> - <nl> - var instances = MUI . Columns . instances ; <nl> - var instance = instances . get ( element . id ) ; <nl> - <nl> - var handle = element . getPrevious ( ' . columnHandle ' ) ; <nl> - handle . setStyle ( ' cursor ' , ( Browser . Engine . webkit | | Browser . Engine . gecko ) ? ' col - resize ' : ' e - resize ' ) ; <nl> - var partner = element . getPrevious ( ' . column ' ) ; <nl> - if ( ! min ) min = 50 ; <nl> - if ( ! max ) max = 250 ; <nl> - if ( MUI . ieLegacySupport ) { <nl> - handle . addEvents ( { <nl> - ' mousedown ' : function ( ) { <nl> - handle . setCapture ( ) ; <nl> - } , <nl> - ' mouseup ' : function ( ) { <nl> - handle . releaseCapture ( ) ; <nl> - } <nl> - } ) ; <nl> - } <nl> - instance . resize = element . makeResizable ( { <nl> - handle : handle , <nl> - modifiers : { x : ' width ' , y : false } , <nl> - invert : true , <nl> - limit : { x : [ min , max ] } , <nl> - onStart : function ( ) { <nl> - $ ( element ) . getElements ( ' iframe ' ) . setStyle ( ' visibility ' , ' hidden ' ) ; <nl> - partner . getElements ( ' iframe ' ) . setStyle ( ' visibility ' , ' hidden ' ) ; <nl> - } . bind ( this ) , <nl> - onDrag : function ( ) { <nl> - MUI . rWidth ( element . getParent ( ) ) ; <nl> - } . bind ( this ) , <nl> - onComplete : function ( ) { <nl> - MUI . rWidth ( element . getParent ( ) ) ; <nl> - $ ( element ) . getElements ( ' iframe ' ) . setStyle ( ' visibility ' , ' visible ' ) ; <nl> - partner . getElements ( ' iframe ' ) . setStyle ( ' visibility ' , ' visible ' ) ; <nl> - instance . fireEvent ( ' onResize ' ) ; <nl> - } . bind ( this ) <nl> - } ) ; <nl> - } <nl> - <nl> - function addResizeBottom ( element ) { <nl> - if ( ! $ ( element ) ) return ; <nl> - var element = $ ( element ) ; <nl> - <nl> - var instances = MUI . Panels . instances ; <nl> - var instance = instances . get ( element . id ) ; <nl> - var handle = instance . handleEl ; <nl> - handle . setStyle ( ' cursor ' , ( Browser . Engine . webkit | | Browser . Engine . gecko ) ? ' row - resize ' : ' n - resize ' ) ; <nl> - partner = instance . partner ; <nl> - min = 0 ; <nl> - max = function ( ) { <nl> - return element . getStyle ( ' height ' ) . toInt ( ) + partner . getStyle ( ' height ' ) . toInt ( ) ; <nl> - } . bind ( this ) ; <nl> - <nl> - if ( MUI . ieLegacySupport ) { <nl> - handle . addEvents ( { <nl> - ' mousedown ' : function ( ) { <nl> - handle . setCapture ( ) ; <nl> - } , <nl> - ' mouseup ' : function ( ) { <nl> - handle . releaseCapture ( ) ; <nl> - } <nl> - } ) ; <nl> - } <nl> - instance . resize = element . makeResizable ( { <nl> - handle : handle , <nl> - modifiers : { x : false , y : ' height ' } , <nl> - limit : { y : [ min , max ] } , <nl> - invert : false , <nl> - onBeforeStart : function ( ) { <nl> - partner = instance . partner ; <nl> - this . originalHeight = element . getStyle ( ' height ' ) . toInt ( ) ; <nl> - this . partnerOriginalHeight = partner . getStyle ( ' height ' ) . toInt ( ) ; <nl> - } . bind ( this ) , <nl> - onStart : function ( ) { <nl> - if ( instance . iframeEl ) { <nl> - if ( ! MUI . ieLegacySupport ) { <nl> - instance . iframeEl . setStyle ( ' visibility ' , ' hidden ' ) ; <nl> - partner . getElements ( ' iframe ' ) . setStyle ( ' visibility ' , ' hidden ' ) ; <nl> - } <nl> - else { <nl> - instance . iframeEl . hide ( ) ; <nl> - partner . getElements ( ' iframe ' ) . hide ( ) ; <nl> - } <nl> - } <nl> - <nl> - } . bind ( this ) , <nl> - onDrag : function ( ) { <nl> - partnerHeight = partnerOriginalHeight ; <nl> - partnerHeight + = ( this . originalHeight - element . getStyle ( ' height ' ) . toInt ( ) ) ; <nl> - partner . setStyle ( ' height ' , partnerHeight ) ; <nl> - MUI . resizeChildren ( element , element . getStyle ( ' height ' ) . toInt ( ) ) ; <nl> - MUI . resizeChildren ( partner , partnerHeight ) ; <nl> - element . getChildren ( ' . column ' ) . each ( function ( column ) { <nl> - MUI . panelHeight ( column ) ; <nl> - } ) ; <nl> - partner . getChildren ( ' . column ' ) . each ( function ( column ) { <nl> - MUI . panelHeight ( column ) ; <nl> - } ) ; <nl> - } . bind ( this ) , <nl> - onComplete : function ( ) { <nl> - partnerHeight = partnerOriginalHeight ; <nl> - partnerHeight + = ( this . originalHeight - element . getStyle ( ' height ' ) . toInt ( ) ) ; <nl> - partner . setStyle ( ' height ' , partnerHeight ) ; <nl> - MUI . resizeChildren ( element , element . getStyle ( ' height ' ) . toInt ( ) ) ; <nl> - MUI . resizeChildren ( partner , partnerHeight ) ; <nl> - element . getChildren ( ' . column ' ) . each ( function ( column ) { <nl> - MUI . panelHeight ( column ) ; <nl> - } ) ; <nl> - partner . getChildren ( ' . column ' ) . each ( function ( column ) { <nl> - MUI . panelHeight ( column ) ; <nl> - } ) ; <nl> - if ( instance . iframeEl ) { <nl> - if ( ! MUI . ieLegacySupport ) { <nl> - instance . iframeEl . setStyle ( ' visibility ' , ' visible ' ) ; <nl> - partner . getElements ( ' iframe ' ) . setStyle ( ' visibility ' , ' visible ' ) ; <nl> - } <nl> - else { <nl> - instance . iframeEl . show ( ) ; <nl> - partner . getElements ( ' iframe ' ) . show ( ) ; <nl> - / / The following hack is to get IE8 Standards Mode to properly resize an iframe <nl> - / / when only the vertical dimension is changed . <nl> - var width = instance . iframeEl . getStyle ( ' width ' ) . toInt ( ) ; <nl> - instance . iframeEl . setStyle ( ' width ' , width - 1 ) ; <nl> - MUI . rWidth ( ) ; <nl> - instance . iframeEl . setStyle ( ' width ' , width ) ; <nl> - } <nl> - } <nl> - instance . fireEvent ( ' onResize ' ) ; <nl> - } . bind ( this ) <nl> - } ) ; <nl> - } <nl> - <nl> - MUI . extend ( { <nl> - / * <nl> - <nl> - Function : closeColumn <nl> - Destroys / removes a column . <nl> - <nl> - Syntax : <nl> - ( start code ) <nl> - MUI . closeColumn ( ) ; <nl> - ( end ) <nl> - <nl> - Arguments : <nl> - columnEl - the ID of the column to be closed <nl> - <nl> - Returns : <nl> - true - the column was closed <nl> - false - the column was not closed <nl> - <nl> - * / <nl> - closeColumn : function ( columnEl ) { <nl> - var instances = MUI . Columns . instances ; <nl> - var instance = instances . get ( columnEl . id ) ; <nl> - if ( columnEl ! = $ ( columnEl ) | | instance . isClosing ) return ; <nl> - <nl> - instance . isClosing = true ; <nl> - <nl> - if ( instance . options . sortable ) { <nl> - instance . container . retrieve ( ' sortables ' ) . removeLists ( this . columnEl ) ; <nl> - } <nl> - <nl> - / / Destroy all the panels in the column . <nl> - var panels = columnEl . getChildren ( ' . panel ' ) ; <nl> - panels . each ( function ( panel ) { <nl> - MUI . closePanel ( $ ( panel . id ) ) ; <nl> - } . bind ( this ) ) ; <nl> - <nl> - if ( MUI . ieLegacySupport ) { <nl> - columnEl . dispose ( ) ; <nl> - if ( instance . handleEl ! = null ) { <nl> - instance . handleEl . dispose ( ) ; <nl> - } <nl> - } <nl> - else { <nl> - columnEl . destroy ( ) ; <nl> - if ( instance . handleEl ! = null ) { <nl> - instance . handleEl . destroy ( ) ; <nl> - } <nl> - } <nl> - if ( MUI . Desktop ) { <nl> - MUI . Desktop . resizePanels ( ) ; <nl> - } <nl> - instances . erase ( instance . options . id ) ; <nl> - return true ; <nl> - } , <nl> - / * <nl> - <nl> - Function : closePanel <nl> - Destroys / removes a panel . <nl> - <nl> - Syntax : <nl> - ( start code ) <nl> - MUI . closePanel ( ) ; <nl> - ( end ) <nl> - <nl> - Arguments : <nl> - panelEl - the ID of the panel to be closed <nl> - <nl> - Returns : <nl> - true - the panel was closed <nl> - false - the panel was not closed <nl> - <nl> - * / <nl> - closePanel : function ( panelEl ) { <nl> - var instances = MUI . Panels . instances ; <nl> - var instance = instances . get ( panelEl . id ) ; <nl> - if ( panelEl ! = $ ( panelEl ) | | instance . isClosing ) return ; <nl> - <nl> - var column = instance . options . column ; <nl> - <nl> - instance . isClosing = true ; <nl> - <nl> - var columnInstances = MUI . Columns . instances ; <nl> - var columnInstance = columnInstances . get ( column ) ; <nl> - <nl> - if ( columnInstance . options . sortable ) { <nl> - columnInstance . options . container . retrieve ( ' sortables ' ) . removeItems ( instance . panelWrapperEl ) ; <nl> - } <nl> - <nl> - instance . panelWrapperEl . destroy ( ) ; <nl> - <nl> - if ( MUI . Desktop ) { <nl> - MUI . Desktop . resizePanels ( ) ; <nl> - } <nl> - <nl> - / / Do this when creating and removing panels <nl> - $ ( column ) . getChildren ( ' . panelWrapper ' ) . each ( function ( panelWrapper ) { <nl> - panelWrapper . getElement ( ' . panel ' ) . removeClass ( ' bottomPanel ' ) ; <nl> - } ) ; <nl> - $ ( column ) . getChildren ( ' . panelWrapper ' ) . getLast ( ) . getElement ( ' . panel ' ) . addClass ( ' bottomPanel ' ) ; <nl> - <nl> - instances . erase ( instance . options . id ) ; <nl> - return true ; <nl> - <nl> - } <nl> - } ) ; <nl> - / * <nl> - <nl> - Script : Dock . js <nl> - Implements the dock / taskbar . Enables window minimize . <nl> - <nl> - Copyright : <nl> - Copyright ( c ) 2007 - 2009 Greg Houston , < http : / / greghoustondesign . com / > . <nl> - <nl> - License : <nl> - MIT - style license . <nl> - <nl> - Requires : <nl> - Core . js , Window . js , Layout . js <nl> - <nl> - Todo : <nl> - - Make it so the dock requires no initial html markup . <nl> - <nl> - * / <nl> - <nl> - MUI . files [ MUI . path . source + ' Layout / Dock . js ' ] = ' loaded ' ; <nl> - <nl> - MUI . options . extend ( { <nl> - / / Naming options : <nl> - / / If you change the IDs of the Mocha Desktop containers in your HTML , you need to change them here as well . <nl> - dockWrapper : ' dockWrapper ' , <nl> - dock : ' dock ' <nl> - } ) ; <nl> - <nl> - MUI . extend ( { <nl> - / * <nl> - <nl> - Function : minimizeAll <nl> - Minimize all windows that are minimizable . <nl> - <nl> - * / <nl> - minimizeAll : function ( ) { <nl> - $ $ ( ' . mocha ' ) . each ( function ( windowEl ) { <nl> - var instance = windowEl . retrieve ( ' instance ' ) ; <nl> - if ( ! instance . isMinimized & & instance . options . minimizable = = true ) { <nl> - MUI . Dock . minimizeWindow ( windowEl ) ; <nl> - } <nl> - } . bind ( this ) ) ; <nl> - } <nl> - } ) ; <nl> - <nl> - MUI . Dock = { <nl> - <nl> - options : { <nl> - useControls : true , / / Toggles autohide and dock placement controls . <nl> - dockPosition : ' bottom ' , / / Position the dock starts in , top or bottom . <nl> - / / Style options <nl> - trueButtonColor : [ 70 , 245 , 70 ] , / / Color for autohide on <nl> - enabledButtonColor : [ 115 , 153 , 191 ] , <nl> - disabledButtonColor : [ 170 , 170 , 170 ] <nl> - } , <nl> - <nl> - initialize : function ( options ) { <nl> - / / Stops if MUI . Desktop is not implemented <nl> - if ( ! MUI . Desktop ) return ; <nl> - <nl> - MUI . dockVisible = true ; <nl> - this . dockWrapper = $ ( MUI . options . dockWrapper ) ; <nl> - this . dock = $ ( MUI . options . dock ) ; <nl> - this . autoHideEvent = null ; <nl> - this . dockAutoHide = false ; / / True when dock autohide is set to on , false if set to off <nl> - <nl> - if ( ! this . dockWrapper ) return ; <nl> - <nl> - if ( ! this . options . useControls ) { <nl> - if ( $ ( ' dockPlacement ' ) ) { <nl> - $ ( ' dockPlacement ' ) . setStyle ( ' cursor ' , ' default ' ) ; <nl> - } <nl> - if ( $ ( ' dockAutoHide ' ) ) { <nl> - $ ( ' dockAutoHide ' ) . setStyle ( ' cursor ' , ' default ' ) ; <nl> - } <nl> - } <nl> - <nl> - this . dockWrapper . setStyles ( { <nl> - ' display ' : ' block ' , <nl> - ' position ' : ' absolute ' , <nl> - ' top ' : null , <nl> - ' bottom ' : MUI . Desktop . desktopFooter ? MUI . Desktop . desktopFooter . offsetHeight : 0 , <nl> - ' left ' : 0 <nl> - } ) ; <nl> - <nl> - if ( this . options . useControls ) { <nl> - this . initializeDockControls ( ) ; <nl> - } <nl> - <nl> - / / Add check mark to menu if link exists in menu <nl> - if ( $ ( ' dockLinkCheck ' ) ) { <nl> - this . sidebarCheck = new Element ( ' div ' , { <nl> - ' class ' : ' check ' , <nl> - ' id ' : ' dock_check ' <nl> - } ) . inject ( $ ( ' dockLinkCheck ' ) ) ; <nl> - } <nl> - <nl> - this . dockSortables = new Sortables ( ' # dockSort ' , { <nl> - opacity : 1 , <nl> - constrain : true , <nl> - clone : false , <nl> - revert : false <nl> - } ) ; <nl> - <nl> - MUI . Desktop . setDesktopSize ( ) ; <nl> - <nl> - if ( MUI . myChain ) { <nl> - MUI . myChain . callChain ( ) ; <nl> - } <nl> - <nl> - } , <nl> - <nl> - initializeDockControls : function ( ) { <nl> - <nl> - / / Convert CSS colors to Canvas colors . <nl> - this . setDockColors ( ) ; <nl> - <nl> - if ( this . options . useControls ) { <nl> - / / Insert canvas <nl> - var canvas = new Element ( ' canvas ' , { <nl> - ' id ' : ' dockCanvas ' , <nl> - ' width ' : ' 15 ' , <nl> - ' height ' : ' 18 ' <nl> - } ) . inject ( this . dock ) ; <nl> - <nl> - / / Dynamically initialize canvas using excanvas . This is only required by IE <nl> - if ( MUI . ieLegacySupport & & MUI . ieSupport = = ' excanvas ' ) { <nl> - G_vmlCanvasManager . initElement ( canvas ) ; <nl> - } <nl> - } <nl> - <nl> - var dockPlacement = $ ( ' dockPlacement ' ) ; <nl> - var dockAutoHide = $ ( ' dockAutoHide ' ) ; <nl> - <nl> - / / Position top or bottom selector <nl> - dockPlacement . setProperty ( ' title ' , ' Position Dock Top ' ) ; <nl> - <nl> - / / Attach event <nl> - dockPlacement . addEvent ( ' click ' , function ( ) { <nl> - this . moveDock ( ) ; <nl> - } . bind ( this ) ) ; <nl> - <nl> - / / Auto Hide toggle switch <nl> - dockAutoHide . setProperty ( ' title ' , ' Turn Auto Hide On ' ) ; <nl> - <nl> - / / Attach event Auto Hide <nl> - dockAutoHide . addEvent ( ' click ' , function ( event ) { <nl> - if ( this . dockWrapper . getProperty ( ' dockPosition ' ) = = ' top ' ) <nl> - return false ; <nl> - <nl> - var ctx = $ ( ' dockCanvas ' ) . getContext ( ' 2d ' ) ; <nl> - this . dockAutoHide = ! this . dockAutoHide ; / / Toggle <nl> - if ( this . dockAutoHide ) { <nl> - $ ( ' dockAutoHide ' ) . setProperty ( ' title ' , ' Turn Auto Hide Off ' ) ; <nl> - / / ctx . clearRect ( 0 , 11 , 100 , 100 ) ; <nl> - MUI . circle ( ctx , 5 , 14 , 3 , this . options . trueButtonColor , 1 . 0 ) ; <nl> - <nl> - / / Define event <nl> - this . autoHideEvent = function ( event ) { <nl> - if ( ! this . dockAutoHide ) <nl> - return ; <nl> - if ( ! MUI . Desktop . desktopFooter ) { <nl> - var dockHotspotHeight = this . dockWrapper . offsetHeight ; <nl> - if ( dockHotspotHeight < 25 ) dockHotspotHeight = 25 ; <nl> - } <nl> - else if ( MUI . Desktop . desktopFooter ) { <nl> - var dockHotspotHeight = this . dockWrapper . offsetHeight + MUI . Desktop . desktopFooter . offsetHeight ; <nl> - if ( dockHotspotHeight < 25 ) dockHotspotHeight = 25 ; <nl> - } <nl> - if ( ! MUI . Desktop . desktopFooter & & event . client . y > ( document . getCoordinates ( ) . height - dockHotspotHeight ) ) { <nl> - if ( ! MUI . dockVisible ) { <nl> - this . dockWrapper . show ( ) ; <nl> - MUI . dockVisible = true ; <nl> - MUI . Desktop . setDesktopSize ( ) ; <nl> - } <nl> - } <nl> - else if ( MUI . Desktop . desktopFooter & & event . client . y > ( document . getCoordinates ( ) . height - dockHotspotHeight ) ) { <nl> - if ( ! MUI . dockVisible ) { <nl> - this . dockWrapper . show ( ) ; <nl> - MUI . dockVisible = true ; <nl> - MUI . Desktop . setDesktopSize ( ) ; <nl> - } <nl> - } <nl> - else if ( MUI . dockVisible ) { <nl> - this . dockWrapper . hide ( ) ; <nl> - MUI . dockVisible = false ; <nl> - MUI . Desktop . setDesktopSize ( ) ; <nl> - <nl> - } <nl> - } . bind ( this ) ; <nl> - <nl> - / / Add event <nl> - document . addEvent ( ' mousemove ' , this . autoHideEvent ) ; <nl> - <nl> - } else { <nl> - $ ( ' dockAutoHide ' ) . setProperty ( ' title ' , ' Turn Auto Hide On ' ) ; <nl> - / / ctx . clearRect ( 0 , 11 , 100 , 100 ) ; <nl> - MUI . circle ( ctx , 5 , 14 , 3 , this . options . enabledButtonColor , 1 . 0 ) ; <nl> - / / Remove event <nl> - document . removeEvent ( ' mousemove ' , this . autoHideEvent ) ; <nl> - } <nl> - <nl> - } . bind ( this ) ) ; <nl> - <nl> - this . renderDockControls ( ) ; <nl> - <nl> - if ( this . options . dockPosition = = ' top ' ) { <nl> - this . moveDock ( ) ; <nl> - } <nl> - <nl> - } , <nl> - <nl> - setDockColors : function ( ) { <nl> - var dockButtonEnabled = MUI . getCSSRule ( ' . dockButtonEnabled ' ) ; <nl> - if ( dockButtonEnabled & & dockButtonEnabled . style . backgroundColor ) { <nl> - this . options . enabledButtonColor = new Color ( dockButtonEnabled . style . backgroundColor ) ; <nl> - } <nl> - <nl> - var dockButtonDisabled = MUI . getCSSRule ( ' . dockButtonDisabled ' ) ; <nl> - if ( dockButtonDisabled & & dockButtonDisabled . style . backgroundColor ) { <nl> - this . options . disabledButtonColor = new Color ( dockButtonDisabled . style . backgroundColor ) ; <nl> - } <nl> - <nl> - var trueButtonColor = MUI . getCSSRule ( ' . dockButtonTrue ' ) ; <nl> - if ( trueButtonColor & & trueButtonColor . style . backgroundColor ) { <nl> - this . options . trueButtonColor = new Color ( trueButtonColor . style . backgroundColor ) ; <nl> - } <nl> - } , <nl> - <nl> - renderDockControls : function ( ) { <nl> - / / Draw dock controls <nl> - var ctx = $ ( ' dockCanvas ' ) . getContext ( ' 2d ' ) ; <nl> - ctx . clearRect ( 0 , 0 , 100 , 100 ) ; <nl> - MUI . circle ( ctx , 5 , 4 , 3 , this . options . enabledButtonColor , 1 . 0 ) ; <nl> - <nl> - if ( this . dockWrapper . getProperty ( ' dockPosition ' ) = = ' top ' ) { <nl> - MUI . circle ( ctx , 5 , 14 , 3 , this . options . disabledButtonColor , 1 . 0 ) <nl> - } <nl> - else if ( this . dockAutoHide ) { <nl> - MUI . circle ( ctx , 5 , 14 , 3 , this . options . trueButtonColor , 1 . 0 ) ; <nl> - } <nl> - else { <nl> - MUI . circle ( ctx , 5 , 14 , 3 , this . options . enabledButtonColor , 1 . 0 ) ; <nl> - } <nl> - } , <nl> - <nl> - moveDock : function ( ) { <nl> - var ctx = $ ( ' dockCanvas ' ) . getContext ( ' 2d ' ) ; <nl> - / / Move dock to top position <nl> - if ( this . dockWrapper . getStyle ( ' position ' ) ! = ' relative ' ) { <nl> - this . dockWrapper . setStyles ( { <nl> - ' position ' : ' relative ' , <nl> - ' bottom ' : null <nl> - } ) ; <nl> - this . dockWrapper . addClass ( ' top ' ) ; <nl> - MUI . Desktop . setDesktopSize ( ) ; <nl> - this . dockWrapper . setProperty ( ' dockPosition ' , ' top ' ) ; <nl> - ctx . clearRect ( 0 , 0 , 100 , 100 ) ; <nl> - MUI . circle ( ctx , 5 , 4 , 3 , this . options . enabledButtonColor , 1 . 0 ) ; <nl> - MUI . circle ( ctx , 5 , 14 , 3 , this . options . disabledButtonColor , 1 . 0 ) ; <nl> - $ ( ' dockPlacement ' ) . setProperty ( ' title ' , ' Position Dock Bottom ' ) ; <nl> - $ ( ' dockAutoHide ' ) . setProperty ( ' title ' , ' Auto Hide Disabled in Top Dock Position ' ) ; <nl> - this . dockAutoHide = false ; <nl> - } <nl> - / / Move dock to bottom position <nl> - else { <nl> - this . dockWrapper . setStyles ( { <nl> - ' position ' : ' absolute ' , <nl> - ' bottom ' : MUI . Desktop . desktopFooter ? MUI . Desktop . desktopFooter . offsetHeight : 0 <nl> - } ) ; <nl> - this . dockWrapper . removeClass ( ' top ' ) ; <nl> - MUI . Desktop . setDesktopSize ( ) ; <nl> - this . dockWrapper . setProperty ( ' dockPosition ' , ' bottom ' ) ; <nl> - ctx . clearRect ( 0 , 0 , 100 , 100 ) ; <nl> - MUI . circle ( ctx , 5 , 4 , 3 , this . options . enabledButtonColor , 1 . 0 ) ; <nl> - MUI . circle ( ctx , 5 , 14 , 3 , this . options . enabledButtonColor , 1 . 0 ) ; <nl> - $ ( ' dockPlacement ' ) . setProperty ( ' title ' , ' Position Dock Top ' ) ; <nl> - $ ( ' dockAutoHide ' ) . setProperty ( ' title ' , ' Turn Auto Hide On ' ) ; <nl> - } <nl> - } , <nl> - <nl> - createDockTab : function ( windowEl ) { <nl> - <nl> - var instance = windowEl . retrieve ( ' instance ' ) ; <nl> - <nl> - var dockTab = new Element ( ' div ' , { <nl> - ' id ' : instance . options . id + ' _dockTab ' , <nl> - ' class ' : ' dockTab ' , <nl> - ' title ' : titleText <nl> - } ) . inject ( $ ( ' dockClear ' ) , ' before ' ) ; <nl> - <nl> - dockTab . addEvent ( ' mousedown ' , function ( e ) { <nl> - new Event ( e ) . stop ( ) ; <nl> - this . timeDown = $ time ( ) ; <nl> - } ) ; <nl> - <nl> - dockTab . addEvent ( ' mouseup ' , function ( e ) { <nl> - this . timeUp = $ time ( ) ; <nl> - if ( ( this . timeUp - this . timeDown ) < 275 ) { <nl> - / / If the visibility of the windows on the page are toggled off , toggle visibility on . <nl> - if ( MUI . Windows . windowsVisible = = false ) { <nl> - MUI . toggleWindowVisibility ( ) ; <nl> - if ( instance . isMinimized = = true ) { <nl> - MUI . Dock . restoreMinimized . delay ( 25 , MUI . Dock , windowEl ) ; <nl> - } <nl> - else { <nl> - MUI . focusWindow ( windowEl ) ; <nl> - } <nl> - return ; <nl> - } <nl> - / / If window is minimized , restore window . <nl> - if ( instance . isMinimized = = true ) { <nl> - MUI . Dock . restoreMinimized . delay ( 25 , MUI . Dock , windowEl ) ; <nl> - } <nl> - else { <nl> - / / If window is not minimized and is focused , minimize window . <nl> - if ( instance . windowEl . hasClass ( ' isFocused ' ) & & instance . options . minimizable = = true ) { <nl> - MUI . Dock . minimizeWindow ( windowEl ) <nl> - } <nl> - / / If window is not minimized and is not focused , focus window . <nl> - else { <nl> - MUI . focusWindow ( windowEl ) ; <nl> - } <nl> - / / if the window is not minimized and is outside the viewport , center it in the viewport . <nl> - var coordinates = document . getCoordinates ( ) ; <nl> - if ( windowEl . getStyle ( ' left ' ) . toInt ( ) > coordinates . width | | windowEl . getStyle ( ' top ' ) . toInt ( ) > coordinates . height ) { <nl> - MUI . centerWindow ( windowEl ) ; <nl> - } <nl> - } <nl> - } <nl> - } ) ; <nl> - <nl> - this . dockSortables . addItems ( dockTab ) ; <nl> - <nl> - var titleText = instance . titleEl . innerHTML ; <nl> - <nl> - var dockTabText = new Element ( ' div ' , { <nl> - ' id ' : instance . options . id + ' _dockTabText ' , <nl> - ' class ' : ' dockText ' <nl> - } ) . set ( ' html ' , titleText . substring ( 0 , 19 ) + ( titleText . length > 19 ? ' . . . ' : ' ' ) ) . inject ( $ ( dockTab ) ) ; <nl> - <nl> - / / If I implement this again , will need to also adjust the titleText truncate and the tab ' s <nl> - / / left padding . <nl> - if ( instance . options . icon ! = false ) { <nl> - / / dockTabText . setStyle ( ' background ' , ' url ( ' + instance . options . icon + ' ) 4px 4px no - repeat ' ) ; <nl> - } <nl> - <nl> - / / Need to resize everything in case the dock wraps when a new tab is added <nl> - MUI . Desktop . setDesktopSize ( ) ; <nl> - <nl> - } , <nl> - <nl> - makeActiveTab : function ( ) { <nl> - <nl> - / / getWindowWith HighestZindex is used in case the currently focused window <nl> - / / is closed . <nl> - var windowEl = MUI . getWindowWithHighestZindex ( ) ; <nl> - var instance = windowEl . retrieve ( ' instance ' ) ; <nl> - <nl> - $ $ ( ' . dockTab ' ) . removeClass ( ' activeDockTab ' ) ; <nl> - if ( instance . isMinimized ! = true ) { <nl> - <nl> - instance . windowEl . addClass ( ' isFocused ' ) ; <nl> - <nl> - var currentButton = $ ( instance . options . id + ' _dockTab ' ) ; <nl> - if ( currentButton ! = null ) { <nl> - currentButton . addClass ( ' activeDockTab ' ) ; <nl> - } <nl> - } <nl> - else { <nl> - instance . windowEl . removeClass ( ' isFocused ' ) ; <nl> - } <nl> - } , <nl> - <nl> - minimizeWindow : function ( windowEl ) { <nl> - if ( windowEl ! = $ ( windowEl ) ) return ; <nl> - <nl> - var instance = windowEl . retrieve ( ' instance ' ) ; <nl> - instance . isMinimized = true ; <nl> - <nl> - / / Hide iframe <nl> - / / Iframe should be hidden when minimizing , maximizing , and moving for performance and Flash issues <nl> - if ( instance . iframeEl ) { <nl> - / / Some elements are still visible in IE8 in the iframe when the iframe ' s visibility is set to hidden . <nl> - if ( ! MUI . ieLegacySupport ) { <nl> - instance . iframeEl . setStyle ( ' visibility ' , ' hidden ' ) ; <nl> - } <nl> - else { <nl> - instance . iframeEl . hide ( ) ; <nl> - } <nl> - } <nl> - <nl> - / / Hide window and add to dock <nl> - instance . contentBorderEl . setStyle ( ' visibility ' , ' hidden ' ) ; <nl> - if ( instance . toolbarWrapperEl ) { <nl> - instance . toolbarWrapperEl . hide ( ) ; <nl> - } <nl> - windowEl . setStyle ( ' visibility ' , ' hidden ' ) ; <nl> - <nl> - MUI . Desktop . setDesktopSize ( ) ; <nl> - <nl> - / / Have to use timeout because window gets focused when you click on the minimize button <nl> - setTimeout ( function ( ) { <nl> - windowEl . setStyle ( ' zIndex ' , 1 ) ; <nl> - windowEl . removeClass ( ' isFocused ' ) ; <nl> - this . makeActiveTab ( ) ; <nl> - } . bind ( this ) , 100 ) ; <nl> - <nl> - instance . fireEvent ( ' onMinimize ' , windowEl ) ; <nl> - } , <nl> - <nl> - restoreMinimized : function ( windowEl ) { <nl> - <nl> - var instance = windowEl . retrieve ( ' instance ' ) ; <nl> - <nl> - if ( instance . isMinimized = = false ) return ; <nl> - <nl> - if ( MUI . Windows . windowsVisible = = false ) { <nl> - MUI . toggleWindowVisibility ( ) ; <nl> - } <nl> - <nl> - MUI . Desktop . setDesktopSize ( ) ; <nl> - <nl> - / / Part of Mac FF2 scrollbar fix <nl> - if ( instance . options . scrollbars = = true & & ! instance . iframeEl ) { <nl> - instance . contentWrapperEl . setStyle ( ' overflow ' , ' auto ' ) ; <nl> - } <nl> - <nl> - if ( instance . isCollapsed ) { <nl> - MUI . collapseToggle ( windowEl ) ; <nl> - } <nl> - <nl> - windowEl . setStyle ( ' visibility ' , ' visible ' ) ; <nl> - instance . contentBorderEl . setStyle ( ' visibility ' , ' visible ' ) ; <nl> - if ( instance . toolbarWrapperEl ) { <nl> - instance . toolbarWrapperEl . show ( ) ; <nl> - } <nl> - <nl> - / / Show iframe <nl> - if ( instance . iframeEl ) { <nl> - if ( ! MUI . ieLegacySupport ) { <nl> - instance . iframeEl . setStyle ( ' visibility ' , ' visible ' ) ; <nl> - } <nl> - else { <nl> - instance . iframeEl . show ( ) ; <nl> - } <nl> - } <nl> - <nl> - instance . isMinimized = false ; <nl> - MUI . focusWindow ( windowEl ) ; <nl> - instance . fireEvent ( ' onRestore ' , windowEl ) ; <nl> - <nl> - } <nl> - } ; <nl> - / * <nl> - <nl> - Script : Workspaces . js <nl> - Save and load workspaces . The Workspaces emulate Adobe Illustrator functionality remembering what windows are open and where they are positioned . <nl> - <nl> - Copyright : <nl> - Copyright ( c ) 2007 - 2009 Greg Houston , < http : / / greghoustondesign . com / > . <nl> - <nl> - License : <nl> - MIT - style license . <nl> - <nl> - Requires : <nl> - Core . js , Window . js <nl> - <nl> - To do : <nl> - - Move to Window <nl> - <nl> - * / <nl> - <nl> - MUI . files [ MUI . path . source + ' Layout / Workspaces . js ' ] = ' loaded ' ; <nl> - <nl> - MUI . extend ( { <nl> - / * <nl> - <nl> - Function : saveWorkspace <nl> - Save the current workspace . <nl> - <nl> - Syntax : <nl> - ( start code ) <nl> - MUI . saveWorkspace ( ) ; <nl> - ( end ) <nl> - <nl> - Notes : <nl> - This version saves the ID of each open window to a cookie , and reloads those windows using the functions in mocha - init . js . This requires that each window have a function in mocha - init . js used to open them . Functions must be named the windowID + " Window " . So if your window is called mywindow , it needs a function called mywindowWindow in mocha - init . js . <nl> - <nl> - * / <nl> - saveWorkspace : function ( ) { <nl> - this . cookie = new Hash . Cookie ( ' mochaUIworkspaceCookie ' , { duration : 3600 } ) ; <nl> - this . cookie . empty ( ) ; <nl> - MUI . Windows . instances . each ( function ( instance ) { <nl> - instance . saveValues ( ) ; <nl> - this . cookie . set ( instance . options . id , { <nl> - ' id ' : instance . options . id , <nl> - ' top ' : instance . options . y , <nl> - ' left ' : instance . options . x , <nl> - ' width ' : instance . contentWrapperEl . getStyle ( ' width ' ) . toInt ( ) , <nl> - ' height ' : instance . contentWrapperEl . getStyle ( ' height ' ) . toInt ( ) <nl> - } ) ; <nl> - } . bind ( this ) ) ; <nl> - this . cookie . save ( ) ; <nl> - <nl> - new MUI . Window ( { <nl> - loadMethod : ' html ' , <nl> - type : ' notification ' , <nl> - addClass : ' notification ' , <nl> - content : ' Workspace saved . ' , <nl> - closeAfter : ' 1400 ' , <nl> - width : 200 , <nl> - height : 40 , <nl> - y : 53 , <nl> - padding : { top : 10 , right : 12 , bottom : 10 , left : 12 } , <nl> - shadowBlur : 5 , <nl> - bodyBgColor : [ 255 , 255 , 255 ] <nl> - } ) ; <nl> - <nl> - } , <nl> - windowUnload : function ( ) { <nl> - if ( $ $ ( ' . mocha ' ) . length = = 0 & & this . myChain ) { <nl> - this . myChain . callChain ( ) ; <nl> - } <nl> - } , <nl> - loadWorkspace2 : function ( workspaceWindows ) { <nl> - workspaceWindows . each ( function ( workspaceWindow ) { <nl> - windowFunction = eval ( ' MUI . ' + workspaceWindow . id + ' Window ' ) ; <nl> - if ( windowFunction ) { <nl> - eval ( ' MUI . ' + workspaceWindow . id + ' Window ( { width : ' + workspaceWindow . width + ' , height : ' + workspaceWindow . height + ' } ) ; ' ) ; <nl> - var windowEl = $ ( workspaceWindow . id ) ; <nl> - windowEl . setStyles ( { <nl> - ' top ' : workspaceWindow . top , <nl> - ' left ' : workspaceWindow . left <nl> - } ) ; <nl> - var instance = windowEl . retrieve ( ' instance ' ) ; <nl> - instance . contentWrapperEl . setStyles ( { <nl> - ' width ' : workspaceWindow . width , <nl> - ' height ' : workspaceWindow . height <nl> - } ) ; <nl> - instance . drawWindow ( ) ; <nl> - } <nl> - } . bind ( this ) ) ; <nl> - this . loadingWorkspace = false ; <nl> - } , <nl> - / * <nl> - <nl> - Function : loadWorkspace <nl> - Load the saved workspace . <nl> - <nl> - Syntax : <nl> - ( start code ) <nl> - MUI . loadWorkspace ( ) ; <nl> - ( end ) <nl> - <nl> - * / <nl> - loadWorkspace : function ( ) { <nl> - cookie = new Hash . Cookie ( ' mochaUIworkspaceCookie ' , { duration : 3600 } ) ; <nl> - workspaceWindows = cookie . load ( ) ; <nl> - <nl> - if ( ! cookie . getKeys ( ) . length ) { <nl> - new MUI . Window ( { <nl> - loadMethod : ' html ' , <nl> - type : ' notification ' , <nl> - addClass : ' notification ' , <nl> - content : ' You have no saved workspace . ' , <nl> - closeAfter : ' 1400 ' , <nl> - width : 220 , <nl> - height : 40 , <nl> - y : 25 , <nl> - padding : { top : 10 , right : 12 , bottom : 10 , left : 12 } , <nl> - shadowBlur : 5 , <nl> - bodyBgColor : [ 255 , 255 , 255 ] <nl> - } ) ; <nl> - return ; <nl> - } <nl> - <nl> - if ( $ $ ( ' . mocha ' ) . length ! = 0 ) { <nl> - this . loadingWorkspace = true ; <nl> - this . myChain = new Chain ( ) ; <nl> - this . myChain . chain ( <nl> - function ( ) { <nl> - $ $ ( ' . mocha ' ) . each ( function ( el ) { <nl> - this . closeWindow ( el ) ; <nl> - } . bind ( this ) ) ; <nl> - } . bind ( this ) , <nl> - function ( ) { <nl> - this . loadWorkspace2 ( workspaceWindows ) ; <nl> - } . bind ( this ) <nl> - ) ; <nl> - this . myChain . callChain ( ) ; <nl> - } <nl> - else { <nl> - this . loadWorkspace2 ( workspaceWindows ) ; <nl> - } <nl> - <nl> - } <nl> - } ) ; <nl> mmm a / src / webui / www / private / setlocation . html <nl> ppp b / src / webui / www / private / setlocation . html <nl> <nl> < meta charset = " UTF - 8 " / > <nl> < title > QBT_TR ( Set location ) QBT_TR [ CONTEXT = HttpServer ] < / title > <nl> < link rel = " stylesheet " href = " css / style . css " type = " text / css " / > <nl> - < script src = " scripts / mootools - 1 . 2 - core - yc . js " > < / script > <nl> - < script src = " scripts / mootools - 1 . 2 - more . js " > < / script > <nl> + < script src = " scripts / lib / mootools - 1 . 2 - core - yc . js " > < / script > <nl> + < script src = " scripts / lib / mootools - 1 . 2 - more . js " > < / script > <nl> < script > <nl> var setLocationKeyboardEvents = new Keyboard ( { <nl> defaultEventType : ' keydown ' , <nl> mmm a / src / webui / www / private / upload . html <nl> ppp b / src / webui / www / private / upload . html <nl> <nl> < title > QBT_TR ( Upload local torrent ) QBT_TR [ CONTEXT = HttpServer ] < / title > <nl> < link rel = " stylesheet " href = " css / style . css " type = " text / css " / > <nl> < link rel = " stylesheet " href = " css / Window . css " type = " text / css " / > <nl> - < script src = " scripts / mootools - 1 . 2 - core - yc . js " > < / script > <nl> + < script src = " scripts / lib / mootools - 1 . 2 - core - yc . js " > < / script > <nl> < script src = " scripts / download . js " > < / script > <nl> < / head > <nl> < body > <nl> mmm a / src / webui / www / private / uploadlimit . html <nl> ppp b / src / webui / www / private / uploadlimit . html <nl> <nl> < meta charset = " UTF - 8 " / > <nl> < title > QBT_TR ( Torrent Upload Speed Limiting ) QBT_TR [ CONTEXT = TransferListWidget ] < / title > <nl> < link rel = " stylesheet " href = " css / style . css " type = " text / css " / > <nl> - < script src = " scripts / mootools - 1 . 2 - core - yc . js " > < / script > <nl> - < script src = " scripts / mootools - 1 . 2 - more . js " > < / script > <nl> - < script src = " scripts / mocha - yc . js " > < / script > <nl> - < script src = " scripts / parametrics . js " > < / script > <nl> + < script src = " scripts / lib / mootools - 1 . 2 - core - yc . js " > < / script > <nl> + < script src = " scripts / lib / mootools - 1 . 2 - more . js " > < / script > <nl> + < script src = " scripts / lib / mocha - yc . js " > < / script > <nl> + < script src = " scripts / lib / parametrics . js " > < / script > <nl> < / head > <nl> < body > <nl> < div style = " width : 100 % ; text - align : center ; margin : 0 auto ; overflow : hidden " > <nl> mmm a / src / webui / www / public / login . html <nl> ppp b / src / webui / www / public / login . html <nl> <nl> < title > qBittorrent QBT_TR ( Web UI ) QBT_TR [ CONTEXT = OptionsDialog ] < / title > <nl> < link rel = " icon " type = " image / png " href = " images / skin / qbittorrent16 . png " / > <nl> < link rel = " stylesheet " type = " text / css " href = " css / style . css " / > <nl> - < script src = " scripts / mootools - 1 . 2 - core - yc . js " charset = " utf - 8 " > < / script > <nl> + < script src = " scripts / lib / mootools - 1 . 2 - core - yc . js " > < / script > <nl> < script > <nl> window . onload = function ( ) { <nl> $ ( ' username ' ) . focus ( ) ; <nl> similarity index 100 % <nl> rename from src / webui / www / public / scripts / mootools - 1 . 2 - core - yc . js <nl> rename to src / webui / www / public / scripts / lib / mootools - 1 . 2 - core - yc . js <nl>
Merge pull request from Chocobo1 / js
qbittorrent/qBittorrent
9e4f246c89f564a3b4dfc972a7e92deb66afd738
2018-04-04T11:23:10Z
mmm a / README . rst <nl> ppp b / README . rst <nl> Mozilla Voice STT <nl> <nl> <nl> . . image : : https : / / readthedocs . org / projects / deepspeech / badge / ? version = latest <nl> - : target : http : / / deepspeech . readthedocs . io / ? badge = latest <nl> + : target : http : / / mozilla - voice - stt . readthedocs . io / ? badge = latest <nl> : alt : Documentation <nl> <nl> <nl> Mozilla Voice STT <nl> <nl> Mozilla Voice STT is an open source Speech - To - Text engine , using a model trained by machine learning techniques based on ` Baidu ' s Deep Speech research paper < https : / / arxiv . org / abs / 1412 . 5567 > ` _ . Mozilla Voice STT uses Google ' s ` TensorFlow < https : / / www . tensorflow . org / > ` _ to make the implementation easier . <nl> <nl> - Documentation for installation , usage , and training models are available on ` deepspeech . readthedocs . io < http : / / deepspeech . readthedocs . io / ? badge = latest > ` _ . <nl> + Documentation for installation , usage , and training models are available on ` mozilla - voice - stt . readthedocs . io < http : / / mozilla - voice - stt . readthedocs . io / ? badge = latest > ` _ . <nl> <nl> For the latest release , including pre - trained models and checkpoints , ` see the latest release on GitHub < https : / / github . com / mozilla / STT / releases / latest > ` _ . <nl> <nl> mmm a / data / README . rst <nl> ppp b / data / README . rst <nl> This directory contains language - specific data files . Most importantly , you will <nl> <nl> 2 . A script used to generate a binary n - gram language model : ` ` data / lm / generate_lm . py ` ` . <nl> <nl> - For more information on how to build these resources from scratch , see the ` ` External scorer scripts ` ` section on ` deepspeech . readthedocs . io < https : / / deepspeech . readthedocs . io / > ` _ . <nl> + For more information on how to build these resources from scratch , see the ` ` External scorer scripts ` ` section on ` mozilla - voice - stt . readthedocs . io < https : / / mozilla - voice - stt . readthedocs . io / > ` _ . <nl> <nl> mmm a / native_client / generate_scorer_package . cpp <nl> ppp b / native_client / generate_scorer_package . cpp <nl> main ( int argc , char * * argv ) <nl> ( " package " , po : : value < string > ( ) , " Path to save scorer package . " ) <nl> ( " default_alpha " , po : : value < float > ( ) , " Default value of alpha hyperparameter ( float ) . " ) <nl> ( " default_beta " , po : : value < float > ( ) , " Default value of beta hyperparameter ( float ) . " ) <nl> - ( " force_utf8 " , po : : value < bool > ( ) , " Boolean flag , force set or unset UTF - 8 mode in the scorer package . If not set , infers from the vocabulary . See < https : / / deepspeech . readthedocs . io / en / master / Decoder . html # utf - 8 - mode > for further explanation . " ) <nl> + ( " force_utf8 " , po : : value < bool > ( ) , " Boolean flag , force set or unset UTF - 8 mode in the scorer package . If not set , infers from the vocabulary . See < https : / / mozilla - voice - stt . readthedocs . io / en / master / Decoder . html # utf - 8 - mode > for further explanation . " ) <nl> ; <nl> <nl> po : : variables_map vm ; <nl> mmm a / native_client / javascript / README . md <nl> ppp b / native_client / javascript / README . md <nl> @ @ - 1 + 1 @ @ <nl> - Full project description and documentation on [ https : / / deepspeech . readthedocs . io / ] ( https : / / deepspeech . readthedocs . io / ) . <nl> + Full project description and documentation on [ https : / / mozilla - voice - stt . readthedocs . io / ] ( https : / / mozilla - voice - stt . readthedocs . io / ) . <nl> mmm a / native_client / python / README . rst <nl> ppp b / native_client / python / README . rst <nl> @ @ - 1 + 1 @ @ <nl> - Full project description and documentation on ` https : / / deepspeech . readthedocs . io / < https : / / deepspeech . readthedocs . io / > ` _ <nl> + Full project description and documentation on ` https : / / mozilla - voice - stt . readthedocs . io / < https : / / mozilla - voice - stt . readthedocs . io / > ` _ <nl>
Merge pull request from lissyx / rtd - rename
mozilla/DeepSpeech
ce71910ab4533e84eaf7be92bc1eb447305f4bd6
2020-08-13T20:55:14Z
mmm a / tools / profiling / microbenchmarks / speedup . py <nl> ppp b / tools / profiling / microbenchmarks / speedup . py <nl> <nl> # OF THIS SOFTWARE , EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE . <nl> <nl> from scipy import stats <nl> + import math <nl> <nl> _THRESHOLD = 0 . 01 <nl> <nl> def cmp ( a , b ) : <nl> <nl> def speedup ( new , old ) : <nl> s0 , p0 = cmp ( new , old ) <nl> + if math . isnan ( p0 ) return 0 <nl> if s0 = = 0 : return 0 <nl> if p0 > _THRESHOLD : return 0 <nl> if s0 < 0 : <nl>
Handle nans
grpc/grpc
d6d2da11492f52a4170be34c826f6adb8ca837d1
2017-04-05T13:34:07Z
mmm a / cocos / 2d / CCComponent . h <nl> ppp b / cocos / 2d / CCComponent . h <nl> <nl> / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * <nl> - Copyright ( c ) 2013 - 2014 Chukong Technologies Inc . <nl> + Copyright ( c ) 2013 - 2015 Chukong Technologies Inc . <nl> <nl> http : / / www . cocos2d - x . org <nl> <nl> THE SOFTWARE . <nl> # ifndef __CC_FRAMEWORK_COMPONENT_H__ <nl> # define __CC_FRAMEWORK_COMPONENT_H__ <nl> <nl> + / / / @ cond DO_NOT_SHOW <nl> + <nl> # include " base / CCRef . h " <nl> # include " base / CCScriptSupport . h " <nl> # include < string > <nl> class CC_DLL Component : public Ref <nl> <nl> NS_CC_END <nl> <nl> + / / / @ endcond <nl> # endif / / __FUNDATION__CCCOMPONENT_H__ <nl> mmm a / cocos / 2d / CCComponentContainer . h <nl> ppp b / cocos / 2d / CCComponentContainer . h <nl> <nl> / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * <nl> - Copyright ( c ) 2013 - 2014 Chukong Technologies Inc . <nl> + Copyright ( c ) 2013 - 2015 Chukong Technologies Inc . <nl> <nl> http : / / www . cocos2d - x . org <nl> <nl> THE SOFTWARE . <nl> # ifndef __CC_FRAMEWORK_COMCONTAINER_H__ <nl> # define __CC_FRAMEWORK_COMCONTAINER_H__ <nl> <nl> + / / / @ cond DO_NOT_SHOW <nl> + <nl> # include " base / CCMap . h " <nl> # include < string > <nl> <nl> class CC_DLL ComponentContainer <nl> <nl> NS_CC_END <nl> <nl> + / / / @ endcond <nl> # endif / / __FUNDATION__CCCOMPONENT_H__ <nl> mmm a / cocos / 2d / CCFont . h <nl> ppp b / cocos / 2d / CCFont . h <nl> <nl> # ifndef _CCFont_h_ <nl> # define _CCFont_h_ <nl> <nl> + / / / @ cond DO_NOT_SHOW <nl> + <nl> # include < string > <nl> # include " 2d / CCLabel . h " <nl> <nl> NS_CC_BEGIN <nl> <nl> class FontAtlas ; <nl> <nl> - / / / @ cond <nl> - <nl> class CC_DLL Font : public Ref <nl> { <nl> public : <nl> class CC_DLL Font : public Ref <nl> <nl> } ; <nl> <nl> - / / / @ endcond <nl> - <nl> NS_CC_END <nl> <nl> + / / / @ endcond <nl> # endif <nl> mmm a / cocos / 2d / CCFontAtlas . h <nl> ppp b / cocos / 2d / CCFontAtlas . h <nl> <nl> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN <nl> THE SOFTWARE . <nl> * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / <nl> + <nl> # ifndef _CCFontAtlas_h_ <nl> # define _CCFontAtlas_h_ <nl> <nl> + / / / @ cond DO_NOT_SHOW <nl> + <nl> # include < string > <nl> # include < unordered_map > <nl> <nl> <nl> <nl> NS_CC_BEGIN <nl> <nl> - / / fwd <nl> class Font ; <nl> class Texture2D ; <nl> class EventCustom ; <nl> class EventListenerCustom ; <nl> <nl> - / / / @ cond <nl> - <nl> struct FontLetterDefinition <nl> { <nl> unsigned short letteCharUTF16 ; <nl> class CC_DLL FontAtlas : public Ref <nl> bool _antialiasEnabled ; <nl> } ; <nl> <nl> - / / / @ endcond <nl> - <nl> NS_CC_END <nl> <nl> - <nl> + / / / @ endcond <nl> # endif / * defined ( __cocos2d_libs__CCFontAtlas__ ) * / <nl> mmm a / cocos / 2d / CCFontAtlasCache . h <nl> ppp b / cocos / 2d / CCFontAtlasCache . h <nl> <nl> # ifndef _CCFontAtlasCache_h_ <nl> # define _CCFontAtlasCache_h_ <nl> <nl> + / / / @ cond DO_NOT_SHOW <nl> + <nl> # include < unordered_map > <nl> <nl> # include " 2d / CCLabel . h " <nl> NS_CC_BEGIN <nl> <nl> class FontAtlas ; <nl> <nl> - / / / @ cond <nl> - <nl> class CC_DLL FontAtlasCache <nl> { <nl> public : <nl> class CC_DLL FontAtlasCache <nl> static std : : unordered_map < std : : string , FontAtlas * > _atlasMap ; <nl> } ; <nl> <nl> - / / / @ endcond <nl> - <nl> NS_CC_END <nl> <nl> + / / / @ endcond <nl> # endif <nl> mmm a / cocos / 2d / CCFontCharMap . h <nl> ppp b / cocos / 2d / CCFontCharMap . h <nl> <nl> # ifndef _CCFontCharMap_h_ <nl> # define _CCFontCharMap_h_ <nl> <nl> + / / / @ cond DO_NOT_SHOW <nl> + <nl> # include " 2d / CCFont . h " <nl> <nl> NS_CC_BEGIN <nl> <nl> - / / / @ cond <nl> - <nl> class FontCharMap : public Font <nl> { <nl> public : <nl> mmm a / cocos / 2d / CCFontFNT . h <nl> ppp b / cocos / 2d / CCFontFNT . h <nl> <nl> # ifndef _CCFontFNT_h_ <nl> # define _CCFontFNT_h_ <nl> <nl> + / / / @ cond DO_NOT_SHOW <nl> + <nl> # include " CCFont . h " <nl> <nl> NS_CC_BEGIN <nl> <nl> class BMFontConfiguration ; <nl> <nl> - / / / @ cond FontFNT <nl> - <nl> class CC_DLL FontFNT : public Font <nl> { <nl> <nl> mmm a / cocos / 2d / CCFontFreeType . h <nl> ppp b / cocos / 2d / CCFontFreeType . h <nl> <nl> # ifndef _FontFreetype_h_ <nl> # define _FontFreetype_h_ <nl> <nl> + / / / @ cond DO_NOT_SHOW <nl> + <nl> # include " CCFont . h " <nl> <nl> # include < string > <nl> <nl> <nl> NS_CC_BEGIN <nl> <nl> - / / / @ cond <nl> - <nl> class CC_DLL FontFreeType : public Font <nl> { <nl> public : <nl> mmm a / cocos / 2d / CCLabelBMFont . h <nl> ppp b / cocos / 2d / CCLabelBMFont . h <nl> Use any of these editors to generate BMFonts : <nl> # ifndef __CCBITMAP_FONT_ATLAS_H__ <nl> # define __CCBITMAP_FONT_ATLAS_H__ <nl> <nl> + / / / @ cond DO_NOT_SHOW <nl> + <nl> # include " 2d / CCLabel . h " <nl> # if CC_LABELBMFONT_DEBUG_DRAW <nl> # include " renderer / CCCustomCommand . h " <nl> Use any of these editors to generate BMFonts : <nl> <nl> NS_CC_BEGIN <nl> <nl> - / / / @ cond <nl> - <nl> # if defined ( __GNUC__ ) & & ( ( __GNUC__ > = 4 ) | | ( ( __GNUC__ = = 3 ) & & ( __GNUC_MINOR__ > = 1 ) ) ) <nl> # pragma GCC diagnostic ignored " - Wdeprecated - declarations " <nl> # elif _MSC_VER > = 1400 / / vs 2005 or higher <nl> class CC_DLL CC_DEPRECATED_ATTRIBUTE LabelBMFont : public Node , public LabelProt <nl> # pragma warning ( pop ) <nl> # endif <nl> <nl> - / / / @ endcond <nl> - <nl> NS_CC_END <nl> <nl> + / / / @ endcond <nl> # endif / / __CCBITMAP_FONT_ATLAS_H__ <nl> mmm a / cocos / 2d / CCLabelTTF . h <nl> ppp b / cocos / 2d / CCLabelTTF . h <nl> LIABILITY , WHETHER IN AN ACTION OF CONTRACT , TORT OR OTHERWISE , ARISING FROM , <nl> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN <nl> THE SOFTWARE . <nl> * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / <nl> + <nl> # ifndef __CCLABELTTF_H__ <nl> # define __CCLABELTTF_H__ <nl> <nl> + / / / @ cond DO_NOT_SHOW <nl> + <nl> # include " 2d / CCNode . h " <nl> <nl> NS_CC_BEGIN <nl> class CC_DLL CC_DEPRECATED_ATTRIBUTE LabelTTF : public Node , public LabelProtoco <nl> # pragma warning ( pop ) <nl> # endif <nl> <nl> - / / / @ endcond <nl> - <nl> NS_CC_END <nl> <nl> + / / / @ endcond <nl> # endif / / __CCLABEL_H__ <nl> <nl> mmm a / cocos / 2d / CCLabelTextFormatter . h <nl> ppp b / cocos / 2d / CCLabelTextFormatter . h <nl> <nl> # ifndef _CCLabelTextFormatter_h_ <nl> # define _CCLabelTextFormatter_h_ <nl> <nl> + / / / @ cond DO_NOT_SHOW <nl> + <nl> # include " platform / CCPlatformMacros . h " <nl> <nl> NS_CC_BEGIN <nl> <nl> class Label ; <nl> <nl> - / / / @ cond <nl> class CC_DLL LabelTextFormatter <nl> { <nl> public : <nl> class CC_DLL LabelTextFormatter <nl> <nl> } ; <nl> <nl> - / / / @ endcond <nl> - <nl> NS_CC_END <nl> <nl> + / / / @ endcond <nl> # endif <nl> mmm a / cocos / 2d / CCTMXXMLParser . h <nl> ppp b / cocos / 2d / CCTMXXMLParser . h <nl> <nl> Copyright ( c ) 2009 - 2010 Ricardo Quesada <nl> Copyright ( c ) 2010 - 2012 cocos2d - x . org <nl> Copyright ( c ) 2011 Zynga Inc . <nl> - Copyright ( c ) 2013 - 2014 Chukong Technologies Inc . <nl> + Copyright ( c ) 2013 - 2015 Chukong Technologies Inc . <nl> <nl> http : / / www . cocos2d - x . org <nl> <nl> THE SOFTWARE . <nl> # ifndef __CC_TM_XML_PARSER__ <nl> # define __CC_TM_XML_PARSER__ <nl> <nl> + / / / @ cond DO_NOT_SHOW <nl> + <nl> # include " math / CCGeometry . h " <nl> # include " platform / CCSAXParser . h " <nl> # include " base / CCVector . h " <nl> class CC_DLL TMXMapInfo : public Ref , public SAXDelegator <nl> <nl> NS_CC_END <nl> <nl> + / / / @ endcond <nl> # endif <nl> - <nl> mmm a / cocos / 2d / CCTweenFunction . h <nl> ppp b / cocos / 2d / CCTweenFunction . h <nl> <nl> / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * <nl> - Copyright ( c ) 2013 - 2014 Chukong Technologies Inc . <nl> + Copyright ( c ) 2013 - 2015 Chukong Technologies Inc . <nl> <nl> http : / / www . cocos2d - x . org <nl> <nl> THE SOFTWARE . <nl> # ifndef __CCTWEENFUNCTION_H__ <nl> # define __CCTWEENFUNCTION_H__ <nl> <nl> + / / / @ cond DO_NOT_SHOW <nl> + <nl> # include " platform / CCPlatformMacros . h " <nl> <nl> NS_CC_BEGIN <nl> namespace tweenfunc { <nl> <nl> NS_CC_END <nl> <nl> + / / / @ endcond <nl> # endif / * __CCTWEENFUNCTION_H__ * / <nl> mmm a / cocos / 3d / cocos3d . h <nl> ppp b / cocos / 3d / cocos3d . h <nl> <nl> / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * <nl> - Copyright ( c ) 2014 Chukong Technologies Inc . <nl> + Copyright ( c ) 2014 - 2015 Chukong Technologies Inc . <nl> <nl> http : / / www . cocos2d - x . org <nl> <nl> mmm a / cocos / base / CCConsole . h <nl> ppp b / cocos / base / CCConsole . h <nl> <nl> / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * <nl> - Copyright ( c ) 2013 - 2014 Chukong Technologies Inc . <nl> + Copyright ( c ) 2013 - 2015 Chukong Technologies Inc . <nl> <nl> http : / / www . cocos2d - x . org <nl> <nl> <nl> THE SOFTWARE . <nl> * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / <nl> <nl> - <nl> # ifndef __CCCONSOLE_H__ <nl> # define __CCCONSOLE_H__ <nl> + / / / @ cond DO_NOT_SHOW <nl> <nl> # if defined ( _MSC_VER ) | | defined ( __MINGW32__ ) <nl> # include < BaseTsd . h > <nl> class CC_DLL Console <nl> <nl> NS_CC_END <nl> <nl> + / / / @ endcond <nl> # endif / * defined ( __CCCONSOLE_H__ ) * / <nl> mmm a / cocos / base / CCDataVisitor . h <nl> ppp b / cocos / base / CCDataVisitor . h <nl> <nl> / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * <nl> - Copyright ( c ) 2013 - 2014 Chukong Technologies Inc . <nl> + Copyright ( c ) 2013 - 2015 Chukong Technologies Inc . <nl> <nl> http : / / www . cocos2d - x . org <nl> <nl> <nl> <nl> # ifndef __CCDATAVISITOR_H__ <nl> # define __CCDATAVISITOR_H__ <nl> + / / / @ cond DO_NOT_SHOW <nl> <nl> # include " platform / CCPlatformMacros . h " <nl> # include < string > <nl> class __Array ; <nl> class __Dictionary ; <nl> class __Set ; <nl> <nl> - / * * <nl> - * @ cond <nl> - * / <nl> - <nl> / * * <nl> * Visitor that helps to perform action that depends on polymorphic object type <nl> * <nl> class CC_DLL PrettyPrinter : public DataVisitor <nl> <nl> NS_CC_END <nl> <nl> + / / / @ endcond <nl> # endif / / __CCDATAVISITOR_H__ <nl> mmm a / cocos / base / CCEventType . h <nl> ppp b / cocos / base / CCEventType . h <nl> <nl> / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * <nl> - Copyright ( c ) 2013 - 2014 Chukong Technologies Inc . <nl> + Copyright ( c ) 2013 - 2015 Chukong Technologies Inc . <nl> <nl> http : / / www . cocos2d - x . org <nl> <nl> <nl> <nl> # ifndef __CCEVENT_TYPE_H__ <nl> # define __CCEVENT_TYPE_H__ <nl> + / / / @ cond DO_NOT_SHOW <nl> <nl> / * * <nl> * This header is used for defining event types using in NotificationCenter <nl> <nl> / / This message is posted in cocos / platform / android / jni / Java_org_cocos2dx_lib_Cocos2dxRenderer . cpp and cocos \ platform \ wp8 - xaml \ cpp \ Cocos2dRenderer . cpp . <nl> # define EVENT_COME_TO_BACKGROUND " event_come_to_background " <nl> <nl> + / / / @ endcond <nl> # endif / / __CCEVENT_TYPE_H__ <nl> mmm a / cocos / base / CCGameController . h <nl> ppp b / cocos / base / CCGameController . h <nl> <nl> / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * <nl> - Copyright ( c ) 2014 cocos2d - x . org <nl> - Copyright ( c ) 2014 Chukong Technologies Inc . <nl> + Copyright ( c ) 2014 - 2015 Chukong Technologies Inc . <nl> <nl> http : / / www . cocos2d - x . org <nl> <nl> <nl> <nl> # ifndef __cocos2d_libs__CCGameController__ <nl> # define __cocos2d_libs__CCGameController__ <nl> + / / / @ cond DO_NOT_SHOW <nl> <nl> # include " base / CCController . h " <nl> # include " base / CCEventController . h " <nl> # include " base / CCEventListenerController . h " <nl> <nl> + / / / @ endcond <nl> # endif / * defined ( __cocos2d_libs__CCGameController__ ) * / <nl> mmm a / cocos / base / CCProfiling . h <nl> ppp b / cocos / base / CCProfiling . h <nl> <nl> / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * <nl> Copyright ( c ) 2010 Stuart Carnie <nl> Copyright ( c ) 2010 - 2012 cocos2d - x . org <nl> - Copyright ( c ) 2013 - 2014 Chukong Technologies Inc . <nl> + Copyright ( c ) 2013 - 2015 Chukong Technologies Inc . <nl> <nl> http : / / www . cocos2d - x . org <nl> <nl> LIABILITY , WHETHER IN AN ACTION OF CONTRACT , TORT OR OTHERWISE , ARISING FROM , <nl> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN <nl> THE SOFTWARE . <nl> * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / <nl> + <nl> # ifndef __SUPPORT_CCPROFILING_H__ <nl> # define __SUPPORT_CCPROFILING_H__ <nl> + / / / @ cond DO_NOT_SHOW <nl> <nl> # include < string > <nl> # include < chrono > <nl> extern bool kProfilerCategoryParticles ; <nl> <nl> NS_CC_END <nl> <nl> + / / / @ endcond <nl> # endif / / __SUPPORT_CCPROFILING_H__ <nl> mmm a / cocos / base / CCProtocols . h <nl> ppp b / cocos / base / CCProtocols . h <nl> <nl> / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * <nl> Copyright ( c ) 2008 - 2010 Ricardo Quesada <nl> Copyright ( c ) 2010 - 2012 cocos2d - x . org <nl> - Copyright ( c ) 2013 - 2014 Chukong Technologies Inc . <nl> + Copyright ( c ) 2013 - 2015 Chukong Technologies Inc . <nl> <nl> http : / / www . cocos2d - x . org <nl> <nl> THE SOFTWARE . <nl> <nl> # ifndef __BASE_CCPROTOCOLS_H__ <nl> # define __BASE_CCPROTOCOLS_H__ <nl> + / / / @ cond DO_NOT_SHOW <nl> <nl> # include < string > <nl> <nl> class CC_DLL DirectorDelegate <nl> <nl> NS_CC_END <nl> <nl> + / / / @ endcond <nl> # endif / / __BASE_CCPROTOCOLS_H__ <nl> mmm a / cocos / base / CCRefPtr . h <nl> ppp b / cocos / base / CCRefPtr . h <nl> <nl> / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * <nl> - Copyright ( c ) 2014 PlayFirst Inc . <nl> - Copyright ( c ) 2014 Chukong Technologies Inc . <nl> + Copyright ( c ) 2014 PlayFirst Inc . <nl> + Copyright ( c ) 2014 - 2015 Chukong Technologies Inc . <nl> <nl> http : / / www . cocos2d - x . org <nl> <nl> <nl> <nl> # ifndef __CC_REF_PTR_H__ <nl> # define __CC_REF_PTR_H__ <nl> + / / / @ cond DO_NOT_SHOW <nl> <nl> # include " base / CCRef . h " <nl> # include " base / ccMacros . h " <nl> <nl> NS_CC_BEGIN <nl> <nl> / * * <nl> - * @ cond DO_NOT_SHOW <nl> - * <nl> * Utility / support macros . Defined to enable RefPtr < T > to contain types like ' const T ' because we do not <nl> * regard retain ( ) / release ( ) as affecting mutability of state . <nl> * / <nl> template < class T , class U > RefPtr < T > dynamic_pointer_cast ( const RefPtr < U > & r ) <nl> # undef CC_REF_PTR_SAFE_RELEASE <nl> # undef CC_REF_PTR_SAFE_RELEASE_NULL <nl> <nl> - / * * @ } * / <nl> - <nl> NS_CC_END <nl> <nl> + / / / @ endcond <nl> # endif / / __CC_REF_PTR_H__ <nl> mmm a / cocos / base / TGAlib . h <nl> ppp b / cocos / base / TGAlib . h <nl> <nl> / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * <nl> Copyright ( c ) 2010 - 2012 cocos2d - x . org <nl> - Copyright ( c ) 2013 - 2014 Chukong Technologies Inc . <nl> + Copyright ( c ) 2013 - 2015 Chukong Technologies Inc . <nl> <nl> http : / / www . cocos2d - x . org <nl> <nl> THE SOFTWARE . <nl> <nl> # ifndef __SUPPORT_DATA_SUPPORT_TGALIB_H__ <nl> # define __SUPPORT_DATA_SUPPORT_TGALIB_H__ <nl> + / / / @ cond DO_NOT_SHOW <nl> <nl> namespace cocos2d { <nl> <nl> void tgaDestroy ( tImageTGA * info ) ; <nl> <nl> } / / namespace cocos2d <nl> <nl> + / / / @ endcond <nl> # endif / / __SUPPORT_DATA_SUPPORT_TGALIB_H__ <nl> mmm a / cocos / base / ZipUtils . h <nl> ppp b / cocos / base / ZipUtils . h <nl> LIABILITY , WHETHER IN AN ACTION OF CONTRACT , TORT OR OTHERWISE , ARISING FROM , <nl> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN <nl> THE SOFTWARE . <nl> * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / <nl> + <nl> # ifndef __SUPPORT_ZIPUTILS_H__ <nl> # define __SUPPORT_ZIPUTILS_H__ <nl> + / / / @ cond DO_NOT_SHOW <nl> <nl> # include < string > <nl> # include " platform / CCPlatformConfig . h " <nl> typedef struct unz_file_info_s unz_file_info ; <nl> / / end group <nl> / / / @ } <nl> <nl> + / / / @ endcond <nl> # endif / / __SUPPORT_ZIPUTILS_H__ <nl> - <nl> mmm a / cocos / base / allocator / CCAllocatorBase . h <nl> ppp b / cocos / base / allocator / CCAllocatorBase . h <nl> <nl> <nl> # ifndef CC_ALLOCATOR_BASE_H <nl> # define CC_ALLOCATOR_BASE_H <nl> - / / / @ cond <nl> + / / / @ cond DO_NOT_SHOW <nl> <nl> # include < string > <nl> <nl> NS_CC_ALLOCATOR_END <nl> NS_CC_END <nl> <nl> / / / @ endcond <nl> - <nl> # endif / / CC_ALLOCATOR_BASE_H <nl> mmm a / cocos / base / allocator / CCAllocatorDiagnostics . h <nl> ppp b / cocos / base / allocator / CCAllocatorDiagnostics . h <nl> <nl> <nl> # ifndef CC_ALLOCATOR_DIAGNOSTICS_H <nl> # define CC_ALLOCATOR_DIAGNOSTICS_H <nl> - / / / @ cond <nl> + / / / @ cond DO_NOT_SHOW <nl> <nl> # include < unordered_set > <nl> <nl> NS_CC_ALLOCATOR_END <nl> NS_CC_END <nl> <nl> / / / @ endcond <nl> - <nl> # endif / / CC_ALLOCATOR_DIAGNOSTICS_H <nl> mmm a / cocos / base / allocator / CCAllocatorGlobal . h <nl> ppp b / cocos / base / allocator / CCAllocatorGlobal . h <nl> <nl> <nl> # ifndef CC_ALLOCATOR_GLOBAL_H <nl> # define CC_ALLOCATOR_GLOBAL_H <nl> - / / / @ cond <nl> + / / / @ cond DO_NOT_SHOW <nl> <nl> # include " base / allocator / CCAllocatorMacros . h " <nl> # include " base / allocator / CCAllocatorStrategyDefault . h " <nl> NS_CC_ALLOCATOR_END <nl> NS_CC_END <nl> <nl> / / / @ endcond <nl> - <nl> # endif / / CC_ALLOCATOR_GLOBAL_H <nl> mmm a / cocos / base / allocator / CCAllocatorMacros . h <nl> ppp b / cocos / base / allocator / CCAllocatorMacros . h <nl> <nl> <nl> # ifndef CC_ALLOCATOR_MACROS_H <nl> # define CC_ALLOCATOR_MACROS_H <nl> - / / / @ cond <nl> + / / / @ cond DO_NOT_SHOW <nl> <nl> # include " base / ccConfig . h " <nl> # include " platform / CCPlatformMacros . h " <nl> <nl> } <nl> <nl> / / / @ endcond <nl> - <nl> # endif / / CC_ALLOCATOR_MACROS_H <nl> mmm a / cocos / base / allocator / CCAllocatorMutex . h <nl> ppp b / cocos / base / allocator / CCAllocatorMutex . h <nl> <nl> <nl> # ifndef CC_ALLOCATOR_MUTEX_H <nl> # define CC_ALLOCATOR_MUTEX_H <nl> - / / / @ cond <nl> + / / / @ cond DO_NOT_SHOW <nl> <nl> # include " platform / CCPlatformMacros . h " <nl> <nl> NS_CC_ALLOCATOR_END <nl> NS_CC_END <nl> <nl> / / / @ endcond <nl> - <nl> # endif / / CC_ALLOCATOR_MUTEX_H <nl> mmm a / cocos / base / allocator / CCAllocatorStrategyDefault . h <nl> ppp b / cocos / base / allocator / CCAllocatorStrategyDefault . h <nl> <nl> <nl> # ifndef CC_ALLOCATOR_STRATEGY_DEFAULT_H <nl> # define CC_ALLOCATOR_STRATEGY_DEFAULT_H <nl> - / / / @ cond <nl> + / / / @ cond DO_NOT_SHOW <nl> <nl> # include " base / allocator / CCAllocatorMacros . h " <nl> # include " base / allocator / CCAllocatorBase . h " <nl> NS_CC_ALLOCATOR_END <nl> NS_CC_END <nl> <nl> / / / @ endcond <nl> - <nl> # endif / / CC_ALLOCATOR_STRATEGY_DEFAULT_H <nl> mmm a / cocos / base / allocator / CCAllocatorStrategyFixedBlock . h <nl> ppp b / cocos / base / allocator / CCAllocatorStrategyFixedBlock . h <nl> <nl> <nl> # ifndef CC_ALLOCATOR_STRATEGY_FIXED_BLOCK_H <nl> # define CC_ALLOCATOR_STRATEGY_FIXED_BLOCK_H <nl> - / / / @ cond <nl> + / / / @ cond DO_NOT_SHOW <nl> <nl> / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * <nl> WARNING ! <nl> NS_CC_ALLOCATOR_END <nl> NS_CC_END <nl> <nl> / / / @ endcond <nl> - <nl> # endif / / CC_ALLOCATOR_STRATEGY_FIXED_BLOCK_H <nl> mmm a / cocos / base / allocator / CCAllocatorStrategyGlobalSmallBlock . h <nl> ppp b / cocos / base / allocator / CCAllocatorStrategyGlobalSmallBlock . h <nl> <nl> <nl> # ifndef CC_ALLOCATOR_STRATEGY_GLOBAL_SMALL_BLOCK_H <nl> # define CC_ALLOCATOR_STRATEGY_GLOBAL_SMALL_BLOCK_H <nl> - / / / @ cond <nl> + / / / @ cond DO_NOT_SHOW <nl> <nl> / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * <nl> WARNING ! <nl> NS_CC_ALLOCATOR_END <nl> NS_CC_END <nl> <nl> / / / @ endcond <nl> - <nl> # endif / / CC_ALLOCATOR_STRATEGY_GLOBAL_SMALL_BLOCK_H <nl> mmm a / cocos / base / allocator / CCAllocatorStrategyPool . h <nl> ppp b / cocos / base / allocator / CCAllocatorStrategyPool . h <nl> <nl> <nl> # ifndef CC_ALLOCATOR_STRATEGY_POOL_H <nl> # define CC_ALLOCATOR_STRATEGY_POOL_H <nl> - / / / @ cond <nl> + / / / @ cond DO_NOT_SHOW <nl> <nl> # include < vector > <nl> # include < typeinfo > <nl> NS_CC_ALLOCATOR_END <nl> NS_CC_END <nl> <nl> / / / @ endcond <nl> - <nl> # endif / / CC_ALLOCATOR_STRATEGY_POOL_H <nl> mmm a / cocos / base / atitc . h <nl> ppp b / cocos / base / atitc . h <nl> <nl> / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * <nl> - Copyright ( c ) 2013 Chukong Technologies Inc . <nl> + Copyright ( c ) 2013 - 2015 Chukong Technologies Inc . <nl> <nl> http : / / www . cocos2d - x . org <nl> <nl> <nl> THE SOFTWARE . <nl> * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / <nl> <nl> - <nl> # ifndef COCOS2DX_PLATFORM_THIRDPARTY_ATITC_ <nl> # define COCOS2DX_PLATFORM_THIRDPARTY_ATITC_ <nl> + / / / @ cond DO_NOT_SHOW <nl> <nl> # include " platform / CCStdC . h " <nl> <nl> void atitc_decode ( uint8_t * encode_data , <nl> ATITCDecodeFlag decodeFlag <nl> ) ; <nl> <nl> - <nl> + / / / @ endcond <nl> # endif / * defined ( COCOS2DX_PLATFORM_THIRDPARTY_ATITC_ ) * / <nl> - <nl> mmm a / cocos / base / base64 . h <nl> ppp b / cocos / base / base64 . h <nl> <nl> / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * <nl> Copyright ( c ) 2010 - 2012 cocos2d - x . org <nl> - Copyright ( c ) 2013 - 2014 Chukong Technologies Inc . <nl> + Copyright ( c ) 2013 - 2015 Chukong Technologies Inc . <nl> <nl> http : / / www . cocos2d - x . org <nl> <nl> THE SOFTWARE . <nl> <nl> # ifndef __SUPPORT_BASE64_H__ <nl> # define __SUPPORT_BASE64_H__ <nl> + / / / @ cond DO_NOT_SHOW <nl> <nl> # include " platform / CCPlatformMacros . h " <nl> <nl> int CC_DLL base64Encode ( const unsigned char * in , unsigned int inLength , char * * o <nl> } <nl> # endif <nl> <nl> + / / / @ endcond <nl> # endif / / __SUPPORT_BASE64_H__ <nl> mmm a / cocos / base / ccCArray . h <nl> ppp b / cocos / base / ccCArray . h <nl> <nl> / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * <nl> Copyright ( c ) 2007 Scott Lembcke <nl> Copyright ( c ) 2010 - 2012 cocos2d - x . org <nl> - Copyright ( c ) 2013 - 2014 Chukong Technologies Inc . <nl> + Copyright ( c ) 2013 - 2015 Chukong Technologies Inc . <nl> <nl> http : / / www . cocos2d - x . org <nl> <nl> THE SOFTWARE . <nl> <nl> # ifndef CC_ARRAY_H <nl> # define CC_ARRAY_H <nl> + / / / @ cond DO_NOT_SHOW <nl> <nl> # include " base / ccMacros . h " <nl> # include " base / CCRef . h " <nl> void ccCArrayFullRemoveArray ( ccCArray * arr , ccCArray * minusArr ) ; <nl> <nl> NS_CC_END <nl> <nl> + / / / @ endcond <nl> # endif / / CC_ARRAY_H <nl> mmm a / cocos / base / ccFPSImages . h <nl> ppp b / cocos / base / ccFPSImages . h <nl> <nl> - / * <nl> - * cocos2d for iPhone : http : / / www . cocos2d - iphone . org <nl> - * <nl> - * Copyright ( c ) 2012 Zynga Inc . <nl> - * <nl> - * Permission is hereby granted , free of charge , to any person obtaining a copy <nl> - * of this software and associated documentation files ( the " Software " ) , to deal <nl> - * in the Software without restriction , including without limitation the rights <nl> - * to use , copy , modify , merge , publish , distribute , sublicense , and / or sell <nl> - * copies of the Software , and to permit persons to whom the Software is <nl> - * furnished to do so , subject to the following conditions : <nl> - * <nl> - * The above copyright notice and this permission notice shall be included in <nl> - * all copies or substantial portions of the Software . <nl> - * <nl> - * THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND , EXPRESS OR <nl> - * IMPLIED , INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY , <nl> - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT . IN NO EVENT SHALL THE <nl> - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM , DAMAGES OR OTHER <nl> - * LIABILITY , WHETHER IN AN ACTION OF CONTRACT , TORT OR OTHERWISE , ARISING FROM , <nl> - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN <nl> - * THE SOFTWARE . <nl> - * / <nl> + / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * <nl> + Copyright ( c ) 2012 Zynga Inc . <nl> + Copyright ( c ) 2013 - 2015 Chukong Technologies Inc . <nl> + <nl> + http : / / www . cocos2d - x . org <nl> + <nl> + Permission is hereby granted , free of charge , to any person obtaining a copy <nl> + of this software and associated documentation files ( the " Software " ) , to deal <nl> + in the Software without restriction , including without limitation the rights <nl> + to use , copy , modify , merge , publish , distribute , sublicense , and / or sell <nl> + copies of the Software , and to permit persons to whom the Software is <nl> + furnished to do so , subject to the following conditions : <nl> + <nl> + The above copyright notice and this permission notice shall be included in <nl> + all copies or substantial portions of the Software . <nl> + <nl> + THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND , EXPRESS OR <nl> + IMPLIED , INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY , <nl> + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT . IN NO EVENT SHALL THE <nl> + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM , DAMAGES OR OTHER <nl> + LIABILITY , WHETHER IN AN ACTION OF CONTRACT , TORT OR OTHERWISE , ARISING FROM , <nl> + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN <nl> + THE SOFTWARE . <nl> + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / <nl> <nl> # ifndef __BASE_CCFPSIMAGES__H <nl> # define __BASE_CCFPSIMAGES__H <nl> + / / / @ cond DO_NOT_SHOW <nl> <nl> # ifdef __cplusplus <nl> extern " C " { <nl> unsigned int cc_fps_images_len ( void ) ; <nl> } <nl> # endif <nl> <nl> + / / / @ endcond <nl> # endif / / __BASE_CCFPSIMAGES__H <nl> mmm a / cocos / base / etc1 . h <nl> ppp b / cocos / base / etc1 . h <nl> <nl> <nl> # ifndef __etc1_h__ <nl> # define __etc1_h__ <nl> + / / / @ cond DO_NOT_SHOW <nl> <nl> # define ETC1_ENCODED_BLOCK_SIZE 8 <nl> # define ETC1_DECODED_BLOCK_SIZE 48 <nl> etc1_uint32 etc1_pkm_get_height ( const etc1_byte * pHeader ) ; <nl> } <nl> # endif <nl> <nl> + / / / @ endcond <nl> # endif <nl> mmm a / cocos / base / firePngData . h <nl> ppp b / cocos / base / firePngData . h <nl> <nl> + / / / @ cond DO_NOT_SHOW <nl> + <nl> const unsigned char __firePngData [ ] = { <nl> 0x89 , 0x50 , 0x4E , 0x47 , 0x0D , 0x0A , 0x1A , 0x0A , 0x00 , 0x00 , 0x00 , 0x0D , 0x49 , 0x48 , 0x44 , 0x52 , <nl> 0x00 , 0x00 , 0x00 , 0x20 , 0x00 , 0x00 , 0x00 , 0x20 , 0x08 , 0x06 , 0x00 , 0x00 , 0x00 , 0x73 , 0x7A , 0x7A , <nl> const unsigned char __firePngData [ ] = { <nl> 0x72 , 0x89 , 0x08 , 0x10 , 0x07 , 0x7D , 0x00 , 0x00 , 0x00 , 0x00 , 0x49 , 0x45 , 0x4E , 0x44 , 0xAE , 0x42 , <nl> 0x60 , 0x82 <nl> } ; <nl> + <nl> + / / / @ endcond <nl> mmm a / cocos / base / s3tc . h <nl> ppp b / cocos / base / s3tc . h <nl> <nl> / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * <nl> - Copyright ( c ) 2013 - 2014 Chukong Technologies <nl> + Copyright ( c ) 2013 - 2015 Chukong Technologies <nl> <nl> http : / / www . cocos2d - x . org <nl> <nl> <nl> THE SOFTWARE . <nl> * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / <nl> <nl> - <nl> # ifndef COCOS2DX_PLATFORM_THIRDPARTY_S3TC_ <nl> # define COCOS2DX_PLATFORM_THIRDPARTY_S3TC_ <nl> + / / / @ cond DO_NOT_SHOW <nl> <nl> # include " platform / CCStdC . h " <nl> <nl> enum class S3TCDecodeFlag <nl> S3TCDecodeFlag decodeFlag <nl> ) ; <nl> <nl> - <nl> + / / / @ endcond <nl> # endif / * defined ( COCOS2DX_PLATFORM_THIRDPARTY_S3TC_ ) * / <nl> - <nl> mmm a / cocos / base / uthash . h <nl> ppp b / cocos / base / uthash . h <nl> SOFTWARE , EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE . <nl> <nl> # ifndef UTHASH_H <nl> # define UTHASH_H <nl> + / / / @ cond DO_NOT_SHOW <nl> <nl> # include < string . h > / * memcmp , strlen * / <nl> # include < stddef . h > / * ptrdiff_t * / <nl> typedef struct UT_hash_handle { <nl> unsigned hashv ; / * result of hash - fcn ( key ) * / <nl> } UT_hash_handle ; <nl> <nl> + / / / @ endcond <nl> # endif / * UTHASH_H * / <nl> mmm a / cocos / base / utlist . h <nl> ppp b / cocos / base / utlist . h <nl> SOFTWARE , EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE . <nl> <nl> # ifndef UTLIST_H <nl> # define UTLIST_H <nl> + / / / @ cond DO_NOT_SHOW <nl> <nl> # define UTLIST_VERSION 1 . 9 . 8 <nl> <nl> do { <nl> } \ <nl> } while ( 0 ) \ <nl> <nl> + / / / @ endcond <nl> # endif / * UTLIST_H * / <nl> - <nl> mmm a / cocos / deprecated / CCArray . h <nl> ppp b / cocos / deprecated / CCArray . h <nl> <nl> / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * <nl> Copyright ( c ) 2010 ForzeField Studios S . L . http : / / forzefield . com <nl> Copyright ( c ) 2010 - 2012 cocos2d - x . org <nl> - Copyright ( c ) 2013 - 2014 Chukong Technologies Inc . <nl> + Copyright ( c ) 2013 - 2015 Chukong Technologies Inc . <nl> <nl> http : / / www . cocos2d - x . org <nl> <nl> LIABILITY , WHETHER IN AN ACTION OF CONTRACT , TORT OR OTHERWISE , ARISING FROM , <nl> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN <nl> THE SOFTWARE . <nl> * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / <nl> + <nl> # ifndef __CCARRAY_H__ <nl> # define __CCARRAY_H__ <nl> + / / / @ cond DO_NOT_SHOW <nl> <nl> # define CC_USE_ARRAY_VECTOR 0 <nl> <nl> class CC_DLL __Array : public Ref , public Clonable <nl> <nl> NS_CC_END <nl> <nl> + / / / @ endcond <nl> # endif / / __CCARRAY_H__ <nl> mmm a / cocos / deprecated / CCBool . h <nl> ppp b / cocos / deprecated / CCBool . h <nl> <nl> / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * <nl> Copyright ( c ) 2010 - 2012 cocos2d - x . org <nl> - Copyright ( c ) 2013 - 2014 Chukong Technologies Inc . <nl> + Copyright ( c ) 2013 - 2015 Chukong Technologies Inc . <nl> <nl> http : / / www . cocos2d - x . org <nl> <nl> Copyright ( c ) 2013 - 2014 Chukong Technologies Inc . <nl> <nl> # ifndef __CCBOOL_H__ <nl> # define __CCBOOL_H__ <nl> + / / / @ cond DO_NOT_SHOW <nl> <nl> # include " base / CCRef . h " <nl> # include " base / CCDataVisitor . h " <nl> class CC_DLL __Bool : public Ref , public Clonable <nl> <nl> NS_CC_END <nl> <nl> + / / / @ endcond <nl> # endif / * __CCBOOL_H__ * / <nl> mmm a / cocos / deprecated / CCDeprecated . h <nl> ppp b / cocos / deprecated / CCDeprecated . h <nl> <nl> / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * <nl> Copyright ( c ) 2013 cocos2d - x . org <nl> - Copyright ( c ) 2013 - 2014 Chukong Technologies Inc . <nl> + Copyright ( c ) 2013 - 2015 Chukong Technologies Inc . <nl> <nl> http : / / www . cocos2d - x . org <nl> <nl> <nl> THE SOFTWARE . <nl> * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / <nl> <nl> + / / / @ cond DO_NOT_SHOW <nl> + <nl> / * * Add deprecated global functions and variables here <nl> * / <nl> <nl> CC_DEPRECATED_ATTRIBUTE CC_DLL Vec4 * kmVec4Transform ( Vec4 * pOut , const Vec4 * pV , <nl> <nl> NS_CC_END <nl> <nl> - <nl> + / / / @ endcond <nl> # endif / / __COCOS2D_CCDEPRECATED_H__ <nl> mmm a / cocos / deprecated / CCDictionary . h <nl> ppp b / cocos / deprecated / CCDictionary . h <nl> <nl> / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * <nl> Copyright ( c ) 2012 cocos2d - x . org <nl> - opyright ( c ) 2013 - 2014 Chukong Technologies Inc . <nl> + opyright ( c ) 2013 - 2015 Chukong Technologies Inc . <nl> <nl> http : / / www . cocos2d - x . org <nl> <nl> THE SOFTWARE . <nl> <nl> # ifndef __CCDICTIONARY_H__ <nl> # define __CCDICTIONARY_H__ <nl> + / / / @ cond DO_NOT_SHOW <nl> <nl> # include " base / uthash . h " <nl> # include " base / CCRef . h " <nl> class CC_DLL __Dictionary : public Ref , public Clonable <nl> <nl> NS_CC_END <nl> <nl> + / / / @ endcond <nl> # endif / * __CCDICTIONARY_H__ * / <nl> mmm a / cocos / deprecated / CCDouble . h <nl> ppp b / cocos / deprecated / CCDouble . h <nl> <nl> / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * <nl> - Copyright ( c ) 2013 - 2014 Chukong Technologies <nl> + Copyright ( c ) 2013 - 2015 Chukong Technologies <nl> <nl> http : / / www . cocos2d - x . org <nl> <nl> <nl> <nl> # ifndef __CCDOUBLE_H__ <nl> # define __CCDOUBLE_H__ <nl> + / / / @ cond DO_NOT_SHOW <nl> <nl> # include " base / CCRef . h " <nl> # include " base / CCDataVisitor . h " <nl> class CC_DLL __Double : public Ref , public Clonable <nl> <nl> NS_CC_END <nl> <nl> + / / / @ endcond <nl> # endif / * __CCDOUBLE_H__ * / <nl> mmm a / cocos / deprecated / CCFloat . h <nl> ppp b / cocos / deprecated / CCFloat . h <nl> <nl> / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * <nl> - Copyright ( c ) 2013 - 2014 Chukong Technologies <nl> + Copyright ( c ) 2013 - 2015 Chukong Technologies <nl> <nl> http : / / www . cocos2d - x . org <nl> <nl> <nl> <nl> # ifndef __CCFLOAT_H__ <nl> # define __CCFLOAT_H__ <nl> + / / / @ cond DO_NOT_SHOW <nl> <nl> # include " base / CCRef . h " <nl> # include " base / CCDataVisitor . h " <nl> class CC_DLL __Float : public Ref , public Clonable <nl> <nl> NS_CC_END <nl> <nl> + / / / @ endcond <nl> # endif / * __CCFLOAT_H__ * / <nl> mmm a / cocos / deprecated / CCInteger . h <nl> ppp b / cocos / deprecated / CCInteger . h <nl> <nl> / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * <nl> - Copyright ( c ) 2013 - 2014 Chukong Technologies <nl> + Copyright ( c ) 2013 - 2015 Chukong Technologies <nl> <nl> http : / / www . cocos2d - x . org <nl> <nl> <nl> <nl> # ifndef __CCINTEGER_H__ <nl> # define __CCINTEGER_H__ <nl> + / / / @ cond DO_NOT_SHOW <nl> <nl> # include " base / CCRef . h " <nl> # include " base / CCConsole . h " <nl> class CC_DLL __Integer : public Ref , public Clonable <nl> <nl> NS_CC_END <nl> <nl> + / / / @ endcond <nl> # endif / * __CCINTEGER_H__ * / <nl> mmm a / cocos / deprecated / CCNotificationCenter . h <nl> ppp b / cocos / deprecated / CCNotificationCenter . h <nl> <nl> / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * <nl> Copyright ( c ) 2011 Erawppa <nl> Copyright ( c ) 2010 - 2012 cocos2d - x . org <nl> - Copyright ( c ) 2013 - 2014 Chukong Technologies Inc . <nl> + Copyright ( c ) 2013 - 2015 Chukong Technologies Inc . <nl> <nl> http : / / www . cocos2d - x . org <nl> <nl> THE SOFTWARE . <nl> <nl> # ifndef __CCNOTIFICATIONCENTER_H__ <nl> # define __CCNOTIFICATIONCENTER_H__ <nl> + / / / @ cond DO_NOT_SHOW <nl> <nl> # include " base / CCRef . h " <nl> # include " base / ccTypes . h " <nl> class CC_DLL NotificationObserver : public Ref <nl> <nl> NS_CC_END <nl> <nl> + / / / @ endcond <nl> # endif / / __CCNOTIFICATIONCENTER_H__ <nl> mmm a / cocos / deprecated / CCSet . h <nl> ppp b / cocos / deprecated / CCSet . h <nl> <nl> / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * <nl> Copyright ( c ) 2010 - 2012 cocos2d - x . org <nl> - Copyright ( c ) 2013 - 2014 Chukong Technologies <nl> + Copyright ( c ) 2013 - 2015 Chukong Technologies <nl> <nl> http : / / www . cocos2d - x . org <nl> <nl> THE SOFTWARE . <nl> <nl> # ifndef __CC_SET_H__ <nl> # define __CC_SET_H__ <nl> + / / / @ cond DO_NOT_SHOW <nl> <nl> # include < set > <nl> # include " base / CCRef . h " <nl> class CC_DLL __Set : public Ref <nl> <nl> NS_CC_END <nl> <nl> + / / / @ endcond <nl> # endif / / __CC_SET_H__ <nl> - <nl> mmm a / cocos / deprecated / CCString . h <nl> ppp b / cocos / deprecated / CCString . h <nl> <nl> / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * <nl> Copyright ( c ) 2010 - 2012 cocos2d - x . org <nl> - Copyright ( c ) 2013 - 2014 Chukong Technologies <nl> + Copyright ( c ) 2013 - 2015 Chukong Technologies <nl> <nl> http : / / www . cocos2d - x . org <nl> <nl> LIABILITY , WHETHER IN AN ACTION OF CONTRACT , TORT OR OTHERWISE , ARISING FROM , <nl> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN <nl> THE SOFTWARE . <nl> * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / <nl> + <nl> # ifndef __CCSTRING_H__ <nl> # define __CCSTRING_H__ <nl> + / / / @ cond DO_NOT_SHOW <nl> <nl> # if ( CC_TARGET_PLATFORM = = CC_PLATFORM_BLACKBERRY ) <nl> # include < string . h > <nl> std : : string CC_DLL format ( const char * format , . . . ) CC_FORMAT_PRINTF ( 1 , 2 ) ; <nl> <nl> NS_CC_END <nl> <nl> + / / / @ endcond <nl> # endif / / __CCSTRING_H__ <nl> mmm a / cocos / network / HttpAsynConnection . h <nl> ppp b / cocos / network / HttpAsynConnection . h <nl> <nl> / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * <nl> - Copyright ( c ) 2013 - 2014 Chukong Technologies Inc . <nl> + Copyright ( c ) 2013 - 2015 Chukong Technologies Inc . <nl> <nl> http : / / www . cocos2d - x . org <nl> <nl> <nl> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN <nl> THE SOFTWARE . <nl> * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / <nl> + <nl> # ifndef __HTTPASYNCONNECTION_H__ <nl> # define __HTTPASYNCONNECTION_H__ <nl> + / / / @ cond DO_NOT_SHOW <nl> <nl> # import < Foundation / Foundation . h > <nl> # import < Security / Security . h > <nl> <nl> - ( void ) startRequest : ( NSURLRequest * ) request ; <nl> <nl> @ end <nl> + <nl> / / / @ endcond <nl> # endif / / __HTTPASYNCONNECTION_H__ <nl> mmm a / cocos / network / HttpCookie . h <nl> ppp b / cocos / network / HttpCookie . h <nl> <nl> / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * <nl> - Copyright ( c ) 2013 - 2014 Chukong Technologies Inc . <nl> + Copyright ( c ) 2013 - 2015 Chukong Technologies Inc . <nl> <nl> http : / / www . cocos2d - x . org <nl> <nl> <nl> <nl> # ifndef HTTP_COOKIE_H <nl> # define HTTP_COOKIE_H <nl> + / / / @ cond DO_NOT_SHOW <nl> <nl> struct CookiesInfo <nl> { <nl> class HttpCookie <nl> std : : vector < CookiesInfo > _cookies ; <nl> } ; <nl> <nl> + / / / @ endcond <nl> # endif / * HTTP_COOKIE_H * / <nl> mmm a / cocos / platform / CCApplication . h <nl> ppp b / cocos / platform / CCApplication . h <nl> <nl> / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * <nl> Copyright ( c ) 2010 - 2012 cocos2d - x . org <nl> - Copyright ( c ) 2013 - 2014 Chukong Technologies Inc . <nl> + Copyright ( c ) 2013 - 2015 Chukong Technologies Inc . <nl> <nl> http : / / www . cocos2d - x . org <nl> <nl> THE SOFTWARE . <nl> <nl> # ifndef __PLATFORM_CCAPPLICATION_H__ <nl> # define __PLATFORM_CCAPPLICATION_H__ <nl> + / / / @ cond DO_NOT_SHOW <nl> <nl> # include " platform / CCPlatformConfig . h " <nl> <nl> THE SOFTWARE . <nl> # include " platform / linux / CCApplication - linux . h " <nl> # endif <nl> <nl> + / / / @ endcond <nl> # endif / * __PLATFORM_CCAPPLICATION_H__ * / <nl> mmm a / cocos / platform / CCCommon . h <nl> ppp b / cocos / platform / CCCommon . h <nl> <nl> / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * <nl> Copyright ( c ) 2010 - 2012 cocos2d - x . org <nl> - Copyright ( c ) 2013 - 2014 Chukong Technologies Inc . <nl> + Copyright ( c ) 2013 - 2015 Chukong Technologies Inc . <nl> <nl> http : / / www . cocos2d - x . org <nl> <nl> THE SOFTWARE . <nl> <nl> # ifndef __CC_COMMON_H__ <nl> # define __CC_COMMON_H__ <nl> + / / / @ cond DO_NOT_SHOW <nl> <nl> # include " platform / CCPlatformMacros . h " <nl> <nl> enum class LanguageType <nl> <nl> NS_CC_END <nl> <nl> + / / / @ endcond <nl> # endif / / __CC_COMMON_H__ <nl> mmm a / cocos / platform / CCGL . h <nl> ppp b / cocos / platform / CCGL . h <nl> <nl> / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * <nl> Copyright ( c ) 2010 - 2012 cocos2d - x . org <nl> - Copyright ( c ) 2013 - 2014 Chukong Technologies Inc . <nl> + Copyright ( c ) 2013 - 2015 Chukong Technologies Inc . <nl> <nl> http : / / www . cocos2d - x . org <nl> <nl> THE SOFTWARE . <nl> <nl> # ifndef __PLATFORM_CCGL_H__ <nl> # define __PLATFORM_CCGL_H__ <nl> + / / / @ cond DO_NOT_SHOW <nl> <nl> # include " platform / CCPlatformConfig . h " <nl> <nl> THE SOFTWARE . <nl> # include " platform / linux / CCGL - linux . h " <nl> # endif <nl> <nl> + / / / @ endcond <nl> # endif / * __PLATFORM_CCPLATFORMDEFINE_H__ * / <nl> mmm a / cocos / platform / CCImage . h <nl> ppp b / cocos / platform / CCImage . h <nl> <nl> / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * <nl> Copyright ( c ) 2010 - 2012 cocos2d - x . org <nl> - Copyright ( c ) 2013 - 2014 Chukong Technologies Inc . <nl> + Copyright ( c ) 2013 - 2015 Chukong Technologies Inc . <nl> <nl> http : / / www . cocos2d - x . org <nl> <nl> THE SOFTWARE . <nl> <nl> # ifndef __CC_IMAGE_H__ <nl> # define __CC_IMAGE_H__ <nl> + / / / @ cond DO_NOT_SHOW <nl> <nl> # include " base / CCRef . h " <nl> # include " renderer / CCTexture2D . h " <nl> class CC_DLL Image : public Ref <nl> <nl> NS_CC_END <nl> <nl> + / / / @ endcond <nl> # endif / / __CC_IMAGE_H__ <nl> mmm a / cocos / platform / CCPlatformConfig . h <nl> ppp b / cocos / platform / CCPlatformConfig . h <nl> <nl> / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * <nl> Copyright ( c ) 2010 - 2012 cocos2d - x . org <nl> - Copyright ( c ) 2013 - 2014 Chukong Technologies <nl> + Copyright ( c ) 2013 - 2015 Chukong Technologies <nl> <nl> http : / / www . cocos2d - x . org <nl> <nl> THE SOFTWARE . <nl> <nl> # ifndef __BASE_CC_PLATFORM_CONFIG_H__ <nl> # define __BASE_CC_PLATFORM_CONFIG_H__ <nl> + / / / @ cond DO_NOT_SHOW <nl> <nl> / * * <nl> Config of cocos2d - x project , per target platform . <nl> THE SOFTWARE . <nl> # endif <nl> # endif / / CC_PLATFORM_WIN32 <nl> <nl> + / / / @ endcond <nl> # endif / / __BASE_CC_PLATFORM_CONFIG_H__ <nl> - <nl> mmm a / cocos / platform / CCPlatformDefine . h <nl> ppp b / cocos / platform / CCPlatformDefine . h <nl> <nl> / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * <nl> Copyright ( c ) 2010 - 2012 cocos2d - x . org <nl> - Copyright ( c ) 2013 - 2014 Chukong Technologies Inc . <nl> + Copyright ( c ) 2013 - 2015 Chukong Technologies Inc . <nl> <nl> http : / / www . cocos2d - x . org <nl> <nl> THE SOFTWARE . <nl> <nl> # ifndef __PLATFORM_CCPLATFORMDEFINE_H__ <nl> # define __PLATFORM_CCPLATFORMDEFINE_H__ <nl> + / / / @ cond DO_NOT_SHOW <nl> <nl> # include " platform / CCPlatformConfig . h " <nl> <nl> THE SOFTWARE . <nl> # include " platform / linux / CCPlatformDefine - linux . h " <nl> # endif <nl> <nl> + / / / @ endcond <nl> # endif / * __PLATFORM_CCPLATFORMDEFINE_H__ * / <nl> mmm a / cocos / platform / CCPlatformMacros . h <nl> ppp b / cocos / platform / CCPlatformMacros . h <nl> <nl> / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * <nl> Copyright ( c ) 2010 - 2012 cocos2d - x . org <nl> - Copyright ( c ) 2013 - 2014 Chukong Technologies <nl> + Copyright ( c ) 2013 - 2015 Chukong Technologies <nl> <nl> http : / / www . cocos2d - x . org <nl> <nl> Copyright ( c ) 2013 - 2014 Chukong Technologies <nl> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN <nl> THE SOFTWARE . <nl> * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / <nl> + <nl> # ifndef __CC_PLATFORM_MACROS_H__ <nl> # define __CC_PLATFORM_MACROS_H__ <nl> + / / / @ cond DO_NOT_SHOW <nl> <nl> / * * <nl> * define some platform specific macros <nl> public : virtual void set # # funName ( varType var ) \ <nl> # endif <nl> # endif <nl> <nl> + / / / @ endcond <nl> # endif / / __CC_PLATFORM_MACROS_H__ <nl> mmm a / cocos / platform / CCSAXParser . h <nl> ppp b / cocos / platform / CCSAXParser . h <nl> <nl> <nl> # ifndef __CCSAXPARSER_H__ <nl> # define __CCSAXPARSER_H__ <nl> + / / / @ cond DO_NOT_SHOW <nl> <nl> # include " platform / CCPlatformConfig . h " <nl> # include " platform / CCCommon . h " <nl> class CC_DLL SAXParser <nl> <nl> NS_CC_END <nl> <nl> + / / / @ endcond <nl> # endif / / __CCSAXPARSER_H__ <nl> mmm a / cocos / platform / CCStdC . h <nl> ppp b / cocos / platform / CCStdC . h <nl> <nl> / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * <nl> Copyright ( c ) 2010 - 2012 cocos2d - x . org <nl> - Copyright ( c ) 2013 - 2014 Chukong Technologies Inc . <nl> + Copyright ( c ) 2013 - 2015 Chukong Technologies Inc . <nl> <nl> http : / / www . cocos2d - x . org <nl> <nl> mmm a / cocos / platform / CCThread . h <nl> ppp b / cocos / platform / CCThread . h <nl> <nl> / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * <nl> Copyright ( c ) 2010 - 2012 cocos2d - x . org <nl> - Copyright ( c ) 2013 - 2014 Chukong Technologies Inc . <nl> + Copyright ( c ) 2013 - 2015 Chukong Technologies Inc . <nl> <nl> http : / / www . cocos2d - x . org <nl> <nl> THE SOFTWARE . <nl> <nl> # ifndef __CC_PLATFORM_THREAD_H__ <nl> # define __CC_PLATFORM_THREAD_H__ <nl> + / / / @ cond DO_NOT_SHOW <nl> <nl> # include " platform / CCPlatformMacros . h " <nl> <nl> class CC_DLL ThreadHelper <nl> <nl> NS_CC_END <nl> <nl> + / / / @ endcond <nl> # endif / / __CC_PLATFORM_THREAD_H__ <nl> mmm a / cocos / renderer / CCRenderCommandPool . h <nl> ppp b / cocos / renderer / CCRenderCommandPool . h <nl> <nl> / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * <nl> - Copyright ( c ) 2013 - 2014 Chukong Technologies Inc . <nl> + Copyright ( c ) 2013 - 2015 Chukong Technologies Inc . <nl> <nl> http : / / www . cocos2d - x . org <nl> <nl> <nl> THE SOFTWARE . <nl> * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / <nl> <nl> - <nl> # ifndef __CC_RENDERCOMMANDPOOL_H__ <nl> # define __CC_RENDERCOMMANDPOOL_H__ <nl> + / / / @ cond DO_NOT_SHOW <nl> <nl> # include < list > <nl> <nl> class RenderCommandPool <nl> <nl> NS_CC_END <nl> <nl> + / / / @ endcond <nl> # endif <nl> mmm a / cocos / renderer / ccShaders . h <nl> ppp b / cocos / renderer / ccShaders . h <nl> <nl> / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * <nl> Copyright ( c ) 2011 Zynga Inc . <nl> Copyright ( c ) 2012 cocos2d - x . org <nl> - Copyright ( c ) 2013 - 2014 Chukong Technologies Inc . <nl> + Copyright ( c ) 2013 - 2015 Chukong Technologies Inc . <nl> <nl> http : / / www . cocos2d - x . org <nl> <nl> LIABILITY , WHETHER IN AN ACTION OF CONTRACT , TORT OR OTHERWISE , ARISING FROM , <nl> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN <nl> THE SOFTWARE . <nl> * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / <nl> + <nl> # ifndef __CCSHADER_H__ <nl> # define __CCSHADER_H__ <nl> + / / / @ cond DO_NOT_SHOW <nl> <nl> # include " platform / CCGL . h " <nl> # include " platform / CCPlatformMacros . h " <nl> extern CC_DLL const GLchar * cc3D_Particle_color_frag ; <nl> <nl> NS_CC_END <nl> <nl> + / / / @ endcond <nl> # endif / * __CCSHADER_H__ * / <nl> mmm a / cocos / ui / UIDeprecated . h <nl> ppp b / cocos / ui / UIDeprecated . h <nl> <nl> / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * <nl> - Copyright ( c ) 2013 - 2014 Chukong Technologies Inc . <nl> + Copyright ( c ) 2013 - 2015 Chukong Technologies Inc . <nl> <nl> http : / / www . cocos2d - x . org <nl> <nl> <nl> <nl> # ifndef cocos2d_libs_UIDeprecated_h <nl> # define cocos2d_libs_UIDeprecated_h <nl> + / / / @ cond DO_NOT_SHOW <nl> <nl> # include " platform / CCPlatformMacros . h " <nl> # include " ui / UIWidget . h " <nl> CC_DEPRECATED_ATTRIBUTE extern const Margin MarginZero ; <nl> <nl> NS_CC_END <nl> <nl> + / / / @ endcond <nl> # endif <nl> mmm a / cocos / ui / UIWebView - inl . h <nl> ppp b / cocos / ui / UIWebView - inl . h <nl> <nl> / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * <nl> - Copyright ( c ) 2014 Chukong Technologies Inc . <nl> + Copyright ( c ) 2014 - 2015 Chukong Technologies Inc . <nl> <nl> http : / / www . cocos2d - x . org <nl> <nl> <nl> THE SOFTWARE . <nl> * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / <nl> <nl> + / / / @ cond DO_NOT_SHOW <nl> <nl> # include " UIWebView . h " <nl> # include " platform / CCGLView . h " <nl> # include " base / CCDirector . h " <nl> # include " platform / CCFileUtils . h " <nl> <nl> - <nl> - <nl> NS_CC_BEGIN <nl> namespace experimental { <nl> namespace ui { <nl> namespace experimental { <nl> } / / namespace experimental <nl> } / / namespace cocos2d <nl> <nl> + / / / @ endcond <nl> mmm a / cocos / ui / UIWebViewImpl - android . h <nl> ppp b / cocos / ui / UIWebViewImpl - android . h <nl> <nl> / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * <nl> - Copyright ( c ) 2014 Chukong Technologies Inc . <nl> + Copyright ( c ) 2014 - 2015 Chukong Technologies Inc . <nl> <nl> http : / / www . cocos2d - x . org <nl> <nl> <nl> <nl> # ifndef __COCOS2D__UI__WEBVIEWIMPL_ANDROID_H_ <nl> # define __COCOS2D__UI__WEBVIEWIMPL_ANDROID_H_ <nl> + / / / @ cond DO_NOT_SHOW <nl> <nl> # ifdef __ANDROID__ <nl> <nl> namespace cocos2d { <nl> <nl> # endif / / __ANDROID__ <nl> <nl> + / / / @ endcond <nl> # endif / * __COCOS2D__UI__WEBVIEWIMPL_ANDROID_H_ * / <nl> mmm a / cocos / ui / UIWebViewImpl - ios . h <nl> ppp b / cocos / ui / UIWebViewImpl - ios . h <nl> <nl> / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * <nl> - Copyright ( c ) 2014 Chukong Technologies Inc . <nl> + Copyright ( c ) 2014 - 2015 Chukong Technologies Inc . <nl> <nl> http : / / www . cocos2d - x . org <nl> <nl> <nl> <nl> # ifndef __COCOS2D_UI_WEBVIEWIMPL_IOS_H_ <nl> # define __COCOS2D_UI_WEBVIEWIMPL_IOS_H_ <nl> + / / / @ cond DO_NOT_SHOW <nl> <nl> # include < iosfwd > <nl> <nl> class WebViewImpl { <nl> } / / namespace experimental <nl> } / / namespace cocos2d <nl> <nl> + / / / @ endcond <nl> # endif / * __COCOS2D_UI_WEBVIEWIMPL_IOS_H_ * / <nl>
Merge pull request from WenhaiLin / v3 - doxygen
cocos2d/cocos2d-x
e6d1dcef5863f2c395ff43ab49b9dd65c2f6a1d4
2015-03-24T12:33:17Z
mmm a / bazel / repository_locations . bzl <nl> ppp b / bazel / repository_locations . bzl <nl> REPOSITORY_LOCATIONS = dict ( <nl> urls = [ " https : / / github . com / google / protobuf / archive / v3 . 5 . 0 . tar . gz " ] , <nl> ) , <nl> envoy_api = dict ( <nl> - commit = " 8345af596d78d5da6becb0538fced3d65efbaadf " , <nl> + commit = " 4e533f22baced334c4aba68fb60c5fc439f0fe9c " , <nl> remote = " https : / / github . com / envoyproxy / data - plane - api " , <nl> ) , <nl> grpc_httpjson_transcoding = dict ( <nl> mmm a / include / envoy / grpc / BUILD <nl> ppp b / include / envoy / grpc / BUILD <nl> envoy_cc_library ( <nl> deps = [ <nl> " : async_client_interface " , <nl> " / / include / envoy / stats : stats_interface " , <nl> - " @ envoy_api / / envoy / api / v2 : grpc_service_cc " , <nl> + " @ envoy_api / / envoy / api / v2 / core : grpc_service_cc " , <nl> ] , <nl> ) <nl> <nl> mmm a / include / envoy / grpc / async_client_manager . h <nl> ppp b / include / envoy / grpc / async_client_manager . h <nl> <nl> # pragma once <nl> <nl> - # include " envoy / api / v2 / grpc_service . pb . h " <nl> + # include " envoy / api / v2 / core / grpc_service . pb . h " <nl> # include " envoy / grpc / async_client . h " <nl> # include " envoy / stats / stats . h " <nl> <nl> class AsyncClientManager { <nl> / * * <nl> * Create a Grpc : : AsyncClients factory for a service . Validation of the service is performed and <nl> * will raise an exception on failure . <nl> - * @ param grpc_service envoy : : api : : v2 : : GrpcService configuration . <nl> + * @ param grpc_service envoy : : api : : v2 : : core : : GrpcService configuration . <nl> * @ param scope stats scope . <nl> * @ return AsyncClientFactoryPtr factory for grpc_service . <nl> * @ throws EnvoyException when grpc_service validation fails . <nl> * / <nl> virtual AsyncClientFactoryPtr <nl> - factoryForGrpcService ( const envoy : : api : : v2 : : GrpcService & grpc_service , Stats : : Scope & scope ) PURE ; <nl> + factoryForGrpcService ( const envoy : : api : : v2 : : core : : GrpcService & grpc_service , <nl> + Stats : : Scope & scope ) PURE ; <nl> } ; <nl> <nl> typedef std : : unique_ptr < AsyncClientManager > AsyncClientManagerPtr ; <nl> mmm a / include / envoy / local_info / BUILD <nl> ppp b / include / envoy / local_info / BUILD <nl> envoy_cc_library ( <nl> hdrs = [ " local_info . h " ] , <nl> deps = [ <nl> " / / include / envoy / network : address_interface " , <nl> - " @ envoy_api / / envoy / api / v2 : base_cc " , <nl> + " @ envoy_api / / envoy / api / v2 / core : base_cc " , <nl> ] , <nl> ) <nl> mmm a / include / envoy / local_info / local_info . h <nl> ppp b / include / envoy / local_info / local_info . h <nl> <nl> <nl> # include < string > <nl> <nl> - # include " envoy / api / v2 / base . pb . h " <nl> + # include " envoy / api / v2 / core / base . pb . h " <nl> # include " envoy / common / pure . h " <nl> # include " envoy / network / address . h " <nl> <nl> class LocalInfo { <nl> / * * <nl> * v2 API Node protobuf . This is the full node identity presented to management servers . <nl> * / <nl> - virtual const envoy : : api : : v2 : : Node & node ( ) const PURE ; <nl> + virtual const envoy : : api : : v2 : : core : : Node & node ( ) const PURE ; <nl> } ; <nl> <nl> typedef std : : unique_ptr < LocalInfo > LocalInfoPtr ; <nl> mmm a / include / envoy / network / resolver . h <nl> ppp b / include / envoy / network / resolver . h <nl> <nl> # include < cstdint > <nl> # include < string > <nl> <nl> - # include " envoy / api / v2 / address . pb . h " <nl> + # include " envoy / api / v2 / core / address . pb . h " <nl> # include " envoy / common / pure . h " <nl> # include " envoy / network / address . h " <nl> <nl> class Resolver { <nl> * @ param socket_address supplies the socket address to resolve . <nl> * @ return InstanceConstSharedPtr appropriate Address : : Instance . <nl> * / <nl> - virtual InstanceConstSharedPtr resolve ( const envoy : : api : : v2 : : SocketAddress & socket_address ) PURE ; <nl> + virtual InstanceConstSharedPtr <nl> + resolve ( const envoy : : api : : v2 : : core : : SocketAddress & socket_address ) PURE ; <nl> <nl> / * * <nl> * @ return std : : string the identifying name for a particular implementation of <nl> mmm a / include / envoy / router / BUILD <nl> ppp b / include / envoy / router / BUILD <nl> envoy_cc_library ( <nl> " / / include / envoy / stats : stats_interface " , <nl> " / / include / envoy / thread_local : thread_local_interface " , <nl> " / / include / envoy / upstream : cluster_manager_interface " , <nl> - " @ envoy_api / / envoy / api / v2 / filter / network : http_connection_manager_cc " , <nl> + " @ envoy_api / / envoy / config / filter / network / http_connection_manager / v2 : http_connection_manager_cc " , <nl> ] , <nl> ) <nl> <nl> mmm a / include / envoy / router / route_config_provider_manager . h <nl> ppp b / include / envoy / router / route_config_provider_manager . h <nl> <nl> <nl> # include < string > <nl> <nl> - # include " envoy / api / v2 / filter / network / http_connection_manager . pb . h " <nl> + # include " envoy / config / filter / network / http_connection_manager / v2 / http_connection_manager . pb . h " <nl> # include " envoy / event / dispatcher . h " <nl> # include " envoy / init / init . h " <nl> # include " envoy / json / json_object . h " <nl> class RouteConfigProviderManager { <nl> * @ param stat_prefix supplies the stat_prefix to use for the provider stats . <nl> * @ param init_manager supplies the init manager . <nl> * / <nl> - virtual RouteConfigProviderSharedPtr <nl> - getRouteConfigProvider ( const envoy : : api : : v2 : : filter : : network : : Rds & rds , <nl> - Upstream : : ClusterManager & cm , Stats : : Scope & scope , <nl> - const std : : string & stat_prefix , Init : : Manager & init_manager ) PURE ; <nl> + virtual RouteConfigProviderSharedPtr getRouteConfigProvider ( <nl> + const envoy : : config : : filter : : network : : http_connection_manager : : v2 : : Rds & rds , <nl> + Upstream : : ClusterManager & cm , Stats : : Scope & scope , const std : : string & stat_prefix , <nl> + Init : : Manager & init_manager ) PURE ; <nl> } ; <nl> <nl> / * * <nl> mmm a / include / envoy / router / router . h <nl> ppp b / include / envoy / router / router . h <nl> <nl> # include < string > <nl> <nl> # include " envoy / access_log / access_log . h " <nl> - # include " envoy / api / v2 / base . pb . h " <nl> + # include " envoy / api / v2 / core / base . pb . h " <nl> # include " envoy / common / optional . h " <nl> # include " envoy / http / codec . h " <nl> # include " envoy / http / codes . h " <nl> class RouteEntry : public ResponseEntry { <nl> virtual bool includeVirtualHostRateLimits ( ) const PURE ; <nl> <nl> / * * <nl> - * @ return const envoy : : api : : v2 : : Metadata & return the metadata provided in the config for this <nl> - * route . <nl> + * @ return const envoy : : api : : v2 : : core : : Metadata & return the metadata provided in the config for <nl> + * this route . <nl> * / <nl> - virtual const envoy : : api : : v2 : : Metadata & metadata ( ) const PURE ; <nl> + virtual const envoy : : api : : v2 : : core : : Metadata & metadata ( ) const PURE ; <nl> } ; <nl> <nl> / * * <nl> mmm a / include / envoy / server / BUILD <nl> ppp b / include / envoy / server / BUILD <nl> envoy_cc_library ( <nl> " / / source / common / common : assert_lib " , <nl> " / / source / common / common : macros " , <nl> " / / source / common / protobuf " , <nl> - " @ envoy_api / / envoy / api / v2 : base_cc " , <nl> + " @ envoy_api / / envoy / api / v2 / core : base_cc " , <nl> ] , <nl> ) <nl> <nl> mmm a / include / envoy / server / filter_config . h <nl> ppp b / include / envoy / server / filter_config . h <nl> <nl> # include < functional > <nl> <nl> # include " envoy / access_log / access_log . h " <nl> - # include " envoy / api / v2 / base . pb . h " <nl> + # include " envoy / api / v2 / core / base . pb . h " <nl> # include " envoy / http / filter . h " <nl> # include " envoy / init / init . h " <nl> # include " envoy / json / json_object . h " <nl> class FactoryContext { <nl> virtual Stats : : Scope & listenerScope ( ) PURE ; <nl> <nl> / * * <nl> - * @ return const envoy : : api : : v2 : : Metadata & the config metadata associated with this listener . <nl> + * @ return const envoy : : api : : v2 : : core : : Metadata & the config metadata associated with this <nl> + * listener . <nl> * / <nl> - virtual const envoy : : api : : v2 : : Metadata & listenerMetadata ( ) const PURE ; <nl> + virtual const envoy : : api : : v2 : : core : : Metadata & listenerMetadata ( ) const PURE ; <nl> } ; <nl> <nl> class ListenerFactoryContext : public FactoryContext { <nl> mmm a / include / envoy / upstream / BUILD <nl> ppp b / include / envoy / upstream / BUILD <nl> envoy_cc_library ( <nl> " : outlier_detection_interface " , <nl> " / / include / envoy / network : address_interface " , <nl> " / / include / envoy / stats : stats_macros " , <nl> - " @ envoy_api / / envoy / api / v2 : base_cc " , <nl> + " @ envoy_api / / envoy / api / v2 / core : base_cc " , <nl> ] , <nl> ) <nl> <nl> mmm a / include / envoy / upstream / cluster_manager . h <nl> ppp b / include / envoy / upstream / cluster_manager . h <nl> class ClusterManagerFactory { <nl> / * * <nl> * Create a CDS API provider from configuration proto . <nl> * / <nl> - virtual CdsApiPtr createCds ( const envoy : : api : : v2 : : ConfigSource & cds_config , <nl> - const Optional < envoy : : api : : v2 : : ConfigSource > & eds_config , <nl> + virtual CdsApiPtr createCds ( const envoy : : api : : v2 : : core : : ConfigSource & cds_config , <nl> + const Optional < envoy : : api : : v2 : : core : : ConfigSource > & eds_config , <nl> ClusterManager & cm ) PURE ; <nl> } ; <nl> <nl> mmm a / include / envoy / upstream / host_description . h <nl> ppp b / include / envoy / upstream / host_description . h <nl> <nl> # include < memory > <nl> # include < string > <nl> <nl> - # include " envoy / api / v2 / base . pb . h " <nl> + # include " envoy / api / v2 / core / base . pb . h " <nl> # include " envoy / network / address . h " <nl> # include " envoy / stats / stats_macros . h " <nl> # include " envoy / upstream / health_check_host_monitor . h " <nl> class HostDescription { <nl> / * * <nl> * @ return the metadata associated with this host <nl> * / <nl> - virtual const envoy : : api : : v2 : : Metadata & metadata ( ) const PURE ; <nl> + virtual const envoy : : api : : v2 : : core : : Metadata & metadata ( ) const PURE ; <nl> <nl> / * * <nl> * @ return the cluster the host is a member of . <nl> class HostDescription { <nl> * @ return the locality of the host ( deployment specific ) . This will be the default instance if <nl> * unknown . <nl> * / <nl> - virtual const envoy : : api : : v2 : : Locality & locality ( ) const PURE ; <nl> + virtual const envoy : : api : : v2 : : core : : Locality & locality ( ) const PURE ; <nl> } ; <nl> <nl> typedef std : : shared_ptr < const HostDescription > HostDescriptionConstSharedPtr ; <nl> mmm a / include / envoy / upstream / upstream . h <nl> ppp b / include / envoy / upstream / upstream . h <nl> <nl> # include < string > <nl> # include < vector > <nl> <nl> - # include " envoy / api / v2 / base . pb . h " <nl> + # include " envoy / api / v2 / core / base . pb . h " <nl> # include " envoy / common / callback . h " <nl> # include " envoy / common / optional . h " <nl> # include " envoy / http / codec . h " <nl> class ClusterInfo { <nl> virtual const LoadBalancerSubsetInfo & lbSubsetInfo ( ) const PURE ; <nl> <nl> / * * <nl> - * @ return const envoy : : api : : v2 : : Metadata & the configuration metadata for this cluster . <nl> + * @ return const envoy : : api : : v2 : : core : : Metadata & the configuration metadata for this cluster . <nl> * / <nl> - virtual const envoy : : api : : v2 : : Metadata & metadata ( ) const PURE ; <nl> + virtual const envoy : : api : : v2 : : core : : Metadata & metadata ( ) const PURE ; <nl> } ; <nl> <nl> typedef std : : shared_ptr < const ClusterInfo > ClusterInfoConstSharedPtr ; <nl> mmm a / source / common / access_log / BUILD <nl> ppp b / source / common / access_log / BUILD <nl> envoy_cc_library ( <nl> " / / include / envoy / upstream : cluster_manager_interface " , <nl> " / / source / common / grpc : async_client_lib " , <nl> " / / source / common / network : utility_lib " , <nl> - " @ envoy_api / / envoy / api / v2 / filter / accesslog : accesslog_cc " , <nl> " @ envoy_api / / envoy / config / accesslog / v2 : als_cc " , <nl> + " @ envoy_api / / envoy / config / filter / accesslog / v2 : accesslog_cc " , <nl> " @ envoy_api / / envoy / service / accesslog / v2 : als_cc " , <nl> ] , <nl> ) <nl> mmm a / source / common / access_log / access_log_impl . cc <nl> ppp b / source / common / access_log / access_log_impl . cc <nl> namespace Envoy { <nl> namespace AccessLog { <nl> <nl> ComparisonFilter : : ComparisonFilter ( <nl> - const envoy : : api : : v2 : : filter : : accesslog : : ComparisonFilter & config , Runtime : : Loader & runtime ) <nl> + const envoy : : config : : filter : : accesslog : : v2 : : ComparisonFilter & config , Runtime : : Loader & runtime ) <nl> : config_ ( config ) , runtime_ ( runtime ) { } <nl> <nl> bool ComparisonFilter : : compareAgainstValue ( uint64_t lhs ) { <nl> bool ComparisonFilter : : compareAgainstValue ( uint64_t lhs ) { <nl> } <nl> <nl> switch ( config_ . op ( ) ) { <nl> - case envoy : : api : : v2 : : filter : : accesslog : : ComparisonFilter : : GE : <nl> + case envoy : : config : : filter : : accesslog : : v2 : : ComparisonFilter : : GE : <nl> return lhs > = value ; <nl> - case envoy : : api : : v2 : : filter : : accesslog : : ComparisonFilter : : EQ : <nl> + case envoy : : config : : filter : : accesslog : : v2 : : ComparisonFilter : : EQ : <nl> return lhs = = value ; <nl> default : <nl> NOT_REACHED ; <nl> } <nl> } <nl> <nl> - FilterPtr FilterFactory : : fromProto ( const envoy : : api : : v2 : : filter : : accesslog : : AccessLogFilter & config , <nl> - Runtime : : Loader & runtime ) { <nl> + FilterPtr <nl> + FilterFactory : : fromProto ( const envoy : : config : : filter : : accesslog : : v2 : : AccessLogFilter & config , <nl> + Runtime : : Loader & runtime ) { <nl> switch ( config . filter_specifier_case ( ) ) { <nl> - case envoy : : api : : v2 : : filter : : accesslog : : AccessLogFilter : : kStatusCodeFilter : <nl> + case envoy : : config : : filter : : accesslog : : v2 : : AccessLogFilter : : kStatusCodeFilter : <nl> return FilterPtr { new StatusCodeFilter ( config . status_code_filter ( ) , runtime ) } ; <nl> - case envoy : : api : : v2 : : filter : : accesslog : : AccessLogFilter : : kDurationFilter : <nl> + case envoy : : config : : filter : : accesslog : : v2 : : AccessLogFilter : : kDurationFilter : <nl> return FilterPtr { new DurationFilter ( config . duration_filter ( ) , runtime ) } ; <nl> - case envoy : : api : : v2 : : filter : : accesslog : : AccessLogFilter : : kNotHealthCheckFilter : <nl> + case envoy : : config : : filter : : accesslog : : v2 : : AccessLogFilter : : kNotHealthCheckFilter : <nl> return FilterPtr { new NotHealthCheckFilter ( ) } ; <nl> - case envoy : : api : : v2 : : filter : : accesslog : : AccessLogFilter : : kTraceableFilter : <nl> + case envoy : : config : : filter : : accesslog : : v2 : : AccessLogFilter : : kTraceableFilter : <nl> return FilterPtr { new TraceableRequestFilter ( ) } ; <nl> - case envoy : : api : : v2 : : filter : : accesslog : : AccessLogFilter : : kRuntimeFilter : <nl> + case envoy : : config : : filter : : accesslog : : v2 : : AccessLogFilter : : kRuntimeFilter : <nl> return FilterPtr { new RuntimeFilter ( config . runtime_filter ( ) , runtime ) } ; <nl> - case envoy : : api : : v2 : : filter : : accesslog : : AccessLogFilter : : kAndFilter : <nl> + case envoy : : config : : filter : : accesslog : : v2 : : AccessLogFilter : : kAndFilter : <nl> return FilterPtr { new AndFilter ( config . and_filter ( ) , runtime ) } ; <nl> - case envoy : : api : : v2 : : filter : : accesslog : : AccessLogFilter : : kOrFilter : <nl> + case envoy : : config : : filter : : accesslog : : v2 : : AccessLogFilter : : kOrFilter : <nl> return FilterPtr { new OrFilter ( config . or_filter ( ) , runtime ) } ; <nl> default : <nl> NOT_REACHED ; <nl> bool DurationFilter : : evaluate ( const RequestInfo : : RequestInfo & info , const Http : : <nl> std : : chrono : : duration_cast < std : : chrono : : milliseconds > ( info . duration ( ) ) . count ( ) ) ; <nl> } <nl> <nl> - RuntimeFilter : : RuntimeFilter ( const envoy : : api : : v2 : : filter : : accesslog : : RuntimeFilter & config , <nl> + RuntimeFilter : : RuntimeFilter ( const envoy : : config : : filter : : accesslog : : v2 : : RuntimeFilter & config , <nl> Runtime : : Loader & runtime ) <nl> : runtime_ ( runtime ) , runtime_key_ ( config . runtime_key ( ) ) { } <nl> <nl> bool RuntimeFilter : : evaluate ( const RequestInfo : : RequestInfo & , <nl> } <nl> } <nl> <nl> - OperatorFilter : : OperatorFilter ( <nl> - const Protobuf : : RepeatedPtrField < envoy : : api : : v2 : : filter : : accesslog : : AccessLogFilter > & configs , <nl> - Runtime : : Loader & runtime ) { <nl> + OperatorFilter : : OperatorFilter ( const Protobuf : : RepeatedPtrField < <nl> + envoy : : config : : filter : : accesslog : : v2 : : AccessLogFilter > & configs , <nl> + Runtime : : Loader & runtime ) { <nl> for ( const auto & config : configs ) { <nl> filters_ . emplace_back ( FilterFactory : : fromProto ( config , runtime ) ) ; <nl> } <nl> } <nl> <nl> - OrFilter : : OrFilter ( const envoy : : api : : v2 : : filter : : accesslog : : OrFilter & config , <nl> + OrFilter : : OrFilter ( const envoy : : config : : filter : : accesslog : : v2 : : OrFilter & config , <nl> Runtime : : Loader & runtime ) <nl> : OperatorFilter ( config . filters ( ) , runtime ) { } <nl> <nl> - AndFilter : : AndFilter ( const envoy : : api : : v2 : : filter : : accesslog : : AndFilter & config , <nl> + AndFilter : : AndFilter ( const envoy : : config : : filter : : accesslog : : v2 : : AndFilter & config , <nl> Runtime : : Loader & runtime ) <nl> : OperatorFilter ( config . filters ( ) , runtime ) { } <nl> <nl> bool NotHealthCheckFilter : : evaluate ( const RequestInfo : : RequestInfo & info , const <nl> } <nl> <nl> InstanceSharedPtr <nl> - AccessLogFactory : : fromProto ( const envoy : : api : : v2 : : filter : : accesslog : : AccessLog & config , <nl> + AccessLogFactory : : fromProto ( const envoy : : config : : filter : : accesslog : : v2 : : AccessLog & config , <nl> Server : : Configuration : : FactoryContext & context ) { <nl> FilterPtr filter ; <nl> if ( config . has_filter ( ) ) { <nl> mmm a / source / common / access_log / access_log_impl . h <nl> ppp b / source / common / access_log / access_log_impl . h <nl> <nl> # include < vector > <nl> <nl> # include " envoy / access_log / access_log . h " <nl> - # include " envoy / api / v2 / filter / accesslog / accesslog . pb . h " <nl> + # include " envoy / config / filter / accesslog / v2 / accesslog . pb . h " <nl> # include " envoy / request_info / request_info . h " <nl> # include " envoy / runtime / runtime . h " <nl> # include " envoy / server / access_log_config . h " <nl> class FilterFactory { <nl> / * * <nl> * Read a filter definition from proto and instantiate a concrete filter class . <nl> * / <nl> - static FilterPtr fromProto ( const envoy : : api : : v2 : : filter : : accesslog : : AccessLogFilter & config , <nl> + static FilterPtr fromProto ( const envoy : : config : : filter : : accesslog : : v2 : : AccessLogFilter & config , <nl> Runtime : : Loader & runtime ) ; <nl> } ; <nl> <nl> class FilterFactory { <nl> * / <nl> class ComparisonFilter : public Filter { <nl> protected : <nl> - ComparisonFilter ( const envoy : : api : : v2 : : filter : : accesslog : : ComparisonFilter & config , <nl> + ComparisonFilter ( const envoy : : config : : filter : : accesslog : : v2 : : ComparisonFilter & config , <nl> Runtime : : Loader & runtime ) ; <nl> <nl> bool compareAgainstValue ( uint64_t lhs ) ; <nl> <nl> - envoy : : api : : v2 : : filter : : accesslog : : ComparisonFilter config_ ; <nl> + envoy : : config : : filter : : accesslog : : v2 : : ComparisonFilter config_ ; <nl> Runtime : : Loader & runtime_ ; <nl> } ; <nl> <nl> class ComparisonFilter : public Filter { <nl> * / <nl> class StatusCodeFilter : public ComparisonFilter { <nl> public : <nl> - StatusCodeFilter ( const envoy : : api : : v2 : : filter : : accesslog : : StatusCodeFilter & config , <nl> + StatusCodeFilter ( const envoy : : config : : filter : : accesslog : : v2 : : StatusCodeFilter & config , <nl> Runtime : : Loader & runtime ) <nl> : ComparisonFilter ( config . comparison ( ) , runtime ) { } <nl> <nl> class StatusCodeFilter : public ComparisonFilter { <nl> * / <nl> class DurationFilter : public ComparisonFilter { <nl> public : <nl> - DurationFilter ( const envoy : : api : : v2 : : filter : : accesslog : : DurationFilter & config , <nl> + DurationFilter ( const envoy : : config : : filter : : accesslog : : v2 : : DurationFilter & config , <nl> Runtime : : Loader & runtime ) <nl> : ComparisonFilter ( config . comparison ( ) , runtime ) { } <nl> <nl> class DurationFilter : public ComparisonFilter { <nl> * / <nl> class OperatorFilter : public Filter { <nl> public : <nl> - OperatorFilter ( <nl> - const Protobuf : : RepeatedPtrField < envoy : : api : : v2 : : filter : : accesslog : : AccessLogFilter > & configs , <nl> - Runtime : : Loader & runtime ) ; <nl> + OperatorFilter ( const Protobuf : : RepeatedPtrField < <nl> + envoy : : config : : filter : : accesslog : : v2 : : AccessLogFilter > & configs , <nl> + Runtime : : Loader & runtime ) ; <nl> <nl> protected : <nl> std : : vector < FilterPtr > filters_ ; <nl> class OperatorFilter : public Filter { <nl> * / <nl> class AndFilter : public OperatorFilter { <nl> public : <nl> - AndFilter ( const envoy : : api : : v2 : : filter : : accesslog : : AndFilter & config , Runtime : : Loader & runtime ) ; <nl> + AndFilter ( const envoy : : config : : filter : : accesslog : : v2 : : AndFilter & config , <nl> + Runtime : : Loader & runtime ) ; <nl> <nl> / / AccessLog : : Filter <nl> bool evaluate ( const RequestInfo : : RequestInfo & info , <nl> class AndFilter : public OperatorFilter { <nl> * / <nl> class OrFilter : public OperatorFilter { <nl> public : <nl> - OrFilter ( const envoy : : api : : v2 : : filter : : accesslog : : OrFilter & config , Runtime : : Loader & runtime ) ; <nl> + OrFilter ( const envoy : : config : : filter : : accesslog : : v2 : : OrFilter & config , Runtime : : Loader & runtime ) ; <nl> <nl> / / AccessLog : : Filter <nl> bool evaluate ( const RequestInfo : : RequestInfo & info , <nl> class TraceableRequestFilter : public Filter { <nl> * / <nl> class RuntimeFilter : public Filter { <nl> public : <nl> - RuntimeFilter ( const envoy : : api : : v2 : : filter : : accesslog : : RuntimeFilter & config , <nl> + RuntimeFilter ( const envoy : : config : : filter : : accesslog : : v2 : : RuntimeFilter & config , <nl> Runtime : : Loader & runtime ) ; <nl> <nl> / / AccessLog : : Filter <nl> class AccessLogFactory { <nl> / * * <nl> * Read a filter definition from proto and instantiate an Instance . <nl> * / <nl> - static InstanceSharedPtr fromProto ( const envoy : : api : : v2 : : filter : : accesslog : : AccessLog & config , <nl> + static InstanceSharedPtr fromProto ( const envoy : : config : : filter : : accesslog : : v2 : : AccessLog & config , <nl> Server : : Configuration : : FactoryContext & context ) ; <nl> } ; <nl> <nl> mmm a / source / common / access_log / grpc_access_log_impl . cc <nl> ppp b / source / common / access_log / grpc_access_log_impl . cc <nl> HttpGrpcAccessLog : : HttpGrpcAccessLog ( <nl> grpc_access_log_streamer_ ( grpc_access_log_streamer ) { } <nl> <nl> void HttpGrpcAccessLog : : responseFlagsToAccessLogResponseFlags ( <nl> - envoy : : api : : v2 : : filter : : accesslog : : AccessLogCommon & common_access_log , <nl> + envoy : : config : : filter : : accesslog : : v2 : : AccessLogCommon & common_access_log , <nl> const RequestInfo : : RequestInfo & request_info ) { <nl> <nl> static_assert ( RequestInfo : : ResponseFlag : : LastFlag = = 0x800 , <nl> void HttpGrpcAccessLog : : log ( const Http : : HeaderMap * request_headers , <nl> switch ( request_info . protocol ( ) . value ( ) ) { <nl> case Http : : Protocol : : Http10 : <nl> log_entry - > set_protocol_version ( <nl> - envoy : : api : : v2 : : filter : : accesslog : : HTTPAccessLogEntry : : HTTP10 ) ; <nl> + envoy : : config : : filter : : accesslog : : v2 : : HTTPAccessLogEntry : : HTTP10 ) ; <nl> break ; <nl> case Http : : Protocol : : Http11 : <nl> log_entry - > set_protocol_version ( <nl> - envoy : : api : : v2 : : filter : : accesslog : : HTTPAccessLogEntry : : HTTP11 ) ; <nl> + envoy : : config : : filter : : accesslog : : v2 : : HTTPAccessLogEntry : : HTTP11 ) ; <nl> break ; <nl> case Http : : Protocol : : Http2 : <nl> - log_entry - > set_protocol_version ( envoy : : api : : v2 : : filter : : accesslog : : HTTPAccessLogEntry : : HTTP2 ) ; <nl> + log_entry - > set_protocol_version ( <nl> + envoy : : config : : filter : : accesslog : : v2 : : HTTPAccessLogEntry : : HTTP2 ) ; <nl> break ; <nl> } <nl> } <nl> mmm a / source / common / access_log / grpc_access_log_impl . h <nl> ppp b / source / common / access_log / grpc_access_log_impl . h <nl> <nl> # include < unordered_map > <nl> <nl> # include " envoy / access_log / access_log . h " <nl> - # include " envoy / api / v2 / filter / accesslog / accesslog . pb . h " <nl> # include " envoy / config / accesslog / v2 / als . pb . h " <nl> + # include " envoy / config / filter / accesslog / v2 / accesslog . pb . h " <nl> # include " envoy / grpc / async_client . h " <nl> # include " envoy / grpc / async_client_manager . h " <nl> # include " envoy / local_info / local_info . h " <nl> class HttpGrpcAccessLog : public Instance { <nl> GrpcAccessLogStreamerSharedPtr grpc_access_log_streamer ) ; <nl> <nl> static void responseFlagsToAccessLogResponseFlags ( <nl> - envoy : : api : : v2 : : filter : : accesslog : : AccessLogCommon & common_access_log , <nl> + envoy : : config : : filter : : accesslog : : v2 : : AccessLogCommon & common_access_log , <nl> const RequestInfo : : RequestInfo & request_info ) ; <nl> <nl> / / AccessLog : : Instance <nl> mmm a / source / common / config / BUILD <nl> ppp b / source / common / config / BUILD <nl> envoy_cc_library ( <nl> " / / source / common / common : assert_lib " , <nl> " / / source / common / network : cidr_range_lib " , <nl> " / / source / common / network : utility_lib " , <nl> - " @ envoy_api / / envoy / api / v2 : address_cc " , <nl> + " @ envoy_api / / envoy / api / v2 / core : address_cc " , <nl> ] , <nl> ) <nl> <nl> envoy_cc_library ( <nl> hdrs = [ " base_json . h " ] , <nl> deps = [ <nl> " / / include / envoy / json : json_object_interface " , <nl> - " @ envoy_api / / envoy / api / v2 : base_cc " , <nl> + " @ envoy_api / / envoy / api / v2 / core : base_cc " , <nl> ] , <nl> ) <nl> <nl> envoy_cc_library ( <nl> " / / source / common / json : config_schemas_lib " , <nl> " / / source / common / protobuf " , <nl> " / / source / common / protobuf : utility_lib " , <nl> - " @ envoy_api / / envoy / api / v2 / filter / http : buffer_cc " , <nl> - " @ envoy_api / / envoy / api / v2 / filter / http : fault_cc " , <nl> - " @ envoy_api / / envoy / api / v2 / filter / http : health_check_cc " , <nl> - " @ envoy_api / / envoy / api / v2 / filter / http : lua_cc " , <nl> - " @ envoy_api / / envoy / api / v2 / filter / http : rate_limit_cc " , <nl> - " @ envoy_api / / envoy / api / v2 / filter / http : router_cc " , <nl> - " @ envoy_api / / envoy / api / v2 / filter / http : squash_cc " , <nl> - " @ envoy_api / / envoy / api / v2 / filter / http : transcoder_cc " , <nl> - " @ envoy_api / / envoy / api / v2 / filter / network : client_ssl_auth_cc " , <nl> - " @ envoy_api / / envoy / api / v2 / filter / network : http_connection_manager_cc " , <nl> - " @ envoy_api / / envoy / api / v2 / filter / network : mongo_proxy_cc " , <nl> - " @ envoy_api / / envoy / api / v2 / filter / network : rate_limit_cc " , <nl> - " @ envoy_api / / envoy / api / v2 / filter / network : redis_proxy_cc " , <nl> - " @ envoy_api / / envoy / api / v2 / filter / network : tcp_proxy_cc " , <nl> + " @ envoy_api / / envoy / config / filter / http / buffer / v2 : buffer_cc " , <nl> + " @ envoy_api / / envoy / config / filter / http / fault / v2 : fault_cc " , <nl> + " @ envoy_api / / envoy / config / filter / http / health_check / v2 : health_check_cc " , <nl> + " @ envoy_api / / envoy / config / filter / http / lua / v2 : lua_cc " , <nl> + " @ envoy_api / / envoy / config / filter / http / rate_limit / v2 : rate_limit_cc " , <nl> + " @ envoy_api / / envoy / config / filter / http / router / v2 : router_cc " , <nl> + " @ envoy_api / / envoy / config / filter / http / squash / v2 : squash_cc " , <nl> + " @ envoy_api / / envoy / config / filter / http / transcoder / v2 : transcoder_cc " , <nl> + " @ envoy_api / / envoy / config / filter / network / client_ssl_auth / v2 : client_ssl_auth_cc " , <nl> + " @ envoy_api / / envoy / config / filter / network / http_connection_manager / v2 : http_connection_manager_cc " , <nl> + " @ envoy_api / / envoy / config / filter / network / mongo_proxy / v2 : mongo_proxy_cc " , <nl> + " @ envoy_api / / envoy / config / filter / network / rate_limit / v2 : rate_limit_cc " , <nl> + " @ envoy_api / / envoy / config / filter / network / redis_proxy / v2 : redis_proxy_cc " , <nl> + " @ envoy_api / / envoy / config / filter / network / tcp_proxy / v2 : tcp_proxy_cc " , <nl> ] , <nl> ) <nl> <nl> envoy_cc_library ( <nl> " / / include / envoy / config : subscription_interface " , <nl> " / / include / envoy / event : dispatcher_interface " , <nl> " / / include / envoy / grpc : async_client_interface " , <nl> - " @ envoy_api / / envoy / api / v2 : base_cc " , <nl> + " @ envoy_api / / envoy / api / v2 / core : base_cc " , <nl> ] , <nl> ) <nl> <nl> envoy_cc_library ( <nl> " / / source / common / http : rest_api_fetcher_lib " , <nl> " / / source / common / protobuf " , <nl> " / / source / common / protobuf : utility_lib " , <nl> - " @ envoy_api / / envoy / api / v2 : base_cc " , <nl> + " @ envoy_api / / envoy / api / v2 / core : base_cc " , <nl> ] , <nl> ) <nl> <nl> envoy_cc_library ( <nl> deps = [ <nl> " / / source / common / protobuf " , <nl> " / / source / common / singleton : const_singleton " , <nl> - " @ envoy_api / / envoy / api / v2 : base_cc " , <nl> + " @ envoy_api / / envoy / api / v2 / core : base_cc " , <nl> ] , <nl> ) <nl> <nl> envoy_cc_library ( <nl> deps = [ <nl> " : json_utility_lib " , <nl> " / / include / envoy / json : json_object_interface " , <nl> - " @ envoy_api / / envoy / api / v2 : protocol_cc " , <nl> + " @ envoy_api / / envoy / api / v2 / core : protocol_cc " , <nl> ] , <nl> ) <nl> <nl> envoy_cc_library ( <nl> " / / include / envoy / upstream : cluster_manager_interface " , <nl> " / / source / common / filesystem : filesystem_lib " , <nl> " / / source / common / protobuf " , <nl> - " @ envoy_api / / envoy / api / v2 : base_cc " , <nl> + " @ envoy_api / / envoy / api / v2 / core : base_cc " , <nl> ] , <nl> ) <nl> <nl> envoy_cc_library ( <nl> " / / source / common / protobuf : utility_lib " , <nl> " / / source / common / singleton : const_singleton " , <nl> " / / source / common / stats : stats_lib " , <nl> - " @ envoy_api / / envoy / api / v2 : base_cc " , <nl> " @ envoy_api / / envoy / api / v2 : cds_cc " , <nl> " @ envoy_api / / envoy / api / v2 : eds_cc " , <nl> " @ envoy_api / / envoy / api / v2 : lds_cc " , <nl> " @ envoy_api / / envoy / api / v2 : rds_cc " , <nl> - " @ envoy_api / / envoy / api / v2 / filter / network : http_connection_manager_cc " , <nl> + " @ envoy_api / / envoy / api / v2 / core : base_cc " , <nl> + " @ envoy_api / / envoy / config / filter / network / http_connection_manager / v2 : http_connection_manager_cc " , <nl> ] , <nl> ) <nl> <nl> mmm a / source / common / config / address_json . cc <nl> ppp b / source / common / config / address_json . cc <nl> namespace Envoy { <nl> namespace Config { <nl> <nl> void AddressJson : : translateAddress ( const std : : string & json_address , bool url , bool resolved , <nl> - envoy : : api : : v2 : : Address & address ) { <nl> + envoy : : api : : v2 : : core : : Address & address ) { <nl> if ( resolved ) { <nl> Network : : Address : : InstanceConstSharedPtr instance = <nl> url ? Network : : Utility : : resolveUrl ( json_address ) <nl> void AddressJson : : translateAddress ( const std : : string & json_address , bool url , bo <nl> <nl> void AddressJson : : translateCidrRangeList ( <nl> const std : : vector < std : : string > & json_ip_list , <nl> - Protobuf : : RepeatedPtrField < envoy : : api : : v2 : : CidrRange > & range_list ) { <nl> + Protobuf : : RepeatedPtrField < envoy : : api : : v2 : : core : : CidrRange > & range_list ) { <nl> for ( const std : : string & source_ip : json_ip_list ) { <nl> Network : : Address : : CidrRange cidr ( Network : : Address : : CidrRange : : create ( source_ip ) ) ; <nl> if ( ! cidr . isValid ( ) ) { <nl> throw EnvoyException ( fmt : : format ( " Invalid cidr entry : { } " , source_ip ) ) ; <nl> } <nl> - envoy : : api : : v2 : : CidrRange * v2_cidr = range_list . Add ( ) ; <nl> + envoy : : api : : v2 : : core : : CidrRange * v2_cidr = range_list . Add ( ) ; <nl> v2_cidr - > set_address_prefix ( cidr . ip ( ) - > addressAsString ( ) ) ; <nl> v2_cidr - > mutable_prefix_len ( ) - > set_value ( cidr . length ( ) ) ; <nl> } <nl> mmm a / source / common / config / address_json . h <nl> ppp b / source / common / config / address_json . h <nl> <nl> # pragma once <nl> <nl> - # include " envoy / api / v2 / address . pb . h " <nl> + # include " envoy / api / v2 / core / address . pb . h " <nl> # include " envoy / json / json_object . h " <nl> <nl> # include " common / protobuf / protobuf . h " <nl> namespace Config { <nl> class AddressJson { <nl> public : <nl> / * * <nl> - * Translate a v1 JSON address to v2 envoy : : api : : v2 : : Address . <nl> + * Translate a v1 JSON address to v2 envoy : : api : : v2 : : core : : Address . <nl> * @ param json_address source address . <nl> * @ param url is json_address a URL ? E . g . tcp : / / < ip > : < port > . If not , it is <nl> * treated as < ip > : < port > . <nl> * @ param resolved is json_address a concrete IP / pipe or unresolved hostname ? <nl> - * @ param address destination envoy : : api : : v2 : : Address . <nl> + * @ param address destination envoy : : api : : v2 : : core : : Address . <nl> * / <nl> static void translateAddress ( const std : : string & json_address , bool url , bool resolved , <nl> - envoy : : api : : v2 : : Address & address ) ; <nl> + envoy : : api : : v2 : : core : : Address & address ) ; <nl> <nl> / * * <nl> * Translate a v1 JSON array of IP ranges to v2 <nl> - * Protobuf : : RepeatedPtrField < envoy : : api : : v2 : : CidrRange > . <nl> + * Protobuf : : RepeatedPtrField < envoy : : api : : v2 : : core : : CidrRange > . <nl> * @ param json_ip_list List of IP ranges , such as " 1 . 1 . 1 . 1 / 24 " <nl> * @ param range_list destination <nl> * / <nl> static void <nl> translateCidrRangeList ( const std : : vector < std : : string > & json_ip_list , <nl> - Protobuf : : RepeatedPtrField < envoy : : api : : v2 : : CidrRange > & range_list ) ; <nl> + Protobuf : : RepeatedPtrField < envoy : : api : : v2 : : core : : CidrRange > & range_list ) ; <nl> } ; <nl> <nl> } / / namespace Config <nl> mmm a / source / common / config / base_json . cc <nl> ppp b / source / common / config / base_json . cc <nl> namespace Envoy { <nl> namespace Config { <nl> <nl> void BaseJson : : translateRuntimeUInt32 ( const Json : : Object & json_runtime , <nl> - envoy : : api : : v2 : : RuntimeUInt32 & runtime ) { <nl> + envoy : : api : : v2 : : core : : RuntimeUInt32 & runtime ) { <nl> runtime . set_default_value ( json_runtime . getInteger ( " default " ) ) ; <nl> runtime . set_runtime_key ( json_runtime . getString ( " key " ) ) ; <nl> } <nl> <nl> - void BaseJson : : translateHeaderValueOption ( const Json : : Object & json_header_value , <nl> - envoy : : api : : v2 : : HeaderValueOption & header_value_option ) { <nl> + void BaseJson : : translateHeaderValueOption ( <nl> + const Json : : Object & json_header_value , <nl> + envoy : : api : : v2 : : core : : HeaderValueOption & header_value_option ) { <nl> header_value_option . mutable_header ( ) - > set_key ( json_header_value . getString ( " key " ) ) ; <nl> header_value_option . mutable_header ( ) - > set_value ( json_header_value . getString ( " value " ) ) ; <nl> } <nl> mmm a / source / common / config / base_json . h <nl> ppp b / source / common / config / base_json . h <nl> <nl> # pragma once <nl> <nl> - # include " envoy / api / v2 / base . pb . h " <nl> + # include " envoy / api / v2 / core / base . pb . h " <nl> # include " envoy / json / json_object . h " <nl> <nl> namespace Envoy { <nl> namespace Config { <nl> class BaseJson { <nl> public : <nl> / * * <nl> - * Translate a v1 JSON integer runtime object to v2 envoy : : api : : v2 : : RuntimeUInt32 . <nl> + * Translate a v1 JSON integer runtime object to v2 envoy : : api : : v2 : : core : : RuntimeUInt32 . <nl> * @ param json_runtime source v1 JSON integer runtime object . <nl> - * @ param runtime destination v2 envoy : : api : : v2 : : RuntimeUInt32 . <nl> + * @ param runtime destination v2 envoy : : api : : v2 : : core : : RuntimeUInt32 . <nl> * / <nl> static void translateRuntimeUInt32 ( const Json : : Object & json_runtime , <nl> - envoy : : api : : v2 : : RuntimeUInt32 & runtime ) ; <nl> + envoy : : api : : v2 : : core : : RuntimeUInt32 & runtime ) ; <nl> <nl> / * * <nl> - * Translate a v1 JSON header - value object to v2 envoy : : api : : v2 : : HeaderValueOption . <nl> + * Translate a v1 JSON header - value object to v2 envoy : : api : : v2 : : core : : HeaderValueOption . <nl> * @ param json_header_value source v1 JSON header - value object . <nl> - * @ param header_value_option destination v2 envoy : : api : : v2 : : HeaderValueOption . <nl> + * @ param header_value_option destination v2 envoy : : api : : v2 : : core : : HeaderValueOption . <nl> * / <nl> - static void translateHeaderValueOption ( const Json : : Object & json_header_value , <nl> - envoy : : api : : v2 : : HeaderValueOption & header_value_option ) ; <nl> + static void <nl> + translateHeaderValueOption ( const Json : : Object & json_header_value , <nl> + envoy : : api : : v2 : : core : : HeaderValueOption & header_value_option ) ; <nl> } ; <nl> <nl> } / / namespace Config <nl> mmm a / source / common / config / bootstrap_json . cc <nl> ppp b / source / common / config / bootstrap_json . cc <nl> void BootstrapJson : : translateClusterManagerBootstrap ( <nl> const Json : : Object & json_cluster_manager , envoy : : config : : bootstrap : : v2 : : Bootstrap & bootstrap ) { <nl> json_cluster_manager . validateSchema ( Json : : Schema : : CLUSTER_MANAGER_SCHEMA ) ; <nl> <nl> - Optional < envoy : : api : : v2 : : ConfigSource > eds_config ; <nl> + Optional < envoy : : api : : v2 : : core : : ConfigSource > eds_config ; <nl> if ( json_cluster_manager . hasObject ( " sds " ) ) { <nl> const auto json_sds = json_cluster_manager . getObject ( " sds " ) ; <nl> auto * cluster = bootstrap . mutable_static_resources ( ) - > mutable_clusters ( ) - > Add ( ) ; <nl> Config : : CdsJson : : translateCluster ( * json_sds - > getObject ( " cluster " ) , <nl> - Optional < envoy : : api : : v2 : : ConfigSource > ( ) , * cluster ) ; <nl> + Optional < envoy : : api : : v2 : : core : : ConfigSource > ( ) , * cluster ) ; <nl> Config : : Utility : : translateEdsConfig ( <nl> * json_sds , <nl> * bootstrap . mutable_dynamic_resources ( ) - > mutable_deprecated_v1 ( ) - > mutable_sds_config ( ) ) ; <nl> mmm a / source / common / config / cds_json . cc <nl> ppp b / source / common / config / cds_json . cc <nl> void CdsJson : : translateRingHashLbConfig ( <nl> } <nl> <nl> void CdsJson : : translateHealthCheck ( const Json : : Object & json_health_check , <nl> - envoy : : api : : v2 : : HealthCheck & health_check ) { <nl> + envoy : : api : : v2 : : core : : HealthCheck & health_check ) { <nl> json_health_check . validateSchema ( Json : : Schema : : CLUSTER_HEALTH_CHECK_SCHEMA ) ; <nl> <nl> JSON_UTIL_SET_DURATION ( json_health_check , health_check , timeout ) ; <nl> void CdsJson : : translateHealthCheck ( const Json : : Object & json_health_check , <nl> } <nl> <nl> void CdsJson : : translateThresholds ( <nl> - const Json : : Object & json_thresholds , const envoy : : api : : v2 : : RoutingPriority & priority , <nl> + const Json : : Object & json_thresholds , const envoy : : api : : v2 : : core : : RoutingPriority & priority , <nl> envoy : : api : : v2 : : cluster : : CircuitBreakers : : Thresholds & thresholds ) { <nl> thresholds . set_priority ( priority ) ; <nl> JSON_UTIL_SET_INTEGER ( json_thresholds , thresholds , max_connections ) ; <nl> void CdsJson : : translateThresholds ( <nl> void CdsJson : : translateCircuitBreakers ( const Json : : Object & json_circuit_breakers , <nl> envoy : : api : : v2 : : cluster : : CircuitBreakers & circuit_breakers ) { <nl> translateThresholds ( * json_circuit_breakers . getObject ( " default " , true ) , <nl> - envoy : : api : : v2 : : RoutingPriority : : DEFAULT , <nl> + envoy : : api : : v2 : : core : : RoutingPriority : : DEFAULT , <nl> * circuit_breakers . mutable_thresholds ( ) - > Add ( ) ) ; <nl> translateThresholds ( * json_circuit_breakers . getObject ( " high " , true ) , <nl> - envoy : : api : : v2 : : RoutingPriority : : HIGH , <nl> + envoy : : api : : v2 : : core : : RoutingPriority : : HIGH , <nl> * circuit_breakers . mutable_thresholds ( ) - > Add ( ) ) ; <nl> } <nl> <nl> void CdsJson : : translateOutlierDetection ( <nl> } <nl> <nl> void CdsJson : : translateCluster ( const Json : : Object & json_cluster , <nl> - const Optional < envoy : : api : : v2 : : ConfigSource > & eds_config , <nl> + const Optional < envoy : : api : : v2 : : core : : ConfigSource > & eds_config , <nl> envoy : : api : : v2 : : Cluster & cluster ) { <nl> json_cluster . validateSchema ( Json : : Schema : : CLUSTER_SCHEMA ) ; <nl> <nl> void CdsJson : : translateCluster ( const Json : : Object & json_cluster , <nl> std : : transform ( hosts . cbegin ( ) , hosts . cend ( ) , <nl> Protobuf : : RepeatedPtrFieldBackInserter ( cluster . mutable_hosts ( ) ) , <nl> [ ] ( const Json : : ObjectSharedPtr & host ) { <nl> - envoy : : api : : v2 : : Address address ; <nl> + envoy : : api : : v2 : : core : : Address address ; <nl> AddressJson : : translateAddress ( host - > getString ( " url " ) , true , false , address ) ; <nl> return address ; <nl> } ) ; <nl> void CdsJson : : translateCluster ( const Json : : Object & json_cluster , <nl> std : : transform ( hosts . cbegin ( ) , hosts . cend ( ) , <nl> Protobuf : : RepeatedPtrFieldBackInserter ( cluster . mutable_hosts ( ) ) , <nl> [ ] ( const Json : : ObjectSharedPtr & host ) { <nl> - envoy : : api : : v2 : : Address address ; <nl> + envoy : : api : : v2 : : core : : Address address ; <nl> AddressJson : : translateAddress ( host - > getString ( " url " ) , true , true , address ) ; <nl> return address ; <nl> } ) ; <nl> void CdsJson : : translateCluster ( const Json : : Object & json_cluster , <nl> std : : transform ( dns_resolvers . cbegin ( ) , dns_resolvers . cend ( ) , <nl> Protobuf : : RepeatedPtrFieldBackInserter ( cluster . mutable_dns_resolvers ( ) ) , <nl> [ ] ( const std : : string & json_address ) { <nl> - envoy : : api : : v2 : : Address address ; <nl> + envoy : : api : : v2 : : core : : Address address ; <nl> AddressJson : : translateAddress ( json_address , false , true , address ) ; <nl> return address ; <nl> } ) ; <nl> mmm a / source / common / config / cds_json . h <nl> ppp b / source / common / config / cds_json . h <nl> class CdsJson { <nl> envoy : : api : : v2 : : Cluster : : RingHashLbConfig & ring_hash_lb_config ) ; <nl> <nl> / * * <nl> - * Translate a v1 JSON health check object to v2 envoy : : api : : v2 : : HealthCheck . <nl> + * Translate a v1 JSON health check object to v2 envoy : : api : : v2 : : core : : HealthCheck . <nl> * @ param json_health_check source v1 JSON health check object . <nl> - * @ param health_check destination v2 envoy : : api : : v2 : : HealthCheck . <nl> + * @ param health_check destination v2 envoy : : api : : v2 : : core : : HealthCheck . <nl> * / <nl> static void translateHealthCheck ( const Json : : Object & json_health_check , <nl> - envoy : : api : : v2 : : HealthCheck & health_check ) ; <nl> + envoy : : api : : v2 : : core : : HealthCheck & health_check ) ; <nl> <nl> / * * <nl> * Translate a v1 JSON thresholds object to v2 envoy : : api : : v2 : : Thresholds . <nl> class CdsJson { <nl> * @ param thresholds destination v2 envoy : : api : : v2 : : Thresholds . <nl> * / <nl> static void translateThresholds ( const Json : : Object & json_thresholds , <nl> - const envoy : : api : : v2 : : RoutingPriority & priority , <nl> + const envoy : : api : : v2 : : core : : RoutingPriority & priority , <nl> envoy : : api : : v2 : : cluster : : CircuitBreakers : : Thresholds & thresholds ) ; <nl> <nl> / * * <nl> class CdsJson { <nl> * @ param cluster destination v2 envoy : : api : : v2 : : Cluster . <nl> * / <nl> static void translateCluster ( const Json : : Object & json_cluster , <nl> - const Optional < envoy : : api : : v2 : : ConfigSource > & eds_config , <nl> + const Optional < envoy : : api : : v2 : : core : : ConfigSource > & eds_config , <nl> envoy : : api : : v2 : : Cluster & cluster ) ; <nl> } ; <nl> <nl> mmm a / source / common / config / filesystem_subscription_impl . h <nl> ppp b / source / common / config / filesystem_subscription_impl . h <nl> <nl> # pragma once <nl> <nl> - # include " envoy / api / v2 / base . pb . h " <nl> + # include " envoy / api / v2 / core / base . pb . h " <nl> # include " envoy / config / subscription . h " <nl> # include " envoy / event / dispatcher . h " <nl> # include " envoy / filesystem / filesystem . h " <nl> mmm a / source / common / config / filter_json . cc <nl> ppp b / source / common / config / filter_json . cc <nl> namespace Config { <nl> namespace { <nl> <nl> void translateComparisonFilter ( const Json : : Object & json_config , <nl> - envoy : : api : : v2 : : filter : : accesslog : : ComparisonFilter & filter ) { <nl> + envoy : : config : : filter : : accesslog : : v2 : : ComparisonFilter & filter ) { <nl> const std : : string op = json_config . getString ( " op " ) ; <nl> if ( op = = " > = " ) { <nl> - filter . set_op ( envoy : : api : : v2 : : filter : : accesslog : : ComparisonFilter : : GE ) ; <nl> + filter . set_op ( envoy : : config : : filter : : accesslog : : v2 : : ComparisonFilter : : GE ) ; <nl> } else { <nl> ASSERT ( op = = " = " ) ; <nl> - filter . set_op ( envoy : : api : : v2 : : filter : : accesslog : : ComparisonFilter : : EQ ) ; <nl> + filter . set_op ( envoy : : config : : filter : : accesslog : : v2 : : ComparisonFilter : : EQ ) ; <nl> } <nl> <nl> auto * runtime = filter . mutable_value ( ) ; <nl> void translateComparisonFilter ( const Json : : Object & json_config , <nl> } <nl> <nl> void translateStatusCodeFilter ( const Json : : Object & json_config , <nl> - envoy : : api : : v2 : : filter : : accesslog : : StatusCodeFilter & filter ) { <nl> + envoy : : config : : filter : : accesslog : : v2 : : StatusCodeFilter & filter ) { <nl> translateComparisonFilter ( json_config , * filter . mutable_comparison ( ) ) ; <nl> } <nl> <nl> void translateDurationFilter ( const Json : : Object & json_config , <nl> - envoy : : api : : v2 : : filter : : accesslog : : DurationFilter & filter ) { <nl> + envoy : : config : : filter : : accesslog : : v2 : : DurationFilter & filter ) { <nl> translateComparisonFilter ( json_config , * filter . mutable_comparison ( ) ) ; <nl> } <nl> <nl> void translateRuntimeFilter ( const Json : : Object & json_config , <nl> - envoy : : api : : v2 : : filter : : accesslog : : RuntimeFilter & filter ) { <nl> + envoy : : config : : filter : : accesslog : : v2 : : RuntimeFilter & filter ) { <nl> filter . set_runtime_key ( json_config . getString ( " key " ) ) ; <nl> } <nl> <nl> void translateRepeatedFilter ( <nl> const Json : : Object & json_config , <nl> - Protobuf : : RepeatedPtrField < envoy : : api : : v2 : : filter : : accesslog : : AccessLogFilter > & filters ) { <nl> + Protobuf : : RepeatedPtrField < envoy : : config : : filter : : accesslog : : v2 : : AccessLogFilter > & filters ) { <nl> for ( const auto & json_filter : json_config . getObjectArray ( " filters " ) ) { <nl> FilterJson : : translateAccessLogFilter ( * json_filter , * filters . Add ( ) ) ; <nl> } <nl> } <nl> <nl> void translateOrFilter ( const Json : : Object & json_config , <nl> - envoy : : api : : v2 : : filter : : accesslog : : OrFilter & filter ) { <nl> + envoy : : config : : filter : : accesslog : : v2 : : OrFilter & filter ) { <nl> translateRepeatedFilter ( json_config , * filter . mutable_filters ( ) ) ; <nl> } <nl> <nl> void translateAndFilter ( const Json : : Object & json_config , <nl> - envoy : : api : : v2 : : filter : : accesslog : : AndFilter & filter ) { <nl> + envoy : : config : : filter : : accesslog : : v2 : : AndFilter & filter ) { <nl> translateRepeatedFilter ( json_config , * filter . mutable_filters ( ) ) ; <nl> } <nl> <nl> void translateRepeatedAccessLog ( <nl> const std : : vector < Json : : ObjectSharedPtr > & json , <nl> - Protobuf : : RepeatedPtrField < envoy : : api : : v2 : : filter : : accesslog : : AccessLog > & access_logs ) { <nl> + Protobuf : : RepeatedPtrField < envoy : : config : : filter : : accesslog : : v2 : : AccessLog > & access_logs ) { <nl> for ( const auto & json_access_log : json ) { <nl> auto * access_log = access_logs . Add ( ) ; <nl> FilterJson : : translateAccessLog ( * json_access_log , * access_log ) ; <nl> void translateRepeatedAccessLog ( <nl> <nl> void FilterJson : : translateAccessLogFilter ( <nl> const Json : : Object & json_config , <nl> - envoy : : api : : v2 : : filter : : accesslog : : AccessLogFilter & proto_config ) { <nl> + envoy : : config : : filter : : accesslog : : v2 : : AccessLogFilter & proto_config ) { <nl> const std : : string type = json_config . getString ( " type " ) ; <nl> if ( type = = " status_code " ) { <nl> translateStatusCodeFilter ( json_config , * proto_config . mutable_status_code_filter ( ) ) ; <nl> void FilterJson : : translateAccessLogFilter ( <nl> } <nl> <nl> void FilterJson : : translateAccessLog ( const Json : : Object & json_config , <nl> - envoy : : api : : v2 : : filter : : accesslog : : AccessLog & proto_config ) { <nl> + envoy : : config : : filter : : accesslog : : v2 : : AccessLog & proto_config ) { <nl> json_config . validateSchema ( Json : : Schema : : ACCESS_LOG_SCHEMA ) ; <nl> <nl> - envoy : : api : : v2 : : filter : : accesslog : : FileAccessLog file_access_log ; <nl> + envoy : : config : : filter : : accesslog : : v2 : : FileAccessLog file_access_log ; <nl> <nl> JSON_UTIL_SET_STRING ( json_config , file_access_log , path ) ; <nl> JSON_UTIL_SET_STRING ( json_config , file_access_log , format ) ; <nl> void FilterJson : : translateAccessLog ( const Json : : Object & json_config , <nl> <nl> void FilterJson : : translateHttpConnectionManager ( <nl> const Json : : Object & json_config , <nl> - envoy : : api : : v2 : : filter : : network : : HttpConnectionManager & proto_config ) { <nl> + envoy : : config : : filter : : network : : http_connection_manager : : v2 : : HttpConnectionManager & <nl> + proto_config ) { <nl> json_config . validateSchema ( Json : : Schema : : HTTP_CONN_NETWORK_FILTER_SCHEMA ) ; <nl> <nl> - envoy : : api : : v2 : : filter : : network : : HttpConnectionManager : : CodecType codec_type { } ; <nl> - envoy : : api : : v2 : : filter : : network : : HttpConnectionManager : : CodecType_Parse ( <nl> - StringUtil : : toUpper ( json_config . getString ( " codec_type " ) ) , & codec_type ) ; <nl> + envoy : : config : : filter : : network : : http_connection_manager : : v2 : : HttpConnectionManager : : CodecType <nl> + codec_type { } ; <nl> + envoy : : config : : filter : : network : : http_connection_manager : : v2 : : HttpConnectionManager : : <nl> + CodecType_Parse ( StringUtil : : toUpper ( json_config . getString ( " codec_type " ) ) , & codec_type ) ; <nl> proto_config . set_codec_type ( codec_type ) ; <nl> <nl> JSON_UTIL_SET_STRING ( json_config , proto_config , stat_prefix ) ; <nl> void FilterJson : : translateHttpConnectionManager ( <nl> const auto json_tracing = json_config . getObject ( " tracing " ) ; <nl> auto * tracing = proto_config . mutable_tracing ( ) ; <nl> <nl> - envoy : : api : : v2 : : filter : : network : : HttpConnectionManager : : Tracing : : OperationName operation_name { } ; <nl> - envoy : : api : : v2 : : filter : : network : : HttpConnectionManager : : Tracing : : OperationName_Parse ( <nl> - StringUtil : : toUpper ( json_tracing - > getString ( " operation_name " ) ) , & operation_name ) ; <nl> + envoy : : config : : filter : : network : : http_connection_manager : : v2 : : HttpConnectionManager : : Tracing : : <nl> + OperationName operation_name { } ; <nl> + envoy : : config : : filter : : network : : http_connection_manager : : v2 : : HttpConnectionManager : : Tracing : : <nl> + OperationName_Parse ( StringUtil : : toUpper ( json_tracing - > getString ( " operation_name " ) ) , <nl> + & operation_name ) ; <nl> tracing - > set_operation_name ( operation_name ) ; <nl> <nl> for ( const std : : string & header : <nl> void FilterJson : : translateHttpConnectionManager ( <nl> JSON_UTIL_SET_BOOL ( json_config , proto_config , use_remote_address ) ; <nl> JSON_UTIL_SET_BOOL ( json_config , proto_config , generate_request_id ) ; <nl> <nl> - envoy : : api : : v2 : : filter : : network : : HttpConnectionManager : : ForwardClientCertDetails fcc_details { } ; <nl> - envoy : : api : : v2 : : filter : : network : : HttpConnectionManager : : ForwardClientCertDetails_Parse ( <nl> - StringUtil : : toUpper ( json_config . getString ( " forward_client_cert " , " sanitize " ) ) , & fcc_details ) ; <nl> + envoy : : config : : filter : : network : : http_connection_manager : : v2 : : HttpConnectionManager : : <nl> + ForwardClientCertDetails fcc_details { } ; <nl> + envoy : : config : : filter : : network : : http_connection_manager : : v2 : : HttpConnectionManager : : <nl> + ForwardClientCertDetails_Parse ( <nl> + StringUtil : : toUpper ( json_config . getString ( " forward_client_cert " , " sanitize " ) ) , <nl> + & fcc_details ) ; <nl> proto_config . set_forward_client_cert_details ( fcc_details ) ; <nl> <nl> for ( const std : : string & detail : <nl> void FilterJson : : translateHttpConnectionManager ( <nl> } <nl> } <nl> <nl> - void FilterJson : : translateRedisProxy ( const Json : : Object & json_config , <nl> - envoy : : api : : v2 : : filter : : network : : RedisProxy & proto_config ) { <nl> + void FilterJson : : translateRedisProxy ( <nl> + const Json : : Object & json_config , <nl> + envoy : : config : : filter : : network : : redis_proxy : : v2 : : RedisProxy & proto_config ) { <nl> json_config . validateSchema ( Json : : Schema : : REDIS_PROXY_NETWORK_FILTER_SCHEMA ) ; <nl> JSON_UTIL_SET_STRING ( json_config , proto_config , stat_prefix ) ; <nl> proto_config . set_cluster ( json_config . getString ( " cluster_name " ) ) ; <nl> void FilterJson : : translateRedisProxy ( const Json : : Object & json_config , <nl> JSON_UTIL_SET_DURATION ( * json_conn_pool , * conn_pool , op_timeout ) ; <nl> } <nl> <nl> - void FilterJson : : translateMongoProxy ( const Json : : Object & json_config , <nl> - envoy : : api : : v2 : : filter : : network : : MongoProxy & proto_config ) { <nl> + void FilterJson : : translateMongoProxy ( <nl> + const Json : : Object & json_config , <nl> + envoy : : config : : filter : : network : : mongo_proxy : : v2 : : MongoProxy & proto_config ) { <nl> json_config . validateSchema ( Json : : Schema : : MONGO_PROXY_NETWORK_FILTER_SCHEMA ) ; <nl> <nl> JSON_UTIL_SET_STRING ( json_config , proto_config , stat_prefix ) ; <nl> void FilterJson : : translateMongoProxy ( const Json : : Object & json_config , <nl> const auto json_fault = json_config . getObject ( " fault " ) - > getObject ( " fixed_delay " ) ; <nl> auto * delay = proto_config . mutable_delay ( ) ; <nl> <nl> - delay - > set_type ( envoy : : api : : v2 : : filter : : FaultDelay : : FIXED ) ; <nl> + delay - > set_type ( envoy : : config : : filter : : fault : : v2 : : FaultDelay : : FIXED ) ; <nl> delay - > set_percent ( static_cast < uint32_t > ( json_fault - > getInteger ( " percent " ) ) ) ; <nl> JSON_UTIL_SET_DURATION_FROM_FIELD ( * json_fault , * delay , fixed_delay , duration ) ; <nl> } <nl> } <nl> <nl> - void FilterJson : : translateFaultFilter ( const Json : : Object & json_config , <nl> - envoy : : api : : v2 : : filter : : http : : HTTPFault & proto_config ) { <nl> + void FilterJson : : translateFaultFilter ( <nl> + const Json : : Object & json_config , <nl> + envoy : : config : : filter : : http : : fault : : v2 : : HTTPFault & proto_config ) { <nl> json_config . validateSchema ( Json : : Schema : : FAULT_HTTP_FILTER_SCHEMA ) ; <nl> <nl> const Json : : ObjectSharedPtr json_config_abort = json_config . getObject ( " abort " , true ) ; <nl> void FilterJson : : translateFaultFilter ( const Json : : Object & json_config , <nl> <nl> if ( ! json_config_delay - > empty ( ) ) { <nl> auto * delay = proto_config . mutable_delay ( ) ; <nl> - delay - > set_type ( envoy : : api : : v2 : : filter : : FaultDelay : : FIXED ) ; <nl> + delay - > set_type ( envoy : : config : : filter : : fault : : v2 : : FaultDelay : : FIXED ) ; <nl> delay - > set_percent ( static_cast < uint32_t > ( json_config_delay - > getInteger ( " fixed_delay_percent " ) ) ) ; <nl> JSON_UTIL_SET_DURATION_FROM_FIELD ( * json_config_delay , * delay , fixed_delay , fixed_duration ) ; <nl> } <nl> void FilterJson : : translateFaultFilter ( const Json : : Object & json_config , <nl> } <nl> <nl> void FilterJson : : translateHealthCheckFilter ( <nl> - const Json : : Object & json_config , envoy : : api : : v2 : : filter : : http : : HealthCheck & proto_config ) { <nl> + const Json : : Object & json_config , <nl> + envoy : : config : : filter : : http : : health_check : : v2 : : HealthCheck & proto_config ) { <nl> json_config . validateSchema ( Json : : Schema : : HEALTH_CHECK_HTTP_FILTER_SCHEMA ) ; <nl> <nl> JSON_UTIL_SET_BOOL ( json_config , proto_config , pass_through_mode ) ; <nl> void FilterJson : : translateHealthCheckFilter ( <nl> <nl> void FilterJson : : translateGrpcJsonTranscoder ( <nl> const Json : : Object & json_config , <nl> - envoy : : api : : v2 : : filter : : http : : GrpcJsonTranscoder & proto_config ) { <nl> + envoy : : config : : filter : : http : : transcoder : : v2 : : GrpcJsonTranscoder & proto_config ) { <nl> json_config . validateSchema ( Json : : Schema : : GRPC_JSON_TRANSCODER_FILTER_SCHEMA ) ; <nl> JSON_UTIL_SET_STRING ( json_config , proto_config , proto_descriptor ) ; <nl> auto * services = proto_config . mutable_services ( ) ; <nl> void FilterJson : : translateGrpcJsonTranscoder ( <nl> } <nl> } <nl> <nl> - void FilterJson : : translateSquashConfig ( const Json : : Object & json_config , <nl> - envoy : : api : : v2 : : filter : : http : : Squash & proto_config ) { <nl> + void FilterJson : : translateSquashConfig ( <nl> + const Json : : Object & json_config , <nl> + envoy : : config : : filter : : http : : squash : : v2 : : Squash & proto_config ) { <nl> json_config . validateSchema ( Json : : Schema : : SQUASH_HTTP_FILTER_SCHEMA ) ; <nl> <nl> JSON_UTIL_SET_STRING ( json_config , proto_config , cluster ) ; <nl> void FilterJson : : translateSquashConfig ( const Json : : Object & json_config , <nl> } <nl> <nl> void FilterJson : : translateRouter ( const Json : : Object & json_config , <nl> - envoy : : api : : v2 : : filter : : http : : Router & proto_config ) { <nl> + envoy : : config : : filter : : http : : router : : v2 : : Router & proto_config ) { <nl> json_config . validateSchema ( Json : : Schema : : ROUTER_HTTP_FILTER_SCHEMA ) ; <nl> <nl> proto_config . mutable_dynamic_stats ( ) - > set_value ( json_config . getBoolean ( " dynamic_stats " , true ) ) ; <nl> proto_config . set_start_child_span ( json_config . getBoolean ( " start_child_span " , false ) ) ; <nl> } <nl> <nl> - void FilterJson : : translateBufferFilter ( const Json : : Object & json_config , <nl> - envoy : : api : : v2 : : filter : : http : : Buffer & proto_config ) { <nl> + void FilterJson : : translateBufferFilter ( <nl> + const Json : : Object & json_config , <nl> + envoy : : config : : filter : : http : : buffer : : v2 : : Buffer & proto_config ) { <nl> json_config . validateSchema ( Json : : Schema : : BUFFER_HTTP_FILTER_SCHEMA ) ; <nl> <nl> JSON_UTIL_SET_INTEGER ( json_config , proto_config , max_request_bytes ) ; <nl> void FilterJson : : translateBufferFilter ( const Json : : Object & json_config , <nl> } <nl> <nl> void FilterJson : : translateLuaFilter ( const Json : : Object & json_config , <nl> - envoy : : api : : v2 : : filter : : http : : Lua & proto_config ) { <nl> + envoy : : config : : filter : : http : : lua : : v2 : : Lua & proto_config ) { <nl> json_config . validateSchema ( Json : : Schema : : LUA_HTTP_FILTER_SCHEMA ) ; <nl> JSON_UTIL_SET_STRING ( json_config , proto_config , inline_code ) ; <nl> } <nl> <nl> - void FilterJson : : translateTcpProxy ( const Json : : Object & json_config , <nl> - envoy : : api : : v2 : : filter : : network : : TcpProxy & proto_config ) { <nl> + void FilterJson : : translateTcpProxy ( <nl> + const Json : : Object & json_config , <nl> + envoy : : config : : filter : : network : : tcp_proxy : : v2 : : TcpProxy & proto_config ) { <nl> json_config . validateSchema ( Json : : Schema : : TCP_PROXY_NETWORK_FILTER_SCHEMA ) ; <nl> <nl> JSON_UTIL_SET_STRING ( json_config , proto_config , stat_prefix ) ; <nl> void FilterJson : : translateTcpProxy ( const Json : : Object & json_config , <nl> <nl> for ( const Json : : ObjectSharedPtr & route_desc : <nl> json_config . getObject ( " route_config " ) - > getObjectArray ( " routes " ) ) { <nl> - envoy : : api : : v2 : : filter : : network : : TcpProxy : : DeprecatedV1 : : TCPRoute * route = <nl> + envoy : : config : : filter : : network : : tcp_proxy : : v2 : : TcpProxy : : DeprecatedV1 : : TCPRoute * route = <nl> proto_config . mutable_deprecated_v1 ( ) - > mutable_routes ( ) - > Add ( ) ; <nl> JSON_UTIL_SET_STRING ( * route_desc , * route , cluster ) ; <nl> JSON_UTIL_SET_STRING ( * route_desc , * route , destination_ports ) ; <nl> void FilterJson : : translateTcpProxy ( const Json : : Object & json_config , <nl> } <nl> <nl> void FilterJson : : translateTcpRateLimitFilter ( <nl> - const Json : : Object & json_config , envoy : : api : : v2 : : filter : : network : : RateLimit & proto_config ) { <nl> + const Json : : Object & json_config , <nl> + envoy : : config : : filter : : network : : rate_limit : : v2 : : RateLimit & proto_config ) { <nl> json_config . validateSchema ( Json : : Schema : : RATELIMIT_NETWORK_FILTER_SCHEMA ) ; <nl> <nl> JSON_UTIL_SET_STRING ( json_config , proto_config , stat_prefix ) ; <nl> void FilterJson : : translateTcpRateLimitFilter ( <nl> } <nl> <nl> void FilterJson : : translateHttpRateLimitFilter ( <nl> - const Json : : Object & json_config , envoy : : api : : v2 : : filter : : http : : RateLimit & proto_config ) { <nl> + const Json : : Object & json_config , <nl> + envoy : : config : : filter : : http : : rate_limit : : v2 : : RateLimit & proto_config ) { <nl> json_config . validateSchema ( Json : : Schema : : RATE_LIMIT_HTTP_FILTER_SCHEMA ) ; <nl> <nl> JSON_UTIL_SET_STRING ( json_config , proto_config , domain ) ; <nl> void FilterJson : : translateHttpRateLimitFilter ( <nl> } <nl> <nl> void FilterJson : : translateClientSslAuthFilter ( <nl> - const Json : : Object & json_config , envoy : : api : : v2 : : filter : : network : : ClientSSLAuth & proto_config ) { <nl> + const Json : : Object & json_config , <nl> + envoy : : config : : filter : : network : : client_ssl_auth : : v2 : : ClientSSLAuth & proto_config ) { <nl> json_config . validateSchema ( Json : : Schema : : CLIENT_SSL_NETWORK_FILTER_SCHEMA ) ; <nl> <nl> JSON_UTIL_SET_STRING ( json_config , proto_config , auth_api_cluster ) ; <nl> mmm a / source / common / config / filter_json . h <nl> ppp b / source / common / config / filter_json . h <nl> <nl> # pragma once <nl> <nl> - # include " envoy / api / v2 / filter / http / buffer . pb . h " <nl> - # include " envoy / api / v2 / filter / http / fault . pb . h " <nl> - # include " envoy / api / v2 / filter / http / health_check . pb . h " <nl> - # include " envoy / api / v2 / filter / http / lua . pb . h " <nl> - # include " envoy / api / v2 / filter / http / rate_limit . pb . h " <nl> - # include " envoy / api / v2 / filter / http / router . pb . h " <nl> - # include " envoy / api / v2 / filter / http / squash . pb . h " <nl> - # include " envoy / api / v2 / filter / http / transcoder . pb . h " <nl> - # include " envoy / api / v2 / filter / network / client_ssl_auth . pb . h " <nl> - # include " envoy / api / v2 / filter / network / http_connection_manager . pb . h " <nl> - # include " envoy / api / v2 / filter / network / mongo_proxy . pb . h " <nl> - # include " envoy / api / v2 / filter / network / rate_limit . pb . h " <nl> - # include " envoy / api / v2 / filter / network / redis_proxy . pb . h " <nl> - # include " envoy / api / v2 / filter / network / tcp_proxy . pb . h " <nl> + # include " envoy / config / filter / http / buffer / v2 / buffer . pb . h " <nl> + # include " envoy / config / filter / http / fault / v2 / fault . pb . h " <nl> + # include " envoy / config / filter / http / health_check / v2 / health_check . pb . h " <nl> + # include " envoy / config / filter / http / lua / v2 / lua . pb . h " <nl> + # include " envoy / config / filter / http / rate_limit / v2 / rate_limit . pb . h " <nl> + # include " envoy / config / filter / http / router / v2 / router . pb . h " <nl> + # include " envoy / config / filter / http / squash / v2 / squash . pb . h " <nl> + # include " envoy / config / filter / http / transcoder / v2 / transcoder . pb . h " <nl> + # include " envoy / config / filter / network / client_ssl_auth / v2 / client_ssl_auth . pb . h " <nl> + # include " envoy / config / filter / network / http_connection_manager / v2 / http_connection_manager . pb . h " <nl> + # include " envoy / config / filter / network / mongo_proxy / v2 / mongo_proxy . pb . h " <nl> + # include " envoy / config / filter / network / rate_limit / v2 / rate_limit . pb . h " <nl> + # include " envoy / config / filter / network / redis_proxy / v2 / redis_proxy . pb . h " <nl> + # include " envoy / config / filter / network / tcp_proxy / v2 / tcp_proxy . pb . h " <nl> # include " envoy / json / json_object . h " <nl> <nl> namespace Envoy { <nl> class FilterJson { <nl> public : <nl> / * * <nl> * Translate a v1 JSON access log filter object to v2 <nl> - * envoy : : api : : v2 : : filter : : accesslog : : AccessLogFilter . <nl> + * envoy : : config : : filter : : accesslog : : v2 : : AccessLogFilter . <nl> * @ param json_config source v1 JSON access log object . <nl> - * @ param proto_config destination v2 envoy : : api : : v2 : : filter : : accesslog : : AccessLog . <nl> + * @ param proto_config destination v2 envoy : : config : : filter : : accesslog : : v2 : : AccessLog . <nl> * / <nl> static void <nl> translateAccessLogFilter ( const Json : : Object & json_config , <nl> - envoy : : api : : v2 : : filter : : accesslog : : AccessLogFilter & proto_config ) ; <nl> + envoy : : config : : filter : : accesslog : : v2 : : AccessLogFilter & proto_config ) ; <nl> <nl> / * * <nl> - * Translate a v1 JSON access log object to v2 envoy : : api : : v2 : : filter : : accesslog : : AccessLog . <nl> + * Translate a v1 JSON access log object to v2 envoy : : config : : filter : : accesslog : : v2 : : AccessLog . <nl> * @ param json_config source v1 JSON access log object . <nl> - * @ param proto_config destination v2 envoy : : api : : v2 : : filter : : accesslog : : AccessLog . <nl> + * @ param proto_config destination v2 envoy : : config : : filter : : accesslog : : v2 : : AccessLog . <nl> * / <nl> static void translateAccessLog ( const Json : : Object & json_config , <nl> - envoy : : api : : v2 : : filter : : accesslog : : AccessLog & proto_config ) ; <nl> + envoy : : config : : filter : : accesslog : : v2 : : AccessLog & proto_config ) ; <nl> <nl> / * * <nl> * Translate a v1 JSON HTTP connection manager object to v2 <nl> - * envoy : : api : : v2 : : filter : : network : : HttpConnectionManager . <nl> + * envoy : : config : : filter : : network : : http_connection_manager : : v2 : : HttpConnectionManager . <nl> * @ param json_config source v1 JSON HTTP connection manager object . <nl> * @ param proto_config destination v2 <nl> - * envoy : : api : : v2 : : filter : : network : : HttpConnectionManager . <nl> + * envoy : : config : : filter : : network : : http_connection_manager : : v2 : : HttpConnectionManager . <nl> * / <nl> static void translateHttpConnectionManager ( <nl> const Json : : Object & json_config , <nl> - envoy : : api : : v2 : : filter : : network : : HttpConnectionManager & proto_config ) ; <nl> + envoy : : config : : filter : : network : : http_connection_manager : : v2 : : HttpConnectionManager & <nl> + proto_config ) ; <nl> <nl> / * * <nl> - * Translate a v1 JSON Redis proxy object to v2 envoy : : api : : v2 : : filter : : network : : RedisProxy . <nl> + * Translate a v1 JSON Redis proxy object to v2 <nl> + * envoy : : config : : filter : : network : : redis_proxy : : v2 : : RedisProxy . <nl> * @ param json_config source v1 JSON HTTP connection manager object . <nl> * @ param proto_config destination v2 <nl> - * envoy : : api : : v2 : : filter : : network : : RedisProxy . <nl> + * envoy : : config : : filter : : network : : redis_proxy : : v2 : : RedisProxy . <nl> * / <nl> - static void translateRedisProxy ( const Json : : Object & json_config , <nl> - envoy : : api : : v2 : : filter : : network : : RedisProxy & proto_config ) ; <nl> + static void <nl> + translateRedisProxy ( const Json : : Object & json_config , <nl> + envoy : : config : : filter : : network : : redis_proxy : : v2 : : RedisProxy & proto_config ) ; <nl> <nl> / * * <nl> - * Translate a v1 JSON Mongo proxy object to v2 envoy : : api : : v2 : : filter : : network : : MongoProxy . <nl> + * Translate a v1 JSON Mongo proxy object to v2 <nl> + * envoy : : config : : filter : : network : : mongo_proxy : : v2 : : MongoProxy . <nl> * @ param json_config source v1 JSON HTTP connection manager object . <nl> * @ param proto_config destination v2 <nl> - * envoy : : api : : v2 : : filter : : network : : MongoProxy . <nl> + * envoy : : config : : filter : : network : : mongo_proxy : : v2 : : MongoProxy . <nl> * / <nl> - static void translateMongoProxy ( const Json : : Object & json_config , <nl> - envoy : : api : : v2 : : filter : : network : : MongoProxy & proto_config ) ; <nl> + static void <nl> + translateMongoProxy ( const Json : : Object & json_config , <nl> + envoy : : config : : filter : : network : : mongo_proxy : : v2 : : MongoProxy & proto_config ) ; <nl> <nl> / * * <nl> - * Translate a v1 JSON Fault filter object to v2 envoy : : api : : v2 : : filter : : http : : HTTPFault . <nl> + * Translate a v1 JSON Fault filter object to v2 <nl> + * envoy : : config : : filter : : http : : fault : : v2 : : HTTPFault . <nl> * @ param json_config source v1 JSON HTTP Fault Filter object . <nl> * @ param proto_config destination v2 <nl> - * envoy : : api : : v2 : : filter : : http : : HTTPFault . <nl> + * envoy : : config : : filter : : http : : fault : : v2 : : HTTPFault . <nl> * / <nl> static void translateFaultFilter ( const Json : : Object & json_config , <nl> - envoy : : api : : v2 : : filter : : http : : HTTPFault & proto_config ) ; <nl> + envoy : : config : : filter : : http : : fault : : v2 : : HTTPFault & proto_config ) ; <nl> <nl> / * * <nl> - * Translate a v1 JSON Health Check filter object to v2 envoy : : api : : v2 : : filter : : http : : HealthCheck . <nl> + * Translate a v1 JSON Health Check filter object to v2 <nl> + * envoy : : config : : filter : : http : : health_check : : v2 : : HealthCheck . <nl> * @ param json_config source v1 JSON Health Check Filter object . <nl> * @ param proto_config destination v2 <nl> - * envoy : : api : : v2 : : filter : : http : : HealthCheck . <nl> + * envoy : : config : : filter : : http : : health_check : : v2 : : HealthCheck . <nl> * / <nl> - static void translateHealthCheckFilter ( const Json : : Object & json_config , <nl> - envoy : : api : : v2 : : filter : : http : : HealthCheck & proto_config ) ; <nl> + static void translateHealthCheckFilter ( <nl> + const Json : : Object & json_config , <nl> + envoy : : config : : filter : : http : : health_check : : v2 : : HealthCheck & proto_config ) ; <nl> <nl> / * * <nl> * Translate a v1 JSON HTTP Grpc JSON transcoder filter object to v2 <nl> - * envoy : : api : : v2 : : filter : : http : : GrpcJsonTranscoder . <nl> + * envoy : : config : : filter : : http : : transcoder : : v2 : : GrpcJsonTranscoder . <nl> * @ param json_config source v1 JSON Grpc JSON Transcoder Filter object . <nl> - * @ param proto_config destination v2 envoy : : api : : v2 : : filter : : http : : GrpcJsonTranscoder . <nl> + * @ param proto_config destination v2 <nl> + * envoy : : config : : filter : : http : : transcoder : : v2 : : GrpcJsonTranscoder . <nl> * / <nl> - static void <nl> - translateGrpcJsonTranscoder ( const Json : : Object & json_config , <nl> - envoy : : api : : v2 : : filter : : http : : GrpcJsonTranscoder & proto_config ) ; <nl> + static void translateGrpcJsonTranscoder ( <nl> + const Json : : Object & json_config , <nl> + envoy : : config : : filter : : http : : transcoder : : v2 : : GrpcJsonTranscoder & proto_config ) ; <nl> <nl> / * * <nl> - * Translate a v1 JSON Router object to v2 envoy : : api : : v2 : : filter : : http : : Router . <nl> + * Translate a v1 JSON Router object to v2 envoy : : config : : filter : : http : : router : : v2 : : Router . <nl> * @ param json_config source v1 JSON HTTP router object . <nl> - * @ param proto_config destination v2 envoy : : api : : v2 : : filter : : http : : Router . <nl> + * @ param proto_config destination v2 envoy : : config : : filter : : http : : router : : v2 : : Router . <nl> * / <nl> static void translateRouter ( const Json : : Object & json_config , <nl> - envoy : : api : : v2 : : filter : : http : : Router & proto_config ) ; <nl> + envoy : : config : : filter : : http : : router : : v2 : : Router & proto_config ) ; <nl> <nl> / * * <nl> - * Translate a v1 JSON Buffer filter object to v2 envoy : : api : : v2 : : filter : : http : : Buffer . <nl> + * Translate a v1 JSON Buffer filter object to v2 envoy : : config : : filter : : http : : buffer : : v2 : : Buffer . <nl> * @ param json_config source v1 JSON HTTP Buffer Filter object . <nl> * @ param proto_config destination v2 <nl> - * envoy : : api : : v2 : : filter : : http : : Buffer . <nl> + * envoy : : config : : filter : : http : : buffer : : v2 : : Buffer . <nl> * / <nl> static void translateBufferFilter ( const Json : : Object & json_config , <nl> - envoy : : api : : v2 : : filter : : http : : Buffer & proto_config ) ; <nl> + envoy : : config : : filter : : http : : buffer : : v2 : : Buffer & proto_config ) ; <nl> <nl> / * * <nl> - * Translate a v1 JSON Lua filter object to v2 envoy : : api : : v2 : : filter : : http : : Lua . <nl> + * Translate a v1 JSON Lua filter object to v2 envoy : : config : : filter : : http : : lua : : v2 : : Lua . <nl> * @ param json_config source v1 JSON HTTP Lua Filter object . <nl> * @ param proto_config destination v2 <nl> - * envoy : : api : : v2 : : filter : : http : : Lua . <nl> + * envoy : : config : : filter : : http : : lua : : v2 : : Lua . <nl> * / <nl> static void translateLuaFilter ( const Json : : Object & json_config , <nl> - envoy : : api : : v2 : : filter : : http : : Lua & proto_config ) ; <nl> + envoy : : config : : filter : : http : : lua : : v2 : : Lua & proto_config ) ; <nl> <nl> / * * <nl> - * Translate a v1 JSON TCP proxy filter object to a v2 envoy : : api : : v2 : : filter : : network : : TcpProxy . <nl> + * Translate a v1 JSON TCP proxy filter object to a v2 <nl> + * envoy : : config : : filter : : network : : tcp_proxy : : v2 : : TcpProxy . <nl> * @ param json_config source v1 JSON TCP proxy object . <nl> - * @ param proto_config destination v2 envoy : : api : : v2 : : filter : : network : : TcpProxy . <nl> + * @ param proto_config destination v2 envoy : : config : : filter : : network : : tcp_proxy : : v2 : : TcpProxy . <nl> * / <nl> - static void translateTcpProxy ( const Json : : Object & json_config , <nl> - envoy : : api : : v2 : : filter : : network : : TcpProxy & proto_config ) ; <nl> + static void <nl> + translateTcpProxy ( const Json : : Object & json_config , <nl> + envoy : : config : : filter : : network : : tcp_proxy : : v2 : : TcpProxy & proto_config ) ; <nl> <nl> / * * <nl> * Translate a v1 JSON TCP Rate Limit filter object to v2 <nl> - * envoy : : api : : v2 : : filter : : network : : RateLimit . <nl> + * envoy : : config : : filter : : network : : rate_limit : : v2 : : RateLimit . <nl> * @ param json_config source v1 JSON Tcp Rate Limit Filter object . <nl> - * @ param proto_config destination v2 envoy : : api : : v2 : : filter : : network : : RateLimit . <nl> + * @ param proto_config destination v2 envoy : : config : : filter : : network : : rate_limit : : v2 : : RateLimit . <nl> * / <nl> - static void translateTcpRateLimitFilter ( const Json : : Object & json_config , <nl> - envoy : : api : : v2 : : filter : : network : : RateLimit & proto_config ) ; <nl> + static void translateTcpRateLimitFilter ( <nl> + const Json : : Object & json_config , <nl> + envoy : : config : : filter : : network : : rate_limit : : v2 : : RateLimit & proto_config ) ; <nl> <nl> / * * <nl> * Translate a v1 JSON HTTP Rate Limit filter object to v2 <nl> - * envoy : : api : : v2 : : filter : : http : : RateLimit . <nl> + * envoy : : config : : filter : : http : : rate_limit : : v2 : : RateLimit . <nl> * @ param json_config source v1 JSON Http Rate Limit Filter object . <nl> - * @ param proto_config destination v2 envoy : : api : : v2 : : filter : : http : : RateLimit . <nl> + * @ param proto_config destination v2 envoy : : config : : filter : : http : : rate_limit : : v2 : : RateLimit . <nl> * / <nl> - static void translateHttpRateLimitFilter ( const Json : : Object & json_config , <nl> - envoy : : api : : v2 : : filter : : http : : RateLimit & proto_config ) ; <nl> + static void translateHttpRateLimitFilter ( <nl> + const Json : : Object & json_config , <nl> + envoy : : config : : filter : : http : : rate_limit : : v2 : : RateLimit & proto_config ) ; <nl> <nl> / * * <nl> * Translate a v1 JSON Client SSL Auth filter object to v2 <nl> - * envoy : : api : : v2 : : filter : : network : : ClientSSLAuth . <nl> + * envoy : : config : : filter : : network : : client_ssl_auth : : v2 : : ClientSSLAuth . <nl> * @ param json_config source v1 JSON Client SSL Auth Filter object . <nl> - * @ param proto_config destination v2 envoy : : api : : v2 : : filter : : network : : ClientSSLAuth . <nl> + * @ param proto_config destination v2 <nl> + * envoy : : config : : filter : : network : : client_ssl_auth : : v2 : : ClientSSLAuth . <nl> * / <nl> - static void <nl> - translateClientSslAuthFilter ( const Json : : Object & json_config , <nl> - envoy : : api : : v2 : : filter : : network : : ClientSSLAuth & proto_config ) ; <nl> + static void translateClientSslAuthFilter ( <nl> + const Json : : Object & json_config , <nl> + envoy : : config : : filter : : network : : client_ssl_auth : : v2 : : ClientSSLAuth & proto_config ) ; <nl> <nl> / * * <nl> - * Translate a v1 JSON SquashConfig object to v2 envoy : : api : : v2 : : filter : : http : : Squash . <nl> + * Translate a v1 JSON SquashConfig object to v2 envoy : : config : : filter : : http : : squash : : v2 : : Squash . <nl> * @ param json_config source v1 JSON HTTP SquashConfig object . <nl> - * @ param proto_config destination v2 envoy : : api : : v2 : : filter : : http : : Squash . <nl> + * @ param proto_config destination v2 envoy : : config : : filter : : http : : squash : : v2 : : Squash . <nl> * / <nl> static void translateSquashConfig ( const Json : : Object & json_config , <nl> - envoy : : api : : v2 : : filter : : http : : Squash & proto_config ) ; <nl> + envoy : : config : : filter : : http : : squash : : v2 : : Squash & proto_config ) ; <nl> } ; <nl> <nl> } / / namespace Config <nl> mmm a / source / common / config / grpc_mux_impl . cc <nl> ppp b / source / common / config / grpc_mux_impl . cc <nl> <nl> namespace Envoy { <nl> namespace Config { <nl> <nl> - GrpcMuxImpl : : GrpcMuxImpl ( const envoy : : api : : v2 : : Node & node , Grpc : : AsyncClientPtr async_client , <nl> + GrpcMuxImpl : : GrpcMuxImpl ( const envoy : : api : : v2 : : core : : Node & node , Grpc : : AsyncClientPtr async_client , <nl> Event : : Dispatcher & dispatcher , <nl> const Protobuf : : MethodDescriptor & service_method ) <nl> : node_ ( node ) , async_client_ ( std : : move ( async_client ) ) , service_method_ ( service_method ) { <nl> GrpcMuxImpl : : GrpcMuxImpl ( const envoy : : api : : v2 : : Node & node , Grpc : : AsyncClientPtr <nl> } <nl> <nl> GrpcMuxImpl : : ~ GrpcMuxImpl ( ) { <nl> + / / Hack to force linking of the service : https : / / github . com / google / protobuf / issues / 4221 <nl> + / / TODO ( kuat ) : Remove explicit proto descriptor import . <nl> + envoy : : service : : discovery : : v2 : : AdsDummy dummy ; <nl> + <nl> for ( const auto & api_state : api_state_ ) { <nl> for ( auto watch : api_state . second . watches_ ) { <nl> watch - > inserted_ = false ; <nl> mmm a / source / common / config / grpc_mux_impl . h <nl> ppp b / source / common / config / grpc_mux_impl . h <nl> class GrpcMuxImpl : public GrpcMux , <nl> Grpc : : TypedAsyncStreamCallbacks < envoy : : api : : v2 : : DiscoveryResponse > , <nl> Logger : : Loggable < Logger : : Id : : upstream > { <nl> public : <nl> - GrpcMuxImpl ( const envoy : : api : : v2 : : Node & node , Grpc : : AsyncClientPtr async_client , <nl> + GrpcMuxImpl ( const envoy : : api : : v2 : : core : : Node & node , Grpc : : AsyncClientPtr async_client , <nl> Event : : Dispatcher & dispatcher , const Protobuf : : MethodDescriptor & service_method ) ; <nl> ~ GrpcMuxImpl ( ) ; <nl> <nl> class GrpcMuxImpl : public GrpcMux , <nl> bool subscribed_ { } ; <nl> } ; <nl> <nl> - envoy : : api : : v2 : : Node node_ ; <nl> + envoy : : api : : v2 : : core : : Node node_ ; <nl> Grpc : : AsyncClientPtr async_client_ ; <nl> Grpc : : AsyncStream * stream_ { } ; <nl> const Protobuf : : MethodDescriptor & service_method_ ; <nl> mmm a / source / common / config / grpc_subscription_impl . h <nl> ppp b / source / common / config / grpc_subscription_impl . h <nl> <nl> # pragma once <nl> <nl> - # include " envoy / api / v2 / base . pb . h " <nl> + # include " envoy / api / v2 / core / base . pb . h " <nl> # include " envoy / config / subscription . h " <nl> # include " envoy / event / dispatcher . h " <nl> # include " envoy / grpc / async_client . h " <nl> namespace Config { <nl> template < class ResourceType > <nl> class GrpcSubscriptionImpl : public Config : : Subscription < ResourceType > { <nl> public : <nl> - GrpcSubscriptionImpl ( const envoy : : api : : v2 : : Node & node , Grpc : : AsyncClientPtr async_client , <nl> + GrpcSubscriptionImpl ( const envoy : : api : : v2 : : core : : Node & node , Grpc : : AsyncClientPtr async_client , <nl> Event : : Dispatcher & dispatcher , <nl> const Protobuf : : MethodDescriptor & service_method , SubscriptionStats stats ) <nl> : grpc_mux_ ( node , std : : move ( async_client ) , dispatcher , service_method ) , <nl> mmm a / source / common / config / http_subscription_impl . h <nl> ppp b / source / common / config / http_subscription_impl . h <nl> <nl> # pragma once <nl> <nl> - # include " envoy / api / v2 / base . pb . h " <nl> + # include " envoy / api / v2 / core / base . pb . h " <nl> # include " envoy / config / subscription . h " <nl> <nl> # include " common / buffer / buffer_impl . h " <nl> class HttpSubscriptionImpl : public Http : : RestApiFetcher , <nl> public Config : : Subscription < ResourceType > , <nl> Logger : : Loggable < Logger : : Id : : config > { <nl> public : <nl> - HttpSubscriptionImpl ( const envoy : : api : : v2 : : Node & node , Upstream : : ClusterManager & cm , <nl> + HttpSubscriptionImpl ( const envoy : : api : : v2 : : core : : Node & node , Upstream : : ClusterManager & cm , <nl> const std : : string & remote_cluster_name , Event : : Dispatcher & dispatcher , <nl> Runtime : : RandomGenerator & random , std : : chrono : : milliseconds refresh_interval , <nl> const Protobuf : : MethodDescriptor & service_method , SubscriptionStats stats ) <nl> mmm a / source / common / config / metadata . cc <nl> ppp b / source / common / config / metadata . cc <nl> <nl> namespace Envoy { <nl> namespace Config { <nl> <nl> - const ProtobufWkt : : Value & Metadata : : metadataValue ( const envoy : : api : : v2 : : Metadata & metadata , <nl> + const ProtobufWkt : : Value & Metadata : : metadataValue ( const envoy : : api : : v2 : : core : : Metadata & metadata , <nl> const std : : string & filter , <nl> const std : : string & key ) { <nl> const auto filter_it = metadata . filter_metadata ( ) . find ( filter ) ; <nl> const ProtobufWkt : : Value & Metadata : : metadataValue ( const envoy : : api : : v2 : : Metadata <nl> return fields_it - > second ; <nl> } <nl> <nl> - ProtobufWkt : : Value & Metadata : : mutableMetadataValue ( envoy : : api : : v2 : : Metadata & metadata , <nl> + ProtobufWkt : : Value & Metadata : : mutableMetadataValue ( envoy : : api : : v2 : : core : : Metadata & metadata , <nl> const std : : string & filter , <nl> const std : : string & key ) { <nl> return ( * ( * metadata . mutable_filter_metadata ( ) ) [ filter ] . mutable_fields ( ) ) [ key ] ; <nl> mmm a / source / common / config / metadata . h <nl> ppp b / source / common / config / metadata . h <nl> <nl> <nl> # include < string > <nl> <nl> - # include " envoy / api / v2 / base . pb . h " <nl> + # include " envoy / api / v2 / core / base . pb . h " <nl> <nl> # include " common / protobuf / protobuf . h " <nl> # include " common / singleton / const_singleton . h " <nl> class Metadata { <nl> * @ param key for filter metadata . <nl> * @ return const ProtobufWkt : : Value & value if found , empty if not found . <nl> * / <nl> - static const ProtobufWkt : : Value & metadataValue ( const envoy : : api : : v2 : : Metadata & metadata , <nl> + static const ProtobufWkt : : Value & metadataValue ( const envoy : : api : : v2 : : core : : Metadata & metadata , <nl> const std : : string & filter , const std : : string & key ) ; <nl> <nl> / * * <nl> class Metadata { <nl> * @ param key for filter metadata . <nl> * @ return ProtobufWkt : : Value & . A Value message is created if not found . <nl> * / <nl> - static ProtobufWkt : : Value & mutableMetadataValue ( envoy : : api : : v2 : : Metadata & metadata , <nl> + static ProtobufWkt : : Value & mutableMetadataValue ( envoy : : api : : v2 : : core : : Metadata & metadata , <nl> const std : : string & filter , <nl> const std : : string & key ) ; <nl> } ; <nl> mmm a / source / common / config / protocol_json . cc <nl> ppp b / source / common / config / protocol_json . cc <nl> namespace Config { <nl> <nl> void ProtocolJson : : translateHttp1ProtocolOptions ( <nl> const Json : : Object & json_http1_settings , <nl> - envoy : : api : : v2 : : Http1ProtocolOptions & http1_protocol_options ) { <nl> + envoy : : api : : v2 : : core : : Http1ProtocolOptions & http1_protocol_options ) { <nl> JSON_UTIL_SET_BOOL ( json_http1_settings , http1_protocol_options , allow_absolute_url ) ; <nl> } <nl> <nl> void ProtocolJson : : translateHttp2ProtocolOptions ( <nl> const Json : : Object & json_http2_settings , <nl> - envoy : : api : : v2 : : Http2ProtocolOptions & http2_protocol_options ) { <nl> + envoy : : api : : v2 : : core : : Http2ProtocolOptions & http2_protocol_options ) { <nl> JSON_UTIL_SET_INTEGER ( json_http2_settings , http2_protocol_options , hpack_table_size ) ; <nl> JSON_UTIL_SET_INTEGER ( json_http2_settings , http2_protocol_options , max_concurrent_streams ) ; <nl> JSON_UTIL_SET_INTEGER ( json_http2_settings , http2_protocol_options , initial_stream_window_size ) ; <nl> mmm a / source / common / config / protocol_json . h <nl> ppp b / source / common / config / protocol_json . h <nl> <nl> # pragma once <nl> <nl> - # include " envoy / api / v2 / protocol . pb . h " <nl> + # include " envoy / api / v2 / core / protocol . pb . h " <nl> # include " envoy / json / json_object . h " <nl> <nl> namespace Envoy { <nl> namespace Config { <nl> class ProtocolJson { <nl> public : <nl> / * * <nl> - * Translate v1 JSON HTTP / 1 . 1 options and settings to v2 envoy : : api : : v2 : : Http1ProtocolOptions . <nl> + * Translate v1 JSON HTTP / 1 . 1 options and settings to v2 <nl> + * envoy : : api : : v2 : : core : : Http1ProtocolOptions . <nl> * @ param json_http1_setting source v1 JSON HTTP / 1 . 1 settings object . <nl> - * @ param http1_protocol_options destination v2 envoy : : api : : v2 : : Http1ProtocolOptions . <nl> + * @ param http1_protocol_options destination v2 envoy : : api : : v2 : : core : : Http1ProtocolOptions . <nl> * / <nl> static void <nl> translateHttp1ProtocolOptions ( const Json : : Object & json_http1_settings , <nl> - envoy : : api : : v2 : : Http1ProtocolOptions & http1_protocol_options ) ; <nl> + envoy : : api : : v2 : : core : : Http1ProtocolOptions & http1_protocol_options ) ; <nl> <nl> / * * <nl> - * Translate v1 JSON HTTP / 2 options and settings to v2 envoy : : api : : v2 : : Http2ProtocolOptions . <nl> + * Translate v1 JSON HTTP / 2 options and settings to v2 envoy : : api : : v2 : : core : : Http2ProtocolOptions . <nl> * @ param json_http2_setting source v1 JSON HTTP / 2 settings object . <nl> - * @ param http2_protocol_options destination v2 envoy : : api : : v2 : : Http2ProtocolOptions . <nl> + * @ param http2_protocol_options destination v2 envoy : : api : : v2 : : core : : Http2ProtocolOptions . <nl> * / <nl> static void <nl> translateHttp2ProtocolOptions ( const Json : : Object & json_http2_settings , <nl> - envoy : : api : : v2 : : Http2ProtocolOptions & http2_protocol_options ) ; <nl> + envoy : : api : : v2 : : core : : Http2ProtocolOptions & http2_protocol_options ) ; <nl> } ; <nl> <nl> } / / namespace Config <nl> mmm a / source / common / config / rds_json . cc <nl> ppp b / source / common / config / rds_json . cc <nl> void RdsJson : : translateVirtualCluster ( const Json : : Object & json_virtual_cluster , <nl> JSON_UTIL_SET_STRING ( json_virtual_cluster , virtual_cluster , name ) ; <nl> JSON_UTIL_SET_STRING ( json_virtual_cluster , virtual_cluster , pattern ) ; <nl> <nl> - envoy : : api : : v2 : : RequestMethod method { } ; <nl> + envoy : : api : : v2 : : core : : RequestMethod method { } ; <nl> RequestMethod_Parse ( json_virtual_cluster . getString ( " method " , " METHOD_UNSPECIFIED " ) , & method ) ; <nl> virtual_cluster . set_method ( method ) ; <nl> } <nl> void RdsJson : : translateRoute ( const Json : : Object & json_route , envoy : : api : : v2 : : rou <nl> JSON_UTIL_SET_STRING ( * json_shadow , * request_mirror_policy , runtime_key ) ; <nl> } <nl> <nl> - envoy : : api : : v2 : : RoutingPriority priority { } ; <nl> + envoy : : api : : v2 : : core : : RoutingPriority priority { } ; <nl> RoutingPriority_Parse ( StringUtil : : toUpper ( json_route . getString ( " priority " , " default " ) ) , <nl> & priority ) ; <nl> action - > set_priority ( priority ) ; <nl> mmm a / source / common / config / subscription_factory . h <nl> ppp b / source / common / config / subscription_factory . h <nl> <nl> <nl> # include < functional > <nl> <nl> - # include " envoy / api / v2 / base . pb . h " <nl> + # include " envoy / api / v2 / core / base . pb . h " <nl> # include " envoy / config / subscription . h " <nl> # include " envoy / upstream / cluster_manager . h " <nl> <nl> class SubscriptionFactory { <nl> public : <nl> / * * <nl> * Subscription factory . <nl> - * @ param config envoy : : api : : v2 : : ConfigSource to construct from . <nl> - * @ param node envoy : : api : : v2 : : Node identifier . <nl> + * @ param config envoy : : api : : v2 : : core : : ConfigSource to construct from . <nl> + * @ param node envoy : : api : : v2 : : core : : Node identifier . <nl> * @ param dispatcher event dispatcher . <nl> * @ param cm cluster manager for async clients ( when REST / gRPC ) . <nl> * @ param random random generator for jittering polling delays ( when REST ) . <nl> class SubscriptionFactory { <nl> * / <nl> template < class ResourceType > <nl> static std : : unique_ptr < Subscription < ResourceType > > subscriptionFromConfigSource ( <nl> - const envoy : : api : : v2 : : ConfigSource & config , const envoy : : api : : v2 : : Node & node , <nl> + const envoy : : api : : v2 : : core : : ConfigSource & config , const envoy : : api : : v2 : : core : : Node & node , <nl> Event : : Dispatcher & dispatcher , Upstream : : ClusterManager & cm , Runtime : : RandomGenerator & random , <nl> Stats : : Scope & scope , std : : function < Subscription < ResourceType > * ( ) > rest_legacy_constructor , <nl> const std : : string & rest_method , const std : : string & grpc_method ) { <nl> std : : unique_ptr < Subscription < ResourceType > > result ; <nl> SubscriptionStats stats = Utility : : generateStats ( scope ) ; <nl> switch ( config . config_source_specifier_case ( ) ) { <nl> - case envoy : : api : : v2 : : ConfigSource : : kPath : { <nl> + case envoy : : api : : v2 : : core : : ConfigSource : : kPath : { <nl> Utility : : checkFilesystemSubscriptionBackingPath ( config . path ( ) ) ; <nl> result . reset ( <nl> new Config : : FilesystemSubscriptionImpl < ResourceType > ( dispatcher , config . path ( ) , stats ) ) ; <nl> break ; <nl> } <nl> - case envoy : : api : : v2 : : ConfigSource : : kApiConfigSource : { <nl> - const envoy : : api : : v2 : : ApiConfigSource & api_config_source = config . api_config_source ( ) ; <nl> + case envoy : : api : : v2 : : core : : ConfigSource : : kApiConfigSource : { <nl> + const envoy : : api : : v2 : : core : : ApiConfigSource & api_config_source = config . api_config_source ( ) ; <nl> Utility : : checkApiConfigSourceSubscriptionBackingCluster ( cm . clusters ( ) , api_config_source ) ; <nl> const std : : string & cluster_name = api_config_source . cluster_names ( ) [ 0 ] ; <nl> switch ( api_config_source . api_type ( ) ) { <nl> - case envoy : : api : : v2 : : ApiConfigSource : : REST_LEGACY : <nl> + case envoy : : api : : v2 : : core : : ApiConfigSource : : REST_LEGACY : <nl> result . reset ( rest_legacy_constructor ( ) ) ; <nl> break ; <nl> - case envoy : : api : : v2 : : ApiConfigSource : : REST : <nl> + case envoy : : api : : v2 : : core : : ApiConfigSource : : REST : <nl> result . reset ( new HttpSubscriptionImpl < ResourceType > ( <nl> node , cm , cluster_name , dispatcher , random , <nl> Utility : : apiConfigSourceRefreshDelay ( api_config_source ) , <nl> * Protobuf : : DescriptorPool : : generated_pool ( ) - > FindMethodByName ( rest_method ) , stats ) ) ; <nl> break ; <nl> - case envoy : : api : : v2 : : ApiConfigSource : : GRPC : { <nl> + case envoy : : api : : v2 : : core : : ApiConfigSource : : GRPC : { <nl> result . reset ( new GrpcSubscriptionImpl < ResourceType > ( <nl> node , <nl> Config : : Utility : : factoryForApiConfigSource ( cm . grpcAsyncClientManager ( ) , <nl> class SubscriptionFactory { <nl> } <nl> break ; <nl> } <nl> - case envoy : : api : : v2 : : ConfigSource : : kAds : { <nl> + case envoy : : api : : v2 : : core : : ConfigSource : : kAds : { <nl> result . reset ( new GrpcMuxSubscriptionImpl < ResourceType > ( cm . adsMux ( ) , stats ) ) ; <nl> break ; <nl> } <nl> default : <nl> - throw EnvoyException ( " Missing config source specifier in envoy : : api : : v2 : : ConfigSource " ) ; <nl> + throw EnvoyException ( " Missing config source specifier in envoy : : api : : v2 : : core : : ConfigSource " ) ; <nl> } <nl> return result ; <nl> } <nl> mmm a / source / common / config / utility . cc <nl> ppp b / source / common / config / utility . cc <nl> namespace Config { <nl> <nl> void Utility : : translateApiConfigSource ( const std : : string & cluster , uint32_t refresh_delay_ms , <nl> const std : : string & api_type , <nl> - envoy : : api : : v2 : : ApiConfigSource & api_config_source ) { <nl> + envoy : : api : : v2 : : core : : ApiConfigSource & api_config_source ) { <nl> / / TODO ( junr03 ) : document the option to chose an api type once we have created <nl> / / stronger constraints around v2 . <nl> if ( api_type = = ApiType : : get ( ) . RestLegacy ) { <nl> - api_config_source . set_api_type ( envoy : : api : : v2 : : ApiConfigSource : : REST_LEGACY ) ; <nl> + api_config_source . set_api_type ( envoy : : api : : v2 : : core : : ApiConfigSource : : REST_LEGACY ) ; <nl> } else if ( api_type = = ApiType : : get ( ) . Rest ) { <nl> - api_config_source . set_api_type ( envoy : : api : : v2 : : ApiConfigSource : : REST ) ; <nl> + api_config_source . set_api_type ( envoy : : api : : v2 : : core : : ApiConfigSource : : REST ) ; <nl> } else { <nl> ASSERT ( api_type = = ApiType : : get ( ) . Grpc ) ; <nl> - api_config_source . set_api_type ( envoy : : api : : v2 : : ApiConfigSource : : GRPC ) ; <nl> + api_config_source . set_api_type ( envoy : : api : : v2 : : core : : ApiConfigSource : : GRPC ) ; <nl> } <nl> api_config_source . add_cluster_names ( cluster ) ; <nl> api_config_source . mutable_refresh_delay ( ) - > CopyFrom ( <nl> void Utility : : checkFilesystemSubscriptionBackingPath ( const std : : string & path ) { <nl> <nl> void Utility : : checkApiConfigSourceSubscriptionBackingCluster ( <nl> const Upstream : : ClusterManager : : ClusterInfoMap & clusters , <nl> - const envoy : : api : : v2 : : ApiConfigSource & api_config_source ) { <nl> + const envoy : : api : : v2 : : core : : ApiConfigSource & api_config_source ) { <nl> if ( api_config_source . cluster_names ( ) . size ( ) ! = 1 ) { <nl> / / TODO ( htuch ) : Add support for multiple clusters , # 1170 . <nl> throw EnvoyException ( <nl> - " envoy : : api : : v2 : : ConfigSource must have a singleton cluster name specified " ) ; <nl> + " envoy : : api : : v2 : : core : : ConfigSource must have a singleton cluster name specified " ) ; <nl> } <nl> <nl> const auto & cluster_name = api_config_source . cluster_names ( ) [ 0 ] ; <nl> void Utility : : checkApiConfigSourceSubscriptionBackingCluster ( <nl> if ( it = = clusters . end ( ) | | it - > second . get ( ) . info ( ) - > addedViaApi ( ) | | <nl> it - > second . get ( ) . info ( ) - > type ( ) = = envoy : : api : : v2 : : Cluster : : EDS ) { <nl> throw EnvoyException ( fmt : : format ( <nl> - " envoy : : api : : v2 : : ConfigSource must have a statically " <nl> + " envoy : : api : : v2 : : core : : ConfigSource must have a statically " <nl> " defined non - EDS cluster : ' { } ' does not exist , was added via api , or is an EDS cluster " , <nl> cluster_name ) ) ; <nl> } <nl> } <nl> <nl> - std : : chrono : : milliseconds <nl> - Utility : : apiConfigSourceRefreshDelay ( const envoy : : api : : v2 : : ApiConfigSource & api_config_source ) { <nl> + std : : chrono : : milliseconds Utility : : apiConfigSourceRefreshDelay ( <nl> + const envoy : : api : : v2 : : core : : ApiConfigSource & api_config_source ) { <nl> if ( ! api_config_source . has_refresh_delay ( ) ) { <nl> throw EnvoyException ( " refresh_delay is required for REST API configuration sources " ) ; <nl> } <nl> Utility : : apiConfigSourceRefreshDelay ( const envoy : : api : : v2 : : ApiConfigSource & api_ <nl> } <nl> <nl> void Utility : : translateEdsConfig ( const Json : : Object & json_config , <nl> - envoy : : api : : v2 : : ConfigSource & eds_config ) { <nl> + envoy : : api : : v2 : : core : : ConfigSource & eds_config ) { <nl> translateApiConfigSource ( json_config . getObject ( " cluster " ) - > getString ( " name " ) , <nl> json_config . getInteger ( " refresh_delay_ms " , 30000 ) , <nl> json_config . getString ( " api_type " , ApiType : : get ( ) . RestLegacy ) , <nl> void Utility : : translateEdsConfig ( const Json : : Object & json_config , <nl> } <nl> <nl> void Utility : : translateCdsConfig ( const Json : : Object & json_config , <nl> - envoy : : api : : v2 : : ConfigSource & cds_config ) { <nl> + envoy : : api : : v2 : : core : : ConfigSource & cds_config ) { <nl> translateApiConfigSource ( json_config . getObject ( " cluster " ) - > getString ( " name " ) , <nl> json_config . getInteger ( " refresh_delay_ms " , 30000 ) , <nl> json_config . getString ( " api_type " , ApiType : : get ( ) . RestLegacy ) , <nl> * cds_config . mutable_api_config_source ( ) ) ; <nl> } <nl> <nl> - void Utility : : translateRdsConfig ( const Json : : Object & json_rds , <nl> - envoy : : api : : v2 : : filter : : network : : Rds & rds ) { <nl> + void Utility : : translateRdsConfig ( <nl> + const Json : : Object & json_rds , <nl> + envoy : : config : : filter : : network : : http_connection_manager : : v2 : : Rds & rds ) { <nl> json_rds . validateSchema ( Json : : Schema : : RDS_CONFIGURATION_SCHEMA ) ; <nl> <nl> const std : : string name = json_rds . getString ( " route_config_name " , " " ) ; <nl> void Utility : : translateRdsConfig ( const Json : : Object & json_rds , <nl> } <nl> <nl> void Utility : : translateLdsConfig ( const Json : : Object & json_lds , <nl> - envoy : : api : : v2 : : ConfigSource & lds_config ) { <nl> + envoy : : api : : v2 : : core : : ConfigSource & lds_config ) { <nl> json_lds . validateSchema ( Json : : Schema : : LDS_CONFIG_SCHEMA ) ; <nl> translateApiConfigSource ( json_lds . getString ( " cluster " ) , <nl> json_lds . getInteger ( " refresh_delay_ms " , 30000 ) , <nl> void Utility : : checkObjNameLength ( const std : : string & error_prefix , const std : : str <nl> <nl> Grpc : : AsyncClientFactoryPtr <nl> Utility : : factoryForApiConfigSource ( Grpc : : AsyncClientManager & async_client_manager , <nl> - const envoy : : api : : v2 : : ApiConfigSource & api_config_source , <nl> + const envoy : : api : : v2 : : core : : ApiConfigSource & api_config_source , <nl> Stats : : Scope & scope ) { <nl> - ASSERT ( api_config_source . api_type ( ) = = envoy : : api : : v2 : : ApiConfigSource : : GRPC ) ; <nl> - envoy : : api : : v2 : : GrpcService grpc_service ; <nl> + ASSERT ( api_config_source . api_type ( ) = = envoy : : api : : v2 : : core : : ApiConfigSource : : GRPC ) ; <nl> + envoy : : api : : v2 : : core : : GrpcService grpc_service ; <nl> if ( api_config_source . cluster_names ( ) . empty ( ) ) { <nl> if ( api_config_source . grpc_services ( ) . empty ( ) ) { <nl> throw EnvoyException ( <nl> - fmt : : format ( " Missing gRPC services in envoy : : api : : v2 : : ApiConfigSource : { } " , <nl> + fmt : : format ( " Missing gRPC services in envoy : : api : : v2 : : core : : ApiConfigSource : { } " , <nl> api_config_source . DebugString ( ) ) ) ; <nl> } <nl> / / TODO ( htuch ) : Implement multiple gRPC services . <nl> if ( api_config_source . grpc_services ( ) . size ( ) ! = 1 ) { <nl> - throw EnvoyException ( fmt : : format ( <nl> - " Only singleton gRPC service lists supported in envoy : : api : : v2 : : ApiConfigSource : { } " , <nl> - api_config_source . DebugString ( ) ) ) ; <nl> + throw EnvoyException ( fmt : : format ( " Only singleton gRPC service lists supported in " <nl> + " envoy : : api : : v2 : : core : : ApiConfigSource : { } " , <nl> + api_config_source . DebugString ( ) ) ) ; <nl> } <nl> grpc_service . MergeFrom ( api_config_source . grpc_services ( 0 ) ) ; <nl> } else { <nl> / / TODO ( htuch ) : cluster_names is deprecated , remove after 1 . 6 . 0 . <nl> if ( api_config_source . cluster_names ( ) . size ( ) ! = 1 ) { <nl> - throw EnvoyException ( fmt : : format ( <nl> - " Only singleton cluster name lists supported in envoy : : api : : v2 : : ApiConfigSource : { } " , <nl> - api_config_source . DebugString ( ) ) ) ; <nl> + throw EnvoyException ( fmt : : format ( " Only singleton cluster name lists supported in " <nl> + " envoy : : api : : v2 : : core : : ApiConfigSource : { } " , <nl> + api_config_source . DebugString ( ) ) ) ; <nl> } <nl> grpc_service . mutable_envoy_grpc ( ) - > set_cluster_name ( api_config_source . cluster_names ( 0 ) ) ; <nl> } <nl> mmm a / source / common / config / utility . h <nl> ppp b / source / common / config / utility . h <nl> <nl> # pragma once <nl> <nl> - # include " envoy / api / v2 / base . pb . h " <nl> # include " envoy / api / v2 / cds . pb . h " <nl> + # include " envoy / api / v2 / core / base . pb . h " <nl> # include " envoy / api / v2 / eds . pb . h " <nl> - # include " envoy / api / v2 / filter / network / http_connection_manager . pb . h " <nl> # include " envoy / api / v2 / lds . pb . h " <nl> # include " envoy / api / v2 / route / route . pb . h " <nl> # include " envoy / config / bootstrap / v2 / bootstrap . pb . h " <nl> + # include " envoy / config / filter / network / http_connection_manager / v2 / http_connection_manager . pb . h " <nl> # include " envoy / config / grpc_mux . h " <nl> # include " envoy / config / subscription . h " <nl> # include " envoy / json / json_object . h " <nl> namespace Envoy { <nl> namespace Config { <nl> <nl> / * * <nl> - * Constant Api Type Values , used by envoy : : api : : v2 : : ApiConfigSource . <nl> + * Constant Api Type Values , used by envoy : : api : : v2 : : core : : ApiConfigSource . <nl> * / <nl> class ApiTypeValues { <nl> public : <nl> class Utility { <nl> } <nl> <nl> / * * <nl> - * Extract refresh_delay as a std : : chrono : : milliseconds from envoy : : api : : v2 : : ApiConfigSource . <nl> + * Extract refresh_delay as a std : : chrono : : milliseconds from <nl> + * envoy : : api : : v2 : : core : : ApiConfigSource . <nl> * / <nl> static std : : chrono : : milliseconds <nl> - apiConfigSourceRefreshDelay ( const envoy : : api : : v2 : : ApiConfigSource & api_config_source ) ; <nl> + apiConfigSourceRefreshDelay ( const envoy : : api : : v2 : : core : : ApiConfigSource & api_config_source ) ; <nl> <nl> / * * <nl> - * Populate an envoy : : api : : v2 : : ApiConfigSource . <nl> + * Populate an envoy : : api : : v2 : : core : : ApiConfigSource . <nl> * @ param cluster supplies the cluster name for the ApiConfigSource . <nl> * @ param refresh_delay_ms supplies the refresh delay for the ApiConfigSource in ms . <nl> * @ param api_type supplies the type of subscription to use for the ApiConfigSource . <nl> - * @ param api_config_source a reference to the envoy : : api : : v2 : : ApiConfigSource object to populate . <nl> + * @ param api_config_source a reference to the envoy : : api : : v2 : : core : : ApiConfigSource object to <nl> + * populate . <nl> * / <nl> static void translateApiConfigSource ( const std : : string & cluster , uint32_t refresh_delay_ms , <nl> const std : : string & api_type , <nl> - envoy : : api : : v2 : : ApiConfigSource & api_config_source ) ; <nl> + envoy : : api : : v2 : : core : : ApiConfigSource & api_config_source ) ; <nl> <nl> / * * <nl> * Check cluster info for API config sanity . Throws on error . <nl> class Utility { <nl> * / <nl> static void checkApiConfigSourceSubscriptionBackingCluster ( <nl> const Upstream : : ClusterManager : : ClusterInfoMap & clusters , <nl> - const envoy : : api : : v2 : : ApiConfigSource & api_config_source ) ; <nl> + const envoy : : api : : v2 : : core : : ApiConfigSource & api_config_source ) ; <nl> <nl> / * * <nl> - * Convert a v1 SDS JSON config to v2 EDS envoy : : api : : v2 : : ConfigSource . <nl> + * Convert a v1 SDS JSON config to v2 EDS envoy : : api : : v2 : : core : : ConfigSource . <nl> * @ param json_config source v1 SDS JSON config . <nl> - * @ param eds_config destination v2 EDS envoy : : api : : v2 : : ConfigSource . <nl> + * @ param eds_config destination v2 EDS envoy : : api : : v2 : : core : : ConfigSource . <nl> * / <nl> static void translateEdsConfig ( const Json : : Object & json_config , <nl> - envoy : : api : : v2 : : ConfigSource & eds_config ) ; <nl> + envoy : : api : : v2 : : core : : ConfigSource & eds_config ) ; <nl> <nl> / * * <nl> - * Convert a v1 CDS JSON config to v2 CDS envoy : : api : : v2 : : ConfigSource . <nl> + * Convert a v1 CDS JSON config to v2 CDS envoy : : api : : v2 : : core : : ConfigSource . <nl> * @ param json_config source v1 CDS JSON config . <nl> - * @ param cds_config destination v2 CDS envoy : : api : : v2 : : ConfigSource . <nl> + * @ param cds_config destination v2 CDS envoy : : api : : v2 : : core : : ConfigSource . <nl> * / <nl> static void translateCdsConfig ( const Json : : Object & json_config , <nl> - envoy : : api : : v2 : : ConfigSource & cds_config ) ; <nl> + envoy : : api : : v2 : : core : : ConfigSource & cds_config ) ; <nl> <nl> / * * <nl> - * Convert a v1 RDS JSON config to v2 RDS envoy : : api : : v2 : : filter : : network : : Rds . <nl> + * Convert a v1 RDS JSON config to v2 RDS <nl> + * envoy : : config : : filter : : network : : http_connection_manager : : v2 : : Rds . <nl> * @ param json_rds source v1 RDS JSON config . <nl> - * @ param rds destination v2 RDS envoy : : api : : v2 : : filter : : network : : Rds . <nl> + * @ param rds destination v2 RDS envoy : : config : : filter : : network : : http_connection_manager : : v2 : : Rds . <nl> * / <nl> - static void translateRdsConfig ( const Json : : Object & json_rds , <nl> - envoy : : api : : v2 : : filter : : network : : Rds & rds ) ; <nl> + static void <nl> + translateRdsConfig ( const Json : : Object & json_rds , <nl> + envoy : : config : : filter : : network : : http_connection_manager : : v2 : : Rds & rds ) ; <nl> <nl> / * * <nl> - * Convert a v1 LDS JSON config to v2 LDS envoy : : api : : v2 : : ConfigSource . <nl> + * Convert a v1 LDS JSON config to v2 LDS envoy : : api : : v2 : : core : : ConfigSource . <nl> * @ param json_lds source v1 LDS JSON config . <nl> - * @ param lds_config destination v2 LDS envoy : : api : : v2 : : ConfigSource . <nl> + * @ param lds_config destination v2 LDS envoy : : api : : v2 : : core : : ConfigSource . <nl> * / <nl> static void translateLdsConfig ( const Json : : Object & json_lds , <nl> - envoy : : api : : v2 : : ConfigSource & lds_config ) ; <nl> + envoy : : api : : v2 : : core : : ConfigSource & lds_config ) ; <nl> <nl> / * * <nl> * Generate a SubscriptionStats object from stats scope . <nl> class Utility { <nl> static void checkObjNameLength ( const std : : string & error_prefix , const std : : string & name ) ; <nl> <nl> / * * <nl> - * Obtain gRPC async client factory from a envoy : : api : : v2 : : ApiConfigSource . <nl> + * Obtain gRPC async client factory from a envoy : : api : : v2 : : core : : ApiConfigSource . <nl> * @ param async_client_manager gRPC async client manager . <nl> - * @ param api_config_source envoy : : api : : v2 : : ApiConfigSource . Must have config type GRPC . <nl> + * @ param api_config_source envoy : : api : : v2 : : core : : ApiConfigSource . Must have config type GRPC . <nl> * @ return Grpc : : AsyncClientFactoryPtr gRPC async client factory . <nl> * / <nl> static Grpc : : AsyncClientFactoryPtr <nl> factoryForApiConfigSource ( Grpc : : AsyncClientManager & async_client_manager , <nl> - const envoy : : api : : v2 : : ApiConfigSource & api_config_source , <nl> + const envoy : : api : : v2 : : core : : ApiConfigSource & api_config_source , <nl> Stats : : Scope & scope ) ; <nl> } ; <nl> <nl> mmm a / source / common / filter / BUILD <nl> ppp b / source / common / filter / BUILD <nl> envoy_cc_library ( <nl> " / / include / envoy / runtime : runtime_interface " , <nl> " / / include / envoy / stats : stats_macros " , <nl> " / / source / common / tracing : http_tracer_lib " , <nl> - " @ envoy_api / / envoy / api / v2 / filter / network : rate_limit_cc " , <nl> + " @ envoy_api / / envoy / config / filter / network / rate_limit / v2 : rate_limit_cc " , <nl> ] , <nl> ) <nl> <nl> envoy_cc_library ( <nl> " / / source / common / network : filter_lib " , <nl> " / / source / common / network : utility_lib " , <nl> " / / source / common / request_info : request_info_lib " , <nl> - " @ envoy_api / / envoy / api / v2 / filter / network : tcp_proxy_cc " , <nl> + " @ envoy_api / / envoy / config / filter / network / tcp_proxy / v2 : tcp_proxy_cc " , <nl> ] , <nl> ) <nl> mmm a / source / common / filter / auth / BUILD <nl> ppp b / source / common / filter / auth / BUILD <nl> envoy_cc_library ( <nl> " / / source / common / json : json_loader_lib " , <nl> " / / source / common / network : cidr_range_lib " , <nl> " / / source / common / network : utility_lib " , <nl> - " @ envoy_api / / envoy / api / v2 / filter / network : client_ssl_auth_cc " , <nl> + " @ envoy_api / / envoy / config / filter / network / client_ssl_auth / v2 : client_ssl_auth_cc " , <nl> ] , <nl> ) <nl> mmm a / source / common / filter / auth / client_ssl . cc <nl> ppp b / source / common / filter / auth / client_ssl . cc <nl> namespace Filter { <nl> namespace Auth { <nl> namespace ClientSsl { <nl> <nl> - Config : : Config ( const envoy : : api : : v2 : : filter : : network : : ClientSSLAuth & config , <nl> + Config : : Config ( const envoy : : config : : filter : : network : : client_ssl_auth : : v2 : : ClientSSLAuth & config , <nl> ThreadLocal : : SlotAllocator & tls , Upstream : : ClusterManager & cm , <nl> Event : : Dispatcher & dispatcher , Stats : : Scope & scope , Runtime : : RandomGenerator & random ) <nl> : RestApiFetcher ( <nl> Config : : Config ( const envoy : : api : : v2 : : filter : : network : : ClientSSLAuth & config , <nl> [ empty ] ( Event : : Dispatcher & ) - > ThreadLocal : : ThreadLocalObjectSharedPtr { return empty ; } ) ; <nl> } <nl> <nl> - ConfigSharedPtr Config : : create ( const envoy : : api : : v2 : : filter : : network : : ClientSSLAuth & config , <nl> - ThreadLocal : : SlotAllocator & tls , Upstream : : ClusterManager & cm , <nl> - Event : : Dispatcher & dispatcher , Stats : : Scope & scope , <nl> - Runtime : : RandomGenerator & random ) { <nl> + ConfigSharedPtr <nl> + Config : : create ( const envoy : : config : : filter : : network : : client_ssl_auth : : v2 : : ClientSSLAuth & config , <nl> + ThreadLocal : : SlotAllocator & tls , Upstream : : ClusterManager & cm , <nl> + Event : : Dispatcher & dispatcher , Stats : : Scope & scope , <nl> + Runtime : : RandomGenerator & random ) { <nl> ConfigSharedPtr new_config ( new Config ( config , tls , cm , dispatcher , scope , random ) ) ; <nl> new_config - > initialize ( ) ; <nl> return new_config ; <nl> mmm a / source / common / filter / auth / client_ssl . h <nl> ppp b / source / common / filter / auth / client_ssl . h <nl> <nl> # include < string > <nl> # include < unordered_set > <nl> <nl> - # include " envoy / api / v2 / filter / network / client_ssl_auth . pb . h " <nl> + # include " envoy / config / filter / network / client_ssl_auth / v2 / client_ssl_auth . pb . h " <nl> # include " envoy / network / filter . h " <nl> # include " envoy / runtime / runtime . h " <nl> # include " envoy / stats / stats_macros . h " <nl> typedef std : : shared_ptr < Config > ConfigSharedPtr ; <nl> * / <nl> class Config : public Http : : RestApiFetcher { <nl> public : <nl> - static ConfigSharedPtr create ( const envoy : : api : : v2 : : filter : : network : : ClientSSLAuth & config , <nl> - ThreadLocal : : SlotAllocator & tls , Upstream : : ClusterManager & cm , <nl> - Event : : Dispatcher & dispatcher , Stats : : Scope & scope , <nl> - Runtime : : RandomGenerator & random ) ; <nl> + static ConfigSharedPtr <nl> + create ( const envoy : : config : : filter : : network : : client_ssl_auth : : v2 : : ClientSSLAuth & config , <nl> + ThreadLocal : : SlotAllocator & tls , Upstream : : ClusterManager & cm , <nl> + Event : : Dispatcher & dispatcher , Stats : : Scope & scope , Runtime : : RandomGenerator & random ) ; <nl> <nl> const AllowedPrincipals & allowedPrincipals ( ) ; <nl> const Network : : Address : : IpList & ipWhiteList ( ) { return ip_white_list_ ; } <nl> GlobalStats & stats ( ) { return stats_ ; } <nl> <nl> private : <nl> - Config ( const envoy : : api : : v2 : : filter : : network : : ClientSSLAuth & config , <nl> + Config ( const envoy : : config : : filter : : network : : client_ssl_auth : : v2 : : ClientSSLAuth & config , <nl> ThreadLocal : : SlotAllocator & tls , Upstream : : ClusterManager & cm , <nl> Event : : Dispatcher & dispatcher , Stats : : Scope & scope , Runtime : : RandomGenerator & random ) ; <nl> <nl> mmm a / source / common / filter / ratelimit . cc <nl> ppp b / source / common / filter / ratelimit . cc <nl> namespace Envoy { <nl> namespace RateLimit { <nl> namespace TcpFilter { <nl> <nl> - Config : : Config ( const envoy : : api : : v2 : : filter : : network : : RateLimit & config , Stats : : Scope & scope , <nl> - Runtime : : Loader & runtime ) <nl> + Config : : Config ( const envoy : : config : : filter : : network : : rate_limit : : v2 : : RateLimit & config , <nl> + Stats : : Scope & scope , Runtime : : Loader & runtime ) <nl> : domain_ ( config . domain ( ) ) , stats_ ( generateStats ( config . stat_prefix ( ) , scope ) ) , <nl> runtime_ ( runtime ) { <nl> <nl> mmm a / source / common / filter / ratelimit . h <nl> ppp b / source / common / filter / ratelimit . h <nl> <nl> # include < string > <nl> # include < vector > <nl> <nl> - # include " envoy / api / v2 / filter / network / rate_limit . pb . h " <nl> + # include " envoy / config / filter / network / rate_limit / v2 / rate_limit . pb . h " <nl> # include " envoy / network / connection . h " <nl> # include " envoy / network / filter . h " <nl> # include " envoy / ratelimit / ratelimit . h " <nl> struct InstanceStats { <nl> * / <nl> class Config { <nl> public : <nl> - Config ( const envoy : : api : : v2 : : filter : : network : : RateLimit & config , Stats : : Scope & scope , <nl> - Runtime : : Loader & runtime ) ; <nl> + Config ( const envoy : : config : : filter : : network : : rate_limit : : v2 : : RateLimit & config , <nl> + Stats : : Scope & scope , Runtime : : Loader & runtime ) ; <nl> const std : : string & domain ( ) { return domain_ ; } <nl> const std : : vector < Descriptor > & descriptors ( ) { return descriptors_ ; } <nl> Runtime : : Loader & runtime ( ) { return runtime_ ; } <nl> mmm a / source / common / filter / tcp_proxy . cc <nl> ppp b / source / common / filter / tcp_proxy . cc <nl> <nl> # include < cstdint > <nl> # include < string > <nl> <nl> - # include " envoy / api / v2 / filter / network / http_connection_manager . pb . h " <nl> # include " envoy / buffer / buffer . h " <nl> + # include " envoy / config / filter / network / http_connection_manager / v2 / http_connection_manager . pb . h " <nl> # include " envoy / event / dispatcher . h " <nl> # include " envoy / event / timer . h " <nl> # include " envoy / stats / stats . h " <nl> namespace Envoy { <nl> namespace Filter { <nl> <nl> TcpProxyConfig : : Route : : Route ( <nl> - const envoy : : api : : v2 : : filter : : network : : TcpProxy : : DeprecatedV1 : : TCPRoute & config ) { <nl> + const envoy : : config : : filter : : network : : tcp_proxy : : v2 : : TcpProxy : : DeprecatedV1 : : TCPRoute & config ) { <nl> cluster_name_ = config . cluster ( ) ; <nl> <nl> source_ips_ = Network : : Address : : IpList ( config . source_ip_list ( ) ) ; <nl> TcpProxyConfig : : Route : : Route ( <nl> } <nl> } <nl> <nl> - TcpProxyConfig : : SharedConfig : : SharedConfig ( const envoy : : api : : v2 : : filter : : network : : TcpProxy & config , <nl> - Server : : Configuration : : FactoryContext & context ) <nl> + TcpProxyConfig : : SharedConfig : : SharedConfig ( <nl> + const envoy : : config : : filter : : network : : tcp_proxy : : v2 : : TcpProxy & config , <nl> + Server : : Configuration : : FactoryContext & context ) <nl> : stats_scope_ ( context . scope ( ) . createScope ( fmt : : format ( " tcp . { } . " , config . stat_prefix ( ) ) ) ) , <nl> stats_ ( generateStats ( * stats_scope_ ) ) { <nl> if ( config . has_idle_timeout ( ) ) { <nl> TcpProxyConfig : : SharedConfig : : SharedConfig ( const envoy : : api : : v2 : : filter : : network <nl> } <nl> } <nl> <nl> - TcpProxyConfig : : TcpProxyConfig ( const envoy : : api : : v2 : : filter : : network : : TcpProxy & config , <nl> - Server : : Configuration : : FactoryContext & context ) <nl> + TcpProxyConfig : : TcpProxyConfig ( <nl> + const envoy : : config : : filter : : network : : tcp_proxy : : v2 : : TcpProxy & config , <nl> + Server : : Configuration : : FactoryContext & context ) <nl> : max_connect_attempts_ ( PROTOBUF_GET_WRAPPED_OR_DEFAULT ( config , max_connect_attempts , 1 ) ) , <nl> upstream_drain_manager_slot_ ( context . threadLocal ( ) . allocateSlot ( ) ) , <nl> shared_config_ ( std : : make_shared < SharedConfig > ( config , context ) ) { <nl> TcpProxyConfig : : TcpProxyConfig ( const envoy : : api : : v2 : : filter : : network : : TcpProxy & <nl> } ) ; <nl> <nl> if ( config . has_deprecated_v1 ( ) ) { <nl> - for ( const envoy : : api : : v2 : : filter : : network : : TcpProxy : : DeprecatedV1 : : TCPRoute & route_desc : <nl> - config . deprecated_v1 ( ) . routes ( ) ) { <nl> + for ( const envoy : : config : : filter : : network : : tcp_proxy : : v2 : : TcpProxy : : DeprecatedV1 : : TCPRoute & <nl> + route_desc : config . deprecated_v1 ( ) . routes ( ) ) { <nl> if ( ! context . clusterManager ( ) . get ( route_desc . cluster ( ) ) ) { <nl> throw EnvoyException ( <nl> fmt : : format ( " tcp proxy : unknown cluster ' { } ' in TCP route " , route_desc . cluster ( ) ) ) ; <nl> TcpProxyConfig : : TcpProxyConfig ( const envoy : : api : : v2 : : filter : : network : : TcpProxy & <nl> } <nl> <nl> if ( ! config . cluster ( ) . empty ( ) ) { <nl> - envoy : : api : : v2 : : filter : : network : : TcpProxy : : DeprecatedV1 : : TCPRoute default_route ; <nl> + envoy : : config : : filter : : network : : tcp_proxy : : v2 : : TcpProxy : : DeprecatedV1 : : TCPRoute default_route ; <nl> default_route . set_cluster ( config . cluster ( ) ) ; <nl> routes_ . emplace_back ( default_route ) ; <nl> } <nl> <nl> - for ( const envoy : : api : : v2 : : filter : : accesslog : : AccessLog & log_config : config . access_log ( ) ) { <nl> + for ( const envoy : : config : : filter : : accesslog : : v2 : : AccessLog & log_config : config . access_log ( ) ) { <nl> access_logs_ . emplace_back ( AccessLog : : AccessLogFactory : : fromProto ( log_config , context ) ) ; <nl> } <nl> } <nl> mmm a / source / common / filter / tcp_proxy . h <nl> ppp b / source / common / filter / tcp_proxy . h <nl> <nl> # include < vector > <nl> <nl> # include " envoy / access_log / access_log . h " <nl> - # include " envoy / api / v2 / filter / network / tcp_proxy . pb . h " <nl> + # include " envoy / config / filter / network / tcp_proxy / v2 / tcp_proxy . pb . h " <nl> # include " envoy / event / timer . h " <nl> # include " envoy / network / connection . h " <nl> # include " envoy / network / filter . h " <nl> class TcpProxyConfig { <nl> * / <nl> class SharedConfig { <nl> public : <nl> - SharedConfig ( const envoy : : api : : v2 : : filter : : network : : TcpProxy & config , <nl> + SharedConfig ( const envoy : : config : : filter : : network : : tcp_proxy : : v2 : : TcpProxy & config , <nl> Server : : Configuration : : FactoryContext & context ) ; <nl> const TcpProxyStats & stats ( ) { return stats_ ; } <nl> const Optional < std : : chrono : : milliseconds > & idleTimeout ( ) { return idle_timeout_ ; } <nl> class TcpProxyConfig { <nl> <nl> typedef std : : shared_ptr < SharedConfig > SharedConfigSharedPtr ; <nl> <nl> - TcpProxyConfig ( const envoy : : api : : v2 : : filter : : network : : TcpProxy & config , <nl> + TcpProxyConfig ( const envoy : : config : : filter : : network : : tcp_proxy : : v2 : : TcpProxy & config , <nl> Server : : Configuration : : FactoryContext & context ) ; <nl> <nl> / * * <nl> class TcpProxyConfig { <nl> <nl> private : <nl> struct Route { <nl> - Route ( const envoy : : api : : v2 : : filter : : network : : TcpProxy : : DeprecatedV1 : : TCPRoute & config ) ; <nl> + Route ( const envoy : : config : : filter : : network : : tcp_proxy : : v2 : : TcpProxy : : DeprecatedV1 : : TCPRoute & <nl> + config ) ; <nl> <nl> Network : : Address : : IpList source_ips_ ; <nl> Network : : PortRangeList source_port_ranges_ ; <nl> mmm a / source / common / grpc / BUILD <nl> ppp b / source / common / grpc / BUILD <nl> envoy_cc_library ( <nl> " / / source / common / common : base64_lib " , <nl> " / / source / common / http : headers_lib " , <nl> " / / source / common / protobuf " , <nl> - " @ envoy_api / / envoy / api / v2 / filter / http : transcoder_cc " , <nl> + " @ envoy_api / / envoy / config / filter / http / transcoder / v2 : transcoder_cc " , <nl> ] , <nl> ) <nl> <nl> mmm a / source / common / grpc / async_client_manager_impl . cc <nl> ppp b / source / common / grpc / async_client_manager_impl . cc <nl> AsyncClientPtr AsyncClientFactoryImpl : : create ( ) { <nl> <nl> GoogleAsyncClientFactoryImpl : : GoogleAsyncClientFactoryImpl ( <nl> ThreadLocal : : Instance & tls , Stats : : Scope & scope , <nl> - const envoy : : api : : v2 : : GrpcService : : GoogleGrpc & config ) <nl> + const envoy : : api : : v2 : : core : : GrpcService : : GoogleGrpc & config ) <nl> : tls_ ( tls ) , scope_ ( scope . createScope ( fmt : : format ( " grpc . { } . " , config . stat_prefix ( ) ) ) ) , <nl> config_ ( config ) { <nl> # ifndef ENVOY_GOOGLE_GRPC <nl> AsyncClientPtr GoogleAsyncClientFactoryImpl : : create ( ) { <nl> } <nl> <nl> AsyncClientFactoryPtr <nl> - AsyncClientManagerImpl : : factoryForGrpcService ( const envoy : : api : : v2 : : GrpcService & grpc_service , <nl> + AsyncClientManagerImpl : : factoryForGrpcService ( const envoy : : api : : v2 : : core : : GrpcService & grpc_service , <nl> Stats : : Scope & scope ) { <nl> switch ( grpc_service . target_specifier_case ( ) ) { <nl> - case envoy : : api : : v2 : : GrpcService : : kEnvoyGrpc : <nl> + case envoy : : api : : v2 : : core : : GrpcService : : kEnvoyGrpc : <nl> return std : : make_unique < AsyncClientFactoryImpl > ( cm_ , grpc_service . envoy_grpc ( ) . cluster_name ( ) ) ; <nl> - case envoy : : api : : v2 : : GrpcService : : kGoogleGrpc : <nl> + case envoy : : api : : v2 : : core : : GrpcService : : kGoogleGrpc : <nl> return std : : make_unique < GoogleAsyncClientFactoryImpl > ( tls_ , scope , grpc_service . google_grpc ( ) ) ; <nl> default : <nl> NOT_REACHED ; <nl> mmm a / source / common / grpc / async_client_manager_impl . h <nl> ppp b / source / common / grpc / async_client_manager_impl . h <nl> class AsyncClientFactoryImpl : public AsyncClientFactory { <nl> class GoogleAsyncClientFactoryImpl : public AsyncClientFactory { <nl> public : <nl> GoogleAsyncClientFactoryImpl ( ThreadLocal : : Instance & tls , Stats : : Scope & scope , <nl> - const envoy : : api : : v2 : : GrpcService : : GoogleGrpc & config ) ; <nl> + const envoy : : api : : v2 : : core : : GrpcService : : GoogleGrpc & config ) ; <nl> <nl> AsyncClientPtr create ( ) override ; <nl> <nl> private : <nl> ThreadLocal : : Instance & tls_ ; <nl> Stats : : ScopePtr scope_ ; <nl> - const envoy : : api : : v2 : : GrpcService : : GoogleGrpc config_ ; <nl> + const envoy : : api : : v2 : : core : : GrpcService : : GoogleGrpc config_ ; <nl> } ; <nl> <nl> class AsyncClientManagerImpl : public AsyncClientManager { <nl> class AsyncClientManagerImpl : public AsyncClientManager { <nl> AsyncClientManagerImpl ( Upstream : : ClusterManager & cm , ThreadLocal : : Instance & tls ) ; <nl> <nl> / / Grpc : : AsyncClientManager <nl> - AsyncClientFactoryPtr factoryForGrpcService ( const envoy : : api : : v2 : : GrpcService & grpc_service , <nl> + AsyncClientFactoryPtr factoryForGrpcService ( const envoy : : api : : v2 : : core : : GrpcService & grpc_service , <nl> Stats : : Scope & scope ) override ; <nl> <nl> private : <nl> mmm a / source / common / grpc / google_async_client_impl . cc <nl> ppp b / source / common / grpc / google_async_client_impl . cc <nl> <nl> namespace Envoy { <nl> namespace Grpc { <nl> <nl> - GoogleAsyncClientImpl : : GoogleAsyncClientImpl ( Event : : Dispatcher & dispatcher , Stats : : Scope & scope , <nl> - const envoy : : api : : v2 : : GrpcService : : GoogleGrpc & config ) <nl> + GoogleAsyncClientImpl : : GoogleAsyncClientImpl ( <nl> + Event : : Dispatcher & dispatcher , Stats : : Scope & scope , <nl> + const envoy : : api : : v2 : : core : : GrpcService : : GoogleGrpc & config ) <nl> : dispatcher_ ( dispatcher ) , stat_prefix_ ( config . stat_prefix ( ) ) , scope_ ( scope ) { <nl> / / TODO ( htuch ) : add support for SSL , OAuth2 , GCP , etc . credentials . <nl> std : : shared_ptr < grpc : : ChannelCredentials > creds = grpc : : InsecureChannelCredentials ( ) ; <nl> mmm a / source / common / grpc / google_async_client_impl . h <nl> ppp b / source / common / grpc / google_async_client_impl . h <nl> struct GoogleAsyncClientStats { <nl> class GoogleAsyncClientImpl final : public AsyncClient { <nl> public : <nl> GoogleAsyncClientImpl ( Event : : Dispatcher & dispatcher , Stats : : Scope & scope , <nl> - const envoy : : api : : v2 : : GrpcService : : GoogleGrpc & config ) ; <nl> + const envoy : : api : : v2 : : core : : GrpcService : : GoogleGrpc & config ) ; <nl> ~ GoogleAsyncClientImpl ( ) override ; <nl> <nl> / / Grpc : : AsyncClient <nl> mmm a / source / common / grpc / json_transcoder_filter . cc <nl> ppp b / source / common / grpc / json_transcoder_filter . cc <nl> class TranscoderImpl : public Transcoder { <nl> } / / namespace <nl> <nl> JsonTranscoderConfig : : JsonTranscoderConfig ( <nl> - const envoy : : api : : v2 : : filter : : http : : GrpcJsonTranscoder & proto_config ) { <nl> + const envoy : : config : : filter : : http : : transcoder : : v2 : : GrpcJsonTranscoder & proto_config ) { <nl> FileDescriptorSet descriptor_set ; <nl> <nl> switch ( proto_config . descriptor_set_case ( ) ) { <nl> - case envoy : : api : : v2 : : filter : : http : : GrpcJsonTranscoder : : kProtoDescriptor : <nl> + case envoy : : config : : filter : : http : : transcoder : : v2 : : GrpcJsonTranscoder : : kProtoDescriptor : <nl> if ( ! descriptor_set . ParseFromString ( <nl> Filesystem : : fileReadToEnd ( proto_config . proto_descriptor ( ) ) ) ) { <nl> throw EnvoyException ( " transcoding_filter : Unable to parse proto descriptor " ) ; <nl> } <nl> break ; <nl> - case envoy : : api : : v2 : : filter : : http : : GrpcJsonTranscoder : : kProtoDescriptorBin : <nl> + case envoy : : config : : filter : : http : : transcoder : : v2 : : GrpcJsonTranscoder : : kProtoDescriptorBin : <nl> if ( ! descriptor_set . ParseFromString ( proto_config . proto_descriptor_bin ( ) ) ) { <nl> throw EnvoyException ( " transcoding_filter : Unable to parse proto descriptor " ) ; <nl> } <nl> mmm a / source / common / grpc / json_transcoder_filter . h <nl> ppp b / source / common / grpc / json_transcoder_filter . h <nl> <nl> # pragma once <nl> <nl> - # include " envoy / api / v2 / filter / http / transcoder . pb . h " <nl> # include " envoy / buffer / buffer . h " <nl> + # include " envoy / config / filter / http / transcoder / v2 / transcoder . pb . h " <nl> # include " envoy / http / filter . h " <nl> # include " envoy / http / header_map . h " <nl> # include " envoy / json / json_object . h " <nl> class JsonTranscoderConfig : public Logger : : Loggable < Logger : : Id : : config > { <nl> * constructor that loads protobuf descriptors from the file specified in the JSON config . <nl> * and construct a path matcher for HTTP path bindings . <nl> * / <nl> - JsonTranscoderConfig ( const envoy : : api : : v2 : : filter : : http : : GrpcJsonTranscoder & proto_config ) ; <nl> + JsonTranscoderConfig ( <nl> + const envoy : : config : : filter : : http : : transcoder : : v2 : : GrpcJsonTranscoder & proto_config ) ; <nl> <nl> / * * <nl> * Create an instance of Transcoder interface based on incoming request <nl> mmm a / source / common / http / BUILD <nl> ppp b / source / common / http / BUILD <nl> envoy_cc_library ( <nl> " / / source / common / json : json_loader_lib " , <nl> " / / source / common / network : utility_lib " , <nl> " / / source / common / protobuf : utility_lib " , <nl> - " @ envoy_api / / envoy / api / v2 : protocol_cc " , <nl> + " @ envoy_api / / envoy / api / v2 / core : protocol_cc " , <nl> ] , <nl> ) <nl> <nl> mmm a / source / common / http / async_client_impl . cc <nl> ppp b / source / common / http / async_client_impl . cc <nl> const AsyncStreamImpl : : NullShadowPolicy AsyncStreamImpl : : RouteEntryImpl : : shadow_ <nl> const AsyncStreamImpl : : NullVirtualHost AsyncStreamImpl : : RouteEntryImpl : : virtual_host_ ; <nl> const AsyncStreamImpl : : NullRateLimitPolicy AsyncStreamImpl : : NullVirtualHost : : rate_limit_policy_ ; <nl> const std : : multimap < std : : string , std : : string > AsyncStreamImpl : : RouteEntryImpl : : opaque_config_ ; <nl> - const envoy : : api : : v2 : : Metadata AsyncStreamImpl : : RouteEntryImpl : : metadata_ ; <nl> + const envoy : : api : : v2 : : core : : Metadata AsyncStreamImpl : : RouteEntryImpl : : metadata_ ; <nl> <nl> AsyncClientImpl : : AsyncClientImpl ( const Upstream : : ClusterInfo & cluster , Stats : : Store & stats_store , <nl> Event : : Dispatcher & dispatcher , <nl> mmm a / source / common / http / async_client_impl . h <nl> ppp b / source / common / http / async_client_impl . h <nl> class AsyncStreamImpl : public AsyncClient : : Stream , <nl> bool autoHostRewrite ( ) const override { return false ; } <nl> bool useWebSocket ( ) const override { return false ; } <nl> bool includeVirtualHostRateLimits ( ) const override { return true ; } <nl> - const envoy : : api : : v2 : : Metadata & metadata ( ) const override { return metadata_ ; } <nl> + const envoy : : api : : v2 : : core : : Metadata & metadata ( ) const override { return metadata_ ; } <nl> <nl> static const NullRateLimitPolicy rate_limit_policy_ ; <nl> static const NullRetryPolicy retry_policy_ ; <nl> static const NullShadowPolicy shadow_policy_ ; <nl> static const NullVirtualHost virtual_host_ ; <nl> static const std : : multimap < std : : string , std : : string > opaque_config_ ; <nl> - static const envoy : : api : : v2 : : Metadata metadata_ ; <nl> + static const envoy : : api : : v2 : : core : : Metadata metadata_ ; <nl> <nl> const std : : string & cluster_name_ ; <nl> Optional < std : : chrono : : milliseconds > timeout_ ; <nl> mmm a / source / common / http / filter / BUILD <nl> ppp b / source / common / http / filter / BUILD <nl> envoy_cc_library ( <nl> " / / source / common / http : headers_lib " , <nl> " / / source / common / protobuf : utility_lib " , <nl> " / / source / common / router : config_lib " , <nl> - " @ envoy_api / / envoy / api / v2 / filter / http : fault_cc " , <nl> + " @ envoy_api / / envoy / config / filter / http / fault / v2 : fault_cc " , <nl> ] , <nl> ) <nl> <nl> envoy_cc_library ( <nl> " / / source / common / http : message_lib " , <nl> " / / source / common / http : utility_lib " , <nl> " / / source / common / protobuf : utility_lib " , <nl> - " @ envoy_api / / envoy / api / v2 / filter / http : squash_cc " , <nl> + " @ envoy_api / / envoy / config / filter / http / squash / v2 : squash_cc " , <nl> ] , <nl> ) <nl> <nl> envoy_cc_library ( <nl> " / / source / common / json : config_schemas_lib " , <nl> " / / source / common / json : json_loader_lib " , <nl> " / / source / common / json : json_validator_lib " , <nl> - " @ envoy_api / / envoy / api / v2 / filter / http : rate_limit_cc " , <nl> + " @ envoy_api / / envoy / config / filter / http / rate_limit / v2 : rate_limit_cc " , <nl> ] , <nl> ) <nl> mmm a / source / common / http / filter / fault_filter . cc <nl> ppp b / source / common / http / filter / fault_filter . cc <nl> const std : : string FaultFilter : : ABORT_PERCENT_KEY = " fault . http . abort . abort_perce <nl> const std : : string FaultFilter : : DELAY_DURATION_KEY = " fault . http . delay . fixed_duration_ms " ; <nl> const std : : string FaultFilter : : ABORT_HTTP_STATUS_KEY = " fault . http . abort . http_status " ; <nl> <nl> - FaultFilterConfig : : FaultFilterConfig ( const envoy : : api : : v2 : : filter : : http : : HTTPFault & fault , <nl> + FaultFilterConfig : : FaultFilterConfig ( const envoy : : config : : filter : : http : : fault : : v2 : : HTTPFault & fault , <nl> Runtime : : Loader & runtime , const std : : string & stats_prefix , <nl> Stats : : Scope & scope ) <nl> : runtime_ ( runtime ) , stats_ ( generateStats ( stats_prefix , scope ) ) , stats_prefix_ ( stats_prefix ) , <nl> mmm a / source / common / http / filter / fault_filter . h <nl> ppp b / source / common / http / filter / fault_filter . h <nl> <nl> # include < unordered_set > <nl> # include < vector > <nl> <nl> - # include " envoy / api / v2 / filter / http / fault . pb . h " <nl> # include " envoy / api / v2 / route / route . pb . h " <nl> + # include " envoy / config / filter / http / fault / v2 / fault . pb . h " <nl> # include " envoy / http / filter . h " <nl> # include " envoy / runtime / runtime . h " <nl> # include " envoy / stats / stats_macros . h " <nl> struct FaultFilterStats { <nl> * / <nl> class FaultFilterConfig { <nl> public : <nl> - FaultFilterConfig ( const envoy : : api : : v2 : : filter : : http : : HTTPFault & fault , Runtime : : Loader & runtime , <nl> - const std : : string & stats_prefix , Stats : : Scope & scope ) ; <nl> + FaultFilterConfig ( const envoy : : config : : filter : : http : : fault : : v2 : : HTTPFault & fault , <nl> + Runtime : : Loader & runtime , const std : : string & stats_prefix , Stats : : Scope & scope ) ; <nl> <nl> const std : : vector < Router : : ConfigUtility : : HeaderData > & filterHeaders ( ) { <nl> return fault_filter_headers_ ; <nl> mmm a / source / common / http / filter / ratelimit . h <nl> ppp b / source / common / http / filter / ratelimit . h <nl> <nl> # include < string > <nl> # include < vector > <nl> <nl> - # include " envoy / api / v2 / filter / http / rate_limit . pb . h " <nl> + # include " envoy / config / filter / http / rate_limit / v2 / rate_limit . pb . h " <nl> # include " envoy / http / filter . h " <nl> # include " envoy / local_info / local_info . h " <nl> # include " envoy / ratelimit / ratelimit . h " <nl> enum class FilterRequestType { Internal , External , Both } ; <nl> * / <nl> class FilterConfig { <nl> public : <nl> - FilterConfig ( const envoy : : api : : v2 : : filter : : http : : RateLimit & config , <nl> + FilterConfig ( const envoy : : config : : filter : : http : : rate_limit : : v2 : : RateLimit & config , <nl> const LocalInfo : : LocalInfo & local_info , Stats : : Scope & scope , <nl> Runtime : : Loader & runtime , Upstream : : ClusterManager & cm ) <nl> : domain_ ( config . domain ( ) ) , stage_ ( static_cast < uint64_t > ( config . stage ( ) ) ) , <nl> mmm a / source / common / http / filter / squash_filter . cc <nl> ppp b / source / common / http / filter / squash_filter . cc <nl> const std : : string SquashFilter : : SERVER_AUTHORITY = " squash - server " ; <nl> const std : : string SquashFilter : : ATTACHED_STATE = " attached " ; <nl> const std : : string SquashFilter : : ERROR_STATE = " error " ; <nl> <nl> - SquashFilterConfig : : SquashFilterConfig ( const envoy : : api : : v2 : : filter : : http : : Squash & proto_config , <nl> - Upstream : : ClusterManager & clusterManager ) <nl> + SquashFilterConfig : : SquashFilterConfig ( <nl> + const envoy : : config : : filter : : http : : squash : : v2 : : Squash & proto_config , <nl> + Upstream : : ClusterManager & clusterManager ) <nl> : cluster_name_ ( proto_config . cluster ( ) ) , <nl> attachment_json_ ( getAttachment ( proto_config . attachment_template ( ) ) ) , <nl> attachment_timeout_ ( PROTOBUF_GET_MS_OR_DEFAULT ( proto_config , attachment_timeout , 60000 ) ) , <nl> mmm a / source / common / http / filter / squash_filter . h <nl> ppp b / source / common / http / filter / squash_filter . h <nl> <nl> # include < regex > <nl> # include < string > <nl> <nl> - # include " envoy / api / v2 / filter / http / squash . pb . h " <nl> # include " envoy / common / optional . h " <nl> + # include " envoy / config / filter / http / squash / v2 / squash . pb . h " <nl> # include " envoy / http / async_client . h " <nl> # include " envoy / http / filter . h " <nl> # include " envoy / upstream / cluster_manager . h " <nl> namespace Http { <nl> <nl> class SquashFilterConfig : protected Logger : : Loggable < Logger : : Id : : config > { <nl> public : <nl> - SquashFilterConfig ( const envoy : : api : : v2 : : filter : : http : : Squash & proto_config , <nl> + SquashFilterConfig ( const envoy : : config : : filter : : http : : squash : : v2 : : Squash & proto_config , <nl> Upstream : : ClusterManager & clusterManager ) ; <nl> const std : : string & clusterName ( ) { return cluster_name_ ; } <nl> const std : : string & attachmentJson ( ) { return attachment_json_ ; } <nl> mmm a / source / common / http / utility . cc <nl> ppp b / source / common / http / utility . cc <nl> bool Utility : : isWebSocketUpgradeRequest ( const HeaderMap & headers ) { <nl> Http : : Headers : : get ( ) . UpgradeValues . WebSocket . c_str ( ) ) ) ) ; <nl> } <nl> <nl> - Http2Settings Utility : : parseHttp2Settings ( const envoy : : api : : v2 : : Http2ProtocolOptions & config ) { <nl> + Http2Settings <nl> + Utility : : parseHttp2Settings ( const envoy : : api : : v2 : : core : : Http2ProtocolOptions & config ) { <nl> Http2Settings ret ; <nl> ret . hpack_table_size_ = PROTOBUF_GET_WRAPPED_OR_DEFAULT ( <nl> config , hpack_table_size , Http : : Http2Settings : : DEFAULT_HPACK_TABLE_SIZE ) ; <nl> Http2Settings Utility : : parseHttp2Settings ( const envoy : : api : : v2 : : Http2ProtocolOpt <nl> return ret ; <nl> } <nl> <nl> - Http1Settings Utility : : parseHttp1Settings ( const envoy : : api : : v2 : : Http1ProtocolOptions & config ) { <nl> + Http1Settings <nl> + Utility : : parseHttp1Settings ( const envoy : : api : : v2 : : core : : Http1ProtocolOptions & config ) { <nl> Http1Settings ret ; <nl> ret . allow_absolute_url_ = PROTOBUF_GET_WRAPPED_OR_DEFAULT ( config , allow_absolute_url , false ) ; <nl> return ret ; <nl> mmm a / source / common / http / utility . h <nl> ppp b / source / common / http / utility . h <nl> <nl> # include < cstdint > <nl> # include < string > <nl> <nl> - # include " envoy / api / v2 / protocol . pb . h " <nl> + # include " envoy / api / v2 / core / protocol . pb . h " <nl> # include " envoy / http / codes . h " <nl> # include " envoy / http / filter . h " <nl> <nl> class Utility { <nl> static bool isWebSocketUpgradeRequest ( const HeaderMap & headers ) ; <nl> <nl> / * * <nl> - * @ return Http2Settings An Http2Settings populated from the envoy : : api : : v2 : : Http2ProtocolOptions <nl> - * config . <nl> + * @ return Http2Settings An Http2Settings populated from the <nl> + * envoy : : api : : v2 : : core : : Http2ProtocolOptions config . <nl> * / <nl> - static Http2Settings parseHttp2Settings ( const envoy : : api : : v2 : : Http2ProtocolOptions & config ) ; <nl> + static Http2Settings parseHttp2Settings ( const envoy : : api : : v2 : : core : : Http2ProtocolOptions & config ) ; <nl> <nl> / * * <nl> - * @ return Http1Settings An Http1Settings populated from the envoy : : api : : v2 : : Http1ProtocolOptions <nl> - * config . <nl> + * @ return Http1Settings An Http1Settings populated from the <nl> + * envoy : : api : : v2 : : core : : Http1ProtocolOptions config . <nl> * / <nl> - static Http1Settings parseHttp1Settings ( const envoy : : api : : v2 : : Http1ProtocolOptions & config ) ; <nl> + static Http1Settings parseHttp1Settings ( const envoy : : api : : v2 : : core : : Http1ProtocolOptions & config ) ; <nl> <nl> / * * <nl> * Create a locally generated response using filter callbacks . <nl> mmm a / source / common / local_info / local_info_impl . h <nl> ppp b / source / common / local_info / local_info_impl . h <nl> namespace LocalInfo { <nl> <nl> class LocalInfoImpl : public LocalInfo { <nl> public : <nl> - LocalInfoImpl ( const envoy : : api : : v2 : : Node & node , Network : : Address : : InstanceConstSharedPtr address , <nl> - const std : : string zone_name , const std : : string cluster_name , <nl> - const std : : string node_name ) <nl> + LocalInfoImpl ( const envoy : : api : : v2 : : core : : Node & node , <nl> + Network : : Address : : InstanceConstSharedPtr address , const std : : string zone_name , <nl> + const std : : string cluster_name , const std : : string node_name ) <nl> : node_ ( node ) , address_ ( address ) { <nl> if ( ! zone_name . empty ( ) ) { <nl> node_ . mutable_locality ( ) - > set_zone ( zone_name ) ; <nl> class LocalInfoImpl : public LocalInfo { <nl> const std : : string zoneName ( ) const override { return node_ . locality ( ) . zone ( ) ; } <nl> const std : : string clusterName ( ) const override { return node_ . cluster ( ) ; } <nl> const std : : string nodeName ( ) const override { return node_ . id ( ) ; } <nl> - const envoy : : api : : v2 : : Node & node ( ) const override { return node_ ; } <nl> + const envoy : : api : : v2 : : core : : Node & node ( ) const override { return node_ ; } <nl> <nl> private : <nl> - envoy : : api : : v2 : : Node node_ ; <nl> + envoy : : api : : v2 : : core : : Node node_ ; <nl> Network : : Address : : InstanceConstSharedPtr address_ ; <nl> } ; <nl> <nl> mmm a / source / common / mongo / BUILD <nl> ppp b / source / common / mongo / BUILD <nl> envoy_cc_library ( <nl> " / / source / common / network : filter_lib " , <nl> " / / source / common / protobuf : utility_lib " , <nl> " / / source / common / singleton : const_singleton " , <nl> - " @ envoy_api / / envoy / api / v2 / filter / network : mongo_proxy_cc " , <nl> + " @ envoy_api / / envoy / config / filter / network / mongo_proxy / v2 : mongo_proxy_cc " , <nl> ] , <nl> ) <nl> <nl> mmm a / source / common / mongo / proxy . h <nl> ppp b / source / common / mongo / proxy . h <nl> <nl> # include < string > <nl> <nl> # include " envoy / access_log / access_log . h " <nl> - # include " envoy / api / v2 / filter / network / mongo_proxy . pb . h " <nl> # include " envoy / common / time . h " <nl> + # include " envoy / config / filter / network / mongo_proxy / v2 / mongo_proxy . pb . h " <nl> # include " envoy / event / timer . h " <nl> # include " envoy / mongo / codec . h " <nl> # include " envoy / network / connection . h " <nl> typedef std : : shared_ptr < AccessLog > AccessLogSharedPtr ; <nl> * / <nl> class FaultConfig { <nl> public : <nl> - FaultConfig ( const envoy : : api : : v2 : : filter : : FaultDelay & fault_config ) <nl> + FaultConfig ( const envoy : : config : : filter : : fault : : v2 : : FaultDelay & fault_config ) <nl> : delay_percent_ ( fault_config . percent ( ) ) , <nl> duration_ms_ ( PROTOBUF_GET_MS_REQUIRED ( fault_config , fixed_delay ) ) { } <nl> uint32_t delayPercent ( ) const { return delay_percent_ ; } <nl> mmm a / source / common / network / BUILD <nl> ppp b / source / common / network / BUILD <nl> envoy_cc_library ( <nl> " / / include / envoy / network : address_interface " , <nl> " / / source / common / common : assert_lib " , <nl> " / / source / common / common : utility_lib " , <nl> - " @ envoy_api / / envoy / api / v2 : address_cc " , <nl> + " @ envoy_api / / envoy / api / v2 / core : address_cc " , <nl> ] , <nl> ) <nl> <nl> envoy_cc_library ( <nl> " / / source / common / buffer : buffer_lib " , <nl> " / / source / common / common : empty_string " , <nl> " / / source / common / http : headers_lib " , <nl> - " @ envoy_api / / envoy / api / v2 : base_cc " , <nl> + " @ envoy_api / / envoy / api / v2 / core : base_cc " , <nl> ] , <nl> ) <nl> <nl> envoy_cc_library ( <nl> " / / source / common / config : well_known_names " , <nl> " / / source / common / network : address_lib " , <nl> " / / source / common / protobuf " , <nl> - " @ envoy_api / / envoy / api / v2 : base_cc " , <nl> + " @ envoy_api / / envoy / api / v2 / core : base_cc " , <nl> ] , <nl> ) <nl> <nl> envoy_cc_library ( <nl> " / / source / common / common : assert_lib " , <nl> " / / source / common / common : utility_lib " , <nl> " / / source / common / protobuf " , <nl> - " @ envoy_api / / envoy / api / v2 : address_cc " , <nl> - " @ envoy_api / / envoy / api / v2 : base_cc " , <nl> + " @ envoy_api / / envoy / api / v2 / core : address_cc " , <nl> + " @ envoy_api / / envoy / api / v2 / core : base_cc " , <nl> ] , <nl> ) <nl> mmm a / source / common / network / cidr_range . cc <nl> ppp b / source / common / network / cidr_range . cc <nl> CidrRange CidrRange : : create ( const std : : string & address , int length ) { <nl> return create ( Utility : : parseInternetAddress ( address ) , length ) ; <nl> } <nl> <nl> - CidrRange CidrRange : : create ( const envoy : : api : : v2 : : CidrRange & cidr ) { <nl> + CidrRange CidrRange : : create ( const envoy : : api : : v2 : : core : : CidrRange & cidr ) { <nl> return create ( Utility : : parseInternetAddress ( cidr . address_prefix ( ) ) , cidr . prefix_len ( ) . value ( ) ) ; <nl> } <nl> <nl> IpList : : IpList ( const std : : vector < std : : string > & subnets ) { <nl> } <nl> } <nl> <nl> - IpList : : IpList ( const Protobuf : : RepeatedPtrField < envoy : : api : : v2 : : CidrRange > & cidrs ) { <nl> - for ( const envoy : : api : : v2 : : CidrRange & entry : cidrs ) { <nl> + IpList : : IpList ( const Protobuf : : RepeatedPtrField < envoy : : api : : v2 : : core : : CidrRange > & cidrs ) { <nl> + for ( const envoy : : api : : v2 : : core : : CidrRange & entry : cidrs ) { <nl> CidrRange list_entry = CidrRange : : create ( entry ) ; <nl> if ( list_entry . isValid ( ) ) { <nl> ip_list_ . push_back ( list_entry ) ; <nl> mmm a / source / common / network / cidr_range . h <nl> ppp b / source / common / network / cidr_range . h <nl> <nl> # include < string > <nl> # include < vector > <nl> <nl> - # include " envoy / api / v2 / address . pb . h " <nl> + # include " envoy / api / v2 / core / address . pb . h " <nl> # include " envoy / json / json_object . h " <nl> # include " envoy / network / address . h " <nl> <nl> class CidrRange { <nl> static CidrRange create ( const std : : string & range ) ; <nl> <nl> / * * <nl> - * Constructs a CidrRange from envoy : : api : : v2 : : CidrRange . <nl> + * Constructs a CidrRange from envoy : : api : : v2 : : core : : CidrRange . <nl> * / <nl> - static CidrRange create ( const envoy : : api : : v2 : : CidrRange & cidr ) ; <nl> + static CidrRange create ( const envoy : : api : : v2 : : core : : CidrRange & cidr ) ; <nl> <nl> / * * <nl> * Given an IP address and a length of high order bits to keep , returns an address <nl> class IpList { <nl> public : <nl> IpList ( const std : : vector < std : : string > & subnets ) ; <nl> IpList ( const Json : : Object & config , const std : : string & member_name ) ; <nl> - IpList ( const Protobuf : : RepeatedPtrField < envoy : : api : : v2 : : CidrRange > & cidrs ) ; <nl> + IpList ( const Protobuf : : RepeatedPtrField < envoy : : api : : v2 : : core : : CidrRange > & cidrs ) ; <nl> IpList ( ) { } ; <nl> <nl> bool contains ( const Instance & address ) const ; <nl> mmm a / source / common / network / resolver_impl . cc <nl> ppp b / source / common / network / resolver_impl . cc <nl> <nl> # include " common / network / resolver_impl . h " <nl> <nl> - # include " envoy / api / v2 / address . pb . h " <nl> + # include " envoy / api / v2 / core / address . pb . h " <nl> # include " envoy / common / exception . h " <nl> # include " envoy / network / address . h " <nl> # include " envoy / network / resolver . h " <nl> namespace Address { <nl> class IpResolver : public Resolver { <nl> <nl> public : <nl> - InstanceConstSharedPtr resolve ( const envoy : : api : : v2 : : SocketAddress & socket_address ) override { <nl> + InstanceConstSharedPtr <nl> + resolve ( const envoy : : api : : v2 : : core : : SocketAddress & socket_address ) override { <nl> switch ( socket_address . port_specifier_case ( ) ) { <nl> - case envoy : : api : : v2 : : SocketAddress : : kPortValue : <nl> + case envoy : : api : : v2 : : core : : SocketAddress : : kPortValue : <nl> / / Default to port 0 if no port value is specified . <nl> - case envoy : : api : : v2 : : SocketAddress : : PORT_SPECIFIER_NOT_SET : <nl> + case envoy : : api : : v2 : : core : : SocketAddress : : PORT_SPECIFIER_NOT_SET : <nl> return Network : : Utility : : parseInternetAddress ( <nl> socket_address . address ( ) , socket_address . port_value ( ) , ! socket_address . ipv4_compat ( ) ) ; <nl> <nl> class IpResolver : public Resolver { <nl> * / <nl> static Registry : : RegisterFactory < IpResolver , Resolver > ip_registered_ ; <nl> <nl> - InstanceConstSharedPtr resolveProtoAddress ( const envoy : : api : : v2 : : Address & address ) { <nl> + InstanceConstSharedPtr resolveProtoAddress ( const envoy : : api : : v2 : : core : : Address & address ) { <nl> switch ( address . address_case ( ) ) { <nl> - case envoy : : api : : v2 : : Address : : kSocketAddress : <nl> + case envoy : : api : : v2 : : core : : Address : : kSocketAddress : <nl> return resolveProtoSocketAddress ( address . socket_address ( ) ) ; <nl> - case envoy : : api : : v2 : : Address : : kPipe : <nl> + case envoy : : api : : v2 : : core : : Address : : kPipe : <nl> return InstanceConstSharedPtr { new PipeInstance ( address . pipe ( ) . path ( ) ) } ; <nl> default : <nl> throw EnvoyException ( " Address must be a socket or pipe : " + address . DebugString ( ) ) ; <nl> InstanceConstSharedPtr resolveProtoAddress ( const envoy : : api : : v2 : : Address & addres <nl> } <nl> <nl> InstanceConstSharedPtr <nl> - resolveProtoSocketAddress ( const envoy : : api : : v2 : : SocketAddress & socket_address ) { <nl> + resolveProtoSocketAddress ( const envoy : : api : : v2 : : core : : SocketAddress & socket_address ) { <nl> Resolver * resolver = nullptr ; <nl> const std : : string & resolver_name = socket_address . resolver_name ( ) ; <nl> if ( resolver_name . empty ( ) ) { <nl> mmm a / source / common / network / resolver_impl . h <nl> ppp b / source / common / network / resolver_impl . h <nl> <nl> # pragma once <nl> <nl> - # include " envoy / api / v2 / address . pb . h " <nl> + # include " envoy / api / v2 / core / address . pb . h " <nl> # include " envoy / network / address . h " <nl> # include " envoy / network / connection . h " <nl> # include " envoy / network / resolver . h " <nl> namespace Envoy { <nl> namespace Network { <nl> namespace Address { <nl> / * * <nl> - * Create an Instance from a envoy : : api : : v2 : : Address . <nl> + * Create an Instance from a envoy : : api : : v2 : : core : : Address . <nl> * @ param address supplies the address proto to resolve . <nl> * @ return pointer to the Instance . <nl> * / <nl> - Address : : InstanceConstSharedPtr resolveProtoAddress ( const envoy : : api : : v2 : : Address & address ) ; <nl> + Address : : InstanceConstSharedPtr resolveProtoAddress ( const envoy : : api : : v2 : : core : : Address & address ) ; <nl> <nl> / * * <nl> - * Create an Instance from a envoy : : api : : v2 : : SocketAddress . <nl> + * Create an Instance from a envoy : : api : : v2 : : core : : SocketAddress . <nl> * @ param address supplies the socket address proto to resolve . <nl> * @ return pointer to the Instance . <nl> * / <nl> Address : : InstanceConstSharedPtr <nl> - resolveProtoSocketAddress ( const envoy : : api : : v2 : : SocketAddress & address ) ; <nl> + resolveProtoSocketAddress ( const envoy : : api : : v2 : : core : : SocketAddress & address ) ; <nl> } / / namespace Address <nl> } / / namespace Network <nl> } / / namespace Envoy <nl> mmm a / source / common / network / utility . cc <nl> ppp b / source / common / network / utility . cc <nl> absl : : uint128 Utility : : flipOrder ( const absl : : uint128 & input ) { <nl> } <nl> <nl> void Utility : : addressToProtobufAddress ( const Address : : Instance & address , <nl> - envoy : : api : : v2 : : Address & proto_address ) { <nl> + envoy : : api : : v2 : : core : : Address & proto_address ) { <nl> if ( address . type ( ) = = Address : : Type : : Pipe ) { <nl> proto_address . mutable_pipe ( ) - > set_path ( address . asString ( ) ) ; <nl> } else { <nl> mmm a / source / common / network / utility . h <nl> ppp b / source / common / network / utility . h <nl> <nl> # include < list > <nl> # include < string > <nl> <nl> - # include " envoy / api / v2 / address . pb . h " <nl> + # include " envoy / api / v2 / core / address . pb . h " <nl> # include " envoy / network / connection . h " <nl> # include " envoy / stats / stats . h " <nl> <nl> class Utility { <nl> * @ param proto_address is the protobuf address to which the address instance is copied into . <nl> * / <nl> static void addressToProtobufAddress ( const Address : : Instance & address , <nl> - envoy : : api : : v2 : : Address & proto_address ) ; <nl> + envoy : : api : : v2 : : core : : Address & proto_address ) ; <nl> <nl> private : <nl> static void throwWithMalformedIp ( const std : : string & ip_address ) ; <nl> mmm a / source / common / ratelimit / ratelimit_impl . cc <nl> ppp b / source / common / ratelimit / ratelimit_impl . cc <nl> void GrpcClientImpl : : onFailure ( Grpc : : Status : : GrpcStatus status , const std : : strin <nl> GrpcFactoryImpl : : GrpcFactoryImpl ( const envoy : : config : : ratelimit : : v2 : : RateLimitServiceConfig & config , <nl> Grpc : : AsyncClientManager & async_client_manager , <nl> Stats : : Scope & scope ) { <nl> - envoy : : api : : v2 : : GrpcService grpc_service ; <nl> + envoy : : api : : v2 : : core : : GrpcService grpc_service ; <nl> grpc_service . MergeFrom ( config . grpc_service ( ) ) ; <nl> / / TODO ( htuch ) : cluster_name is deprecated , remove after 1 . 6 . 0 . <nl> if ( config . service_specifier_case ( ) = = <nl> mmm a / source / common / redis / BUILD <nl> ppp b / source / common / redis / BUILD <nl> envoy_cc_library ( <nl> " / / source / common / common : assert_lib " , <nl> " / / source / common / network : filter_lib " , <nl> " / / source / common / protobuf : utility_lib " , <nl> - " @ envoy_api / / envoy / api / v2 / filter / network : redis_proxy_cc " , <nl> + " @ envoy_api / / envoy / config / filter / network / redis_proxy / v2 : redis_proxy_cc " , <nl> ] , <nl> ) <nl> <nl> envoy_cc_library ( <nl> " / / source / common / buffer : buffer_lib " , <nl> " / / source / common / common : assert_lib " , <nl> " / / source / common / config : utility_lib " , <nl> - " @ envoy_api / / envoy / api / v2 / filter / network : redis_proxy_cc " , <nl> + " @ envoy_api / / envoy / config / filter / network / redis_proxy / v2 : redis_proxy_cc " , <nl> ] , <nl> ) <nl> <nl> mmm a / source / common / redis / conn_pool_impl . cc <nl> ppp b / source / common / redis / conn_pool_impl . cc <nl> namespace Envoy { <nl> namespace Redis { <nl> namespace ConnPool { <nl> <nl> - ConfigImpl : : ConfigImpl ( const envoy : : api : : v2 : : filter : : network : : RedisProxy : : ConnPoolSettings & config ) <nl> + ConfigImpl : : ConfigImpl ( <nl> + const envoy : : config : : filter : : network : : redis_proxy : : v2 : : RedisProxy : : ConnPoolSettings & config ) <nl> : op_timeout_ ( PROTOBUF_GET_MS_REQUIRED ( config , op_timeout ) ) { } <nl> <nl> ClientPtr ClientImpl : : create ( Upstream : : HostConstSharedPtr host , Event : : Dispatcher & dispatcher , <nl> ClientPtr ClientFactoryImpl : : create ( Upstream : : HostConstSharedPtr host , <nl> InstanceImpl : : InstanceImpl ( <nl> const std : : string & cluster_name , Upstream : : ClusterManager & cm , ClientFactory & client_factory , <nl> ThreadLocal : : SlotAllocator & tls , <nl> - const envoy : : api : : v2 : : filter : : network : : RedisProxy : : ConnPoolSettings & config ) <nl> + const envoy : : config : : filter : : network : : redis_proxy : : v2 : : RedisProxy : : ConnPoolSettings & config ) <nl> : cm_ ( cm ) , client_factory_ ( client_factory ) , tls_ ( tls . allocateSlot ( ) ) , config_ ( config ) { <nl> tls_ - > set ( [ this , cluster_name ] ( <nl> Event : : Dispatcher & dispatcher ) - > ThreadLocal : : ThreadLocalObjectSharedPtr { <nl> mmm a / source / common / redis / conn_pool_impl . h <nl> ppp b / source / common / redis / conn_pool_impl . h <nl> <nl> # include < unordered_map > <nl> # include < vector > <nl> <nl> - # include " envoy / api / v2 / filter / network / redis_proxy . pb . h " <nl> + # include " envoy / config / filter / network / redis_proxy / v2 / redis_proxy . pb . h " <nl> # include " envoy / redis / conn_pool . h " <nl> # include " envoy / thread_local / thread_local . h " <nl> # include " envoy / upstream / cluster_manager . h " <nl> namespace ConnPool { <nl> <nl> class ConfigImpl : public Config { <nl> public : <nl> - ConfigImpl ( const envoy : : api : : v2 : : filter : : network : : RedisProxy : : ConnPoolSettings & config ) ; <nl> + ConfigImpl ( <nl> + const envoy : : config : : filter : : network : : redis_proxy : : v2 : : RedisProxy : : ConnPoolSettings & config ) ; <nl> <nl> bool disableOutlierEvents ( ) const override { return false ; } <nl> std : : chrono : : milliseconds opTimeout ( ) const override { return op_timeout_ ; } <nl> class ClientFactoryImpl : public ClientFactory { <nl> <nl> class InstanceImpl : public Instance { <nl> public : <nl> - InstanceImpl ( const std : : string & cluster_name , Upstream : : ClusterManager & cm , <nl> - ClientFactory & client_factory , ThreadLocal : : SlotAllocator & tls , <nl> - const envoy : : api : : v2 : : filter : : network : : RedisProxy : : ConnPoolSettings & config ) ; <nl> + InstanceImpl ( <nl> + const std : : string & cluster_name , Upstream : : ClusterManager & cm , ClientFactory & client_factory , <nl> + ThreadLocal : : SlotAllocator & tls , <nl> + const envoy : : config : : filter : : network : : redis_proxy : : v2 : : RedisProxy : : ConnPoolSettings & config ) ; <nl> <nl> / / Redis : : ConnPool : : Instance <nl> PoolRequest * makeRequest ( const std : : string & hash_key , const RespValue & request , <nl> mmm a / source / common / redis / proxy_filter . cc <nl> ppp b / source / common / redis / proxy_filter . cc <nl> <nl> namespace Envoy { <nl> namespace Redis { <nl> <nl> - ProxyFilterConfig : : ProxyFilterConfig ( const envoy : : api : : v2 : : filter : : network : : RedisProxy & config , <nl> - Upstream : : ClusterManager & cm , Stats : : Scope & scope , <nl> - const Network : : DrainDecision & drain_decision , <nl> - Runtime : : Loader & runtime ) <nl> + ProxyFilterConfig : : ProxyFilterConfig ( <nl> + const envoy : : config : : filter : : network : : redis_proxy : : v2 : : RedisProxy & config , <nl> + Upstream : : ClusterManager & cm , Stats : : Scope & scope , const Network : : DrainDecision & drain_decision , <nl> + Runtime : : Loader & runtime ) <nl> : drain_decision_ ( drain_decision ) , runtime_ ( runtime ) , cluster_name_ ( config . cluster ( ) ) , <nl> stat_prefix_ ( fmt : : format ( " redis . { } . " , config . stat_prefix ( ) ) ) , <nl> stats_ ( generateStats ( stat_prefix_ , scope ) ) { <nl> mmm a / source / common / redis / proxy_filter . h <nl> ppp b / source / common / redis / proxy_filter . h <nl> <nl> # include < memory > <nl> # include < string > <nl> <nl> - # include " envoy / api / v2 / filter / network / redis_proxy . pb . h " <nl> + # include " envoy / config / filter / network / redis_proxy / v2 / redis_proxy . pb . h " <nl> # include " envoy / network / drain_decision . h " <nl> # include " envoy / network / filter . h " <nl> # include " envoy / redis / codec . h " <nl> struct ProxyStats { <nl> * / <nl> class ProxyFilterConfig { <nl> public : <nl> - ProxyFilterConfig ( const envoy : : api : : v2 : : filter : : network : : RedisProxy & config , <nl> + ProxyFilterConfig ( const envoy : : config : : filter : : network : : redis_proxy : : v2 : : RedisProxy & config , <nl> Upstream : : ClusterManager & cm , Stats : : Scope & scope , <nl> const Network : : DrainDecision & drain_decision , Runtime : : Loader & runtime ) ; <nl> <nl> mmm a / source / common / router / BUILD <nl> ppp b / source / common / router / BUILD <nl> envoy_cc_library ( <nl> " / / source / common / config : utility_lib " , <nl> " / / source / common / protobuf : utility_lib " , <nl> " @ envoy_api / / envoy / api / v2 : rds_cc " , <nl> - " @ envoy_api / / envoy / api / v2 / filter / network : http_connection_manager_cc " , <nl> + " @ envoy_api / / envoy / config / filter / network / http_connection_manager / v2 : http_connection_manager_cc " , <nl> ] , <nl> ) <nl> <nl> envoy_cc_library ( <nl> " / / source / common / http : headers_lib " , <nl> " / / source / common / http : rest_api_fetcher_lib " , <nl> " / / source / common / json : json_loader_lib " , <nl> - " @ envoy_api / / envoy / api / v2 / filter / network : http_connection_manager_cc " , <nl> + " @ envoy_api / / envoy / config / filter / network / http_connection_manager / v2 : http_connection_manager_cc " , <nl> ] , <nl> ) <nl> <nl> envoy_cc_library ( <nl> " / / source / common / http : utility_lib " , <nl> " / / source / common / request_info : request_info_lib " , <nl> " / / source / common / tracing : http_tracer_lib " , <nl> - " @ envoy_api / / envoy / api / v2 / filter / http : router_cc " , <nl> + " @ envoy_api / / envoy / config / filter / http / router / v2 : router_cc " , <nl> ] , <nl> ) <nl> <nl> mmm a / source / common / router / config_impl . cc <nl> ppp b / source / common / router / config_impl . cc <nl> VirtualHostImpl : : VirtualHostImpl ( const envoy : : api : : v2 : : route : : VirtualHost & virtu <nl> <nl> VirtualHostImpl : : VirtualClusterEntry : : VirtualClusterEntry ( <nl> const envoy : : api : : v2 : : route : : VirtualCluster & virtual_cluster ) { <nl> - if ( virtual_cluster . method ( ) ! = envoy : : api : : v2 : : RequestMethod : : METHOD_UNSPECIFIED ) { <nl> - method_ = envoy : : api : : v2 : : RequestMethod_Name ( virtual_cluster . method ( ) ) ; <nl> + if ( virtual_cluster . method ( ) ! = envoy : : api : : v2 : : core : : RequestMethod : : METHOD_UNSPECIFIED ) { <nl> + method_ = envoy : : api : : v2 : : core : : RequestMethod_Name ( virtual_cluster . method ( ) ) ; <nl> } <nl> <nl> const std : : string pattern = virtual_cluster . pattern ( ) ; <nl> mmm a / source / common / router / config_impl . h <nl> ppp b / source / common / router / config_impl . h <nl> class RouteEntryImplBase : public RouteEntry , <nl> return opaque_config_ ; <nl> } <nl> bool includeVirtualHostRateLimits ( ) const override { return include_vh_rate_limits_ ; } <nl> - const envoy : : api : : v2 : : Metadata & metadata ( ) const override { return metadata_ ; } <nl> + const envoy : : api : : v2 : : core : : Metadata & metadata ( ) const override { return metadata_ ; } <nl> <nl> / / Router : : DirectResponseEntry <nl> std : : string newPath ( const Http : : HeaderMap & headers ) const override ; <nl> class RouteEntryImplBase : public RouteEntry , <nl> bool includeVirtualHostRateLimits ( ) const override { <nl> return parent_ - > includeVirtualHostRateLimits ( ) ; <nl> } <nl> - const envoy : : api : : v2 : : Metadata & metadata ( ) const override { return parent_ - > metadata ( ) ; } <nl> + const envoy : : api : : v2 : : core : : Metadata & metadata ( ) const override { return parent_ - > metadata ( ) ; } <nl> <nl> / / Router : : Route <nl> const DirectResponseEntry * directResponseEntry ( ) const override { return nullptr ; } <nl> class RouteEntryImplBase : public RouteEntry , <nl> MetadataMatchCriteriaImplConstPtr metadata_match_criteria_ ; <nl> HeaderParserPtr request_headers_parser_ ; <nl> HeaderParserPtr response_headers_parser_ ; <nl> - envoy : : api : : v2 : : Metadata metadata_ ; <nl> + envoy : : api : : v2 : : core : : Metadata metadata_ ; <nl> <nl> / / TODO ( danielhochman ) : refactor multimap into unordered_map since JSON is unordered map . <nl> const std : : multimap < std : : string , std : : string > opaque_config_ ; <nl> mmm a / source / common / router / config_utility . cc <nl> ppp b / source / common / router / config_utility . cc <nl> bool ConfigUtility : : QueryParameterMatcher : : matches ( <nl> } <nl> <nl> Upstream : : ResourcePriority <nl> - ConfigUtility : : parsePriority ( const envoy : : api : : v2 : : RoutingPriority & priority ) { <nl> + ConfigUtility : : parsePriority ( const envoy : : api : : v2 : : core : : RoutingPriority & priority ) { <nl> switch ( priority ) { <nl> - case envoy : : api : : v2 : : RoutingPriority : : DEFAULT : <nl> + case envoy : : api : : v2 : : core : : RoutingPriority : : DEFAULT : <nl> return Upstream : : ResourcePriority : : Default ; <nl> - case envoy : : api : : v2 : : RoutingPriority : : HIGH : <nl> + case envoy : : api : : v2 : : core : : RoutingPriority : : HIGH : <nl> return Upstream : : ResourcePriority : : High ; <nl> default : <nl> NOT_IMPLEMENTED ; <nl> mmm a / source / common / router / config_utility . h <nl> ppp b / source / common / router / config_utility . h <nl> class ConfigUtility { <nl> / * * <nl> * @ return the resource priority parsed from proto . <nl> * / <nl> - static Upstream : : ResourcePriority parsePriority ( const envoy : : api : : v2 : : RoutingPriority & priority ) ; <nl> + static Upstream : : ResourcePriority <nl> + parsePriority ( const envoy : : api : : v2 : : core : : RoutingPriority & priority ) ; <nl> <nl> / * * <nl> * See if the headers specified in the config are present in a request . <nl> mmm a / source / common / router / header_parser . cc <nl> ppp b / source / common / router / header_parser . cc <nl> std : : string unescape ( absl : : string_view sv ) { return absl : : StrReplaceAll ( sv , { { " % <nl> / / The statement machine does minimal validation of the arguments ( if any ) and does not know the <nl> / / names of valid variables . Interpretation of the variable name and arguments is delegated to <nl> / / RequestInfoHeaderFormatter . <nl> - HeaderFormatterPtr parseInternal ( const envoy : : api : : v2 : : HeaderValueOption & header_value_option ) { <nl> + HeaderFormatterPtr <nl> + parseInternal ( const envoy : : api : : v2 : : core : : HeaderValueOption & header_value_option ) { <nl> const bool append = PROTOBUF_GET_WRAPPED_OR_DEFAULT ( header_value_option , append , true ) ; <nl> <nl> absl : : string_view format ( header_value_option . header ( ) . value ( ) ) ; <nl> HeaderFormatterPtr parseInternal ( const envoy : : api : : v2 : : HeaderValueOption & header <nl> } / / namespace <nl> <nl> HeaderParserPtr HeaderParser : : configure ( <nl> - const Protobuf : : RepeatedPtrField < envoy : : api : : v2 : : HeaderValueOption > & headers_to_add ) { <nl> + const Protobuf : : RepeatedPtrField < envoy : : api : : v2 : : core : : HeaderValueOption > & headers_to_add ) { <nl> HeaderParserPtr header_parser ( new HeaderParser ( ) ) ; <nl> <nl> for ( const auto & header_value_option : headers_to_add ) { <nl> HeaderParserPtr HeaderParser : : configure ( <nl> } <nl> <nl> HeaderParserPtr HeaderParser : : configure ( <nl> - const Protobuf : : RepeatedPtrField < envoy : : api : : v2 : : HeaderValueOption > & headers_to_add , <nl> + const Protobuf : : RepeatedPtrField < envoy : : api : : v2 : : core : : HeaderValueOption > & headers_to_add , <nl> const Protobuf : : RepeatedPtrField < ProtobufTypes : : String > & headers_to_remove ) { <nl> HeaderParserPtr header_parser = configure ( headers_to_add ) ; <nl> <nl> mmm a / source / common / router / header_parser . h <nl> ppp b / source / common / router / header_parser . h <nl> <nl> # include < vector > <nl> <nl> # include " envoy / access_log / access_log . h " <nl> - # include " envoy / api / v2 / base . pb . h " <nl> + # include " envoy / api / v2 / core / base . pb . h " <nl> # include " envoy / http / header_map . h " <nl> <nl> # include " common / protobuf / protobuf . h " <nl> class HeaderParser { <nl> * @ param headers_to_add defines the headers to add during calls to evaluateHeaders <nl> * @ return HeaderParserPtr a configured HeaderParserPtr <nl> * / <nl> - static HeaderParserPtr <nl> - configure ( const Protobuf : : RepeatedPtrField < envoy : : api : : v2 : : HeaderValueOption > & headers_to_add ) ; <nl> + static HeaderParserPtr configure ( <nl> + const Protobuf : : RepeatedPtrField < envoy : : api : : v2 : : core : : HeaderValueOption > & headers_to_add ) ; <nl> <nl> / * <nl> * @ param headers_to_add defines headers to add during calls to evaluateHeaders <nl> * @ param headers_to_remove defines headers to remove during calls to evaluateHeaders <nl> * @ return HeaderParserPtr a configured HeaderParserPtr <nl> * / <nl> - static HeaderParserPtr <nl> - configure ( const Protobuf : : RepeatedPtrField < envoy : : api : : v2 : : HeaderValueOption > & headers_to_add , <nl> - const Protobuf : : RepeatedPtrField < ProtobufTypes : : String > & headers_to_remove ) ; <nl> + static HeaderParserPtr configure ( <nl> + const Protobuf : : RepeatedPtrField < envoy : : api : : v2 : : core : : HeaderValueOption > & headers_to_add , <nl> + const Protobuf : : RepeatedPtrField < ProtobufTypes : : String > & headers_to_remove ) ; <nl> <nl> void evaluateHeaders ( Http : : HeaderMap & headers , <nl> const RequestInfo : : RequestInfo & request_info ) const ; <nl> mmm a / source / common / router / rds_impl . cc <nl> ppp b / source / common / router / rds_impl . cc <nl> namespace Envoy { <nl> namespace Router { <nl> <nl> RouteConfigProviderSharedPtr RouteConfigProviderUtil : : create ( <nl> - const envoy : : api : : v2 : : filter : : network : : HttpConnectionManager & config , Runtime : : Loader & runtime , <nl> - Upstream : : ClusterManager & cm , Stats : : Scope & scope , const std : : string & stat_prefix , <nl> - Init : : Manager & init_manager , RouteConfigProviderManager & route_config_provider_manager ) { <nl> + const envoy : : config : : filter : : network : : http_connection_manager : : v2 : : HttpConnectionManager & <nl> + config , <nl> + Runtime : : Loader & runtime , Upstream : : ClusterManager & cm , Stats : : Scope & scope , <nl> + const std : : string & stat_prefix , Init : : Manager & init_manager , <nl> + RouteConfigProviderManager & route_config_provider_manager ) { <nl> switch ( config . route_specifier_case ( ) ) { <nl> - case envoy : : api : : v2 : : filter : : network : : HttpConnectionManager : : kRouteConfig : <nl> + case envoy : : config : : filter : : network : : http_connection_manager : : v2 : : HttpConnectionManager : : <nl> + kRouteConfig : <nl> return RouteConfigProviderSharedPtr { <nl> new StaticRouteConfigProviderImpl ( config . route_config ( ) , runtime , cm ) } ; <nl> - case envoy : : api : : v2 : : filter : : network : : HttpConnectionManager : : kRds : <nl> + case envoy : : config : : filter : : network : : http_connection_manager : : v2 : : HttpConnectionManager : : kRds : <nl> return route_config_provider_manager . getRouteConfigProvider ( config . rds ( ) , cm , scope , <nl> stat_prefix , init_manager ) ; <nl> default : <nl> StaticRouteConfigProviderImpl : : StaticRouteConfigProviderImpl ( <nl> / / TODO ( htuch ) : If support for multiple clusters is added per # 1170 cluster_name_ <nl> / / initialization needs to be fixed . <nl> RdsRouteConfigProviderImpl : : RdsRouteConfigProviderImpl ( <nl> - const envoy : : api : : v2 : : filter : : network : : Rds & rds , const std : : string & manager_identifier , <nl> - Runtime : : Loader & runtime , Upstream : : ClusterManager & cm , Event : : Dispatcher & dispatcher , <nl> - Runtime : : RandomGenerator & random , const LocalInfo : : LocalInfo & local_info , Stats : : Scope & scope , <nl> - const std : : string & stat_prefix , ThreadLocal : : SlotAllocator & tls , <nl> - RouteConfigProviderManagerImpl & route_config_provider_manager ) <nl> + const envoy : : config : : filter : : network : : http_connection_manager : : v2 : : Rds & rds , <nl> + const std : : string & manager_identifier , Runtime : : Loader & runtime , Upstream : : ClusterManager & cm , <nl> + Event : : Dispatcher & dispatcher , Runtime : : RandomGenerator & random , <nl> + const LocalInfo : : LocalInfo & local_info , Stats : : Scope & scope , const std : : string & stat_prefix , <nl> + ThreadLocal : : SlotAllocator & tls , RouteConfigProviderManagerImpl & route_config_provider_manager ) <nl> : runtime_ ( runtime ) , cm_ ( cm ) , tls_ ( tls . allocateSlot ( ) ) , <nl> route_config_name_ ( rds . route_config_name ( ) ) , <nl> scope_ ( scope . createScope ( stat_prefix + " rds . " + route_config_name_ + " . " ) ) , <nl> RouteConfigProviderManagerImpl : : rdsRouteConfigProviders ( ) { <nl> } ; <nl> <nl> Router : : RouteConfigProviderSharedPtr RouteConfigProviderManagerImpl : : getRouteConfigProvider ( <nl> - const envoy : : api : : v2 : : filter : : network : : Rds & rds , Upstream : : ClusterManager & cm , <nl> - Stats : : Scope & scope , const std : : string & stat_prefix , Init : : Manager & init_manager ) { <nl> + const envoy : : config : : filter : : network : : http_connection_manager : : v2 : : Rds & rds , <nl> + Upstream : : ClusterManager & cm , Stats : : Scope & scope , const std : : string & stat_prefix , <nl> + Init : : Manager & init_manager ) { <nl> <nl> / / RdsRouteConfigProviders are unique based on their serialized RDS config . <nl> / / TODO ( htuch ) : Full serialization here gives large IDs , could get away with a <nl> mmm a / source / common / router / rds_impl . h <nl> ppp b / source / common / router / rds_impl . h <nl> <nl> # include < string > <nl> # include < unordered_map > <nl> <nl> - # include " envoy / api / v2 / filter / network / http_connection_manager . pb . h " <nl> # include " envoy / api / v2 / rds . pb . h " <nl> # include " envoy / api / v2 / route / route . pb . h " <nl> + # include " envoy / config / filter / network / http_connection_manager / v2 / http_connection_manager . pb . h " <nl> # include " envoy / config / subscription . h " <nl> # include " envoy / http / codes . h " <nl> # include " envoy / init / init . h " <nl> class RouteConfigProviderUtil { <nl> * configuration . <nl> * / <nl> static RouteConfigProviderSharedPtr <nl> - create ( const envoy : : api : : v2 : : filter : : network : : HttpConnectionManager & config , <nl> + create ( const envoy : : config : : filter : : network : : http_connection_manager : : v2 : : HttpConnectionManager & <nl> + config , <nl> Runtime : : Loader & runtime , Upstream : : ClusterManager & cm , Stats : : Scope & scope , <nl> const std : : string & stat_prefix , Init : : Manager & init_manager , <nl> RouteConfigProviderManager & route_config_provider_manager ) ; <nl> class RdsRouteConfigProviderImpl <nl> ConfigConstSharedPtr config_ ; <nl> } ; <nl> <nl> - RdsRouteConfigProviderImpl ( const envoy : : api : : v2 : : filter : : network : : Rds & rds , <nl> - const std : : string & manager_identifier , Runtime : : Loader & runtime , <nl> - Upstream : : ClusterManager & cm , Event : : Dispatcher & dispatcher , <nl> - Runtime : : RandomGenerator & random , <nl> - const LocalInfo : : LocalInfo & local_info , Stats : : Scope & scope , <nl> - const std : : string & stat_prefix , ThreadLocal : : SlotAllocator & tls , <nl> - RouteConfigProviderManagerImpl & route_config_provider_manager ) ; <nl> + RdsRouteConfigProviderImpl ( <nl> + const envoy : : config : : filter : : network : : http_connection_manager : : v2 : : Rds & rds , <nl> + const std : : string & manager_identifier , Runtime : : Loader & runtime , Upstream : : ClusterManager & cm , <nl> + Event : : Dispatcher & dispatcher , Runtime : : RandomGenerator & random , <nl> + const LocalInfo : : LocalInfo & local_info , Stats : : Scope & scope , const std : : string & stat_prefix , <nl> + ThreadLocal : : SlotAllocator & tls , <nl> + RouteConfigProviderManagerImpl & route_config_provider_manager ) ; <nl> <nl> void registerInitTarget ( Init : : Manager & init_manager ) ; <nl> void runInitializeCallbackIfAny ( ) ; <nl> class RouteConfigProviderManagerImpl : public ServerRouteConfigProviderManager , <nl> / / ServerRouteConfigProviderManager <nl> std : : vector < RdsRouteConfigProviderSharedPtr > rdsRouteConfigProviders ( ) override ; <nl> / / RouteConfigProviderManager <nl> - RouteConfigProviderSharedPtr <nl> - getRouteConfigProvider ( const envoy : : api : : v2 : : filter : : network : : Rds & rds , <nl> - Upstream : : ClusterManager & cm , Stats : : Scope & scope , <nl> - const std : : string & stat_prefix , Init : : Manager & init_manager ) override ; <nl> + RouteConfigProviderSharedPtr getRouteConfigProvider ( <nl> + const envoy : : config : : filter : : network : : http_connection_manager : : v2 : : Rds & rds , <nl> + Upstream : : ClusterManager & cm , Stats : : Scope & scope , const std : : string & stat_prefix , <nl> + Init : : Manager & init_manager ) override ; <nl> <nl> private : <nl> / * * <nl> mmm a / source / common / router / rds_subscription . cc <nl> ppp b / source / common / router / rds_subscription . cc <nl> <nl> namespace Envoy { <nl> namespace Router { <nl> <nl> - RdsSubscription : : RdsSubscription ( Envoy : : Config : : SubscriptionStats stats , <nl> - const envoy : : api : : v2 : : filter : : network : : Rds & rds , <nl> - Upstream : : ClusterManager & cm , Event : : Dispatcher & dispatcher , <nl> - Runtime : : RandomGenerator & random , <nl> - const LocalInfo : : LocalInfo & local_info ) <nl> + RdsSubscription : : RdsSubscription ( <nl> + Envoy : : Config : : SubscriptionStats stats , <nl> + const envoy : : config : : filter : : network : : http_connection_manager : : v2 : : Rds & rds , <nl> + Upstream : : ClusterManager & cm , Event : : Dispatcher & dispatcher , Runtime : : RandomGenerator & random , <nl> + const LocalInfo : : LocalInfo & local_info ) <nl> : RestApiFetcher ( cm , rds . config_source ( ) . api_config_source ( ) . cluster_names ( ) [ 0 ] , dispatcher , <nl> random , <nl> Envoy : : Config : : Utility : : apiConfigSourceRefreshDelay ( <nl> RdsSubscription : : RdsSubscription ( Envoy : : Config : : SubscriptionStats stats , <nl> const auto & api_config_source = rds . config_source ( ) . api_config_source ( ) ; <nl> UNREFERENCED_PARAMETER ( api_config_source ) ; <nl> / / If we are building an RdsSubscription , the ConfigSource should be REST_LEGACY . <nl> - ASSERT ( api_config_source . api_type ( ) = = envoy : : api : : v2 : : ApiConfigSource : : REST_LEGACY ) ; <nl> + ASSERT ( api_config_source . api_type ( ) = = envoy : : api : : v2 : : core : : ApiConfigSource : : REST_LEGACY ) ; <nl> / / TODO ( htuch ) : Add support for multiple clusters , # 1170 . <nl> ASSERT ( api_config_source . cluster_names ( ) . size ( ) = = 1 ) ; <nl> ASSERT ( api_config_source . has_refresh_delay ( ) ) ; <nl> mmm a / source / common / router / rds_subscription . h <nl> ppp b / source / common / router / rds_subscription . h <nl> <nl> # include < cstdint > <nl> # include < string > <nl> <nl> - # include " envoy / api / v2 / filter / network / http_connection_manager . pb . h " <nl> + # include " envoy / config / filter / network / http_connection_manager / v2 / http_connection_manager . pb . h " <nl> # include " envoy / config / subscription . h " <nl> <nl> # include " common / common / assert . h " <nl> class RdsSubscription : public Http : : RestApiFetcher , <nl> Logger : : Loggable < Logger : : Id : : upstream > { <nl> public : <nl> RdsSubscription ( Envoy : : Config : : SubscriptionStats stats , <nl> - const envoy : : api : : v2 : : filter : : network : : Rds & rds , Upstream : : ClusterManager & cm , <nl> - Event : : Dispatcher & dispatcher , Runtime : : RandomGenerator & random , <nl> - const LocalInfo : : LocalInfo & local_info ) ; <nl> + const envoy : : config : : filter : : network : : http_connection_manager : : v2 : : Rds & rds , <nl> + Upstream : : ClusterManager & cm , Event : : Dispatcher & dispatcher , <nl> + Runtime : : RandomGenerator & random , const LocalInfo : : LocalInfo & local_info ) ; <nl> <nl> private : <nl> / / Config : : Subscription <nl> mmm a / source / common / router / router . h <nl> ppp b / source / common / router / router . h <nl> <nl> # include < memory > <nl> # include < string > <nl> <nl> - # include " envoy / api / v2 / filter / http / router . pb . h " <nl> + # include " envoy / config / filter / http / router / v2 / router . pb . h " <nl> # include " envoy / http / codec . h " <nl> # include " envoy / http / codes . h " <nl> # include " envoy / http / filter . h " <nl> class FilterConfig { <nl> shadow_writer_ ( std : : move ( shadow_writer ) ) { } <nl> <nl> FilterConfig ( const std : : string & stat_prefix , Server : : Configuration : : FactoryContext & context , <nl> - ShadowWriterPtr & & shadow_writer , const envoy : : api : : v2 : : filter : : http : : Router & config ) <nl> + ShadowWriterPtr & & shadow_writer , <nl> + const envoy : : config : : filter : : http : : router : : v2 : : Router & config ) <nl> : FilterConfig ( stat_prefix , context . localInfo ( ) , context . scope ( ) , context . clusterManager ( ) , <nl> context . runtime ( ) , context . random ( ) , std : : move ( shadow_writer ) , <nl> PROTOBUF_GET_WRAPPED_OR_DEFAULT ( config , dynamic_stats , true ) , <nl> mmm a / source / common / ssl / context_config_impl . cc <nl> ppp b / source / common / ssl / context_config_impl . cc <nl> ContextConfigImpl : : ContextConfigImpl ( const envoy : : api : : v2 : : auth : : CommonTlsContex <nl> } <nl> } <nl> <nl> - const std : : string ContextConfigImpl : : readDataSource ( const envoy : : api : : v2 : : DataSource & source , <nl> + const std : : string ContextConfigImpl : : readDataSource ( const envoy : : api : : v2 : : core : : DataSource & source , <nl> bool allow_empty ) { <nl> switch ( source . specifier_case ( ) ) { <nl> - case envoy : : api : : v2 : : DataSource : : kFilename : <nl> + case envoy : : api : : v2 : : core : : DataSource : : kFilename : <nl> return Filesystem : : fileReadToEnd ( source . filename ( ) ) ; <nl> - case envoy : : api : : v2 : : DataSource : : kInlineBytes : <nl> + case envoy : : api : : v2 : : core : : DataSource : : kInlineBytes : <nl> return source . inline_bytes ( ) ; <nl> - case envoy : : api : : v2 : : DataSource : : kInlineString : <nl> + case envoy : : api : : v2 : : core : : DataSource : : kInlineString : <nl> return source . inline_string ( ) ; <nl> default : <nl> if ( ! allow_empty ) { <nl> const std : : string ContextConfigImpl : : readDataSource ( const envoy : : api : : v2 : : DataSo <nl> } <nl> } <nl> <nl> - const std : : string ContextConfigImpl : : getDataSourcePath ( const envoy : : api : : v2 : : DataSource & source ) { <nl> - return source . specifier_case ( ) = = envoy : : api : : v2 : : DataSource : : kFilename ? source . filename ( ) : " " ; <nl> + const std : : string <nl> + ContextConfigImpl : : getDataSourcePath ( const envoy : : api : : v2 : : core : : DataSource & source ) { <nl> + return source . specifier_case ( ) = = envoy : : api : : v2 : : core : : DataSource : : kFilename ? source . filename ( ) <nl> + : " " ; <nl> } <nl> <nl> unsigned ContextConfigImpl : : tlsVersionFromProto ( <nl> mmm a / source / common / ssl / context_config_impl . h <nl> ppp b / source / common / ssl / context_config_impl . h <nl> class ContextConfigImpl : public virtual Ssl : : ContextConfig { <nl> protected : <nl> ContextConfigImpl ( const envoy : : api : : v2 : : auth : : CommonTlsContext & config ) ; <nl> <nl> - static const std : : string readDataSource ( const envoy : : api : : v2 : : DataSource & source , <nl> + static const std : : string readDataSource ( const envoy : : api : : v2 : : core : : DataSource & source , <nl> bool allow_empty ) ; <nl> - static const std : : string getDataSourcePath ( const envoy : : api : : v2 : : DataSource & source ) ; <nl> + static const std : : string getDataSourcePath ( const envoy : : api : : v2 : : core : : DataSource & source ) ; <nl> <nl> private : <nl> static unsigned <nl> mmm a / source / common / upstream / BUILD <nl> ppp b / source / common / upstream / BUILD <nl> envoy_cc_library ( <nl> " / / source / common / protobuf : utility_lib " , <nl> " / / source / common / router : shadow_writer_lib " , <nl> " / / source / common / upstream : upstream_lib " , <nl> - " @ envoy_api / / envoy / api / v2 : base_cc " , <nl> + " @ envoy_api / / envoy / api / v2 / core : base_cc " , <nl> ] , <nl> ) <nl> <nl> envoy_cc_library ( <nl> " / / source / common / network : filter_lib " , <nl> " / / source / common / protobuf : utility_lib " , <nl> " / / source / common / redis : conn_pool_lib " , <nl> - " @ envoy_api / / envoy / api / v2 : health_check_cc " , <nl> + " @ envoy_api / / envoy / api / v2 / core : health_check_cc " , <nl> ] , <nl> ) <nl> <nl> envoy_cc_library ( <nl> " / / source / common / network : resolver_lib " , <nl> " / / source / common / network : utility_lib " , <nl> " / / source / common / protobuf : utility_lib " , <nl> - " @ envoy_api / / envoy / api / v2 : base_cc " , <nl> " @ envoy_api / / envoy / api / v2 : eds_cc " , <nl> + " @ envoy_api / / envoy / api / v2 / core : base_cc " , <nl> " @ envoy_api / / envoy / api / v2 / endpoint : endpoint_cc " , <nl> ] , <nl> ) <nl> envoy_cc_library ( <nl> " / / source / common / json : json_loader_lib " , <nl> " / / source / common / protobuf " , <nl> " / / source / common / router : router_lib " , <nl> - " @ envoy_api / / envoy / api / v2 : base_cc " , <nl> " @ envoy_api / / envoy / api / v2 : eds_cc " , <nl> + " @ envoy_api / / envoy / api / v2 / core : base_cc " , <nl> " @ envoy_api / / envoy / api / v2 / endpoint : endpoint_cc " , <nl> ] , <nl> ) <nl> envoy_cc_library ( <nl> " / / source / common / network : utility_lib " , <nl> " / / source / common / protobuf " , <nl> " / / source / common / protobuf : utility_lib " , <nl> - " @ envoy_api / / envoy / api / v2 : base_cc " , <nl> + " @ envoy_api / / envoy / api / v2 / core : base_cc " , <nl> ] , <nl> ) <nl> <nl> envoy_cc_library ( <nl> " / / source / common / config : metadata_lib " , <nl> " / / source / common / config : well_known_names " , <nl> " / / source / common / stats : stats_lib " , <nl> - " @ envoy_api / / envoy / api / v2 : base_cc " , <nl> + " @ envoy_api / / envoy / api / v2 / core : base_cc " , <nl> ] , <nl> ) <nl> mmm a / source / common / upstream / cds_api_impl . cc <nl> ppp b / source / common / upstream / cds_api_impl . cc <nl> <nl> namespace Envoy { <nl> namespace Upstream { <nl> <nl> - CdsApiPtr CdsApiImpl : : create ( const envoy : : api : : v2 : : ConfigSource & cds_config , <nl> - const Optional < envoy : : api : : v2 : : ConfigSource > & eds_config , <nl> + CdsApiPtr CdsApiImpl : : create ( const envoy : : api : : v2 : : core : : ConfigSource & cds_config , <nl> + const Optional < envoy : : api : : v2 : : core : : ConfigSource > & eds_config , <nl> ClusterManager & cm , Event : : Dispatcher & dispatcher , <nl> Runtime : : RandomGenerator & random , <nl> const LocalInfo : : LocalInfo & local_info , Stats : : Scope & scope ) { <nl> CdsApiPtr CdsApiImpl : : create ( const envoy : : api : : v2 : : ConfigSource & cds_config , <nl> new CdsApiImpl ( cds_config , eds_config , cm , dispatcher , random , local_info , scope ) } ; <nl> } <nl> <nl> - CdsApiImpl : : CdsApiImpl ( const envoy : : api : : v2 : : ConfigSource & cds_config , <nl> - const Optional < envoy : : api : : v2 : : ConfigSource > & eds_config , ClusterManager & cm , <nl> - Event : : Dispatcher & dispatcher , Runtime : : RandomGenerator & random , <nl> - const LocalInfo : : LocalInfo & local_info , Stats : : Scope & scope ) <nl> + CdsApiImpl : : CdsApiImpl ( const envoy : : api : : v2 : : core : : ConfigSource & cds_config , <nl> + const Optional < envoy : : api : : v2 : : core : : ConfigSource > & eds_config , <nl> + ClusterManager & cm , Event : : Dispatcher & dispatcher , <nl> + Runtime : : RandomGenerator & random , const LocalInfo : : LocalInfo & local_info , <nl> + Stats : : Scope & scope ) <nl> : cm_ ( cm ) , scope_ ( scope . createScope ( " cluster_manager . cds . " ) ) { <nl> Config : : Utility : : checkLocalInfo ( " cds " , local_info ) ; <nl> <nl> mmm a / source / common / upstream / cds_api_impl . h <nl> ppp b / source / common / upstream / cds_api_impl . h <nl> class CdsApiImpl : public CdsApi , <nl> Config : : SubscriptionCallbacks < envoy : : api : : v2 : : Cluster > , <nl> Logger : : Loggable < Logger : : Id : : upstream > { <nl> public : <nl> - static CdsApiPtr create ( const envoy : : api : : v2 : : ConfigSource & cds_config , <nl> - const Optional < envoy : : api : : v2 : : ConfigSource > & eds_config , <nl> + static CdsApiPtr create ( const envoy : : api : : v2 : : core : : ConfigSource & cds_config , <nl> + const Optional < envoy : : api : : v2 : : core : : ConfigSource > & eds_config , <nl> ClusterManager & cm , Event : : Dispatcher & dispatcher , <nl> Runtime : : RandomGenerator & random , const LocalInfo : : LocalInfo & local_info , <nl> Stats : : Scope & scope ) ; <nl> class CdsApiImpl : public CdsApi , <nl> void onConfigUpdateFailed ( const EnvoyException * e ) override ; <nl> <nl> private : <nl> - CdsApiImpl ( const envoy : : api : : v2 : : ConfigSource & cds_config , <nl> - const Optional < envoy : : api : : v2 : : ConfigSource > & eds_config , ClusterManager & cm , <nl> + CdsApiImpl ( const envoy : : api : : v2 : : core : : ConfigSource & cds_config , <nl> + const Optional < envoy : : api : : v2 : : core : : ConfigSource > & eds_config , ClusterManager & cm , <nl> Event : : Dispatcher & dispatcher , Runtime : : RandomGenerator & random , <nl> const LocalInfo : : LocalInfo & local_info , Stats : : Scope & scope ) ; <nl> void runInitializeCallbackIfAny ( ) ; <nl> mmm a / source / common / upstream / cds_subscription . cc <nl> ppp b / source / common / upstream / cds_subscription . cc <nl> namespace Envoy { <nl> namespace Upstream { <nl> <nl> CdsSubscription : : CdsSubscription ( Config : : SubscriptionStats stats , <nl> - const envoy : : api : : v2 : : ConfigSource & cds_config , <nl> - const Optional < envoy : : api : : v2 : : ConfigSource > & eds_config , <nl> + const envoy : : api : : v2 : : core : : ConfigSource & cds_config , <nl> + const Optional < envoy : : api : : v2 : : core : : ConfigSource > & eds_config , <nl> ClusterManager & cm , Event : : Dispatcher & dispatcher , <nl> Runtime : : RandomGenerator & random , <nl> const LocalInfo : : LocalInfo & local_info ) <nl> CdsSubscription : : CdsSubscription ( Config : : SubscriptionStats stats , <nl> const auto & api_config_source = cds_config . api_config_source ( ) ; <nl> UNREFERENCED_PARAMETER ( api_config_source ) ; <nl> / / If we are building an CdsSubscription , the ConfigSource should be REST_LEGACY . <nl> - ASSERT ( api_config_source . api_type ( ) = = envoy : : api : : v2 : : ApiConfigSource : : REST_LEGACY ) ; <nl> + ASSERT ( api_config_source . api_type ( ) = = envoy : : api : : v2 : : core : : ApiConfigSource : : REST_LEGACY ) ; <nl> / / TODO ( htuch ) : Add support for multiple clusters , # 1170 . <nl> ASSERT ( api_config_source . cluster_names ( ) . size ( ) = = 1 ) ; <nl> ASSERT ( api_config_source . has_refresh_delay ( ) ) ; <nl> mmm a / source / common / upstream / cds_subscription . h <nl> ppp b / source / common / upstream / cds_subscription . h <nl> class CdsSubscription : public Http : : RestApiFetcher , <nl> public Config : : Subscription < envoy : : api : : v2 : : Cluster > , <nl> Logger : : Loggable < Logger : : Id : : upstream > { <nl> public : <nl> - CdsSubscription ( Config : : SubscriptionStats stats , const envoy : : api : : v2 : : ConfigSource & cds_config , <nl> - const Optional < envoy : : api : : v2 : : ConfigSource > & eds_config , ClusterManager & cm , <nl> - Event : : Dispatcher & dispatcher , Runtime : : RandomGenerator & random , <nl> - const LocalInfo : : LocalInfo & local_info ) ; <nl> + CdsSubscription ( Config : : SubscriptionStats stats , <nl> + const envoy : : api : : v2 : : core : : ConfigSource & cds_config , <nl> + const Optional < envoy : : api : : v2 : : core : : ConfigSource > & eds_config , <nl> + ClusterManager & cm , Event : : Dispatcher & dispatcher , <nl> + Runtime : : RandomGenerator & random , const LocalInfo : : LocalInfo & local_info ) ; <nl> <nl> private : <nl> / / Config : : Subscription <nl> class CdsSubscription : public Http : : RestApiFetcher , <nl> const LocalInfo : : LocalInfo & local_info_ ; <nl> Config : : SubscriptionCallbacks < envoy : : api : : v2 : : Cluster > * callbacks_ = nullptr ; <nl> Config : : SubscriptionStats stats_ ; <nl> - const Optional < envoy : : api : : v2 : : ConfigSource > & eds_config_ ; <nl> + const Optional < envoy : : api : : v2 : : core : : ConfigSource > & eds_config_ ; <nl> } ; <nl> <nl> } / / namespace Upstream <nl> mmm a / source / common / upstream / cluster_manager_impl . cc <nl> ppp b / source / common / upstream / cluster_manager_impl . cc <nl> ClusterManagerImpl : : ClusterManagerImpl ( const envoy : : config : : bootstrap : : v2 : : Boots <nl> if ( bootstrap . dynamic_resources ( ) . deprecated_v1 ( ) . has_sds_config ( ) ) { <nl> const auto & sds_config = bootstrap . dynamic_resources ( ) . deprecated_v1 ( ) . sds_config ( ) ; <nl> switch ( sds_config . config_source_specifier_case ( ) ) { <nl> - case envoy : : api : : v2 : : ConfigSource : : kPath : { <nl> + case envoy : : api : : v2 : : core : : ConfigSource : : kPath : { <nl> Config : : Utility : : checkFilesystemSubscriptionBackingPath ( sds_config . path ( ) ) ; <nl> break ; <nl> } <nl> - case envoy : : api : : v2 : : ConfigSource : : kApiConfigSource : { <nl> + case envoy : : api : : v2 : : core : : ConfigSource : : kApiConfigSource : { <nl> Config : : Utility : : checkApiConfigSourceSubscriptionBackingCluster ( <nl> loaded_clusters , sds_config . api_config_source ( ) ) ; <nl> break ; <nl> } <nl> - case envoy : : api : : v2 : : ConfigSource : : kAds : { <nl> + case envoy : : api : : v2 : : core : : ConfigSource : : kAds : { <nl> / / Backing cluster will be checked below <nl> break ; <nl> } <nl> ClusterSharedPtr ProdClusterManagerFactory : : clusterFromProto ( <nl> } <nl> <nl> CdsApiPtr <nl> - ProdClusterManagerFactory : : createCds ( const envoy : : api : : v2 : : ConfigSource & cds_config , <nl> - const Optional < envoy : : api : : v2 : : ConfigSource > & eds_config , <nl> + ProdClusterManagerFactory : : createCds ( const envoy : : api : : v2 : : core : : ConfigSource & cds_config , <nl> + const Optional < envoy : : api : : v2 : : core : : ConfigSource > & eds_config , <nl> ClusterManager & cm ) { <nl> return CdsApiImpl : : create ( cds_config , eds_config , cm , primary_dispatcher_ , random_ , local_info_ , <nl> stats_ ) ; <nl> mmm a / source / common / upstream / cluster_manager_impl . h <nl> ppp b / source / common / upstream / cluster_manager_impl . h <nl> class ProdClusterManagerFactory : public ClusterManagerFactory { <nl> ClusterSharedPtr clusterFromProto ( const envoy : : api : : v2 : : Cluster & cluster , ClusterManager & cm , <nl> Outlier : : EventLoggerSharedPtr outlier_event_logger , <nl> bool added_via_api ) override ; <nl> - CdsApiPtr createCds ( const envoy : : api : : v2 : : ConfigSource & cds_config , <nl> - const Optional < envoy : : api : : v2 : : ConfigSource > & eds_config , <nl> + CdsApiPtr createCds ( const envoy : : api : : v2 : : core : : ConfigSource & cds_config , <nl> + const Optional < envoy : : api : : v2 : : core : : ConfigSource > & eds_config , <nl> ClusterManager & cm ) override ; <nl> <nl> protected : <nl> class ClusterManagerImpl : public ClusterManager , Logger : : Loggable < Logger : : Id : : u <nl> ThreadLocal : : SlotPtr tls_ ; <nl> Runtime : : RandomGenerator & random_ ; <nl> std : : unordered_map < std : : string , PrimaryClusterData > primary_clusters_ ; <nl> - Optional < envoy : : api : : v2 : : ConfigSource > eds_config_ ; <nl> + Optional < envoy : : api : : v2 : : core : : ConfigSource > eds_config_ ; <nl> Network : : Address : : InstanceConstSharedPtr source_address_ ; <nl> Outlier : : EventLoggerSharedPtr outlier_event_logger_ ; <nl> const LocalInfo : : LocalInfo & local_info_ ; <nl> mmm a / source / common / upstream / eds . h <nl> ppp b / source / common / upstream / eds . h <nl> <nl> # pragma once <nl> <nl> - # include " envoy / api / v2 / base . pb . h " <nl> + # include " envoy / api / v2 / core / base . pb . h " <nl> # include " envoy / api / v2 / eds . pb . h " <nl> # include " envoy / config / subscription . h " <nl> # include " envoy / local_info / local_info . h " <nl> mmm a / source / common / upstream / health_checker_impl . cc <nl> ppp b / source / common / upstream / health_checker_impl . cc <nl> <nl> namespace Envoy { <nl> namespace Upstream { <nl> <nl> - HealthCheckerSharedPtr HealthCheckerFactory : : create ( const envoy : : api : : v2 : : HealthCheck & hc_config , <nl> - Upstream : : Cluster & cluster , <nl> - Runtime : : Loader & runtime , <nl> - Runtime : : RandomGenerator & random , <nl> - Event : : Dispatcher & dispatcher ) { <nl> + HealthCheckerSharedPtr <nl> + HealthCheckerFactory : : create ( const envoy : : api : : v2 : : core : : HealthCheck & hc_config , <nl> + Upstream : : Cluster & cluster , Runtime : : Loader & runtime , <nl> + Runtime : : RandomGenerator & random , Event : : Dispatcher & dispatcher ) { <nl> switch ( hc_config . health_checker_case ( ) ) { <nl> - case envoy : : api : : v2 : : HealthCheck : : HealthCheckerCase : : kHttpHealthCheck : <nl> + case envoy : : api : : v2 : : core : : HealthCheck : : HealthCheckerCase : : kHttpHealthCheck : <nl> return std : : make_shared < ProdHttpHealthCheckerImpl > ( cluster , hc_config , dispatcher , runtime , <nl> random ) ; <nl> - case envoy : : api : : v2 : : HealthCheck : : HealthCheckerCase : : kTcpHealthCheck : <nl> + case envoy : : api : : v2 : : core : : HealthCheck : : HealthCheckerCase : : kTcpHealthCheck : <nl> return std : : make_shared < TcpHealthCheckerImpl > ( cluster , hc_config , dispatcher , runtime , random ) ; <nl> - case envoy : : api : : v2 : : HealthCheck : : HealthCheckerCase : : kRedisHealthCheck : <nl> + case envoy : : api : : v2 : : core : : HealthCheck : : HealthCheckerCase : : kRedisHealthCheck : <nl> return std : : make_shared < RedisHealthCheckerImpl > ( cluster , hc_config , dispatcher , runtime , random , <nl> Redis : : ConnPool : : ClientFactoryImpl : : instance_ ) ; <nl> - case envoy : : api : : v2 : : HealthCheck : : HealthCheckerCase : : kGrpcHealthCheck : <nl> + case envoy : : api : : v2 : : core : : HealthCheck : : HealthCheckerCase : : kGrpcHealthCheck : <nl> if ( ! ( cluster . info ( ) - > features ( ) & Upstream : : ClusterInfo : : Features : : HTTP2 ) ) { <nl> throw EnvoyException ( fmt : : format ( " { } cluster must support HTTP / 2 for gRPC healthchecking " , <nl> cluster . info ( ) - > name ( ) ) ) ; <nl> HealthCheckerSharedPtr HealthCheckerFactory : : create ( const envoy : : api : : v2 : : Health <nl> const std : : chrono : : milliseconds HealthCheckerImplBase : : NO_TRAFFIC_INTERVAL { 60000 } ; <nl> <nl> HealthCheckerImplBase : : HealthCheckerImplBase ( const Cluster & cluster , <nl> - const envoy : : api : : v2 : : HealthCheck & config , <nl> + const envoy : : api : : v2 : : core : : HealthCheck & config , <nl> Event : : Dispatcher & dispatcher , <nl> Runtime : : Loader & runtime , <nl> Runtime : : RandomGenerator & random ) <nl> void HealthCheckerImplBase : : ActiveHealthCheckSession : : onTimeoutBase ( ) { <nl> } <nl> <nl> HttpHealthCheckerImpl : : HttpHealthCheckerImpl ( const Cluster & cluster , <nl> - const envoy : : api : : v2 : : HealthCheck & config , <nl> + const envoy : : api : : v2 : : core : : HealthCheck & config , <nl> Event : : Dispatcher & dispatcher , <nl> Runtime : : Loader & runtime , <nl> Runtime : : RandomGenerator & random ) <nl> ProdHttpHealthCheckerImpl : : createCodecClient ( Upstream : : Host : : CreateConnectionDat <nl> } <nl> <nl> TcpHealthCheckMatcher : : MatchSegments TcpHealthCheckMatcher : : loadProtoBytes ( <nl> - const Protobuf : : RepeatedPtrField < envoy : : api : : v2 : : HealthCheck : : Payload > & byte_array ) { <nl> + const Protobuf : : RepeatedPtrField < envoy : : api : : v2 : : core : : HealthCheck : : Payload > & byte_array ) { <nl> MatchSegments result ; <nl> <nl> for ( const auto & entry : byte_array ) { <nl> bool TcpHealthCheckMatcher : : match ( const MatchSegments & expected , const Buffer : : I <nl> } <nl> <nl> TcpHealthCheckerImpl : : TcpHealthCheckerImpl ( const Cluster & cluster , <nl> - const envoy : : api : : v2 : : HealthCheck & config , <nl> + const envoy : : api : : v2 : : core : : HealthCheck & config , <nl> Event : : Dispatcher & dispatcher , Runtime : : Loader & runtime , <nl> Runtime : : RandomGenerator & random ) <nl> : HealthCheckerImplBase ( cluster , config , dispatcher , runtime , random ) , send_bytes_ ( [ & config ] { <nl> - Protobuf : : RepeatedPtrField < envoy : : api : : v2 : : HealthCheck : : Payload > send_repeated ; <nl> + Protobuf : : RepeatedPtrField < envoy : : api : : v2 : : core : : HealthCheck : : Payload > send_repeated ; <nl> if ( ! config . tcp_health_check ( ) . send ( ) . text ( ) . empty ( ) ) { <nl> send_repeated . Add ( ) - > CopyFrom ( config . tcp_health_check ( ) . send ( ) ) ; <nl> } <nl> void TcpHealthCheckerImpl : : TcpActiveHealthCheckSession : : onTimeout ( ) { <nl> } <nl> <nl> RedisHealthCheckerImpl : : RedisHealthCheckerImpl ( const Cluster & cluster , <nl> - const envoy : : api : : v2 : : HealthCheck & config , <nl> + const envoy : : api : : v2 : : core : : HealthCheck & config , <nl> Event : : Dispatcher & dispatcher , <nl> Runtime : : Loader & runtime , <nl> Runtime : : RandomGenerator & random , <nl> RedisHealthCheckerImpl : : HealthCheckRequest : : HealthCheckRequest ( ) { <nl> } <nl> <nl> GrpcHealthCheckerImpl : : GrpcHealthCheckerImpl ( const Cluster & cluster , <nl> - const envoy : : api : : v2 : : HealthCheck & config , <nl> + const envoy : : api : : v2 : : core : : HealthCheck & config , <nl> Event : : Dispatcher & dispatcher , <nl> Runtime : : Loader & runtime , <nl> Runtime : : RandomGenerator & random ) <nl> mmm a / source / common / upstream / health_checker_impl . h <nl> ppp b / source / common / upstream / health_checker_impl . h <nl> <nl> # include < unordered_map > <nl> # include < vector > <nl> <nl> - # include " envoy / api / v2 / health_check . pb . h " <nl> + # include " envoy / api / v2 / core / health_check . pb . h " <nl> # include " envoy / event / timer . h " <nl> # include " envoy / grpc / status . h " <nl> # include " envoy / http / codec . h " <nl> class HealthCheckerFactory { <nl> * @ param dispatcher supplies the dispatcher . <nl> * @ return a health checker . <nl> * / <nl> - static HealthCheckerSharedPtr create ( const envoy : : api : : v2 : : HealthCheck & hc_config , <nl> + static HealthCheckerSharedPtr create ( const envoy : : api : : v2 : : core : : HealthCheck & hc_config , <nl> Upstream : : Cluster & cluster , Runtime : : Loader & runtime , <nl> Runtime : : RandomGenerator & random , <nl> Event : : Dispatcher & dispatcher ) ; <nl> class HealthCheckerImplBase : public HealthChecker , <nl> <nl> typedef std : : unique_ptr < ActiveHealthCheckSession > ActiveHealthCheckSessionPtr ; <nl> <nl> - HealthCheckerImplBase ( const Cluster & cluster , const envoy : : api : : v2 : : HealthCheck & config , <nl> + HealthCheckerImplBase ( const Cluster & cluster , const envoy : : api : : v2 : : core : : HealthCheck & config , <nl> Event : : Dispatcher & dispatcher , Runtime : : Loader & runtime , <nl> Runtime : : RandomGenerator & random ) ; <nl> <nl> class HealthCheckerImplBase : public HealthChecker , <nl> * / <nl> class HttpHealthCheckerImpl : public HealthCheckerImplBase { <nl> public : <nl> - HttpHealthCheckerImpl ( const Cluster & cluster , const envoy : : api : : v2 : : HealthCheck & config , <nl> + HttpHealthCheckerImpl ( const Cluster & cluster , const envoy : : api : : v2 : : core : : HealthCheck & config , <nl> Event : : Dispatcher & dispatcher , Runtime : : Loader & runtime , <nl> Runtime : : RandomGenerator & random ) ; <nl> <nl> class TcpHealthCheckMatcher { <nl> typedef std : : list < std : : vector < uint8_t > > MatchSegments ; <nl> <nl> static MatchSegments loadProtoBytes ( <nl> - const Protobuf : : RepeatedPtrField < envoy : : api : : v2 : : HealthCheck : : Payload > & byte_array ) ; <nl> + const Protobuf : : RepeatedPtrField < envoy : : api : : v2 : : core : : HealthCheck : : Payload > & byte_array ) ; <nl> static bool match ( const MatchSegments & expected , const Buffer : : Instance & buffer ) ; <nl> } ; <nl> <nl> class TcpHealthCheckMatcher { <nl> * / <nl> class TcpHealthCheckerImpl : public HealthCheckerImplBase { <nl> public : <nl> - TcpHealthCheckerImpl ( const Cluster & cluster , const envoy : : api : : v2 : : HealthCheck & config , <nl> + TcpHealthCheckerImpl ( const Cluster & cluster , const envoy : : api : : v2 : : core : : HealthCheck & config , <nl> Event : : Dispatcher & dispatcher , Runtime : : Loader & runtime , <nl> Runtime : : RandomGenerator & random ) ; <nl> <nl> class TcpHealthCheckerImpl : public HealthCheckerImplBase { <nl> * / <nl> class RedisHealthCheckerImpl : public HealthCheckerImplBase { <nl> public : <nl> - RedisHealthCheckerImpl ( const Cluster & cluster , const envoy : : api : : v2 : : HealthCheck & config , <nl> + RedisHealthCheckerImpl ( const Cluster & cluster , const envoy : : api : : v2 : : core : : HealthCheck & config , <nl> Event : : Dispatcher & dispatcher , Runtime : : Loader & runtime , <nl> Runtime : : RandomGenerator & random , <nl> Redis : : ConnPool : : ClientFactory & client_factory ) ; <nl> class RedisHealthCheckerImpl : public HealthCheckerImplBase { <nl> * / <nl> class GrpcHealthCheckerImpl : public HealthCheckerImplBase { <nl> public : <nl> - GrpcHealthCheckerImpl ( const Cluster & cluster , const envoy : : api : : v2 : : HealthCheck & config , <nl> + GrpcHealthCheckerImpl ( const Cluster & cluster , const envoy : : api : : v2 : : core : : HealthCheck & config , <nl> Event : : Dispatcher & dispatcher , Runtime : : Loader & runtime , <nl> Runtime : : RandomGenerator & random ) ; <nl> <nl> mmm a / source / common / upstream / load_stats_reporter . cc <nl> ppp b / source / common / upstream / load_stats_reporter . cc <nl> <nl> namespace Envoy { <nl> namespace Upstream { <nl> <nl> - LoadStatsReporter : : LoadStatsReporter ( const envoy : : api : : v2 : : Node & node , <nl> + LoadStatsReporter : : LoadStatsReporter ( const envoy : : api : : v2 : : core : : Node & node , <nl> ClusterManager & cluster_manager , Stats : : Scope & scope , <nl> Grpc : : AsyncClientPtr async_client , <nl> Event : : Dispatcher & dispatcher ) <nl> mmm a / source / common / upstream / load_stats_reporter . h <nl> ppp b / source / common / upstream / load_stats_reporter . h <nl> class LoadStatsReporter <nl> : Grpc : : TypedAsyncStreamCallbacks < envoy : : service : : load_stats : : v2 : : LoadStatsResponse > , <nl> Logger : : Loggable < Logger : : Id : : upstream > { <nl> public : <nl> - LoadStatsReporter ( const envoy : : api : : v2 : : Node & node , ClusterManager & cluster_manager , <nl> + LoadStatsReporter ( const envoy : : api : : v2 : : core : : Node & node , ClusterManager & cluster_manager , <nl> Stats : : Scope & scope , Grpc : : AsyncClientPtr async_client , <nl> Event : : Dispatcher & dispatcher ) ; <nl> <nl> mmm a / source / common / upstream / logical_dns_cluster . h <nl> ppp b / source / common / upstream / logical_dns_cluster . h <nl> class LogicalDnsCluster : public ClusterImplBase { <nl> struct LogicalHost : public HostImpl { <nl> LogicalHost ( ClusterInfoConstSharedPtr cluster , const std : : string & hostname , <nl> Network : : Address : : InstanceConstSharedPtr address , LogicalDnsCluster & parent ) <nl> - : HostImpl ( cluster , hostname , address , envoy : : api : : v2 : : Metadata : : default_instance ( ) , 1 , <nl> - envoy : : api : : v2 : : Locality ( ) . default_instance ( ) ) , <nl> + : HostImpl ( cluster , hostname , address , envoy : : api : : v2 : : core : : Metadata : : default_instance ( ) , <nl> + 1 , envoy : : api : : v2 : : core : : Locality ( ) . default_instance ( ) ) , <nl> parent_ ( parent ) { } <nl> <nl> / / Upstream : : Host <nl> class LogicalDnsCluster : public ClusterImplBase { <nl> <nl> / / Upstream : HostDescription <nl> bool canary ( ) const override { return false ; } <nl> - const envoy : : api : : v2 : : Metadata & metadata ( ) const override { <nl> - return envoy : : api : : v2 : : Metadata : : default_instance ( ) ; <nl> + const envoy : : api : : v2 : : core : : Metadata & metadata ( ) const override { <nl> + return envoy : : api : : v2 : : core : : Metadata : : default_instance ( ) ; <nl> } <nl> const ClusterInfo & cluster ( ) const override { return logical_host_ - > cluster ( ) ; } <nl> HealthCheckHostMonitor & healthChecker ( ) const override { <nl> class LogicalDnsCluster : public ClusterImplBase { <nl> const HostStats & stats ( ) const override { return logical_host_ - > stats ( ) ; } <nl> const std : : string & hostname ( ) const override { return logical_host_ - > hostname ( ) ; } <nl> Network : : Address : : InstanceConstSharedPtr address ( ) const override { return address_ ; } <nl> - const envoy : : api : : v2 : : Locality & locality ( ) const override { <nl> - return envoy : : api : : v2 : : Locality ( ) . default_instance ( ) ; <nl> + const envoy : : api : : v2 : : core : : Locality & locality ( ) const override { <nl> + return envoy : : api : : v2 : : core : : Locality ( ) . default_instance ( ) ; <nl> } <nl> <nl> Network : : Address : : InstanceConstSharedPtr address_ ; <nl> mmm a / source / common / upstream / original_dst_cluster . cc <nl> ppp b / source / common / upstream / original_dst_cluster . cc <nl> HostConstSharedPtr OriginalDstCluster : : LoadBalancer : : chooseHost ( LoadBalancerCont <nl> Network : : Utility : : copyInternetAddressAndPort ( * dst_ip ) ) ; <nl> / / Create a host we can use immediately . <nl> host . reset ( new HostImpl ( info_ , info_ - > name ( ) + dst_addr . asString ( ) , std : : move ( host_ip_port ) , <nl> - envoy : : api : : v2 : : Metadata : : default_instance ( ) , 1 , <nl> - envoy : : api : : v2 : : Locality ( ) . default_instance ( ) ) ) ; <nl> + envoy : : api : : v2 : : core : : Metadata : : default_instance ( ) , 1 , <nl> + envoy : : api : : v2 : : core : : Locality ( ) . default_instance ( ) ) ) ; <nl> <nl> ENVOY_LOG ( debug , " Created host { } . " , host - > address ( ) - > asString ( ) ) ; <nl> / / Add the new host to the map . We just failed to find it in <nl> mmm a / source / common / upstream / sds_subscription . cc <nl> ppp b / source / common / upstream / sds_subscription . cc <nl> namespace Envoy { <nl> namespace Upstream { <nl> <nl> SdsSubscription : : SdsSubscription ( ClusterStats & stats , <nl> - const envoy : : api : : v2 : : ConfigSource & eds_config , ClusterManager & cm , <nl> - Event : : Dispatcher & dispatcher , Runtime : : RandomGenerator & random ) <nl> + const envoy : : api : : v2 : : core : : ConfigSource & eds_config , <nl> + ClusterManager & cm , Event : : Dispatcher & dispatcher , <nl> + Runtime : : RandomGenerator & random ) <nl> : RestApiFetcher ( cm , eds_config . api_config_source ( ) . cluster_names ( ) [ 0 ] , dispatcher , random , <nl> Config : : Utility : : apiConfigSourceRefreshDelay ( eds_config . api_config_source ( ) ) ) , <nl> stats_ ( stats ) { <nl> const auto & api_config_source = eds_config . api_config_source ( ) ; <nl> UNREFERENCED_PARAMETER ( api_config_source ) ; <nl> / / If we are building an SdsSubscription , the ConfigSource should be REST_LEGACY . <nl> - ASSERT ( api_config_source . api_type ( ) = = envoy : : api : : v2 : : ApiConfigSource : : REST_LEGACY ) ; <nl> + ASSERT ( api_config_source . api_type ( ) = = envoy : : api : : v2 : : core : : ApiConfigSource : : REST_LEGACY ) ; <nl> / / TODO ( htuch ) : Add support for multiple clusters , # 1170 . <nl> ASSERT ( api_config_source . cluster_names ( ) . size ( ) = = 1 ) ; <nl> ASSERT ( api_config_source . has_refresh_delay ( ) ) ; <nl> mmm a / source / common / upstream / sds_subscription . h <nl> ppp b / source / common / upstream / sds_subscription . h <nl> <nl> # include < cstdint > <nl> # include < string > <nl> <nl> - # include " envoy / api / v2 / base . pb . h " <nl> + # include " envoy / api / v2 / core / base . pb . h " <nl> # include " envoy / api / v2 / eds . pb . h " <nl> # include " envoy / config / subscription . h " <nl> <nl> class SdsSubscription : public Http : : RestApiFetcher , <nl> public Config : : Subscription < envoy : : api : : v2 : : ClusterLoadAssignment > , <nl> Logger : : Loggable < Logger : : Id : : upstream > { <nl> public : <nl> - SdsSubscription ( ClusterStats & stats , const envoy : : api : : v2 : : ConfigSource & eds_config , <nl> + SdsSubscription ( ClusterStats & stats , const envoy : : api : : v2 : : core : : ConfigSource & eds_config , <nl> ClusterManager & cm , Event : : Dispatcher & dispatcher , <nl> Runtime : : RandomGenerator & random ) ; <nl> <nl> mmm a / source / common / upstream / subset_lb . cc <nl> ppp b / source / common / upstream / subset_lb . cc <nl> void SubsetLoadBalancer : : update ( uint32_t priority , const HostVector & hosts_added <nl> } <nl> <nl> bool SubsetLoadBalancer : : hostMatchesDefaultSubset ( const Host & host ) { <nl> - const envoy : : api : : v2 : : Metadata & host_metadata = host . metadata ( ) ; <nl> + const envoy : : api : : v2 : : core : : Metadata & host_metadata = host . metadata ( ) ; <nl> <nl> for ( const auto & it : default_subset_ . fields ( ) ) { <nl> const ProtobufWkt : : Value & host_value = Config : : Metadata : : metadataValue ( <nl> bool SubsetLoadBalancer : : hostMatchesDefaultSubset ( const Host & host ) { <nl> } <nl> <nl> bool SubsetLoadBalancer : : hostMatches ( const SubsetMetadata & kvs , const Host & host ) { <nl> - const envoy : : api : : v2 : : Metadata & host_metadata = host . metadata ( ) ; <nl> + const envoy : : api : : v2 : : core : : Metadata & host_metadata = host . metadata ( ) ; <nl> <nl> for ( const auto & kv : kvs ) { <nl> const ProtobufWkt : : Value & host_value = Config : : Metadata : : metadataValue ( <nl> SubsetLoadBalancer : : extractSubsetMetadata ( const std : : set < std : : string > & subset_ke <nl> const Host & host ) { <nl> SubsetMetadata kvs ; <nl> <nl> - const envoy : : api : : v2 : : Metadata & metadata = host . metadata ( ) ; <nl> + const envoy : : api : : v2 : : core : : Metadata & metadata = host . metadata ( ) ; <nl> const auto & filter_it = metadata . filter_metadata ( ) . find ( Config : : MetadataFilters : : get ( ) . ENVOY_LB ) ; <nl> if ( filter_it = = metadata . filter_metadata ( ) . end ( ) ) { <nl> return kvs ; <nl> mmm a / source / common / upstream / upstream_impl . cc <nl> ppp b / source / common / upstream / upstream_impl . cc <nl> ClusterInfoImpl : : ResourceManagers : : ResourceManagers ( const envoy : : api : : v2 : : Cluste <nl> Runtime : : Loader & runtime , <nl> const std : : string & cluster_name ) { <nl> managers_ [ enumToInt ( ResourcePriority : : Default ) ] = <nl> - load ( config , runtime , cluster_name , envoy : : api : : v2 : : RoutingPriority : : DEFAULT ) ; <nl> + load ( config , runtime , cluster_name , envoy : : api : : v2 : : core : : RoutingPriority : : DEFAULT ) ; <nl> managers_ [ enumToInt ( ResourcePriority : : High ) ] = <nl> - load ( config , runtime , cluster_name , envoy : : api : : v2 : : RoutingPriority : : HIGH ) ; <nl> + load ( config , runtime , cluster_name , envoy : : api : : v2 : : core : : RoutingPriority : : HIGH ) ; <nl> } <nl> <nl> ResourceManagerImplPtr <nl> ClusterInfoImpl : : ResourceManagers : : load ( const envoy : : api : : v2 : : Cluster & config , <nl> Runtime : : Loader & runtime , const std : : string & cluster_name , <nl> - const envoy : : api : : v2 : : RoutingPriority & priority ) { <nl> + const envoy : : api : : v2 : : core : : RoutingPriority & priority ) { <nl> uint64_t max_connections = 1024 ; <nl> uint64_t max_pending_requests = 1024 ; <nl> uint64_t max_requests = 1024 ; <nl> ClusterInfoImpl : : ResourceManagers : : load ( const envoy : : api : : v2 : : Cluster & config , <nl> <nl> std : : string priority_name ; <nl> switch ( priority ) { <nl> - case envoy : : api : : v2 : : RoutingPriority : : DEFAULT : <nl> + case envoy : : api : : v2 : : core : : RoutingPriority : : DEFAULT : <nl> priority_name = " default " ; <nl> break ; <nl> - case envoy : : api : : v2 : : RoutingPriority : : HIGH : <nl> + case envoy : : api : : v2 : : core : : RoutingPriority : : HIGH : <nl> priority_name = " high " ; <nl> break ; <nl> default : <nl> StaticClusterImpl : : StaticClusterImpl ( const envoy : : api : : v2 : : Cluster & cluster , <nl> for ( const auto & host : cluster . hosts ( ) ) { <nl> initial_hosts_ - > emplace_back ( <nl> HostSharedPtr { new HostImpl ( info_ , " " , Network : : Address : : resolveProtoAddress ( host ) , <nl> - envoy : : api : : v2 : : Metadata : : default_instance ( ) , 1 , <nl> - envoy : : api : : v2 : : Locality ( ) . default_instance ( ) ) } ) ; <nl> + envoy : : api : : v2 : : core : : Metadata : : default_instance ( ) , 1 , <nl> + envoy : : api : : v2 : : core : : Locality ( ) . default_instance ( ) ) } ) ; <nl> } <nl> } <nl> <nl> void StrictDnsClusterImpl : : ResolveTarget : : startResolve ( ) { <nl> ASSERT ( address ! = nullptr ) ; <nl> new_hosts . emplace_back ( new HostImpl ( parent_ . info_ , dns_address_ , <nl> Network : : Utility : : getAddressWithPort ( * address , port_ ) , <nl> - envoy : : api : : v2 : : Metadata : : default_instance ( ) , 1 , <nl> - envoy : : api : : v2 : : Locality ( ) . default_instance ( ) ) ) ; <nl> + envoy : : api : : v2 : : core : : Metadata : : default_instance ( ) , 1 , <nl> + envoy : : api : : v2 : : core : : Locality ( ) . default_instance ( ) ) ) ; <nl> } <nl> <nl> HostVector hosts_added ; <nl> mmm a / source / common / upstream / upstream_impl . h <nl> ppp b / source / common / upstream / upstream_impl . h <nl> <nl> # include < utility > <nl> # include < vector > <nl> <nl> - # include " envoy / api / v2 / base . pb . h " <nl> + # include " envoy / api / v2 / core / base . pb . h " <nl> # include " envoy / event / timer . h " <nl> # include " envoy / local_info / local_info . h " <nl> # include " envoy / network / dns . h " <nl> <nl> namespace Envoy { <nl> namespace Upstream { <nl> <nl> - / / Wrapper around envoy : : api : : v2 : : Locality to make it easier to compare for ordering in std : : map and <nl> - / / in tests to construct literals . <nl> + / / Wrapper around envoy : : api : : v2 : : core : : Locality to make it easier to compare for ordering in <nl> + / / std : : map and in tests to construct literals . <nl> / / TODO ( htuch ) : Consider making this reference based when we have a single string implementation . <nl> class Locality : public std : : tuple < std : : string , std : : string , std : : string > { <nl> public : <nl> Locality ( const std : : string & region , const std : : string & zone , const std : : string & sub_zone ) <nl> : std : : tuple < std : : string , std : : string , std : : string > ( region , zone , sub_zone ) { } <nl> - Locality ( const envoy : : api : : v2 : : Locality & locality ) <nl> + Locality ( const envoy : : api : : v2 : : core : : Locality & locality ) <nl> : std : : tuple < std : : string , std : : string , std : : string > ( locality . region ( ) , locality . zone ( ) , <nl> locality . sub_zone ( ) ) { } <nl> bool empty ( ) const { <nl> class HostDescriptionImpl : virtual public HostDescription { <nl> public : <nl> HostDescriptionImpl ( ClusterInfoConstSharedPtr cluster , const std : : string & hostname , <nl> Network : : Address : : InstanceConstSharedPtr dest_address , <nl> - const envoy : : api : : v2 : : Metadata & metadata , <nl> - const envoy : : api : : v2 : : Locality & locality ) <nl> + const envoy : : api : : v2 : : core : : Metadata & metadata , <nl> + const envoy : : api : : v2 : : core : : Locality & locality ) <nl> : cluster_ ( cluster ) , hostname_ ( hostname ) , address_ ( dest_address ) , <nl> canary_ ( Config : : Metadata : : metadataValue ( metadata , Config : : MetadataFilters : : get ( ) . ENVOY_LB , <nl> Config : : MetadataEnvoyLbKeys : : get ( ) . CANARY ) <nl> class HostDescriptionImpl : virtual public HostDescription { <nl> <nl> / / Upstream : : HostDescription <nl> bool canary ( ) const override { return canary_ ; } <nl> - const envoy : : api : : v2 : : Metadata & metadata ( ) const override { return metadata_ ; } <nl> + const envoy : : api : : v2 : : core : : Metadata & metadata ( ) const override { return metadata_ ; } <nl> const ClusterInfo & cluster ( ) const override { return * cluster_ ; } <nl> HealthCheckHostMonitor & healthChecker ( ) const override { <nl> if ( health_checker_ ) { <nl> class HostDescriptionImpl : virtual public HostDescription { <nl> const HostStats & stats ( ) const override { return stats_ ; } <nl> const std : : string & hostname ( ) const override { return hostname_ ; } <nl> Network : : Address : : InstanceConstSharedPtr address ( ) const override { return address_ ; } <nl> - const envoy : : api : : v2 : : Locality & locality ( ) const override { return locality_ ; } <nl> + const envoy : : api : : v2 : : core : : Locality & locality ( ) const override { return locality_ ; } <nl> <nl> protected : <nl> ClusterInfoConstSharedPtr cluster_ ; <nl> const std : : string hostname_ ; <nl> Network : : Address : : InstanceConstSharedPtr address_ ; <nl> const bool canary_ ; <nl> - const envoy : : api : : v2 : : Metadata metadata_ ; <nl> - const envoy : : api : : v2 : : Locality locality_ ; <nl> + const envoy : : api : : v2 : : core : : Metadata metadata_ ; <nl> + const envoy : : api : : v2 : : core : : Locality locality_ ; <nl> Stats : : IsolatedStoreImpl stats_store_ ; <nl> HostStats stats_ ; <nl> Outlier : : DetectorHostMonitorPtr outlier_detector_ ; <nl> class HostImpl : public HostDescriptionImpl , <nl> public : <nl> HostImpl ( ClusterInfoConstSharedPtr cluster , const std : : string & hostname , <nl> Network : : Address : : InstanceConstSharedPtr address , <nl> - const envoy : : api : : v2 : : Metadata & metadata , uint32_t initial_weight , <nl> - const envoy : : api : : v2 : : Locality & locality ) <nl> + const envoy : : api : : v2 : : core : : Metadata & metadata , uint32_t initial_weight , <nl> + const envoy : : api : : v2 : : core : : Locality & locality ) <nl> : HostDescriptionImpl ( cluster , hostname , address , metadata , locality ) , used_ ( true ) { <nl> weight ( initial_weight ) ; <nl> } <nl> class ClusterInfoImpl : public ClusterInfo , <nl> return source_address_ ; <nl> } ; <nl> const LoadBalancerSubsetInfo & lbSubsetInfo ( ) const override { return lb_subset_ ; } <nl> - const envoy : : api : : v2 : : Metadata & metadata ( ) const override { return metadata_ ; } <nl> + const envoy : : api : : v2 : : core : : Metadata & metadata ( ) const override { return metadata_ ; } <nl> <nl> / / Server : : Configuration : : TransportSocketFactoryContext <nl> Ssl : : ContextManager & sslContextManager ( ) override { return ssl_context_manager_ ; } <nl> class ClusterInfoImpl : public ClusterInfo , <nl> const std : : string & cluster_name ) ; <nl> ResourceManagerImplPtr load ( const envoy : : api : : v2 : : Cluster & config , Runtime : : Loader & runtime , <nl> const std : : string & cluster_name , <nl> - const envoy : : api : : v2 : : RoutingPriority & priority ) ; <nl> + const envoy : : api : : v2 : : core : : RoutingPriority & priority ) ; <nl> <nl> typedef std : : array < ResourceManagerImplPtr , NumResourcePriorities > Managers ; <nl> <nl> class ClusterInfoImpl : public ClusterInfo , <nl> Ssl : : ContextManager & ssl_context_manager_ ; <nl> const bool added_via_api_ ; <nl> LoadBalancerSubsetInfoImpl lb_subset_ ; <nl> - const envoy : : api : : v2 : : Metadata metadata_ ; <nl> + const envoy : : api : : v2 : : core : : Metadata metadata_ ; <nl> } ; <nl> <nl> / * * <nl> mmm a / source / server / config / access_log / file_access_log . cc <nl> ppp b / source / server / config / access_log / file_access_log . cc <nl> <nl> # include " server / config / access_log / file_access_log . h " <nl> <nl> - # include " envoy / api / v2 / filter / accesslog / accesslog . pb . validate . h " <nl> + # include " envoy / config / filter / accesslog / v2 / accesslog . pb . validate . h " <nl> # include " envoy / registry / registry . h " <nl> # include " envoy / server / filter_config . h " <nl> <nl> namespace Configuration { <nl> AccessLog : : InstanceSharedPtr FileAccessLogFactory : : createAccessLogInstance ( <nl> const Protobuf : : Message & config , AccessLog : : FilterPtr & & filter , FactoryContext & context ) { <nl> const auto & fal_config = <nl> - MessageUtil : : downcastAndValidate < const envoy : : api : : v2 : : filter : : accesslog : : FileAccessLog & > ( <nl> + MessageUtil : : downcastAndValidate < const envoy : : config : : filter : : accesslog : : v2 : : FileAccessLog & > ( <nl> config ) ; <nl> AccessLog : : FormatterPtr formatter ; <nl> if ( fal_config . format ( ) . empty ( ) ) { <nl> AccessLog : : InstanceSharedPtr FileAccessLogFactory : : createAccessLogInstance ( <nl> } <nl> <nl> ProtobufTypes : : MessagePtr FileAccessLogFactory : : createEmptyConfigProto ( ) { <nl> - return ProtobufTypes : : MessagePtr { new envoy : : api : : v2 : : filter : : accesslog : : FileAccessLog ( ) } ; <nl> + return ProtobufTypes : : MessagePtr { new envoy : : config : : filter : : accesslog : : v2 : : FileAccessLog ( ) } ; <nl> } <nl> <nl> std : : string FileAccessLogFactory : : name ( ) const { return Config : : AccessLogNames : : get ( ) . FILE ; } <nl> mmm a / source / server / config / access_log / grpc_access_log . cc <nl> ppp b / source / server / config / access_log / grpc_access_log . cc <nl> <nl> # include " server / config / access_log / grpc_access_log . h " <nl> <nl> - # include " envoy / api / v2 / filter / accesslog / accesslog . pb . validate . h " <nl> # include " envoy / config / accesslog / v2 / als . pb . validate . h " <nl> + # include " envoy / config / filter / accesslog / v2 / accesslog . pb . validate . h " <nl> # include " envoy / registry / registry . h " <nl> # include " envoy / server / filter_config . h " <nl> <nl> mmm a / source / server / config / http / BUILD <nl> ppp b / source / server / config / http / BUILD <nl> envoy_cc_library ( <nl> " / / source / common / json : config_schemas_lib " , <nl> " / / source / common / router : router_lib " , <nl> " / / source / common / router : shadow_writer_lib " , <nl> - " @ envoy_api / / envoy / api / v2 / filter / http : router_cc " , <nl> + " @ envoy_api / / envoy / config / filter / http / router / v2 : router_cc " , <nl> ] , <nl> ) <nl> <nl> mmm a / source / server / config / http / buffer . cc <nl> ppp b / source / server / config / http / buffer . cc <nl> <nl> # include < cstdint > <nl> # include < string > <nl> <nl> - # include " envoy / api / v2 / filter / http / buffer . pb . validate . h " <nl> + # include " envoy / config / filter / http / buffer / v2 / buffer . pb . validate . h " <nl> # include " envoy / registry / registry . h " <nl> <nl> # include " common / config / filter_json . h " <nl> namespace Envoy { <nl> namespace Server { <nl> namespace Configuration { <nl> <nl> - HttpFilterFactoryCb <nl> - BufferFilterConfig : : createFilter ( const envoy : : api : : v2 : : filter : : http : : Buffer & proto_config , <nl> - const std : : string & stats_prefix , FactoryContext & context ) { <nl> + HttpFilterFactoryCb BufferFilterConfig : : createFilter ( <nl> + const envoy : : config : : filter : : http : : buffer : : v2 : : Buffer & proto_config , <nl> + const std : : string & stats_prefix , FactoryContext & context ) { <nl> ASSERT ( proto_config . has_max_request_bytes ( ) ) ; <nl> ASSERT ( proto_config . has_max_request_time ( ) ) ; <nl> <nl> BufferFilterConfig : : createFilter ( const envoy : : api : : v2 : : filter : : http : : Buffer & pro <nl> HttpFilterFactoryCb BufferFilterConfig : : createFilterFactory ( const Json : : Object & json_config , <nl> const std : : string & stats_prefix , <nl> FactoryContext & context ) { <nl> - envoy : : api : : v2 : : filter : : http : : Buffer proto_config ; <nl> + envoy : : config : : filter : : http : : buffer : : v2 : : Buffer proto_config ; <nl> Config : : FilterJson : : translateBufferFilter ( json_config , proto_config ) ; <nl> return createFilter ( proto_config , stats_prefix , context ) ; <nl> } <nl> BufferFilterConfig : : createFilterFactoryFromProto ( const Protobuf : : Message & proto_ <nl> const std : : string & stats_prefix , <nl> FactoryContext & context ) { <nl> return createFilter ( <nl> - MessageUtil : : downcastAndValidate < const envoy : : api : : v2 : : filter : : http : : Buffer & > ( proto_config ) , <nl> + MessageUtil : : downcastAndValidate < const envoy : : config : : filter : : http : : buffer : : v2 : : Buffer & > ( <nl> + proto_config ) , <nl> stats_prefix , context ) ; <nl> } <nl> <nl> mmm a / source / server / config / http / buffer . h <nl> ppp b / source / server / config / http / buffer . h <nl> <nl> <nl> # include < string > <nl> <nl> - # include " envoy / api / v2 / filter / http / buffer . pb . h " <nl> + # include " envoy / config / filter / http / buffer / v2 / buffer . pb . h " <nl> # include " envoy / server / filter_config . h " <nl> <nl> # include " common / config / well_known_names . h " <nl> class BufferFilterConfig : public NamedHttpFilterConfigFactory { <nl> FactoryContext & context ) override ; <nl> <nl> ProtobufTypes : : MessagePtr createEmptyConfigProto ( ) override { <nl> - return ProtobufTypes : : MessagePtr { new envoy : : api : : v2 : : filter : : http : : Buffer ( ) } ; <nl> + return ProtobufTypes : : MessagePtr { new envoy : : config : : filter : : http : : buffer : : v2 : : Buffer ( ) } ; <nl> } <nl> <nl> std : : string name ( ) override { return Config : : HttpFilterNames : : get ( ) . BUFFER ; } <nl> <nl> private : <nl> - HttpFilterFactoryCb createFilter ( const envoy : : api : : v2 : : filter : : http : : Buffer & proto_config , <nl> - const std : : string & stats_prefix , FactoryContext & context ) ; <nl> + HttpFilterFactoryCb <nl> + createFilter ( const envoy : : config : : filter : : http : : buffer : : v2 : : Buffer & proto_config , <nl> + const std : : string & stats_prefix , FactoryContext & context ) ; <nl> } ; <nl> <nl> } / / namespace Configuration <nl> mmm a / source / server / config / http / fault . cc <nl> ppp b / source / server / config / http / fault . cc <nl> <nl> # include " server / config / http / fault . h " <nl> <nl> - # include " envoy / api / v2 / filter / http / fault . pb . validate . h " <nl> + # include " envoy / config / filter / http / fault / v2 / fault . pb . validate . h " <nl> # include " envoy / registry / registry . h " <nl> <nl> # include " common / config / filter_json . h " <nl> namespace Server { <nl> namespace Configuration { <nl> <nl> HttpFilterFactoryCb <nl> - FaultFilterConfig : : createFilter ( const envoy : : api : : v2 : : filter : : http : : HTTPFault & config , <nl> + FaultFilterConfig : : createFilter ( const envoy : : config : : filter : : http : : fault : : v2 : : HTTPFault & config , <nl> const std : : string & stats_prefix , FactoryContext & context ) { <nl> Http : : FaultFilterConfigSharedPtr filter_config ( <nl> new Http : : FaultFilterConfig ( config , context . runtime ( ) , stats_prefix , context . scope ( ) ) ) ; <nl> FaultFilterConfig : : createFilter ( const envoy : : api : : v2 : : filter : : http : : HTTPFault & c <nl> HttpFilterFactoryCb FaultFilterConfig : : createFilterFactory ( const Json : : Object & json_config , <nl> const std : : string & stats_prefix , <nl> FactoryContext & context ) { <nl> - envoy : : api : : v2 : : filter : : http : : HTTPFault proto_config ; <nl> + envoy : : config : : filter : : http : : fault : : v2 : : HTTPFault proto_config ; <nl> Config : : FilterJson : : translateFaultFilter ( json_config , proto_config ) ; <nl> return createFilter ( proto_config , stats_prefix , context ) ; <nl> } <nl> FaultFilterConfig : : createFilterFactoryFromProto ( const Protobuf : : Message & proto_c <nl> const std : : string & stats_prefix , <nl> FactoryContext & context ) { <nl> return createFilter ( <nl> - MessageUtil : : downcastAndValidate < const envoy : : api : : v2 : : filter : : http : : HTTPFault & > ( <nl> + MessageUtil : : downcastAndValidate < const envoy : : config : : filter : : http : : fault : : v2 : : HTTPFault & > ( <nl> proto_config ) , <nl> stats_prefix , context ) ; <nl> } <nl> mmm a / source / server / config / http / fault . h <nl> ppp b / source / server / config / http / fault . h <nl> <nl> <nl> # include < string > <nl> <nl> - # include " envoy / api / v2 / filter / http / fault . pb . h " <nl> + # include " envoy / config / filter / http / fault / v2 / fault . pb . h " <nl> # include " envoy / server / filter_config . h " <nl> <nl> # include " common / config / well_known_names . h " <nl> class FaultFilterConfig : public NamedHttpFilterConfigFactory { <nl> FactoryContext & context ) override ; <nl> <nl> ProtobufTypes : : MessagePtr createEmptyConfigProto ( ) override { <nl> - return ProtobufTypes : : MessagePtr { new envoy : : api : : v2 : : filter : : http : : HTTPFault ( ) } ; <nl> + return ProtobufTypes : : MessagePtr { new envoy : : config : : filter : : http : : fault : : v2 : : HTTPFault ( ) } ; <nl> } <nl> <nl> std : : string name ( ) override { return Config : : HttpFilterNames : : get ( ) . FAULT ; } <nl> <nl> private : <nl> - HttpFilterFactoryCb createFilter ( const envoy : : api : : v2 : : filter : : http : : HTTPFault & proto_config , <nl> - const std : : string & stats_prefix , FactoryContext & context ) ; <nl> + HttpFilterFactoryCb <nl> + createFilter ( const envoy : : config : : filter : : http : : fault : : v2 : : HTTPFault & proto_config , <nl> + const std : : string & stats_prefix , FactoryContext & context ) ; <nl> } ; <nl> <nl> } / / namespace Configuration <nl> mmm a / source / server / config / http / grpc_json_transcoder . cc <nl> ppp b / source / server / config / http / grpc_json_transcoder . cc <nl> <nl> # include " server / config / http / grpc_json_transcoder . h " <nl> <nl> - # include " envoy / api / v2 / filter / http / transcoder . pb . validate . h " <nl> + # include " envoy / config / filter / http / transcoder / v2 / transcoder . pb . validate . h " <nl> # include " envoy / registry / registry . h " <nl> <nl> # include " common / config / filter_json . h " <nl> namespace Server { <nl> namespace Configuration { <nl> <nl> HttpFilterFactoryCb GrpcJsonTranscoderFilterConfig : : createFilter ( <nl> - const envoy : : api : : v2 : : filter : : http : : GrpcJsonTranscoder & proto_config , const std : : string & , <nl> - FactoryContext & ) { <nl> + const envoy : : config : : filter : : http : : transcoder : : v2 : : GrpcJsonTranscoder & proto_config , <nl> + const std : : string & , FactoryContext & ) { <nl> ASSERT ( ! proto_config . proto_descriptor ( ) . empty ( ) ) ; <nl> ASSERT ( proto_config . services_size ( ) > 0 ) ; <nl> <nl> HttpFilterFactoryCb GrpcJsonTranscoderFilterConfig : : createFilter ( <nl> <nl> HttpFilterFactoryCb GrpcJsonTranscoderFilterConfig : : createFilterFactory ( <nl> const Json : : Object & json_config , const std : : string & stat_prefix , FactoryContext & context ) { <nl> - envoy : : api : : v2 : : filter : : http : : GrpcJsonTranscoder proto_config ; <nl> + envoy : : config : : filter : : http : : transcoder : : v2 : : GrpcJsonTranscoder proto_config ; <nl> Config : : FilterJson : : translateGrpcJsonTranscoder ( json_config , proto_config ) ; <nl> return createFilter ( proto_config , stat_prefix , context ) ; <nl> } <nl> GrpcJsonTranscoderFilterConfig : : createFilterFactoryFromProto ( const Protobuf : : Mes <nl> const std : : string & stat_prefix , <nl> FactoryContext & context ) { <nl> return createFilter ( <nl> - MessageUtil : : downcastAndValidate < const envoy : : api : : v2 : : filter : : http : : GrpcJsonTranscoder & > ( <nl> - proto_config ) , <nl> + MessageUtil : : downcastAndValidate < <nl> + const envoy : : config : : filter : : http : : transcoder : : v2 : : GrpcJsonTranscoder & > ( proto_config ) , <nl> stat_prefix , context ) ; <nl> } <nl> <nl> mmm a / source / server / config / http / grpc_json_transcoder . h <nl> ppp b / source / server / config / http / grpc_json_transcoder . h <nl> <nl> <nl> # include < string > <nl> <nl> - # include " envoy / api / v2 / filter / http / transcoder . pb . h " <nl> + # include " envoy / config / filter / http / transcoder / v2 / transcoder . pb . h " <nl> # include " envoy / server / instance . h " <nl> <nl> # include " common / config / well_known_names . h " <nl> class GrpcJsonTranscoderFilterConfig : public NamedHttpFilterConfigFactory { <nl> FactoryContext & context ) override ; <nl> <nl> ProtobufTypes : : MessagePtr createEmptyConfigProto ( ) override { <nl> - return ProtobufTypes : : MessagePtr { new envoy : : api : : v2 : : filter : : http : : GrpcJsonTranscoder ( ) } ; <nl> + return ProtobufTypes : : MessagePtr { <nl> + new envoy : : config : : filter : : http : : transcoder : : v2 : : GrpcJsonTranscoder ( ) } ; <nl> } <nl> <nl> std : : string name ( ) override { return Config : : HttpFilterNames : : get ( ) . GRPC_JSON_TRANSCODER ; } ; <nl> <nl> private : <nl> HttpFilterFactoryCb <nl> - createFilter ( const envoy : : api : : v2 : : filter : : http : : GrpcJsonTranscoder & proto_config , <nl> + createFilter ( const envoy : : config : : filter : : http : : transcoder : : v2 : : GrpcJsonTranscoder & proto_config , <nl> const std : : string & stats_prefix , FactoryContext & context ) ; <nl> } ; <nl> <nl> mmm a / source / server / config / http / lua . cc <nl> ppp b / source / server / config / http / lua . cc <nl> <nl> # include " server / config / http / lua . h " <nl> <nl> - # include " envoy / api / v2 / filter / http / lua . pb . validate . h " <nl> + # include " envoy / config / filter / http / lua / v2 / lua . pb . validate . h " <nl> # include " envoy / registry / registry . h " <nl> <nl> # include " common / config / filter_json . h " <nl> namespace Server { <nl> namespace Configuration { <nl> <nl> HttpFilterFactoryCb <nl> - LuaFilterConfig : : createFilter ( const envoy : : api : : v2 : : filter : : http : : Lua & proto_config , <nl> + LuaFilterConfig : : createFilter ( const envoy : : config : : filter : : http : : lua : : v2 : : Lua & proto_config , <nl> const std : : string & , FactoryContext & context ) { <nl> Http : : Filter : : Lua : : FilterConfigConstSharedPtr filter_config ( new Http : : Filter : : Lua : : FilterConfig { <nl> proto_config . inline_code ( ) , context . threadLocal ( ) , context . clusterManager ( ) } ) ; <nl> LuaFilterConfig : : createFilter ( const envoy : : api : : v2 : : filter : : http : : Lua & proto_con <nl> HttpFilterFactoryCb LuaFilterConfig : : createFilterFactory ( const Json : : Object & json_config , <nl> const std : : string & stat_prefix , <nl> FactoryContext & context ) { <nl> - envoy : : api : : v2 : : filter : : http : : Lua proto_config ; <nl> + envoy : : config : : filter : : http : : lua : : v2 : : Lua proto_config ; <nl> Config : : FilterJson : : translateLuaFilter ( json_config , proto_config ) ; <nl> return createFilter ( proto_config , stat_prefix , context ) ; <nl> } <nl> LuaFilterConfig : : createFilterFactoryFromProto ( const Protobuf : : Message & proto_con <nl> const std : : string & stat_prefix , <nl> FactoryContext & context ) { <nl> return createFilter ( <nl> - MessageUtil : : downcastAndValidate < const envoy : : api : : v2 : : filter : : http : : Lua & > ( proto_config ) , <nl> + MessageUtil : : downcastAndValidate < const envoy : : config : : filter : : http : : lua : : v2 : : Lua & > ( <nl> + proto_config ) , <nl> stat_prefix , context ) ; <nl> } <nl> <nl> mmm a / source / server / config / http / lua . h <nl> ppp b / source / server / config / http / lua . h <nl> <nl> <nl> # include < string > <nl> <nl> - # include " envoy / api / v2 / filter / http / lua . pb . h " <nl> + # include " envoy / config / filter / http / lua / v2 / lua . pb . h " <nl> # include " envoy / server / filter_config . h " <nl> <nl> # include " common / config / well_known_names . h " <nl> class LuaFilterConfig : public NamedHttpFilterConfigFactory { <nl> FactoryContext & context ) override ; <nl> <nl> ProtobufTypes : : MessagePtr createEmptyConfigProto ( ) override { <nl> - return ProtobufTypes : : MessagePtr { new envoy : : api : : v2 : : filter : : http : : Lua ( ) } ; <nl> + return ProtobufTypes : : MessagePtr { new envoy : : config : : filter : : http : : lua : : v2 : : Lua ( ) } ; <nl> } <nl> <nl> std : : string name ( ) override { return Config : : HttpFilterNames : : get ( ) . LUA ; } <nl> <nl> private : <nl> - HttpFilterFactoryCb createFilter ( const envoy : : api : : v2 : : filter : : http : : Lua & proto_config , <nl> + HttpFilterFactoryCb createFilter ( const envoy : : config : : filter : : http : : lua : : v2 : : Lua & proto_config , <nl> const std : : string & , FactoryContext & context ) ; <nl> } ; <nl> <nl> mmm a / source / server / config / http / ratelimit . cc <nl> ppp b / source / server / config / http / ratelimit . cc <nl> <nl> # include < chrono > <nl> # include < string > <nl> <nl> - # include " envoy / api / v2 / filter / http / rate_limit . pb . validate . h " <nl> + # include " envoy / config / filter / http / rate_limit / v2 / rate_limit . pb . validate . h " <nl> # include " envoy / registry / registry . h " <nl> <nl> # include " common / config / filter_json . h " <nl> namespace Envoy { <nl> namespace Server { <nl> namespace Configuration { <nl> <nl> - HttpFilterFactoryCb <nl> - RateLimitFilterConfig : : createFilter ( const envoy : : api : : v2 : : filter : : http : : RateLimit & proto_config , <nl> - const std : : string & , FactoryContext & context ) { <nl> + HttpFilterFactoryCb RateLimitFilterConfig : : createFilter ( <nl> + const envoy : : config : : filter : : http : : rate_limit : : v2 : : RateLimit & proto_config , const std : : string & , <nl> + FactoryContext & context ) { <nl> ASSERT ( ! proto_config . domain ( ) . empty ( ) ) ; <nl> Http : : RateLimit : : FilterConfigSharedPtr filter_config ( <nl> new Http : : RateLimit : : FilterConfig ( proto_config , context . localInfo ( ) , context . scope ( ) , <nl> RateLimitFilterConfig : : createFilter ( const envoy : : api : : v2 : : filter : : http : : RateLimi <nl> HttpFilterFactoryCb RateLimitFilterConfig : : createFilterFactory ( const Json : : Object & json_config , <nl> const std : : string & stats_prefix , <nl> FactoryContext & context ) { <nl> - envoy : : api : : v2 : : filter : : http : : RateLimit proto_config ; <nl> + envoy : : config : : filter : : http : : rate_limit : : v2 : : RateLimit proto_config ; <nl> Config : : FilterJson : : translateHttpRateLimitFilter ( json_config , proto_config ) ; <nl> return createFilter ( proto_config , stats_prefix , context ) ; <nl> } <nl> RateLimitFilterConfig : : createFilterFactoryFromProto ( const Protobuf : : Message & pro <nl> const std : : string & stats_prefix , <nl> FactoryContext & context ) { <nl> return createFilter ( <nl> - MessageUtil : : downcastAndValidate < const envoy : : api : : v2 : : filter : : http : : RateLimit & > ( <nl> - proto_config ) , <nl> + MessageUtil : : downcastAndValidate < <nl> + const envoy : : config : : filter : : http : : rate_limit : : v2 : : RateLimit & > ( proto_config ) , <nl> stats_prefix , context ) ; <nl> } <nl> <nl> mmm a / source / server / config / http / ratelimit . h <nl> ppp b / source / server / config / http / ratelimit . h <nl> <nl> <nl> # include < string > <nl> <nl> - # include " envoy / api / v2 / filter / http / rate_limit . pb . h " <nl> + # include " envoy / config / filter / http / rate_limit / v2 / rate_limit . pb . h " <nl> # include " envoy / server / filter_config . h " <nl> <nl> # include " common / config / well_known_names . h " <nl> class RateLimitFilterConfig : public NamedHttpFilterConfigFactory { <nl> FactoryContext & context ) override ; <nl> <nl> ProtobufTypes : : MessagePtr createEmptyConfigProto ( ) override { <nl> - return ProtobufTypes : : MessagePtr { new envoy : : api : : v2 : : filter : : http : : RateLimit ( ) } ; <nl> + return ProtobufTypes : : MessagePtr { new envoy : : config : : filter : : http : : rate_limit : : v2 : : RateLimit ( ) } ; <nl> } <nl> <nl> std : : string name ( ) override { return Config : : HttpFilterNames : : get ( ) . RATE_LIMIT ; } <nl> <nl> private : <nl> - HttpFilterFactoryCb createFilter ( const envoy : : api : : v2 : : filter : : http : : RateLimit & proto_config , <nl> - const std : : string & stats_prefix , FactoryContext & context ) ; <nl> + HttpFilterFactoryCb <nl> + createFilter ( const envoy : : config : : filter : : http : : rate_limit : : v2 : : RateLimit & proto_config , <nl> + const std : : string & stats_prefix , FactoryContext & context ) ; <nl> } ; <nl> <nl> } / / namespace Configuration <nl> mmm a / source / server / config / http / router . cc <nl> ppp b / source / server / config / http / router . cc <nl> <nl> <nl> # include < string > <nl> <nl> - # include " envoy / api / v2 / filter / http / router . pb . validate . h " <nl> + # include " envoy / config / filter / http / router / v2 / router . pb . validate . h " <nl> # include " envoy / registry / registry . h " <nl> <nl> # include " common / config / filter_json . h " <nl> namespace Envoy { <nl> namespace Server { <nl> namespace Configuration { <nl> <nl> - HttpFilterFactoryCb <nl> - RouterFilterConfig : : createFilter ( const envoy : : api : : v2 : : filter : : http : : Router & proto_config , <nl> - const std : : string & stat_prefix , FactoryContext & context ) { <nl> + HttpFilterFactoryCb RouterFilterConfig : : createFilter ( <nl> + const envoy : : config : : filter : : http : : router : : v2 : : Router & proto_config , <nl> + const std : : string & stat_prefix , FactoryContext & context ) { <nl> Router : : FilterConfigSharedPtr filter_config ( new Router : : FilterConfig ( <nl> stat_prefix , context , <nl> Router : : ShadowWriterPtr { new Router : : ShadowWriterImpl ( context . clusterManager ( ) ) } , <nl> RouterFilterConfig : : createFilter ( const envoy : : api : : v2 : : filter : : http : : Router & pro <nl> HttpFilterFactoryCb RouterFilterConfig : : createFilterFactory ( const Json : : Object & json_config , <nl> const std : : string & stat_prefix , <nl> FactoryContext & context ) { <nl> - envoy : : api : : v2 : : filter : : http : : Router proto_config ; <nl> + envoy : : config : : filter : : http : : router : : v2 : : Router proto_config ; <nl> Config : : FilterJson : : translateRouter ( json_config , proto_config ) ; <nl> return createFilter ( proto_config , stat_prefix , context ) ; <nl> } <nl> RouterFilterConfig : : createFilterFactoryFromProto ( const Protobuf : : Message & proto_ <nl> const std : : string & stat_prefix , <nl> FactoryContext & context ) { <nl> return createFilter ( <nl> - MessageUtil : : downcastAndValidate < const envoy : : api : : v2 : : filter : : http : : Router & > ( proto_config ) , <nl> + MessageUtil : : downcastAndValidate < const envoy : : config : : filter : : http : : router : : v2 : : Router & > ( <nl> + proto_config ) , <nl> stat_prefix , context ) ; <nl> } <nl> <nl> mmm a / source / server / config / http / router . h <nl> ppp b / source / server / config / http / router . h <nl> <nl> <nl> # include < string > <nl> <nl> - # include " envoy / api / v2 / filter / http / router . pb . h " <nl> + # include " envoy / config / filter / http / router / v2 / router . pb . h " <nl> # include " envoy / server / filter_config . h " <nl> <nl> # include " common / config / well_known_names . h " <nl> class RouterFilterConfig : public NamedHttpFilterConfigFactory { <nl> FactoryContext & context ) override ; <nl> <nl> ProtobufTypes : : MessagePtr createEmptyConfigProto ( ) override { <nl> - return ProtobufTypes : : MessagePtr { new envoy : : api : : v2 : : filter : : http : : Router ( ) } ; <nl> + return ProtobufTypes : : MessagePtr { new envoy : : config : : filter : : http : : router : : v2 : : Router ( ) } ; <nl> } <nl> <nl> std : : string name ( ) override { return Config : : HttpFilterNames : : get ( ) . ROUTER ; } <nl> <nl> private : <nl> - HttpFilterFactoryCb createFilter ( const envoy : : api : : v2 : : filter : : http : : Router & proto_config , <nl> - const std : : string & stat_prefix , FactoryContext & context ) ; <nl> + HttpFilterFactoryCb <nl> + createFilter ( const envoy : : config : : filter : : http : : router : : v2 : : Router & proto_config , <nl> + const std : : string & stat_prefix , FactoryContext & context ) ; <nl> } ; <nl> <nl> } / / namespace Configuration <nl> mmm a / source / server / config / http / squash . cc <nl> ppp b / source / server / config / http / squash . cc <nl> <nl> <nl> # include < string > <nl> <nl> - # include " envoy / api / v2 / filter / http / squash . pb . validate . h " <nl> + # include " envoy / config / filter / http / squash / v2 / squash . pb . validate . h " <nl> # include " envoy / registry / registry . h " <nl> <nl> # include " common / config / filter_json . h " <nl> namespace Configuration { <nl> HttpFilterFactoryCb SquashFilterConfig : : createFilterFactory ( const Envoy : : Json : : Object & json_config , <nl> const std : : string & , <nl> FactoryContext & context ) { <nl> - envoy : : api : : v2 : : filter : : http : : Squash proto_config ; <nl> + envoy : : config : : filter : : http : : squash : : v2 : : Squash proto_config ; <nl> Config : : FilterJson : : translateSquashConfig ( json_config , proto_config ) ; <nl> <nl> return createFilter ( proto_config , context ) ; <nl> HttpFilterFactoryCb SquashFilterConfig : : createFilterFactory ( const Envoy : : Json : : O <nl> HttpFilterFactoryCb <nl> SquashFilterConfig : : createFilterFactoryFromProto ( const Envoy : : Protobuf : : Message & proto_config , <nl> const std : : string & , FactoryContext & context ) { <nl> - return createFilter ( <nl> - Envoy : : MessageUtil : : downcastAndValidate < const envoy : : api : : v2 : : filter : : http : : Squash & > ( <nl> - proto_config ) , <nl> - context ) ; <nl> + return createFilter ( Envoy : : MessageUtil : : downcastAndValidate < <nl> + const envoy : : config : : filter : : http : : squash : : v2 : : Squash & > ( proto_config ) , <nl> + context ) ; <nl> } <nl> <nl> - HttpFilterFactoryCb <nl> - SquashFilterConfig : : createFilter ( const envoy : : api : : v2 : : filter : : http : : Squash & proto_config , <nl> - FactoryContext & context ) { <nl> + HttpFilterFactoryCb SquashFilterConfig : : createFilter ( <nl> + const envoy : : config : : filter : : http : : squash : : v2 : : Squash & proto_config , FactoryContext & context ) { <nl> <nl> Http : : SquashFilterConfigSharedPtr config = std : : make_shared < Http : : SquashFilterConfig > ( <nl> Http : : SquashFilterConfig ( proto_config , context . clusterManager ( ) ) ) ; <nl> mmm a / source / server / config / http / squash . h <nl> ppp b / source / server / config / http / squash . h <nl> <nl> # include < regex > <nl> # include < string > <nl> <nl> - # include " envoy / api / v2 / filter / http / squash . pb . h " <nl> + # include " envoy / config / filter / http / squash / v2 / squash . pb . h " <nl> # include " envoy / server / filter_config . h " <nl> <nl> # include " common / config / well_known_names . h " <nl> class SquashFilterConfig : public NamedHttpFilterConfigFactory { <nl> FactoryContext & context ) override ; <nl> <nl> ProtobufTypes : : MessagePtr createEmptyConfigProto ( ) override { <nl> - return ProtobufTypes : : MessagePtr { new envoy : : api : : v2 : : filter : : http : : Squash ( ) } ; <nl> + return ProtobufTypes : : MessagePtr { new envoy : : config : : filter : : http : : squash : : v2 : : Squash ( ) } ; <nl> } <nl> <nl> std : : string name ( ) override { return Config : : HttpFilterNames : : get ( ) . SQUASH ; } <nl> <nl> private : <nl> - HttpFilterFactoryCb createFilter ( const envoy : : api : : v2 : : filter : : http : : Squash & proto_config , <nl> - FactoryContext & context ) ; <nl> + HttpFilterFactoryCb <nl> + createFilter ( const envoy : : config : : filter : : http : : squash : : v2 : : Squash & proto_config , <nl> + FactoryContext & context ) ; <nl> } ; <nl> <nl> } / / namespace Configuration <nl> mmm a / source / server / config / network / BUILD <nl> ppp b / source / server / config / network / BUILD <nl> envoy_cc_library ( <nl> " / / source / common / config : filter_json_lib " , <nl> " / / source / common / config : well_known_names " , <nl> " / / source / common / filter : tcp_proxy_lib " , <nl> - " @ envoy_api / / envoy / api / v2 / filter / network : tcp_proxy_cc " , <nl> + " @ envoy_api / / envoy / config / filter / network / tcp_proxy / v2 : tcp_proxy_cc " , <nl> ] , <nl> ) <nl> <nl> mmm a / source / server / config / network / client_ssl_auth . cc <nl> ppp b / source / server / config / network / client_ssl_auth . cc <nl> <nl> <nl> # include < string > <nl> <nl> - # include " envoy / api / v2 / filter / network / client_ssl_auth . pb . validate . h " <nl> + # include " envoy / config / filter / network / client_ssl_auth / v2 / client_ssl_auth . pb . validate . h " <nl> # include " envoy / network / connection . h " <nl> # include " envoy / registry / registry . h " <nl> <nl> namespace Server { <nl> namespace Configuration { <nl> <nl> NetworkFilterFactoryCb ClientSslAuthConfigFactory : : createFilter ( <nl> - const envoy : : api : : v2 : : filter : : network : : ClientSSLAuth & proto_config , FactoryContext & context ) { <nl> + const envoy : : config : : filter : : network : : client_ssl_auth : : v2 : : ClientSSLAuth & proto_config , <nl> + FactoryContext & context ) { <nl> ASSERT ( ! proto_config . auth_api_cluster ( ) . empty ( ) ) ; <nl> ASSERT ( ! proto_config . stat_prefix ( ) . empty ( ) ) ; <nl> <nl> NetworkFilterFactoryCb ClientSslAuthConfigFactory : : createFilter ( <nl> NetworkFilterFactoryCb <nl> ClientSslAuthConfigFactory : : createFilterFactory ( const Json : : Object & json_config , <nl> FactoryContext & context ) { <nl> - envoy : : api : : v2 : : filter : : network : : ClientSSLAuth proto_config ; <nl> + envoy : : config : : filter : : network : : client_ssl_auth : : v2 : : ClientSSLAuth proto_config ; <nl> Config : : FilterJson : : translateClientSslAuthFilter ( json_config , proto_config ) ; <nl> return createFilter ( proto_config , context ) ; <nl> } <nl> NetworkFilterFactoryCb <nl> ClientSslAuthConfigFactory : : createFilterFactoryFromProto ( const Protobuf : : Message & proto_config , <nl> FactoryContext & context ) { <nl> return createFilter ( <nl> - MessageUtil : : downcastAndValidate < const envoy : : api : : v2 : : filter : : network : : ClientSSLAuth & > ( <nl> - proto_config ) , <nl> + MessageUtil : : downcastAndValidate < <nl> + const envoy : : config : : filter : : network : : client_ssl_auth : : v2 : : ClientSSLAuth & > ( proto_config ) , <nl> context ) ; <nl> } <nl> <nl> mmm a / source / server / config / network / client_ssl_auth . h <nl> ppp b / source / server / config / network / client_ssl_auth . h <nl> <nl> <nl> # include < string > <nl> <nl> - # include " envoy / api / v2 / filter / network / client_ssl_auth . pb . h " <nl> + # include " envoy / config / filter / network / client_ssl_auth / v2 / client_ssl_auth . pb . h " <nl> # include " envoy / server / filter_config . h " <nl> <nl> # include " common / config / well_known_names . h " <nl> class ClientSslAuthConfigFactory : public NamedNetworkFilterConfigFactory { <nl> FactoryContext & context ) override ; <nl> <nl> ProtobufTypes : : MessagePtr createEmptyConfigProto ( ) override { <nl> - return ProtobufTypes : : MessagePtr { new envoy : : api : : v2 : : filter : : network : : ClientSSLAuth ( ) } ; <nl> + return ProtobufTypes : : MessagePtr { <nl> + new envoy : : config : : filter : : network : : client_ssl_auth : : v2 : : ClientSSLAuth ( ) } ; <nl> } <nl> <nl> std : : string name ( ) override { return Config : : NetworkFilterNames : : get ( ) . CLIENT_SSL_AUTH ; } <nl> <nl> private : <nl> - NetworkFilterFactoryCb <nl> - createFilter ( const envoy : : api : : v2 : : filter : : network : : ClientSSLAuth & proto_config , <nl> - FactoryContext & context ) ; <nl> + NetworkFilterFactoryCb createFilter ( <nl> + const envoy : : config : : filter : : network : : client_ssl_auth : : v2 : : ClientSSLAuth & proto_config , <nl> + FactoryContext & context ) ; <nl> } ; <nl> <nl> } / / namespace Configuration <nl> mmm a / source / server / config / network / http_connection_manager . cc <nl> ppp b / source / server / config / network / http_connection_manager . cc <nl> <nl> # include < string > <nl> # include < vector > <nl> <nl> - # include " envoy / api / v2 / filter / network / http_connection_manager . pb . validate . h " <nl> + # include " envoy / config / filter / network / http_connection_manager / v2 / http_connection_manager . pb . validate . h " <nl> # include " envoy / filesystem / filesystem . h " <nl> # include " envoy / network / connection . h " <nl> # include " envoy / registry / registry . h " <nl> SINGLETON_MANAGER_REGISTRATION ( date_provider ) ; <nl> SINGLETON_MANAGER_REGISTRATION ( route_config_provider_manager ) ; <nl> <nl> NetworkFilterFactoryCb HttpConnectionManagerFilterConfigFactory : : createFilter ( <nl> - const envoy : : api : : v2 : : filter : : network : : HttpConnectionManager & proto_config , <nl> + const envoy : : config : : filter : : network : : http_connection_manager : : v2 : : HttpConnectionManager & <nl> + proto_config , <nl> FactoryContext & context ) { <nl> std : : shared_ptr < Http : : TlsCachingDateProviderImpl > date_provider = <nl> context . singletonManager ( ) . getTyped < Http : : TlsCachingDateProviderImpl > ( <nl> NetworkFilterFactoryCb HttpConnectionManagerFilterConfigFactory : : createFilter ( <nl> NetworkFilterFactoryCb <nl> HttpConnectionManagerFilterConfigFactory : : createFilterFactory ( const Json : : Object & json_config , <nl> FactoryContext & context ) { <nl> - envoy : : api : : v2 : : filter : : network : : HttpConnectionManager proto_config ; <nl> + envoy : : config : : filter : : network : : http_connection_manager : : v2 : : HttpConnectionManager proto_config ; <nl> Config : : FilterJson : : translateHttpConnectionManager ( json_config , proto_config ) ; <nl> return createFilter ( proto_config , context ) ; <nl> } <nl> HttpConnectionManagerFilterConfigFactory : : createFilterFactory ( const Json : : Object <nl> NetworkFilterFactoryCb HttpConnectionManagerFilterConfigFactory : : createFilterFactoryFromProto ( <nl> const Protobuf : : Message & proto_config , FactoryContext & context ) { <nl> return createFilter ( <nl> - MessageUtil : : downcastAndValidate < <nl> - const envoy : : api : : v2 : : filter : : network : : HttpConnectionManager & > ( proto_config ) , <nl> + MessageUtil : : downcastAndValidate < const envoy : : config : : filter : : network : : <nl> + http_connection_manager : : v2 : : HttpConnectionManager & > ( <nl> + proto_config ) , <nl> context ) ; <nl> } <nl> <nl> HttpConnectionManagerConfigUtility : : determineNextProtocol ( Network : : Connection & c <nl> } <nl> <nl> HttpConnectionManagerConfig : : HttpConnectionManagerConfig ( <nl> - const envoy : : api : : v2 : : filter : : network : : HttpConnectionManager & config , FactoryContext & context , <nl> - Http : : DateProvider & date_provider , <nl> + const envoy : : config : : filter : : network : : http_connection_manager : : v2 : : HttpConnectionManager & <nl> + config , <nl> + FactoryContext & context , Http : : DateProvider & date_provider , <nl> Router : : RouteConfigProviderManager & route_config_provider_manager ) <nl> : context_ ( context ) , stats_prefix_ ( fmt : : format ( " http . { } . " , config . stat_prefix ( ) ) ) , <nl> stats_ ( Http : : ConnectionManagerImpl : : generateStats ( stats_prefix_ , context_ . scope ( ) ) ) , <nl> HttpConnectionManagerConfig : : HttpConnectionManagerConfig ( <nl> context_ . initManager ( ) , route_config_provider_manager_ ) ; <nl> <nl> switch ( config . forward_client_cert_details ( ) ) { <nl> - case envoy : : api : : v2 : : filter : : network : : HttpConnectionManager : : SANITIZE : <nl> + case envoy : : config : : filter : : network : : http_connection_manager : : v2 : : HttpConnectionManager : : SANITIZE : <nl> forward_client_cert_ = Http : : ForwardClientCertType : : Sanitize ; <nl> break ; <nl> - case envoy : : api : : v2 : : filter : : network : : HttpConnectionManager : : FORWARD_ONLY : <nl> + case envoy : : config : : filter : : network : : http_connection_manager : : v2 : : HttpConnectionManager : : <nl> + FORWARD_ONLY : <nl> forward_client_cert_ = Http : : ForwardClientCertType : : ForwardOnly ; <nl> break ; <nl> - case envoy : : api : : v2 : : filter : : network : : HttpConnectionManager : : APPEND_FORWARD : <nl> + case envoy : : config : : filter : : network : : http_connection_manager : : v2 : : HttpConnectionManager : : <nl> + APPEND_FORWARD : <nl> forward_client_cert_ = Http : : ForwardClientCertType : : AppendForward ; <nl> break ; <nl> - case envoy : : api : : v2 : : filter : : network : : HttpConnectionManager : : SANITIZE_SET : <nl> + case envoy : : config : : filter : : network : : http_connection_manager : : v2 : : HttpConnectionManager : : <nl> + SANITIZE_SET : <nl> forward_client_cert_ = Http : : ForwardClientCertType : : SanitizeSet ; <nl> break ; <nl> - case envoy : : api : : v2 : : filter : : network : : HttpConnectionManager : : ALWAYS_FORWARD_ONLY : <nl> + case envoy : : config : : filter : : network : : http_connection_manager : : v2 : : HttpConnectionManager : : <nl> + ALWAYS_FORWARD_ONLY : <nl> forward_client_cert_ = Http : : ForwardClientCertType : : AlwaysForwardOnly ; <nl> break ; <nl> default : <nl> HttpConnectionManagerConfig : : HttpConnectionManagerConfig ( <nl> std : : vector < Http : : LowerCaseString > request_headers_for_tags ; <nl> <nl> switch ( tracing_config . operation_name ( ) ) { <nl> - case envoy : : api : : v2 : : filter : : network : : HttpConnectionManager : : Tracing : : INGRESS : <nl> + case envoy : : config : : filter : : network : : http_connection_manager : : v2 : : HttpConnectionManager : : <nl> + Tracing : : INGRESS : <nl> tracing_operation_name = Tracing : : OperationName : : Ingress ; <nl> break ; <nl> - case envoy : : api : : v2 : : filter : : network : : HttpConnectionManager : : Tracing : : EGRESS : <nl> + case envoy : : config : : filter : : network : : http_connection_manager : : v2 : : HttpConnectionManager : : <nl> + Tracing : : EGRESS : <nl> tracing_operation_name = Tracing : : OperationName : : Egress ; <nl> break ; <nl> default : <nl> HttpConnectionManagerConfig : : HttpConnectionManagerConfig ( <nl> } <nl> <nl> switch ( config . codec_type ( ) ) { <nl> - case envoy : : api : : v2 : : filter : : network : : HttpConnectionManager : : AUTO : <nl> + case envoy : : config : : filter : : network : : http_connection_manager : : v2 : : HttpConnectionManager : : AUTO : <nl> codec_type_ = CodecType : : AUTO ; <nl> break ; <nl> - case envoy : : api : : v2 : : filter : : network : : HttpConnectionManager : : HTTP1 : <nl> + case envoy : : config : : filter : : network : : http_connection_manager : : v2 : : HttpConnectionManager : : HTTP1 : <nl> codec_type_ = CodecType : : HTTP1 ; <nl> break ; <nl> - case envoy : : api : : v2 : : filter : : network : : HttpConnectionManager : : HTTP2 : <nl> + case envoy : : config : : filter : : network : : http_connection_manager : : v2 : : HttpConnectionManager : : HTTP2 : <nl> codec_type_ = CodecType : : HTTP2 ; <nl> break ; <nl> default : <nl> mmm a / source / server / config / network / http_connection_manager . h <nl> ppp b / source / server / config / network / http_connection_manager . h <nl> class HttpConnectionManagerFilterConfigFactory : Logger : : Loggable < Logger : : Id : : co <nl> FactoryContext & context ) override ; <nl> <nl> ProtobufTypes : : MessagePtr createEmptyConfigProto ( ) override { <nl> - return std : : unique_ptr < envoy : : api : : v2 : : filter : : network : : HttpConnectionManager > ( <nl> - new envoy : : api : : v2 : : filter : : network : : HttpConnectionManager ( ) ) ; <nl> + return std : : unique_ptr < <nl> + envoy : : config : : filter : : network : : http_connection_manager : : v2 : : HttpConnectionManager > ( <nl> + new envoy : : config : : filter : : network : : http_connection_manager : : v2 : : HttpConnectionManager ( ) ) ; <nl> } <nl> std : : string name ( ) override { return Config : : NetworkFilterNames : : get ( ) . HTTP_CONNECTION_MANAGER ; } <nl> <nl> private : <nl> - NetworkFilterFactoryCb <nl> - createFilter ( const envoy : : api : : v2 : : filter : : network : : HttpConnectionManager & proto_config , <nl> - FactoryContext & context ) ; <nl> + NetworkFilterFactoryCb createFilter ( <nl> + const envoy : : config : : filter : : network : : http_connection_manager : : v2 : : HttpConnectionManager & <nl> + proto_config , <nl> + FactoryContext & context ) ; <nl> } ; <nl> <nl> / * * <nl> class HttpConnectionManagerConfig : Logger : : Loggable < Logger : : Id : : config > , <nl> public Http : : FilterChainFactory , <nl> public Http : : ConnectionManagerConfig { <nl> public : <nl> - HttpConnectionManagerConfig ( const envoy : : api : : v2 : : filter : : network : : HttpConnectionManager & config , <nl> - FactoryContext & context , Http : : DateProvider & date_provider , <nl> - Router : : RouteConfigProviderManager & route_config_provider_manager ) ; <nl> + HttpConnectionManagerConfig ( <nl> + const envoy : : config : : filter : : network : : http_connection_manager : : v2 : : HttpConnectionManager & <nl> + config , <nl> + FactoryContext & context , Http : : DateProvider & date_provider , <nl> + Router : : RouteConfigProviderManager & route_config_provider_manager ) ; <nl> <nl> / / Http : : FilterChainFactory <nl> void createFilterChain ( Http : : FilterChainFactoryCallbacks & callbacks ) override ; <nl> mmm a / source / server / config / network / mongo_proxy . cc <nl> ppp b / source / server / config / network / mongo_proxy . cc <nl> <nl> <nl> # include < string > <nl> <nl> - # include " envoy / api / v2 / filter / network / mongo_proxy . pb . validate . h " <nl> + # include " envoy / config / filter / network / mongo_proxy / v2 / mongo_proxy . pb . validate . h " <nl> # include " envoy / network / connection . h " <nl> # include " envoy / registry / registry . h " <nl> <nl> namespace Server { <nl> namespace Configuration { <nl> <nl> NetworkFilterFactoryCb MongoProxyFilterConfigFactory : : createFilter ( <nl> - const envoy : : api : : v2 : : filter : : network : : MongoProxy & proto_config , FactoryContext & context ) { <nl> + const envoy : : config : : filter : : network : : mongo_proxy : : v2 : : MongoProxy & proto_config , <nl> + FactoryContext & context ) { <nl> <nl> ASSERT ( ! proto_config . stat_prefix ( ) . empty ( ) ) ; <nl> <nl> NetworkFilterFactoryCb MongoProxyFilterConfigFactory : : createFilter ( <nl> NetworkFilterFactoryCb <nl> MongoProxyFilterConfigFactory : : createFilterFactory ( const Json : : Object & json_config , <nl> FactoryContext & context ) { <nl> - envoy : : api : : v2 : : filter : : network : : MongoProxy proto_config ; <nl> + envoy : : config : : filter : : network : : mongo_proxy : : v2 : : MongoProxy proto_config ; <nl> Config : : FilterJson : : translateMongoProxy ( json_config , proto_config ) ; <nl> return createFilter ( proto_config , context ) ; <nl> } <nl> NetworkFilterFactoryCb <nl> MongoProxyFilterConfigFactory : : createFilterFactoryFromProto ( const Protobuf : : Message & proto_config , <nl> FactoryContext & context ) { <nl> return createFilter ( <nl> - MessageUtil : : downcastAndValidate < const envoy : : api : : v2 : : filter : : network : : MongoProxy & > ( <nl> - proto_config ) , <nl> + MessageUtil : : downcastAndValidate < <nl> + const envoy : : config : : filter : : network : : mongo_proxy : : v2 : : MongoProxy & > ( proto_config ) , <nl> context ) ; <nl> } <nl> <nl> mmm a / source / server / config / network / mongo_proxy . h <nl> ppp b / source / server / config / network / mongo_proxy . h <nl> <nl> <nl> # include < string > <nl> <nl> - # include " envoy / api / v2 / filter / network / mongo_proxy . pb . h " <nl> + # include " envoy / config / filter / network / mongo_proxy / v2 / mongo_proxy . pb . h " <nl> # include " envoy / server / filter_config . h " <nl> <nl> # include " common / config / well_known_names . h " <nl> class MongoProxyFilterConfigFactory : public NamedNetworkFilterConfigFactory { <nl> FactoryContext & context ) override ; <nl> <nl> ProtobufTypes : : MessagePtr createEmptyConfigProto ( ) override { <nl> - return ProtobufTypes : : MessagePtr { new envoy : : api : : v2 : : filter : : network : : MongoProxy ( ) } ; <nl> + return ProtobufTypes : : MessagePtr { <nl> + new envoy : : config : : filter : : network : : mongo_proxy : : v2 : : MongoProxy ( ) } ; <nl> } <nl> <nl> std : : string name ( ) override { return Config : : NetworkFilterNames : : get ( ) . MONGO_PROXY ; } <nl> <nl> private : <nl> NetworkFilterFactoryCb <nl> - createFilter ( const envoy : : api : : v2 : : filter : : network : : MongoProxy & proto_config , <nl> + createFilter ( const envoy : : config : : filter : : network : : mongo_proxy : : v2 : : MongoProxy & proto_config , <nl> FactoryContext & context ) ; <nl> } ; <nl> <nl> mmm a / source / server / config / network / ratelimit . cc <nl> ppp b / source / server / config / network / ratelimit . cc <nl> <nl> # include < chrono > <nl> # include < string > <nl> <nl> - # include " envoy / api / v2 / filter / network / rate_limit . pb . validate . h " <nl> + # include " envoy / config / filter / network / rate_limit / v2 / rate_limit . pb . validate . h " <nl> # include " envoy / network / connection . h " <nl> # include " envoy / registry / registry . h " <nl> <nl> namespace Envoy { <nl> namespace Server { <nl> namespace Configuration { <nl> <nl> - NetworkFilterFactoryCb <nl> - RateLimitConfigFactory : : createFilter ( const envoy : : api : : v2 : : filter : : network : : RateLimit & proto_config , <nl> - FactoryContext & context ) { <nl> + NetworkFilterFactoryCb RateLimitConfigFactory : : createFilter ( <nl> + const envoy : : config : : filter : : network : : rate_limit : : v2 : : RateLimit & proto_config , <nl> + FactoryContext & context ) { <nl> <nl> ASSERT ( ! proto_config . stat_prefix ( ) . empty ( ) ) ; <nl> ASSERT ( ! proto_config . domain ( ) . empty ( ) ) ; <nl> RateLimitConfigFactory : : createFilter ( const envoy : : api : : v2 : : filter : : network : : Rate <nl> <nl> NetworkFilterFactoryCb RateLimitConfigFactory : : createFilterFactory ( const Json : : Object & json_config , <nl> FactoryContext & context ) { <nl> - envoy : : api : : v2 : : filter : : network : : RateLimit proto_config ; <nl> + envoy : : config : : filter : : network : : rate_limit : : v2 : : RateLimit proto_config ; <nl> Config : : FilterJson : : translateTcpRateLimitFilter ( json_config , proto_config ) ; <nl> return createFilter ( proto_config , context ) ; <nl> } <nl> NetworkFilterFactoryCb <nl> RateLimitConfigFactory : : createFilterFactoryFromProto ( const Protobuf : : Message & proto_config , <nl> FactoryContext & context ) { <nl> return createFilter ( <nl> - MessageUtil : : downcastAndValidate < const envoy : : api : : v2 : : filter : : network : : RateLimit & > ( <nl> - proto_config ) , <nl> + MessageUtil : : downcastAndValidate < <nl> + const envoy : : config : : filter : : network : : rate_limit : : v2 : : RateLimit & > ( proto_config ) , <nl> context ) ; <nl> } <nl> <nl> mmm a / source / server / config / network / ratelimit . h <nl> ppp b / source / server / config / network / ratelimit . h <nl> <nl> <nl> # include < string > <nl> <nl> - # include " envoy / api / v2 / filter / network / rate_limit . pb . h " <nl> + # include " envoy / config / filter / network / rate_limit / v2 / rate_limit . pb . h " <nl> # include " envoy / server / filter_config . h " <nl> <nl> # include " common / config / well_known_names . h " <nl> class RateLimitConfigFactory : public NamedNetworkFilterConfigFactory { <nl> FactoryContext & context ) override ; <nl> <nl> ProtobufTypes : : MessagePtr createEmptyConfigProto ( ) override { <nl> - return ProtobufTypes : : MessagePtr { new envoy : : api : : v2 : : filter : : network : : RateLimit ( ) } ; <nl> + return ProtobufTypes : : MessagePtr { <nl> + new envoy : : config : : filter : : network : : rate_limit : : v2 : : RateLimit ( ) } ; <nl> } <nl> <nl> std : : string name ( ) override { return Config : : NetworkFilterNames : : get ( ) . RATE_LIMIT ; } <nl> <nl> private : <nl> NetworkFilterFactoryCb <nl> - createFilter ( const envoy : : api : : v2 : : filter : : network : : RateLimit & proto_config , <nl> + createFilter ( const envoy : : config : : filter : : network : : rate_limit : : v2 : : RateLimit & proto_config , <nl> FactoryContext & context ) ; <nl> } ; <nl> <nl> mmm a / source / server / config / network / redis_proxy . cc <nl> ppp b / source / server / config / network / redis_proxy . cc <nl> <nl> # include < memory > <nl> # include < string > <nl> <nl> - # include " envoy / api / v2 / filter / network / redis_proxy . pb . validate . h " <nl> + # include " envoy / config / filter / network / redis_proxy / v2 / redis_proxy . pb . validate . h " <nl> # include " envoy / registry / registry . h " <nl> <nl> # include " common / config / filter_json . h " <nl> namespace Server { <nl> namespace Configuration { <nl> <nl> NetworkFilterFactoryCb RedisProxyFilterConfigFactory : : createFilter ( <nl> - const envoy : : api : : v2 : : filter : : network : : RedisProxy & proto_config , FactoryContext & context ) { <nl> + const envoy : : config : : filter : : network : : redis_proxy : : v2 : : RedisProxy & proto_config , <nl> + FactoryContext & context ) { <nl> <nl> ASSERT ( ! proto_config . stat_prefix ( ) . empty ( ) ) ; <nl> ASSERT ( ! proto_config . cluster ( ) . empty ( ) ) ; <nl> NetworkFilterFactoryCb RedisProxyFilterConfigFactory : : createFilter ( <nl> NetworkFilterFactoryCb <nl> RedisProxyFilterConfigFactory : : createFilterFactory ( const Json : : Object & json_config , <nl> FactoryContext & context ) { <nl> - envoy : : api : : v2 : : filter : : network : : RedisProxy proto_config ; <nl> + envoy : : config : : filter : : network : : redis_proxy : : v2 : : RedisProxy proto_config ; <nl> Config : : FilterJson : : translateRedisProxy ( json_config , proto_config ) ; <nl> return createFilter ( proto_config , context ) ; <nl> } <nl> NetworkFilterFactoryCb <nl> RedisProxyFilterConfigFactory : : createFilterFactoryFromProto ( const Protobuf : : Message & proto_config , <nl> FactoryContext & context ) { <nl> return createFilter ( <nl> - MessageUtil : : downcastAndValidate < const envoy : : api : : v2 : : filter : : network : : RedisProxy & > ( <nl> - proto_config ) , <nl> + MessageUtil : : downcastAndValidate < <nl> + const envoy : : config : : filter : : network : : redis_proxy : : v2 : : RedisProxy & > ( proto_config ) , <nl> context ) ; <nl> } <nl> <nl> mmm a / source / server / config / network / redis_proxy . h <nl> ppp b / source / server / config / network / redis_proxy . h <nl> <nl> <nl> # include < string > <nl> <nl> - # include " envoy / api / v2 / filter / network / redis_proxy . pb . h " <nl> + # include " envoy / config / filter / network / redis_proxy / v2 / redis_proxy . pb . h " <nl> # include " envoy / server / filter_config . h " <nl> <nl> # include " common / config / well_known_names . h " <nl> class RedisProxyFilterConfigFactory : public NamedNetworkFilterConfigFactory { <nl> FactoryContext & context ) override ; <nl> <nl> ProtobufTypes : : MessagePtr createEmptyConfigProto ( ) override { <nl> - return ProtobufTypes : : MessagePtr { new envoy : : api : : v2 : : filter : : network : : RedisProxy ( ) } ; <nl> + return ProtobufTypes : : MessagePtr { <nl> + new envoy : : config : : filter : : network : : redis_proxy : : v2 : : RedisProxy ( ) } ; <nl> } <nl> <nl> std : : string name ( ) override { return Config : : NetworkFilterNames : : get ( ) . REDIS_PROXY ; } <nl> <nl> private : <nl> NetworkFilterFactoryCb <nl> - createFilter ( const envoy : : api : : v2 : : filter : : network : : RedisProxy & proto_config , <nl> + createFilter ( const envoy : : config : : filter : : network : : redis_proxy : : v2 : : RedisProxy & proto_config , <nl> FactoryContext & context ) ; <nl> } ; <nl> <nl> mmm a / source / server / config / network / tcp_proxy . cc <nl> ppp b / source / server / config / network / tcp_proxy . cc <nl> <nl> <nl> # include < string > <nl> <nl> - # include " envoy / api / v2 / filter / network / tcp_proxy . pb . validate . h " <nl> + # include " envoy / config / filter / network / tcp_proxy / v2 / tcp_proxy . pb . validate . h " <nl> # include " envoy / network / connection . h " <nl> # include " envoy / registry / registry . h " <nl> <nl> namespace Envoy { <nl> namespace Server { <nl> namespace Configuration { <nl> <nl> - NetworkFilterFactoryCb <nl> - TcpProxyConfigFactory : : createFilter ( const envoy : : api : : v2 : : filter : : network : : TcpProxy & proto_config , <nl> - FactoryContext & context ) { <nl> + NetworkFilterFactoryCb TcpProxyConfigFactory : : createFilter ( <nl> + const envoy : : config : : filter : : network : : tcp_proxy : : v2 : : TcpProxy & proto_config , <nl> + FactoryContext & context ) { <nl> ASSERT ( ! proto_config . stat_prefix ( ) . empty ( ) ) ; <nl> if ( proto_config . has_deprecated_v1 ( ) ) { <nl> ASSERT ( proto_config . deprecated_v1 ( ) . routes_size ( ) > 0 ) ; <nl> TcpProxyConfigFactory : : createFilter ( const envoy : : api : : v2 : : filter : : network : : TcpPr <nl> <nl> NetworkFilterFactoryCb TcpProxyConfigFactory : : createFilterFactory ( const Json : : Object & json_config , <nl> FactoryContext & context ) { <nl> - envoy : : api : : v2 : : filter : : network : : TcpProxy proto_config ; <nl> + envoy : : config : : filter : : network : : tcp_proxy : : v2 : : TcpProxy proto_config ; <nl> Config : : FilterJson : : translateTcpProxy ( json_config , proto_config ) ; <nl> return createFilter ( proto_config , context ) ; <nl> } <nl> NetworkFilterFactoryCb <nl> TcpProxyConfigFactory : : createFilterFactoryFromProto ( const Protobuf : : Message & proto_config , <nl> FactoryContext & context ) { <nl> return createFilter ( <nl> - MessageUtil : : downcastAndValidate < const envoy : : api : : v2 : : filter : : network : : TcpProxy & > ( <nl> - proto_config ) , <nl> + MessageUtil : : downcastAndValidate < <nl> + const envoy : : config : : filter : : network : : tcp_proxy : : v2 : : TcpProxy & > ( proto_config ) , <nl> context ) ; <nl> } <nl> <nl> mmm a / source / server / config / network / tcp_proxy . h <nl> ppp b / source / server / config / network / tcp_proxy . h <nl> <nl> # pragma once <nl> <nl> - # include " envoy / api / v2 / filter / network / tcp_proxy . pb . h " <nl> + # include " envoy / config / filter / network / tcp_proxy / v2 / tcp_proxy . pb . h " <nl> # include " envoy / server / filter_config . h " <nl> <nl> # include " common / config / well_known_names . h " <nl> class TcpProxyConfigFactory : public NamedNetworkFilterConfigFactory { <nl> FactoryContext & context ) override ; <nl> <nl> ProtobufTypes : : MessagePtr createEmptyConfigProto ( ) override { <nl> - return std : : unique_ptr < envoy : : api : : v2 : : filter : : network : : TcpProxy > ( <nl> - new envoy : : api : : v2 : : filter : : network : : TcpProxy ( ) ) ; <nl> + return std : : unique_ptr < envoy : : config : : filter : : network : : tcp_proxy : : v2 : : TcpProxy > ( <nl> + new envoy : : config : : filter : : network : : tcp_proxy : : v2 : : TcpProxy ( ) ) ; <nl> } <nl> <nl> std : : string name ( ) override { return Config : : NetworkFilterNames : : get ( ) . TCP_PROXY ; } <nl> <nl> private : <nl> - NetworkFilterFactoryCb createFilter ( const envoy : : api : : v2 : : filter : : network : : TcpProxy & proto_config , <nl> - FactoryContext & context ) ; <nl> + NetworkFilterFactoryCb <nl> + createFilter ( const envoy : : config : : filter : : network : : tcp_proxy : : v2 : : TcpProxy & proto_config , <nl> + FactoryContext & context ) ; <nl> } ; <nl> <nl> } / / namespace Configuration <nl> mmm a / source / server / config_validation / cluster_manager . cc <nl> ppp b / source / server / config_validation / cluster_manager . cc <nl> ClusterManagerPtr ValidationClusterManagerFactory : : clusterManagerFromProto ( <nl> bootstrap , * this , stats , tls , runtime , random , local_info , log_manager , primary_dispatcher_ ) } ; <nl> } <nl> <nl> - CdsApiPtr <nl> - ValidationClusterManagerFactory : : createCds ( const envoy : : api : : v2 : : ConfigSource & cds_config , <nl> - const Optional < envoy : : api : : v2 : : ConfigSource > & eds_config , <nl> - ClusterManager & cm ) { <nl> + CdsApiPtr ValidationClusterManagerFactory : : createCds ( <nl> + const envoy : : api : : v2 : : core : : ConfigSource & cds_config , <nl> + const Optional < envoy : : api : : v2 : : core : : ConfigSource > & eds_config , ClusterManager & cm ) { <nl> / / Create the CdsApiImpl . . . <nl> ProdClusterManagerFactory : : createCds ( cds_config , eds_config , cm ) ; <nl> / / . . . and then throw it away , so that we don ' t actually connect to it . <nl> mmm a / source / server / config_validation / cluster_manager . h <nl> ppp b / source / server / config_validation / cluster_manager . h <nl> class ValidationClusterManagerFactory : public ProdClusterManagerFactory { <nl> <nl> / / Delegates to ProdClusterManagerFactory : : createCds , but discards the result and returns nullptr <nl> / / unconditionally . <nl> - CdsApiPtr createCds ( const envoy : : api : : v2 : : ConfigSource & cds_config , <nl> - const Optional < envoy : : api : : v2 : : ConfigSource > & eds_config , <nl> + CdsApiPtr createCds ( const envoy : : api : : v2 : : core : : ConfigSource & cds_config , <nl> + const Optional < envoy : : api : : v2 : : core : : ConfigSource > & eds_config , <nl> ClusterManager & cm ) override ; <nl> } ; <nl> <nl> mmm a / source / server / http / BUILD <nl> ppp b / source / server / http / BUILD <nl> envoy_cc_library ( <nl> " / / source / common / http : utility_lib " , <nl> " / / source / common / protobuf : utility_lib " , <nl> " / / source / server / config / network : http_connection_manager_lib " , <nl> - " @ envoy_api / / envoy / api / v2 / filter / http : health_check_cc " , <nl> + " @ envoy_api / / envoy / config / filter / http / health_check / v2 : health_check_cc " , <nl> ] , <nl> ) <nl> mmm a / source / server / http / health_check . cc <nl> ppp b / source / server / http / health_check . cc <nl> namespace Envoy { <nl> namespace Server { <nl> namespace Configuration { <nl> <nl> - HttpFilterFactoryCb <nl> - HealthCheckFilterConfig : : createFilter ( const envoy : : api : : v2 : : filter : : http : : HealthCheck & proto_config , <nl> - const std : : string & , FactoryContext & context ) { <nl> + HttpFilterFactoryCb HealthCheckFilterConfig : : createFilter ( <nl> + const envoy : : config : : filter : : http : : health_check : : v2 : : HealthCheck & proto_config , <nl> + const std : : string & , FactoryContext & context ) { <nl> ASSERT ( proto_config . has_pass_through_mode ( ) ) ; <nl> ASSERT ( ! proto_config . endpoint ( ) . empty ( ) ) ; <nl> <nl> HealthCheckFilterConfig : : createFilter ( const envoy : : api : : v2 : : filter : : http : : Health <nl> HttpFilterFactoryCb HealthCheckFilterConfig : : createFilterFactory ( const Json : : Object & json_config , <nl> const std : : string & stats_prefix , <nl> FactoryContext & context ) { <nl> - envoy : : api : : v2 : : filter : : http : : HealthCheck proto_config ; <nl> + envoy : : config : : filter : : http : : health_check : : v2 : : HealthCheck proto_config ; <nl> Config : : FilterJson : : translateHealthCheckFilter ( json_config , proto_config ) ; <nl> return createFilter ( proto_config , stats_prefix , context ) ; <nl> } <nl> HttpFilterFactoryCb <nl> HealthCheckFilterConfig : : createFilterFactoryFromProto ( const Protobuf : : Message & proto_config , <nl> const std : : string & stats_prefix , <nl> FactoryContext & context ) { <nl> - return createFilter ( dynamic_cast < const envoy : : api : : v2 : : filter : : http : : HealthCheck & > ( proto_config ) , <nl> - stats_prefix , context ) ; <nl> + return createFilter ( <nl> + dynamic_cast < const envoy : : config : : filter : : http : : health_check : : v2 : : HealthCheck & > ( proto_config ) , <nl> + stats_prefix , context ) ; <nl> } <nl> <nl> / * * <nl> mmm a / source / server / http / health_check . h <nl> ppp b / source / server / http / health_check . h <nl> <nl> # include < memory > <nl> # include < string > <nl> <nl> - # include " envoy / api / v2 / filter / http / health_check . pb . h " <nl> + # include " envoy / config / filter / http / health_check / v2 / health_check . pb . h " <nl> # include " envoy / http / codes . h " <nl> # include " envoy / http / filter . h " <nl> # include " envoy / server / filter_config . h " <nl> class HealthCheckFilterConfig : public NamedHttpFilterConfigFactory { <nl> FactoryContext & context ) override ; <nl> <nl> ProtobufTypes : : MessagePtr createEmptyConfigProto ( ) override { <nl> - return ProtobufTypes : : MessagePtr { new envoy : : api : : v2 : : filter : : http : : HealthCheck ( ) } ; <nl> + return ProtobufTypes : : MessagePtr { <nl> + new envoy : : config : : filter : : http : : health_check : : v2 : : HealthCheck ( ) } ; <nl> } <nl> <nl> std : : string name ( ) override { return Config : : HttpFilterNames : : get ( ) . HEALTH_CHECK ; } <nl> <nl> private : <nl> - HttpFilterFactoryCb createFilter ( const envoy : : api : : v2 : : filter : : http : : HealthCheck & proto_config , <nl> - const std : : string & stats_prefix , FactoryContext & context ) ; <nl> + HttpFilterFactoryCb <nl> + createFilter ( const envoy : : config : : filter : : http : : health_check : : v2 : : HealthCheck & proto_config , <nl> + const std : : string & stats_prefix , FactoryContext & context ) ; <nl> } ; <nl> <nl> } / / namespace Configuration <nl> mmm a / source / server / lds_api . cc <nl> ppp b / source / server / lds_api . cc <nl> <nl> namespace Envoy { <nl> namespace Server { <nl> <nl> - LdsApi : : LdsApi ( const envoy : : api : : v2 : : ConfigSource & lds_config , Upstream : : ClusterManager & cm , <nl> + LdsApi : : LdsApi ( const envoy : : api : : v2 : : core : : ConfigSource & lds_config , Upstream : : ClusterManager & cm , <nl> Event : : Dispatcher & dispatcher , Runtime : : RandomGenerator & random , <nl> Init : : Manager & init_manager , const LocalInfo : : LocalInfo & local_info , <nl> Stats : : Scope & scope , ListenerManager & lm ) <nl> mmm a / source / server / lds_api . h <nl> ppp b / source / server / lds_api . h <nl> class LdsApi : public Init : : Target , <nl> Config : : SubscriptionCallbacks < envoy : : api : : v2 : : Listener > , <nl> Logger : : Loggable < Logger : : Id : : upstream > { <nl> public : <nl> - LdsApi ( const envoy : : api : : v2 : : ConfigSource & lds_config , Upstream : : ClusterManager & cm , <nl> + LdsApi ( const envoy : : api : : v2 : : core : : ConfigSource & lds_config , Upstream : : ClusterManager & cm , <nl> Event : : Dispatcher & dispatcher , Runtime : : RandomGenerator & random , <nl> Init : : Manager & init_manager , const LocalInfo : : LocalInfo & local_info , Stats : : Scope & scope , <nl> ListenerManager & lm ) ; <nl> mmm a / source / server / lds_subscription . cc <nl> ppp b / source / server / lds_subscription . cc <nl> namespace Envoy { <nl> namespace Server { <nl> <nl> LdsSubscription : : LdsSubscription ( Config : : SubscriptionStats stats , <nl> - const envoy : : api : : v2 : : ConfigSource & lds_config , <nl> + const envoy : : api : : v2 : : core : : ConfigSource & lds_config , <nl> Upstream : : ClusterManager & cm , Event : : Dispatcher & dispatcher , <nl> Runtime : : RandomGenerator & random , <nl> const LocalInfo : : LocalInfo & local_info ) <nl> LdsSubscription : : LdsSubscription ( Config : : SubscriptionStats stats , <nl> const auto & api_config_source = lds_config . api_config_source ( ) ; <nl> UNREFERENCED_PARAMETER ( lds_config ) ; <nl> / / If we are building an LdsSubscription , the ConfigSource should be REST_LEGACY . <nl> - ASSERT ( api_config_source . api_type ( ) = = envoy : : api : : v2 : : ApiConfigSource : : REST_LEGACY ) ; <nl> + ASSERT ( api_config_source . api_type ( ) = = envoy : : api : : v2 : : core : : ApiConfigSource : : REST_LEGACY ) ; <nl> / / TODO ( htuch ) : Add support for multiple clusters , # 1170 . <nl> ASSERT ( api_config_source . cluster_names ( ) . size ( ) = = 1 ) ; <nl> ASSERT ( api_config_source . has_refresh_delay ( ) ) ; <nl> mmm a / source / server / lds_subscription . h <nl> ppp b / source / server / lds_subscription . h <nl> class LdsSubscription : public Http : : RestApiFetcher , <nl> public Config : : Subscription < envoy : : api : : v2 : : Listener > , <nl> Logger : : Loggable < Logger : : Id : : upstream > { <nl> public : <nl> - LdsSubscription ( Config : : SubscriptionStats stats , const envoy : : api : : v2 : : ConfigSource & lds_config , <nl> + LdsSubscription ( Config : : SubscriptionStats stats , <nl> + const envoy : : api : : v2 : : core : : ConfigSource & lds_config , <nl> Upstream : : ClusterManager & cm , Event : : Dispatcher & dispatcher , <nl> Runtime : : RandomGenerator & random , const LocalInfo : : LocalInfo & local_info ) ; <nl> <nl> mmm a / source / server / listener_manager_impl . cc <nl> ppp b / source / server / listener_manager_impl . cc <nl> ListenerImpl : : ListenerImpl ( const envoy : : api : : v2 : : Listener & config , ListenerManag <nl> workers_started_ ( workers_started ) , hash_ ( hash ) , <nl> local_drain_manager_ ( parent . factory_ . createDrainManager ( config . drain_type ( ) ) ) , <nl> metadata_ ( config . has_metadata ( ) ? config . metadata ( ) <nl> - : envoy : : api : : v2 : : Metadata : : default_instance ( ) ) { <nl> + : envoy : : api : : v2 : : core : : Metadata : : default_instance ( ) ) { <nl> / / TODO ( htuch ) : Support multiple filter chains # 1280 , add constraint to ensure we have at least on <nl> / / filter chain # 1308 . <nl> ASSERT ( config . filter_chains ( ) . size ( ) > = 1 ) ; <nl> mmm a / source / server / listener_manager_impl . h <nl> ppp b / source / server / listener_manager_impl . h <nl> class ListenerImpl : public Network : : ListenerConfig , <nl> Singleton : : Manager & singletonManager ( ) override { return parent_ . server_ . singletonManager ( ) ; } <nl> ThreadLocal : : Instance & threadLocal ( ) override { return parent_ . server_ . threadLocal ( ) ; } <nl> Admin & admin ( ) override { return parent_ . server_ . admin ( ) ; } <nl> - const envoy : : api : : v2 : : Metadata & listenerMetadata ( ) const override { return metadata_ ; } ; <nl> + const envoy : : api : : v2 : : core : : Metadata & listenerMetadata ( ) const override { return metadata_ ; } ; <nl> void setListenSocketOptions ( const Network : : Socket : : OptionsSharedPtr & options ) override { <nl> listen_socket_options_ = options ; <nl> } <nl> class ListenerImpl : public Network : : ListenerConfig , <nl> std : : vector < Configuration : : ListenerFilterFactoryCb > listener_filter_factories_ ; <nl> DrainManagerPtr local_drain_manager_ ; <nl> bool saw_listener_create_failure_ { } ; <nl> - const envoy : : api : : v2 : : Metadata metadata_ ; <nl> + const envoy : : api : : v2 : : core : : Metadata metadata_ ; <nl> Network : : Socket : : OptionsSharedPtr listen_socket_options_ ; <nl> } ; <nl> <nl> mmm a / test / common / access_log / access_log_impl_test . cc <nl> ppp b / test / common / access_log / access_log_impl_test . cc <nl> namespace Envoy { <nl> namespace AccessLog { <nl> namespace { <nl> <nl> - envoy : : api : : v2 : : filter : : accesslog : : AccessLog <nl> + envoy : : config : : filter : : accesslog : : v2 : : AccessLog <nl> parseAccessLogFromJson ( const std : : string & json_string ) { <nl> - envoy : : api : : v2 : : filter : : accesslog : : AccessLog access_log ; <nl> + envoy : : config : : filter : : accesslog : : v2 : : AccessLog access_log ; <nl> auto json_object_ptr = Json : : Factory : : loadFromString ( json_string ) ; <nl> Config : : FilterJson : : translateAccessLog ( * json_object_ptr , access_log ) ; <nl> return access_log ; <nl> TEST_F ( AccessLogImplTest , multipleOperators ) { <nl> } <nl> <nl> TEST_F ( AccessLogImplTest , ConfigureFromProto ) { <nl> - envoy : : api : : v2 : : filter : : accesslog : : AccessLog config ; <nl> + envoy : : config : : filter : : accesslog : : v2 : : AccessLog config ; <nl> <nl> - envoy : : api : : v2 : : filter : : accesslog : : FileAccessLog fal_config ; <nl> + envoy : : config : : filter : : accesslog : : v2 : : FileAccessLog fal_config ; <nl> fal_config . set_path ( " / dev / null " ) ; <nl> <nl> MessageUtil : : jsonConvert ( fal_config , * config . mutable_config ( ) ) ; <nl> TEST ( AccessLogFilterTest , DurationWithRuntimeKey ) { <nl> NiceMock < Runtime : : MockLoader > runtime ; <nl> <nl> Json : : ObjectSharedPtr filter_object = loader - > getObject ( " filter " ) ; <nl> - envoy : : api : : v2 : : filter : : accesslog : : AccessLogFilter config ; <nl> + envoy : : config : : filter : : accesslog : : v2 : : AccessLogFilter config ; <nl> Config : : FilterJson : : translateAccessLogFilter ( * filter_object , config ) ; <nl> DurationFilter filter ( config . duration_filter ( ) , runtime ) ; <nl> Http : : TestHeaderMapImpl request_headers { { " : method " , " GET " } , { " : path " , " / " } } ; <nl> TEST ( AccessLogFilterTest , StatusCodeWithRuntimeKey ) { <nl> NiceMock < Runtime : : MockLoader > runtime ; <nl> <nl> Json : : ObjectSharedPtr filter_object = loader - > getObject ( " filter " ) ; <nl> - envoy : : api : : v2 : : filter : : accesslog : : AccessLogFilter config ; <nl> + envoy : : config : : filter : : accesslog : : v2 : : AccessLogFilter config ; <nl> Config : : FilterJson : : translateAccessLogFilter ( * filter_object , config ) ; <nl> StatusCodeFilter filter ( config . status_code_filter ( ) , runtime ) ; <nl> <nl> mmm a / test / common / access_log / grpc_access_log_impl_test . cc <nl> ppp b / test / common / access_log / grpc_access_log_impl_test . cc <nl> TEST_F ( HttpGrpcAccessLogTest , Marshalling ) { <nl> TEST ( responseFlagsToAccessLogResponseFlagsTest , All ) { <nl> NiceMock < RequestInfo : : MockRequestInfo > request_info ; <nl> ON_CALL ( request_info , getResponseFlag ( _ ) ) . WillByDefault ( Return ( true ) ) ; <nl> - envoy : : api : : v2 : : filter : : accesslog : : AccessLogCommon common_access_log ; <nl> + envoy : : config : : filter : : accesslog : : v2 : : AccessLogCommon common_access_log ; <nl> HttpGrpcAccessLog : : responseFlagsToAccessLogResponseFlags ( common_access_log , request_info ) ; <nl> <nl> - envoy : : api : : v2 : : filter : : accesslog : : AccessLogCommon common_access_log_expected ; <nl> + envoy : : config : : filter : : accesslog : : v2 : : AccessLogCommon common_access_log_expected ; <nl> common_access_log_expected . mutable_response_flags ( ) - > set_failed_local_healthcheck ( true ) ; <nl> common_access_log_expected . mutable_response_flags ( ) - > set_no_healthy_upstream ( true ) ; <nl> common_access_log_expected . mutable_response_flags ( ) - > set_upstream_request_timeout ( true ) ; <nl> mmm a / test / common / config / BUILD <nl> ppp b / test / common / config / BUILD <nl> envoy_cc_test ( <nl> " / / test / mocks / upstream : upstream_mocks " , <nl> " / / test / test_common : environment_lib " , <nl> " / / test / test_common : utility_lib " , <nl> - " @ envoy_api / / envoy / api / v2 : base_cc " , <nl> " @ envoy_api / / envoy / api / v2 : eds_cc " , <nl> + " @ envoy_api / / envoy / api / v2 / core : base_cc " , <nl> ] , <nl> ) <nl> <nl> mmm a / test / common / config / filter_json_test . cc <nl> ppp b / test / common / config / filter_json_test . cc <nl> <nl> - # include " envoy / api / v2 / filter / http / router . pb . h " <nl> + # include " envoy / config / filter / http / router / v2 / router . pb . h " <nl> <nl> # include " common / config / filter_json . h " <nl> # include " common / json / json_loader . h " <nl> namespace Envoy { <nl> namespace Config { <nl> namespace { <nl> <nl> - envoy : : api : : v2 : : filter : : http : : Router parseRouterFromJson ( const std : : string & json_string ) { <nl> - envoy : : api : : v2 : : filter : : http : : Router router ; <nl> + envoy : : config : : filter : : http : : router : : v2 : : Router <nl> + parseRouterFromJson ( const std : : string & json_string ) { <nl> + envoy : : config : : filter : : http : : router : : v2 : : Router router ; <nl> auto json_object_ptr = Json : : Factory : : loadFromString ( json_string ) ; <nl> Config : : FilterJson : : translateRouter ( * json_object_ptr , router ) ; <nl> return router ; <nl> mmm a / test / common / config / grpc_mux_impl_test . cc <nl> ppp b / test / common / config / grpc_mux_impl_test . cc <nl> class GrpcMuxImplTest : public testing : : Test { <nl> return timer_ ; <nl> } ) ) ; <nl> <nl> - envoy : : service : : discovery : : v2 : : AdsDummy dummy ; <nl> - <nl> grpc_mux_ . reset ( new GrpcMuxImpl ( <nl> - envoy : : api : : v2 : : Node ( ) , std : : unique_ptr < Grpc : : MockAsyncClient > ( async_client_ ) , dispatcher_ , <nl> + envoy : : api : : v2 : : core : : Node ( ) , std : : unique_ptr < Grpc : : MockAsyncClient > ( async_client_ ) , <nl> + dispatcher_ , <nl> * Protobuf : : DescriptorPool : : generated_pool ( ) - > FindMethodByName ( <nl> " envoy . service . discovery . v2 . AggregatedDiscoveryService . StreamAggregatedResources " ) ) ) ; <nl> } <nl> class GrpcMuxImplTest : public testing : : Test { <nl> EXPECT_CALL ( async_stream_ , sendMessage ( ProtoEq ( expected_request ) , false ) ) ; <nl> } <nl> <nl> - envoy : : api : : v2 : : Node node_ ; <nl> + envoy : : api : : v2 : : core : : Node node_ ; <nl> NiceMock < Event : : MockDispatcher > dispatcher_ ; <nl> Grpc : : MockAsyncClient * async_client_ ; <nl> Event : : MockTimer * timer_ ; <nl> mmm a / test / common / config / grpc_subscription_test_harness . h <nl> ppp b / test / common / config / grpc_subscription_test_harness . h <nl> class GrpcSubscriptionTestHarness : public SubscriptionTestHarness { <nl> Event : : MockDispatcher dispatcher_ ; <nl> Event : : MockTimer * timer_ ; <nl> Event : : TimerCb timer_cb_ ; <nl> - envoy : : api : : v2 : : Node node_ ; <nl> + envoy : : api : : v2 : : core : : Node node_ ; <nl> Config : : MockSubscriptionCallbacks < envoy : : api : : v2 : : ClusterLoadAssignment > callbacks_ ; <nl> Grpc : : MockAsyncStream async_stream_ ; <nl> std : : unique_ptr < GrpcEdsSubscriptionImpl > subscription_ ; <nl> mmm a / test / common / config / http_subscription_test_harness . h <nl> ppp b / test / common / config / http_subscription_test_harness . h <nl> class HttpSubscriptionTestHarness : public SubscriptionTestHarness { <nl> Event : : MockDispatcher dispatcher_ ; <nl> Event : : MockTimer * timer_ ; <nl> Event : : TimerCb timer_cb_ ; <nl> - envoy : : api : : v2 : : Node node_ ; <nl> + envoy : : api : : v2 : : core : : Node node_ ; <nl> Runtime : : MockRandomGenerator random_gen_ ; <nl> Http : : MockAsyncClientRequest http_request_ ; <nl> Http : : AsyncClient : : Callbacks * http_callbacks_ ; <nl> mmm a / test / common / config / metadata_test . cc <nl> ppp b / test / common / config / metadata_test . cc <nl> namespace Config { <nl> namespace { <nl> <nl> TEST ( MetadataTest , MetadataValue ) { <nl> - envoy : : api : : v2 : : Metadata metadata ; <nl> + envoy : : api : : v2 : : core : : Metadata metadata ; <nl> Metadata : : mutableMetadataValue ( metadata , MetadataFilters : : get ( ) . ENVOY_LB , <nl> MetadataEnvoyLbKeys : : get ( ) . CANARY ) <nl> . set_bool_value ( true ) ; <nl> mmm a / test / common / config / subscription_factory_test . cc <nl> ppp b / test / common / config / subscription_factory_test . cc <nl> class SubscriptionFactoryTest : public : : testing : : Test { <nl> } <nl> <nl> std : : unique_ptr < Subscription < envoy : : api : : v2 : : ClusterLoadAssignment > > <nl> - subscriptionFromConfigSource ( const envoy : : api : : v2 : : ConfigSource & config ) { <nl> + subscriptionFromConfigSource ( const envoy : : api : : v2 : : core : : ConfigSource & config ) { <nl> return SubscriptionFactory : : subscriptionFromConfigSource < envoy : : api : : v2 : : ClusterLoadAssignment > ( <nl> config , node_ , dispatcher_ , cm_ , random_ , stats_store_ , <nl> [ this ] ( ) - > Subscription < envoy : : api : : v2 : : ClusterLoadAssignment > * { <nl> class SubscriptionFactoryTest : public : : testing : : Test { <nl> " envoy . api . v2 . EndpointDiscoveryService . StreamEndpoints " ) ; <nl> } <nl> <nl> - envoy : : api : : v2 : : Node node_ ; <nl> + envoy : : api : : v2 : : core : : Node node_ ; <nl> Upstream : : MockClusterManager cm_ ; <nl> Event : : MockDispatcher dispatcher_ ; <nl> Runtime : : MockRandomGenerator random_ ; <nl> class SubscriptionFactoryTest : public : : testing : : Test { <nl> <nl> class SubscriptionFactoryTestApiConfigSource <nl> : public SubscriptionFactoryTest , <nl> - public testing : : WithParamInterface < : : envoy : : api : : v2 : : ApiConfigSource_ApiType > { } ; <nl> + public testing : : WithParamInterface < : : envoy : : api : : v2 : : core : : ApiConfigSource_ApiType > { } ; <nl> <nl> TEST_F ( SubscriptionFactoryTest , NoConfigSpecifier ) { <nl> - envoy : : api : : v2 : : ConfigSource config ; <nl> - EXPECT_THROW_WITH_MESSAGE ( subscriptionFromConfigSource ( config ) , EnvoyException , <nl> - " Missing config source specifier in envoy : : api : : v2 : : ConfigSource " ) ; <nl> + envoy : : api : : v2 : : core : : ConfigSource config ; <nl> + EXPECT_THROW_WITH_MESSAGE ( <nl> + subscriptionFromConfigSource ( config ) , EnvoyException , <nl> + " Missing config source specifier in envoy : : api : : v2 : : core : : ConfigSource " ) ; <nl> } <nl> <nl> TEST_F ( SubscriptionFactoryTest , WrongClusterNameLength ) { <nl> - envoy : : api : : v2 : : ConfigSource config ; <nl> - config . mutable_api_config_source ( ) - > set_api_type ( envoy : : api : : v2 : : ApiConfigSource : : REST ) ; <nl> + envoy : : api : : v2 : : core : : ConfigSource config ; <nl> + config . mutable_api_config_source ( ) - > set_api_type ( envoy : : api : : v2 : : core : : ApiConfigSource : : REST ) ; <nl> EXPECT_CALL ( cm_ , clusters ( ) ) ; <nl> EXPECT_THROW_WITH_MESSAGE ( <nl> subscriptionFromConfigSource ( config ) , EnvoyException , <nl> - " envoy : : api : : v2 : : ConfigSource must have a singleton cluster name specified " ) ; <nl> + " envoy : : api : : v2 : : core : : ConfigSource must have a singleton cluster name specified " ) ; <nl> config . mutable_api_config_source ( ) - > add_cluster_names ( " foo " ) ; <nl> config . mutable_api_config_source ( ) - > add_cluster_names ( " bar " ) ; <nl> EXPECT_CALL ( cm_ , clusters ( ) ) ; <nl> EXPECT_THROW_WITH_MESSAGE ( <nl> subscriptionFromConfigSource ( config ) , EnvoyException , <nl> - " envoy : : api : : v2 : : ConfigSource must have a singleton cluster name specified " ) ; <nl> + " envoy : : api : : v2 : : core : : ConfigSource must have a singleton cluster name specified " ) ; <nl> } <nl> <nl> TEST_F ( SubscriptionFactoryTest , FilesystemSubscription ) { <nl> - envoy : : api : : v2 : : ConfigSource config ; <nl> + envoy : : api : : v2 : : core : : ConfigSource config ; <nl> std : : string test_path = TestEnvironment : : temporaryDirectory ( ) ; <nl> config . set_path ( test_path ) ; <nl> auto * watcher = new Filesystem : : MockWatcher ( ) ; <nl> TEST_F ( SubscriptionFactoryTest , FilesystemSubscription ) { <nl> } <nl> <nl> TEST_F ( SubscriptionFactoryTest , FilesystemSubscriptionNonExistentFile ) { <nl> - envoy : : api : : v2 : : ConfigSource config ; <nl> + envoy : : api : : v2 : : core : : ConfigSource config ; <nl> config . set_path ( " / blahblah " ) ; <nl> EXPECT_THROW_WITH_MESSAGE ( subscriptionFromConfigSource ( config ) - > start ( { " foo " } , callbacks_ ) , <nl> EnvoyException , <nl> TEST_F ( SubscriptionFactoryTest , FilesystemSubscriptionNonExistentFile ) { <nl> } <nl> <nl> TEST_F ( SubscriptionFactoryTest , LegacySubscription ) { <nl> - envoy : : api : : v2 : : ConfigSource config ; <nl> + envoy : : api : : v2 : : core : : ConfigSource config ; <nl> auto * api_config_source = config . mutable_api_config_source ( ) ; <nl> - api_config_source - > set_api_type ( envoy : : api : : v2 : : ApiConfigSource : : REST_LEGACY ) ; <nl> + api_config_source - > set_api_type ( envoy : : api : : v2 : : core : : ApiConfigSource : : REST_LEGACY ) ; <nl> api_config_source - > add_cluster_names ( " eds_cluster " ) ; <nl> Upstream : : ClusterManager : : ClusterInfoMap cluster_map ; <nl> Upstream : : MockCluster cluster ; <nl> TEST_F ( SubscriptionFactoryTest , LegacySubscription ) { <nl> } <nl> <nl> TEST_F ( SubscriptionFactoryTest , HttpSubscription ) { <nl> - envoy : : api : : v2 : : ConfigSource config ; <nl> + envoy : : api : : v2 : : core : : ConfigSource config ; <nl> auto * api_config_source = config . mutable_api_config_source ( ) ; <nl> - api_config_source - > set_api_type ( envoy : : api : : v2 : : ApiConfigSource : : REST ) ; <nl> + api_config_source - > set_api_type ( envoy : : api : : v2 : : core : : ApiConfigSource : : REST ) ; <nl> api_config_source - > add_cluster_names ( " eds_cluster " ) ; <nl> api_config_source - > mutable_refresh_delay ( ) - > set_seconds ( 1 ) ; <nl> Upstream : : ClusterManager : : ClusterInfoMap cluster_map ; <nl> TEST_F ( SubscriptionFactoryTest , HttpSubscription ) { <nl> <nl> / / Confirm error when no refresh delay is set ( not checked by schema ) . <nl> TEST_F ( SubscriptionFactoryTest , HttpSubscriptionNoRefreshDelay ) { <nl> - envoy : : api : : v2 : : ConfigSource config ; <nl> + envoy : : api : : v2 : : core : : ConfigSource config ; <nl> auto * api_config_source = config . mutable_api_config_source ( ) ; <nl> - api_config_source - > set_api_type ( envoy : : api : : v2 : : ApiConfigSource : : REST ) ; <nl> + api_config_source - > set_api_type ( envoy : : api : : v2 : : core : : ApiConfigSource : : REST ) ; <nl> api_config_source - > add_cluster_names ( " eds_cluster " ) ; <nl> Upstream : : ClusterManager : : ClusterInfoMap cluster_map ; <nl> Upstream : : MockCluster cluster ; <nl> TEST_F ( SubscriptionFactoryTest , HttpSubscriptionNoRefreshDelay ) { <nl> } <nl> <nl> TEST_F ( SubscriptionFactoryTest , GrpcSubscription ) { <nl> - envoy : : api : : v2 : : ConfigSource config ; <nl> + envoy : : api : : v2 : : core : : ConfigSource config ; <nl> auto * api_config_source = config . mutable_api_config_source ( ) ; <nl> - api_config_source - > set_api_type ( envoy : : api : : v2 : : ApiConfigSource : : GRPC ) ; <nl> + api_config_source - > set_api_type ( envoy : : api : : v2 : : core : : ApiConfigSource : : GRPC ) ; <nl> api_config_source - > add_cluster_names ( " eds_cluster " ) ; <nl> - envoy : : api : : v2 : : GrpcService expected_grpc_service ; <nl> + envoy : : api : : v2 : : core : : GrpcService expected_grpc_service ; <nl> expected_grpc_service . mutable_envoy_grpc ( ) - > set_cluster_name ( " eds_cluster " ) ; <nl> Upstream : : ClusterManager : : ClusterInfoMap cluster_map ; <nl> Upstream : : MockCluster cluster ; <nl> TEST_F ( SubscriptionFactoryTest , GrpcSubscription ) { <nl> EXPECT_CALL ( * cluster . info_ , addedViaApi ( ) ) ; <nl> EXPECT_CALL ( cm_ , grpcAsyncClientManager ( ) ) . WillOnce ( ReturnRef ( cm_ . async_client_manager_ ) ) ; <nl> EXPECT_CALL ( cm_ . async_client_manager_ , factoryForGrpcService ( ProtoEq ( expected_grpc_service ) , _ ) ) <nl> - . WillOnce ( Invoke ( [ ] ( const envoy : : api : : v2 : : GrpcService & , Stats : : Scope & ) { <nl> + . WillOnce ( Invoke ( [ ] ( const envoy : : api : : v2 : : core : : GrpcService & , Stats : : Scope & ) { <nl> auto async_client_factory = std : : make_unique < Grpc : : MockAsyncClientFactory > ( ) ; <nl> EXPECT_CALL ( * async_client_factory , create ( ) ) . WillOnce ( Invoke ( [ ] { <nl> return std : : make_unique < NiceMock < Grpc : : MockAsyncClient > > ( ) ; <nl> TEST_F ( SubscriptionFactoryTest , GrpcSubscription ) { <nl> <nl> INSTANTIATE_TEST_CASE_P ( SubscriptionFactoryTestApiConfigSource , <nl> SubscriptionFactoryTestApiConfigSource , <nl> - : : testing : : Values ( envoy : : api : : v2 : : ApiConfigSource : : REST_LEGACY , <nl> - envoy : : api : : v2 : : ApiConfigSource : : REST , <nl> - envoy : : api : : v2 : : ApiConfigSource : : GRPC ) ) ; <nl> + : : testing : : Values ( envoy : : api : : v2 : : core : : ApiConfigSource : : REST_LEGACY , <nl> + envoy : : api : : v2 : : core : : ApiConfigSource : : REST , <nl> + envoy : : api : : v2 : : core : : ApiConfigSource : : GRPC ) ) ; <nl> <nl> TEST_P ( SubscriptionFactoryTestApiConfigSource , NonExistentCluster ) { <nl> - envoy : : api : : v2 : : ConfigSource config ; <nl> + envoy : : api : : v2 : : core : : ConfigSource config ; <nl> auto * api_config_source = config . mutable_api_config_source ( ) ; <nl> api_config_source - > set_api_type ( GetParam ( ) ) ; <nl> api_config_source - > add_cluster_names ( " eds_cluster " ) ; <nl> Upstream : : ClusterManager : : ClusterInfoMap cluster_map ; <nl> EXPECT_CALL ( cm_ , clusters ( ) ) . WillOnce ( Return ( cluster_map ) ) ; <nl> - EXPECT_THROW_WITH_MESSAGE ( <nl> - subscriptionFromConfigSource ( config ) - > start ( { " foo " } , callbacks_ ) , EnvoyException , <nl> - " envoy : : api : : v2 : : ConfigSource must have a statically defined non - EDS cluster : ' eds_cluster ' " <nl> - " does not exist , was added via api , or is an EDS cluster " ) ; <nl> + EXPECT_THROW_WITH_MESSAGE ( subscriptionFromConfigSource ( config ) - > start ( { " foo " } , callbacks_ ) , <nl> + EnvoyException , <nl> + " envoy : : api : : v2 : : core : : ConfigSource must have a statically defined " <nl> + " non - EDS cluster : ' eds_cluster ' " <nl> + " does not exist , was added via api , or is an EDS cluster " ) ; <nl> } <nl> <nl> TEST_P ( SubscriptionFactoryTestApiConfigSource , DynamicCluster ) { <nl> - envoy : : api : : v2 : : ConfigSource config ; <nl> + envoy : : api : : v2 : : core : : ConfigSource config ; <nl> auto * api_config_source = config . mutable_api_config_source ( ) ; <nl> api_config_source - > set_api_type ( GetParam ( ) ) ; <nl> api_config_source - > add_cluster_names ( " eds_cluster " ) ; <nl> TEST_P ( SubscriptionFactoryTestApiConfigSource , DynamicCluster ) { <nl> EXPECT_CALL ( cm_ , clusters ( ) ) . WillOnce ( Return ( cluster_map ) ) ; <nl> EXPECT_CALL ( cluster , info ( ) ) ; <nl> EXPECT_CALL ( * cluster . info_ , addedViaApi ( ) ) . WillOnce ( Return ( true ) ) ; <nl> - EXPECT_THROW_WITH_MESSAGE ( <nl> - subscriptionFromConfigSource ( config ) - > start ( { " foo " } , callbacks_ ) , EnvoyException , <nl> - " envoy : : api : : v2 : : ConfigSource must have a statically defined non - EDS cluster : ' eds_cluster ' " <nl> - " does not exist , was added via api , or is an EDS cluster " ) ; <nl> + EXPECT_THROW_WITH_MESSAGE ( subscriptionFromConfigSource ( config ) - > start ( { " foo " } , callbacks_ ) , <nl> + EnvoyException , <nl> + " envoy : : api : : v2 : : core : : ConfigSource must have a statically defined " <nl> + " non - EDS cluster : ' eds_cluster ' " <nl> + " does not exist , was added via api , or is an EDS cluster " ) ; <nl> } <nl> <nl> TEST_P ( SubscriptionFactoryTestApiConfigSource , EDSClusterBackingEDSCluster ) { <nl> - envoy : : api : : v2 : : ConfigSource config ; <nl> + envoy : : api : : v2 : : core : : ConfigSource config ; <nl> auto * api_config_source = config . mutable_api_config_source ( ) ; <nl> api_config_source - > set_api_type ( GetParam ( ) ) ; <nl> api_config_source - > add_cluster_names ( " eds_cluster " ) ; <nl> TEST_P ( SubscriptionFactoryTestApiConfigSource , EDSClusterBackingEDSCluster ) { <nl> EXPECT_CALL ( cluster , info ( ) ) . Times ( 2 ) ; <nl> EXPECT_CALL ( * cluster . info_ , addedViaApi ( ) ) ; <nl> EXPECT_CALL ( * cluster . info_ , type ( ) ) . WillOnce ( Return ( envoy : : api : : v2 : : Cluster : : EDS ) ) ; <nl> - EXPECT_THROW_WITH_MESSAGE ( <nl> - subscriptionFromConfigSource ( config ) - > start ( { " foo " } , callbacks_ ) , EnvoyException , <nl> - " envoy : : api : : v2 : : ConfigSource must have a statically defined non - EDS cluster : ' eds_cluster ' " <nl> - " does not exist , was added via api , or is an EDS cluster " ) ; <nl> + EXPECT_THROW_WITH_MESSAGE ( subscriptionFromConfigSource ( config ) - > start ( { " foo " } , callbacks_ ) , <nl> + EnvoyException , <nl> + " envoy : : api : : v2 : : core : : ConfigSource must have a statically defined " <nl> + " non - EDS cluster : ' eds_cluster ' " <nl> + " does not exist , was added via api , or is an EDS cluster " ) ; <nl> } <nl> <nl> } / / namespace Config <nl> mmm a / test / common / config / utility_test . cc <nl> ppp b / test / common / config / utility_test . cc <nl> TEST ( UtilityTest , ComputeHashedVersion ) { <nl> } <nl> <nl> TEST ( UtilityTest , ApiConfigSourceRefreshDelay ) { <nl> - envoy : : api : : v2 : : ApiConfigSource api_config_source ; <nl> + envoy : : api : : v2 : : core : : ApiConfigSource api_config_source ; <nl> api_config_source . mutable_refresh_delay ( ) - > CopyFrom ( <nl> Protobuf : : util : : TimeUtil : : MillisecondsToDuration ( 1234 ) ) ; <nl> EXPECT_EQ ( 1234 , Utility : : apiConfigSourceRefreshDelay ( api_config_source ) . count ( ) ) ; <nl> } <nl> <nl> TEST ( UtilityTest , TranslateApiConfigSource ) { <nl> - envoy : : api : : v2 : : ApiConfigSource api_config_source_rest_legacy ; <nl> + envoy : : api : : v2 : : core : : ApiConfigSource api_config_source_rest_legacy ; <nl> Utility : : translateApiConfigSource ( " test_rest_legacy_cluster " , 10000 , ApiType : : get ( ) . RestLegacy , <nl> api_config_source_rest_legacy ) ; <nl> - EXPECT_EQ ( envoy : : api : : v2 : : ApiConfigSource : : REST_LEGACY , api_config_source_rest_legacy . api_type ( ) ) ; <nl> + EXPECT_EQ ( envoy : : api : : v2 : : core : : ApiConfigSource : : REST_LEGACY , <nl> + api_config_source_rest_legacy . api_type ( ) ) ; <nl> EXPECT_EQ ( 10000 , Protobuf : : util : : TimeUtil : : DurationToMilliseconds ( <nl> api_config_source_rest_legacy . refresh_delay ( ) ) ) ; <nl> EXPECT_EQ ( " test_rest_legacy_cluster " , api_config_source_rest_legacy . cluster_names ( 0 ) ) ; <nl> <nl> - envoy : : api : : v2 : : ApiConfigSource api_config_source_rest ; <nl> + envoy : : api : : v2 : : core : : ApiConfigSource api_config_source_rest ; <nl> Utility : : translateApiConfigSource ( " test_rest_cluster " , 20000 , ApiType : : get ( ) . Rest , <nl> api_config_source_rest ) ; <nl> - EXPECT_EQ ( envoy : : api : : v2 : : ApiConfigSource : : REST , api_config_source_rest . api_type ( ) ) ; <nl> + EXPECT_EQ ( envoy : : api : : v2 : : core : : ApiConfigSource : : REST , api_config_source_rest . api_type ( ) ) ; <nl> EXPECT_EQ ( 20000 , Protobuf : : util : : TimeUtil : : DurationToMilliseconds ( <nl> api_config_source_rest . refresh_delay ( ) ) ) ; <nl> EXPECT_EQ ( " test_rest_cluster " , api_config_source_rest . cluster_names ( 0 ) ) ; <nl> <nl> - envoy : : api : : v2 : : ApiConfigSource api_config_source_grpc ; <nl> + envoy : : api : : v2 : : core : : ApiConfigSource api_config_source_grpc ; <nl> Utility : : translateApiConfigSource ( " test_grpc_cluster " , 30000 , ApiType : : get ( ) . Grpc , <nl> api_config_source_grpc ) ; <nl> - EXPECT_EQ ( envoy : : api : : v2 : : ApiConfigSource : : GRPC , api_config_source_grpc . api_type ( ) ) ; <nl> + EXPECT_EQ ( envoy : : api : : v2 : : core : : ApiConfigSource : : GRPC , api_config_source_grpc . api_type ( ) ) ; <nl> EXPECT_EQ ( 30000 , Protobuf : : util : : TimeUtil : : DurationToMilliseconds ( <nl> api_config_source_grpc . refresh_delay ( ) ) ) ; <nl> EXPECT_EQ ( " test_grpc_cluster " , api_config_source_grpc . cluster_names ( 0 ) ) ; <nl> TEST ( UtilityTest , ObjNameLength ) { <nl> R " EOF ( " , " type " : " static " , " lb_type " : " random " , " connect_timeout_ms " : 1 } ) EOF " ; <nl> auto json_object_ptr = Json : : Factory : : loadFromString ( json ) ; <nl> envoy : : api : : v2 : : Cluster cluster ; <nl> - envoy : : api : : v2 : : ConfigSource eds_config ; <nl> + envoy : : api : : v2 : : core : : ConfigSource eds_config ; <nl> EXPECT_THROW_WITH_MESSAGE ( <nl> Config : : CdsJson : : translateCluster ( * json_object_ptr , eds_config , cluster ) , EnvoyException , <nl> err_prefix + err_suffix ) ; <nl> TEST ( UtilityTest , ObjNameLength ) { <nl> err_prefix = " Invalid route_config name " ; <nl> std : : string json = R " EOF ( { " route_config_name " : " ) EOF " + name + R " EOF ( " , " cluster " : " foo " } ) EOF " ; <nl> auto json_object_ptr = Json : : Factory : : loadFromString ( json ) ; <nl> - envoy : : api : : v2 : : filter : : network : : Rds rds ; <nl> + envoy : : config : : filter : : network : : http_connection_manager : : v2 : : Rds rds ; <nl> EXPECT_THROW_WITH_MESSAGE ( Config : : Utility : : translateRdsConfig ( * json_object_ptr , rds ) , <nl> EnvoyException , err_prefix + err_suffix ) ; <nl> } <nl> TEST ( UtilityTest , UnixClusterDns ) { <nl> R " EOF ( " , " lb_type " : " random " , " connect_timeout_ms " : 1 , " hosts " : [ { " url " : " unix : / / / test . sock " } ] } ) EOF " ; <nl> auto json_object_ptr = Json : : Factory : : loadFromString ( json ) ; <nl> envoy : : api : : v2 : : Cluster cluster ; <nl> - envoy : : api : : v2 : : ConfigSource eds_config ; <nl> + envoy : : api : : v2 : : core : : ConfigSource eds_config ; <nl> EXPECT_THROW_WITH_MESSAGE ( <nl> Config : : CdsJson : : translateCluster ( * json_object_ptr , eds_config , cluster ) , EnvoyException , <nl> " unresolved URL must be TCP scheme , got : unix : / / / test . sock " ) ; <nl> TEST ( UtilityTest , UnixClusterStatic ) { <nl> R " EOF ( " , " lb_type " : " random " , " connect_timeout_ms " : 1 , " hosts " : [ { " url " : " unix : / / / test . sock " } ] } ) EOF " ; <nl> auto json_object_ptr = Json : : Factory : : loadFromString ( json ) ; <nl> envoy : : api : : v2 : : Cluster cluster ; <nl> - envoy : : api : : v2 : : ConfigSource eds_config ; <nl> + envoy : : api : : v2 : : core : : ConfigSource eds_config ; <nl> Config : : CdsJson : : translateCluster ( * json_object_ptr , eds_config , cluster ) ; <nl> EXPECT_EQ ( " / test . sock " , cluster . hosts ( 0 ) . pipe ( ) . path ( ) ) ; <nl> } <nl> TEST ( UtilityTest , CheckFilesystemSubscriptionBackingPath ) { <nl> } <nl> <nl> TEST ( UtilityTest , CheckApiConfigSourceSubscriptionBackingCluster ) { <nl> - envoy : : api : : v2 : : ConfigSource config ; <nl> + envoy : : api : : v2 : : core : : ConfigSource config ; <nl> auto * api_config_source = config . mutable_api_config_source ( ) ; <nl> api_config_source - > add_cluster_names ( " foo_cluster " ) ; <nl> Upstream : : ClusterManager : : ClusterInfoMap cluster_map ; <nl> TEST ( UtilityTest , CheckApiConfigSourceSubscriptionBackingCluster ) { <nl> EXPECT_THROW_WITH_MESSAGE ( <nl> Utility : : checkApiConfigSourceSubscriptionBackingCluster ( cluster_map , * api_config_source ) , <nl> EnvoyException , <nl> - " envoy : : api : : v2 : : ConfigSource must have a statically defined non - EDS cluster : ' foo_cluster ' " <nl> + " envoy : : api : : v2 : : core : : ConfigSource must have a statically defined non - EDS cluster : " <nl> + " ' foo_cluster ' " <nl> " does not exist , was added via api , or is an EDS cluster " ) ; <nl> <nl> / / Dynamic Cluster . <nl> TEST ( UtilityTest , CheckApiConfigSourceSubscriptionBackingCluster ) { <nl> EXPECT_THROW_WITH_MESSAGE ( <nl> Utility : : checkApiConfigSourceSubscriptionBackingCluster ( cluster_map , * api_config_source ) , <nl> EnvoyException , <nl> - " envoy : : api : : v2 : : ConfigSource must have a statically defined non - EDS cluster : ' foo_cluster ' " <nl> + " envoy : : api : : v2 : : core : : ConfigSource must have a statically defined non - EDS cluster : " <nl> + " ' foo_cluster ' " <nl> " does not exist , was added via api , or is an EDS cluster " ) ; <nl> <nl> / / EDS Cluster backing EDS Cluster . <nl> TEST ( UtilityTest , CheckApiConfigSourceSubscriptionBackingCluster ) { <nl> EXPECT_THROW_WITH_MESSAGE ( <nl> Utility : : checkApiConfigSourceSubscriptionBackingCluster ( cluster_map , * api_config_source ) , <nl> EnvoyException , <nl> - " envoy : : api : : v2 : : ConfigSource must have a statically defined non - EDS cluster : ' foo_cluster ' " <nl> + " envoy : : api : : v2 : : core : : ConfigSource must have a statically defined non - EDS cluster : " <nl> + " ' foo_cluster ' " <nl> " does not exist , was added via api , or is an EDS cluster " ) ; <nl> <nl> / / All ok . <nl> TEST ( UtilityTest , FactoryForApiConfigSource ) { <nl> Stats : : MockStore scope ; <nl> <nl> { <nl> - envoy : : api : : v2 : : ApiConfigSource api_config_source ; <nl> - api_config_source . set_api_type ( envoy : : api : : v2 : : ApiConfigSource : : GRPC ) ; <nl> + envoy : : api : : v2 : : core : : ApiConfigSource api_config_source ; <nl> + api_config_source . set_api_type ( envoy : : api : : v2 : : core : : ApiConfigSource : : GRPC ) ; <nl> EXPECT_THROW_WITH_REGEX ( <nl> Utility : : factoryForApiConfigSource ( async_client_manager , api_config_source , scope ) , <nl> - EnvoyException , " Missing gRPC services in envoy : : api : : v2 : : ApiConfigSource : " ) ; <nl> + EnvoyException , " Missing gRPC services in envoy : : api : : v2 : : core : : ApiConfigSource : " ) ; <nl> } <nl> <nl> { <nl> - envoy : : api : : v2 : : ApiConfigSource api_config_source ; <nl> - api_config_source . set_api_type ( envoy : : api : : v2 : : ApiConfigSource : : GRPC ) ; <nl> + envoy : : api : : v2 : : core : : ApiConfigSource api_config_source ; <nl> + api_config_source . set_api_type ( envoy : : api : : v2 : : core : : ApiConfigSource : : GRPC ) ; <nl> api_config_source . add_grpc_services ( ) ; <nl> api_config_source . add_grpc_services ( ) ; <nl> EXPECT_THROW_WITH_REGEX ( <nl> Utility : : factoryForApiConfigSource ( async_client_manager , api_config_source , scope ) , <nl> EnvoyException , <nl> - " Only singleton gRPC service lists supported in envoy : : api : : v2 : : ApiConfigSource : " ) ; <nl> + " Only singleton gRPC service lists supported in envoy : : api : : v2 : : core : : ApiConfigSource : " ) ; <nl> } <nl> <nl> { <nl> - envoy : : api : : v2 : : ApiConfigSource api_config_source ; <nl> - api_config_source . set_api_type ( envoy : : api : : v2 : : ApiConfigSource : : GRPC ) ; <nl> + envoy : : api : : v2 : : core : : ApiConfigSource api_config_source ; <nl> + api_config_source . set_api_type ( envoy : : api : : v2 : : core : : ApiConfigSource : : GRPC ) ; <nl> api_config_source . add_cluster_names ( ) ; <nl> api_config_source . add_cluster_names ( ) ; <nl> EXPECT_THROW_WITH_REGEX ( <nl> Utility : : factoryForApiConfigSource ( async_client_manager , api_config_source , scope ) , <nl> EnvoyException , <nl> - " Only singleton cluster name lists supported in envoy : : api : : v2 : : ApiConfigSource : " ) ; <nl> + " Only singleton cluster name lists supported in envoy : : api : : v2 : : core : : ApiConfigSource : " ) ; <nl> } <nl> <nl> { <nl> - envoy : : api : : v2 : : ApiConfigSource api_config_source ; <nl> - api_config_source . set_api_type ( envoy : : api : : v2 : : ApiConfigSource : : GRPC ) ; <nl> + envoy : : api : : v2 : : core : : ApiConfigSource api_config_source ; <nl> + api_config_source . set_api_type ( envoy : : api : : v2 : : core : : ApiConfigSource : : GRPC ) ; <nl> api_config_source . add_cluster_names ( " foo " ) ; <nl> - envoy : : api : : v2 : : GrpcService expected_grpc_service ; <nl> + envoy : : api : : v2 : : core : : GrpcService expected_grpc_service ; <nl> expected_grpc_service . mutable_envoy_grpc ( ) - > set_cluster_name ( " foo " ) ; <nl> EXPECT_CALL ( async_client_manager , <nl> factoryForGrpcService ( ProtoEq ( expected_grpc_service ) , Ref ( scope ) ) ) ; <nl> TEST ( UtilityTest , FactoryForApiConfigSource ) { <nl> } <nl> <nl> { <nl> - envoy : : api : : v2 : : ApiConfigSource api_config_source ; <nl> - api_config_source . set_api_type ( envoy : : api : : v2 : : ApiConfigSource : : GRPC ) ; <nl> + envoy : : api : : v2 : : core : : ApiConfigSource api_config_source ; <nl> + api_config_source . set_api_type ( envoy : : api : : v2 : : core : : ApiConfigSource : : GRPC ) ; <nl> api_config_source . add_grpc_services ( ) - > mutable_envoy_grpc ( ) - > set_cluster_name ( " foo " ) ; <nl> EXPECT_CALL ( async_client_manager , <nl> factoryForGrpcService ( ProtoEq ( api_config_source . grpc_services ( 0 ) ) , Ref ( scope ) ) ) ; <nl> mmm a / test / common / filter / auth / client_ssl_test . cc <nl> ppp b / test / common / filter / auth / client_ssl_test . cc <nl> TEST ( ClientSslAuthConfigTest , BadClientSslAuthConfig ) { <nl> ) EOF " ; <nl> <nl> Json : : ObjectSharedPtr json_config = Json : : Factory : : loadFromString ( json ) ; <nl> - envoy : : api : : v2 : : filter : : network : : ClientSSLAuth proto_config { } ; <nl> + envoy : : config : : filter : : network : : client_ssl_auth : : v2 : : ClientSSLAuth proto_config { } ; <nl> EXPECT_THROW ( Envoy : : Config : : FilterJson : : translateClientSslAuthFilter ( * json_config , proto_config ) , <nl> Json : : Exception ) ; <nl> } <nl> class ClientSslAuthFilterTest : public testing : : Test { <nl> ) EOF " ; <nl> <nl> Json : : ObjectSharedPtr json_config = Json : : Factory : : loadFromString ( json ) ; <nl> - envoy : : api : : v2 : : filter : : network : : ClientSSLAuth proto_config { } ; <nl> + envoy : : config : : filter : : network : : client_ssl_auth : : v2 : : ClientSSLAuth proto_config { } ; <nl> Envoy : : Config : : FilterJson : : translateClientSslAuthFilter ( * json_config , proto_config ) ; <nl> EXPECT_CALL ( cm_ , get ( " vpn " ) ) ; <nl> setupRequest ( ) ; <nl> TEST_F ( ClientSslAuthFilterTest , NoCluster ) { <nl> ) EOF " ; <nl> <nl> Json : : ObjectSharedPtr json_config = Json : : Factory : : loadFromString ( json ) ; <nl> - envoy : : api : : v2 : : filter : : network : : ClientSSLAuth proto_config { } ; <nl> + envoy : : config : : filter : : network : : client_ssl_auth : : v2 : : ClientSSLAuth proto_config { } ; <nl> Envoy : : Config : : FilterJson : : translateClientSslAuthFilter ( * json_config , proto_config ) ; <nl> EXPECT_CALL ( cm_ , get ( " bad_cluster " ) ) . WillOnce ( Return ( nullptr ) ) ; <nl> EXPECT_THROW ( Config : : create ( proto_config , tls_ , cm_ , dispatcher_ , stats_store_ , random_ ) , <nl> mmm a / test / common / filter / ratelimit_test . cc <nl> ppp b / test / common / filter / ratelimit_test . cc <nl> class RateLimitFilterTest : public testing : : Test { <nl> . WillByDefault ( Return ( true ) ) ; <nl> <nl> Json : : ObjectSharedPtr json_config = Json : : Factory : : loadFromString ( json ) ; <nl> - envoy : : api : : v2 : : filter : : network : : RateLimit proto_config { } ; <nl> + envoy : : config : : filter : : network : : rate_limit : : v2 : : RateLimit proto_config { } ; <nl> Envoy : : Config : : FilterJson : : translateTcpRateLimitFilter ( * json_config , proto_config ) ; <nl> config_ . reset ( new Config ( proto_config , stats_store_ , runtime_ ) ) ; <nl> client_ = new MockClient ( ) ; <nl> TEST_F ( RateLimitFilterTest , BadRatelimitConfig ) { <nl> ) EOF " ; <nl> <nl> Json : : ObjectSharedPtr json_config = Json : : Factory : : loadFromString ( json_string ) ; <nl> - envoy : : api : : v2 : : filter : : network : : RateLimit proto_config { } ; <nl> + envoy : : config : : filter : : network : : rate_limit : : v2 : : RateLimit proto_config { } ; <nl> <nl> EXPECT_THROW ( Envoy : : Config : : FilterJson : : translateTcpRateLimitFilter ( * json_config , proto_config ) , <nl> Json : : Exception ) ; <nl> mmm a / test / common / filter / tcp_proxy_test . cc <nl> ppp b / test / common / filter / tcp_proxy_test . cc <nl> namespace Filter { <nl> namespace { <nl> TcpProxyConfig constructTcpProxyConfigFromJson ( const Json : : Object & json , <nl> Server : : Configuration : : FactoryContext & context ) { <nl> - envoy : : api : : v2 : : filter : : network : : TcpProxy tcp_proxy ; <nl> + envoy : : config : : filter : : network : : tcp_proxy : : v2 : : TcpProxy tcp_proxy ; <nl> Config : : FilterJson : : translateTcpProxy ( json , tcp_proxy ) ; <nl> return TcpProxyConfig ( tcp_proxy , context ) ; <nl> } <nl> TEST ( TcpProxyConfigTest , EmptyRouteConfig ) { <nl> } <nl> <nl> TEST ( TcpProxyConfigTest , AccessLogConfig ) { <nl> - envoy : : api : : v2 : : filter : : network : : TcpProxy config ; <nl> - envoy : : api : : v2 : : filter : : accesslog : : AccessLog * log = config . mutable_access_log ( ) - > Add ( ) ; <nl> + envoy : : config : : filter : : network : : tcp_proxy : : v2 : : TcpProxy config ; <nl> + envoy : : config : : filter : : accesslog : : v2 : : AccessLog * log = config . mutable_access_log ( ) - > Add ( ) ; <nl> log - > set_name ( Config : : AccessLogNames : : get ( ) . FILE ) ; <nl> { <nl> - envoy : : api : : v2 : : filter : : accesslog : : FileAccessLog file_access_log ; <nl> + envoy : : config : : filter : : accesslog : : v2 : : FileAccessLog file_access_log ; <nl> file_access_log . set_path ( " some_path " ) ; <nl> file_access_log . set_format ( " the format specifier " ) ; <nl> ProtobufWkt : : Struct * custom_config = log - > mutable_config ( ) ; <nl> TEST ( TcpProxyConfigTest , AccessLogConfig ) { <nl> log = config . mutable_access_log ( ) - > Add ( ) ; <nl> log - > set_name ( Config : : AccessLogNames : : get ( ) . FILE ) ; <nl> { <nl> - envoy : : api : : v2 : : filter : : accesslog : : FileAccessLog file_access_log ; <nl> + envoy : : config : : filter : : accesslog : : v2 : : FileAccessLog file_access_log ; <nl> file_access_log . set_path ( " another path " ) ; <nl> ProtobufWkt : : Struct * custom_config = log - > mutable_config ( ) ; <nl> MessageUtil : : jsonConvert ( file_access_log , * custom_config ) ; <nl> class TcpProxyTest : public testing : : Test { <nl> . WillByDefault ( SaveArg < 0 > ( & access_log_data_ ) ) ; <nl> } <nl> <nl> - void configure ( const envoy : : api : : v2 : : filter : : network : : TcpProxy & config ) { <nl> + void configure ( const envoy : : config : : filter : : network : : tcp_proxy : : v2 : : TcpProxy & config ) { <nl> config_ . reset ( new TcpProxyConfig ( config , factory_context_ ) ) ; <nl> } <nl> <nl> - envoy : : api : : v2 : : filter : : network : : TcpProxy defaultConfig ( ) { <nl> - envoy : : api : : v2 : : filter : : network : : TcpProxy config ; <nl> + envoy : : config : : filter : : network : : tcp_proxy : : v2 : : TcpProxy defaultConfig ( ) { <nl> + envoy : : config : : filter : : network : : tcp_proxy : : v2 : : TcpProxy config ; <nl> config . set_stat_prefix ( " name " ) ; <nl> auto * route = config . mutable_deprecated_v1 ( ) - > mutable_routes ( ) - > Add ( ) ; <nl> route - > set_cluster ( " fake_cluster " ) ; <nl> class TcpProxyTest : public testing : : Test { <nl> } <nl> <nl> / / Return the default config , plus one file access log with the specified format <nl> - envoy : : api : : v2 : : filter : : network : : TcpProxy accessLogConfig ( const std : : string access_log_format ) { <nl> - envoy : : api : : v2 : : filter : : network : : TcpProxy config = defaultConfig ( ) ; <nl> - envoy : : api : : v2 : : filter : : accesslog : : AccessLog * access_log = config . mutable_access_log ( ) - > Add ( ) ; <nl> + envoy : : config : : filter : : network : : tcp_proxy : : v2 : : TcpProxy <nl> + accessLogConfig ( const std : : string access_log_format ) { <nl> + envoy : : config : : filter : : network : : tcp_proxy : : v2 : : TcpProxy config = defaultConfig ( ) ; <nl> + envoy : : config : : filter : : accesslog : : v2 : : AccessLog * access_log = <nl> + config . mutable_access_log ( ) - > Add ( ) ; <nl> access_log - > set_name ( Config : : AccessLogNames : : get ( ) . FILE ) ; <nl> - envoy : : api : : v2 : : filter : : accesslog : : FileAccessLog file_access_log ; <nl> + envoy : : config : : filter : : accesslog : : v2 : : FileAccessLog file_access_log ; <nl> file_access_log . set_path ( " unused " ) ; <nl> file_access_log . set_format ( access_log_format ) ; <nl> MessageUtil : : jsonConvert ( file_access_log , * access_log - > mutable_config ( ) ) ; <nl> class TcpProxyTest : public testing : : Test { <nl> return config ; <nl> } <nl> <nl> - void setup ( uint32_t connections , const envoy : : api : : v2 : : filter : : network : : TcpProxy & config ) { <nl> + void setup ( uint32_t connections , <nl> + const envoy : : config : : filter : : network : : tcp_proxy : : v2 : : TcpProxy & config ) { <nl> configure ( config ) ; <nl> upstream_local_address_ = Network : : Utility : : resolveUrl ( " tcp : / / 2 . 2 . 2 . 2 : 50000 " ) ; <nl> upstream_remote_address_ = Network : : Utility : : resolveUrl ( " tcp : / / 127 . 0 . 0 . 1 : 80 " ) ; <nl> TEST_F ( TcpProxyTest , UpstreamDisconnect ) { <nl> <nl> / / Test that reconnect is attempted after a connect failure <nl> TEST_F ( TcpProxyTest , ConnectAttemptsUpstreamFail ) { <nl> - envoy : : api : : v2 : : filter : : network : : TcpProxy config = defaultConfig ( ) ; <nl> + envoy : : config : : filter : : network : : tcp_proxy : : v2 : : TcpProxy config = defaultConfig ( ) ; <nl> config . mutable_max_connect_attempts ( ) - > set_value ( 2 ) ; <nl> setup ( 2 , config ) ; <nl> <nl> TEST_F ( TcpProxyTest , ConnectAttemptsUpstreamFail ) { <nl> <nl> / / Test that reconnect is attempted after a connect timeout <nl> TEST_F ( TcpProxyTest , ConnectAttemptsUpstreamTimeout ) { <nl> - envoy : : api : : v2 : : filter : : network : : TcpProxy config = defaultConfig ( ) ; <nl> + envoy : : config : : filter : : network : : tcp_proxy : : v2 : : TcpProxy config = defaultConfig ( ) ; <nl> config . mutable_max_connect_attempts ( ) - > set_value ( 2 ) ; <nl> setup ( 2 , config ) ; <nl> <nl> TEST_F ( TcpProxyTest , ConnectAttemptsUpstreamTimeout ) { <nl> <nl> / / Test that only the configured number of connect attempts occur <nl> TEST_F ( TcpProxyTest , ConnectAttemptsLimit ) { <nl> - envoy : : api : : v2 : : filter : : network : : TcpProxy config = defaultConfig ( ) ; <nl> + envoy : : config : : filter : : network : : tcp_proxy : : v2 : : TcpProxy config = defaultConfig ( ) ; <nl> config . mutable_max_connect_attempts ( ) - > set_value ( 3 ) ; <nl> setup ( 3 , config ) ; <nl> <nl> TEST_F ( TcpProxyTest , ConnectAttemptsLimit ) { <nl> <nl> / / Test that the tcp proxy sends the correct notifications to the outlier detector <nl> TEST_F ( TcpProxyTest , OutlierDetection ) { <nl> - envoy : : api : : v2 : : filter : : network : : TcpProxy config = defaultConfig ( ) ; <nl> + envoy : : config : : filter : : network : : tcp_proxy : : v2 : : TcpProxy config = defaultConfig ( ) ; <nl> config . mutable_max_connect_attempts ( ) - > set_value ( 3 ) ; <nl> setup ( 3 , config ) ; <nl> <nl> TEST_F ( TcpProxyTest , UpstreamConnectionLimit ) { <nl> / / Tests that the idle timer closes both connections , and gets updated when either <nl> / / connection has activity . <nl> TEST_F ( TcpProxyTest , IdleTimeout ) { <nl> - envoy : : api : : v2 : : filter : : network : : TcpProxy config = defaultConfig ( ) ; <nl> + envoy : : config : : filter : : network : : tcp_proxy : : v2 : : TcpProxy config = defaultConfig ( ) ; <nl> config . mutable_idle_timeout ( ) - > set_seconds ( 1 ) ; <nl> setup ( 1 , config ) ; <nl> <nl> TEST_F ( TcpProxyTest , IdleTimeout ) { <nl> <nl> / / Tests that the idle timer is disabled when the downstream connection is closed . <nl> TEST_F ( TcpProxyTest , IdleTimerDisabledDownstreamClose ) { <nl> - envoy : : api : : v2 : : filter : : network : : TcpProxy config = defaultConfig ( ) ; <nl> + envoy : : config : : filter : : network : : tcp_proxy : : v2 : : TcpProxy config = defaultConfig ( ) ; <nl> config . mutable_idle_timeout ( ) - > set_seconds ( 1 ) ; <nl> setup ( 1 , config ) ; <nl> <nl> TEST_F ( TcpProxyTest , IdleTimerDisabledDownstreamClose ) { <nl> <nl> / / Tests that the idle timer is disabled when the upstream connection is closed . <nl> TEST_F ( TcpProxyTest , IdleTimerDisabledUpstreamClose ) { <nl> - envoy : : api : : v2 : : filter : : network : : TcpProxy config = defaultConfig ( ) ; <nl> + envoy : : config : : filter : : network : : tcp_proxy : : v2 : : TcpProxy config = defaultConfig ( ) ; <nl> config . mutable_idle_timeout ( ) - > set_seconds ( 1 ) ; <nl> setup ( 1 , config ) ; <nl> <nl> TEST_F ( TcpProxyTest , UpstreamFlushNoTimeout ) { <nl> / / Tests that upstream flush works with an idle timeout configured , but the connection <nl> / / finishes draining before the timer expires . <nl> TEST_F ( TcpProxyTest , UpstreamFlushTimeoutConfigured ) { <nl> - envoy : : api : : v2 : : filter : : network : : TcpProxy config = defaultConfig ( ) ; <nl> + envoy : : config : : filter : : network : : tcp_proxy : : v2 : : TcpProxy config = defaultConfig ( ) ; <nl> config . mutable_idle_timeout ( ) - > set_seconds ( 1 ) ; <nl> setup ( 1 , config ) ; <nl> <nl> TEST_F ( TcpProxyTest , UpstreamFlushTimeoutConfigured ) { <nl> <nl> / / Tests that upstream flush closes the connection when the idle timeout fires . <nl> TEST_F ( TcpProxyTest , UpstreamFlushTimeoutExpired ) { <nl> - envoy : : api : : v2 : : filter : : network : : TcpProxy config = defaultConfig ( ) ; <nl> + envoy : : config : : filter : : network : : tcp_proxy : : v2 : : TcpProxy config = defaultConfig ( ) ; <nl> config . mutable_idle_timeout ( ) - > set_seconds ( 1 ) ; <nl> setup ( 1 , config ) ; <nl> <nl> mmm a / test / common / grpc / async_client_manager_impl_test . cc <nl> ppp b / test / common / grpc / async_client_manager_impl_test . cc <nl> class AsyncClientManagerImplTest : public testing : : Test { <nl> <nl> TEST_F ( AsyncClientManagerImplTest , EnvoyGrpcOk ) { <nl> AsyncClientManagerImpl async_client_manager ( cm_ , tls_ ) ; <nl> - envoy : : api : : v2 : : GrpcService grpc_service ; <nl> + envoy : : api : : v2 : : core : : GrpcService grpc_service ; <nl> grpc_service . mutable_envoy_grpc ( ) - > set_cluster_name ( " foo " ) ; <nl> <nl> Upstream : : ClusterManager : : ClusterInfoMap cluster_map ; <nl> TEST_F ( AsyncClientManagerImplTest , EnvoyGrpcOk ) { <nl> <nl> TEST_F ( AsyncClientManagerImplTest , EnvoyGrpcUnknown ) { <nl> AsyncClientManagerImpl async_client_manager ( cm_ , tls_ ) ; <nl> - envoy : : api : : v2 : : GrpcService grpc_service ; <nl> + envoy : : api : : v2 : : core : : GrpcService grpc_service ; <nl> grpc_service . mutable_envoy_grpc ( ) - > set_cluster_name ( " foo " ) ; <nl> <nl> EXPECT_CALL ( cm_ , clusters ( ) ) ; <nl> TEST_F ( AsyncClientManagerImplTest , EnvoyGrpcUnknown ) { <nl> <nl> TEST_F ( AsyncClientManagerImplTest , EnvoyGrpcDynamicCluster ) { <nl> AsyncClientManagerImpl async_client_manager ( cm_ , tls_ ) ; <nl> - envoy : : api : : v2 : : GrpcService grpc_service ; <nl> + envoy : : api : : v2 : : core : : GrpcService grpc_service ; <nl> grpc_service . mutable_envoy_grpc ( ) - > set_cluster_name ( " foo " ) ; <nl> <nl> Upstream : : ClusterManager : : ClusterInfoMap cluster_map ; <nl> TEST_F ( AsyncClientManagerImplTest , EnvoyGrpcDynamicCluster ) { <nl> TEST_F ( AsyncClientManagerImplTest , GoogleGrpc ) { <nl> EXPECT_CALL ( scope_ , createScope_ ( " grpc . foo . " ) ) ; <nl> AsyncClientManagerImpl async_client_manager ( cm_ , tls_ ) ; <nl> - envoy : : api : : v2 : : GrpcService grpc_service ; <nl> + envoy : : api : : v2 : : core : : GrpcService grpc_service ; <nl> grpc_service . mutable_google_grpc ( ) - > set_stat_prefix ( " foo " ) ; <nl> <nl> # ifdef ENVOY_GOOGLE_GRPC <nl> mmm a / test / common / grpc / grpc_client_integration . h <nl> ppp b / test / common / grpc / grpc_client_integration . h <nl> class GrpcClientIntegrationParamTest <nl> Network : : Address : : IpVersion ipVersion ( ) const { return std : : get < 0 > ( GetParam ( ) ) ; } <nl> ClientType clientType ( ) const { return std : : get < 1 > ( GetParam ( ) ) ; } <nl> <nl> - void setGrpcService ( envoy : : api : : v2 : : GrpcService & grpc_service , const std : : string & cluster_name , <nl> + void setGrpcService ( envoy : : api : : v2 : : core : : GrpcService & grpc_service , <nl> + const std : : string & cluster_name , <nl> Network : : Address : : InstanceConstSharedPtr address ) { <nl> switch ( clientType ( ) ) { <nl> case ClientType : : EnvoyGrpc : <nl> mmm a / test / common / grpc / grpc_client_integration_test . cc <nl> ppp b / test / common / grpc / grpc_client_integration_test . cc <nl> class GrpcClientIntegrationTest : public GrpcClientIntegrationParamTest { <nl> <nl> AsyncClientPtr createGoogleAsyncClientImpl ( ) { <nl> # ifdef ENVOY_GOOGLE_GRPC <nl> - envoy : : api : : v2 : : GrpcService : : GoogleGrpc config ; <nl> + envoy : : api : : v2 : : core : : GrpcService : : GoogleGrpc config ; <nl> config . set_target_uri ( fake_upstream_ - > localAddress ( ) - > asString ( ) ) ; <nl> config . set_stat_prefix ( " fake_cluster " ) ; <nl> return std : : make_unique < GoogleAsyncClientImpl > ( dispatcher_ , stats_store_ , config ) ; <nl> class GrpcClientIntegrationTest : public GrpcClientIntegrationParamTest { <nl> NiceMock < Runtime : : MockRandomGenerator > random_ ; <nl> Http : : AsyncClientPtr http_async_client_ ; <nl> Http : : ConnectionPool : : InstancePtr http_conn_pool_ ; <nl> - envoy : : api : : v2 : : Locality host_locality_ ; <nl> + envoy : : api : : v2 : : core : : Locality host_locality_ ; <nl> Upstream : : MockHost * mock_host_ = new NiceMock < Upstream : : MockHost > ( ) ; <nl> Upstream : : MockHostDescription * mock_host_description_ = <nl> new NiceMock < Upstream : : MockHostDescription > ( ) ; <nl> mmm a / test / common / grpc / json_transcoder_filter_test . cc <nl> ppp b / test / common / grpc / json_transcoder_filter_test . cc <nl> namespace Grpc { <nl> <nl> class GrpcJsonTranscoderConfigTest : public testing : : Test { <nl> public : <nl> - const envoy : : api : : v2 : : filter : : http : : GrpcJsonTranscoder <nl> + const envoy : : config : : filter : : http : : transcoder : : v2 : : GrpcJsonTranscoder <nl> getProtoConfig ( const std : : string & descriptor_path , const std : : string & service_name ) { <nl> std : : string json_string = " { \ " proto_descriptor \ " : \ " " + descriptor_path + <nl> " \ " , \ " services \ " : [ \ " " + service_name + " \ " ] } " ; <nl> auto json_config = Json : : Factory : : loadFromString ( json_string ) ; <nl> - envoy : : api : : v2 : : filter : : http : : GrpcJsonTranscoder proto_config ; <nl> + envoy : : config : : filter : : http : : transcoder : : v2 : : GrpcJsonTranscoder proto_config ; <nl> Envoy : : Config : : FilterJson : : translateGrpcJsonTranscoder ( * json_config , proto_config ) ; <nl> return proto_config ; <nl> } <nl> TEST_F ( GrpcJsonTranscoderConfigTest , ParseConfig ) { <nl> } <nl> <nl> TEST_F ( GrpcJsonTranscoderConfigTest , ParseBinaryConfig ) { <nl> - envoy : : api : : v2 : : filter : : http : : GrpcJsonTranscoder proto_config ; <nl> + envoy : : config : : filter : : http : : transcoder : : v2 : : GrpcJsonTranscoder proto_config ; <nl> proto_config . set_proto_descriptor_bin ( <nl> Filesystem : : fileReadToEnd ( TestEnvironment : : runfilesPath ( " test / proto / bookstore . descriptor " ) ) ) ; <nl> proto_config . add_services ( " bookstore . Bookstore " ) ; <nl> TEST_F ( GrpcJsonTranscoderConfigTest , NonProto ) { <nl> } <nl> <nl> TEST_F ( GrpcJsonTranscoderConfigTest , NonBinaryProto ) { <nl> - envoy : : api : : v2 : : filter : : http : : GrpcJsonTranscoder proto_config ; <nl> + envoy : : config : : filter : : http : : transcoder : : v2 : : GrpcJsonTranscoder proto_config ; <nl> proto_config . set_proto_descriptor_bin ( " This is invalid proto " ) ; <nl> proto_config . add_services ( " bookstore . Bookstore " ) ; <nl> EXPECT_THROW_WITH_MESSAGE ( JsonTranscoderConfig config ( proto_config ) , EnvoyException , <nl> class GrpcJsonTranscoderFilterTest : public testing : : Test { <nl> filter_ . setEncoderFilterCallbacks ( encoder_callbacks_ ) ; <nl> } <nl> <nl> - const envoy : : api : : v2 : : filter : : http : : GrpcJsonTranscoder bookstoreProtoConfig ( ) { <nl> + const envoy : : config : : filter : : http : : transcoder : : v2 : : GrpcJsonTranscoder bookstoreProtoConfig ( ) { <nl> std : : string json_string = " { \ " proto_descriptor \ " : \ " " + bookstoreDescriptorPath ( ) + <nl> " \ " , \ " services \ " : [ \ " bookstore . Bookstore \ " ] } " ; <nl> auto json_config = Json : : Factory : : loadFromString ( json_string ) ; <nl> - envoy : : api : : v2 : : filter : : http : : GrpcJsonTranscoder proto_config { } ; <nl> + envoy : : config : : filter : : http : : transcoder : : v2 : : GrpcJsonTranscoder proto_config { } ; <nl> Envoy : : Config : : FilterJson : : translateGrpcJsonTranscoder ( * json_config , proto_config ) ; <nl> return proto_config ; <nl> } <nl> class GrpcJsonTranscoderFilterPrintTest <nl> GrpcJsonTranscoderFilterPrintTest ( ) { <nl> auto json_config = <nl> Json : : Factory : : loadFromString ( TestEnvironment : : substitute ( GetParam ( ) . config_json_ ) ) ; <nl> - envoy : : api : : v2 : : filter : : http : : GrpcJsonTranscoder proto_config { } ; <nl> + envoy : : config : : filter : : http : : transcoder : : v2 : : GrpcJsonTranscoder proto_config { } ; <nl> Envoy : : Config : : FilterJson : : translateGrpcJsonTranscoder ( * json_config , proto_config ) ; <nl> config_ = new JsonTranscoderConfig ( proto_config ) ; <nl> filter_ = new JsonTranscoderFilter ( * config_ ) ; <nl> mmm a / test / common / http / async_client_impl_test . cc <nl> ppp b / test / common / http / async_client_impl_test . cc <nl> class AsyncClientImplTest : public testing : : Test { <nl> message_ - > headers ( ) . insertHost ( ) . value ( std : : string ( " host " ) ) ; <nl> message_ - > headers ( ) . insertPath ( ) . value ( std : : string ( " / " ) ) ; <nl> ON_CALL ( * cm_ . conn_pool_ . host_ , locality ( ) ) <nl> - . WillByDefault ( ReturnRef ( envoy : : api : : v2 : : Locality ( ) . default_instance ( ) ) ) ; <nl> + . WillByDefault ( ReturnRef ( envoy : : api : : v2 : : core : : Locality ( ) . default_instance ( ) ) ) ; <nl> } <nl> <nl> void expectSuccess ( uint64_t code ) { <nl> mmm a / test / common / http / conn_manager_impl_test . cc <nl> ppp b / test / common / http / conn_manager_impl_test . cc <nl> TEST_F ( HttpConnectionManagerImplTest , WebSocketConnectTimeoutError ) { <nl> conn_info . host_description_ . reset ( <nl> new Upstream : : HostImpl ( cluster_manager_ . thread_local_cluster_ . cluster_ . info_ , " newhost " , <nl> Network : : Utility : : resolveUrl ( " tcp : / / 127 . 0 . 0 . 1 : 80 " ) , <nl> - envoy : : api : : v2 : : Metadata : : default_instance ( ) , 1 , <nl> - envoy : : api : : v2 : : Locality ( ) . default_instance ( ) ) ) ; <nl> + envoy : : api : : v2 : : core : : Metadata : : default_instance ( ) , 1 , <nl> + envoy : : api : : v2 : : core : : Locality ( ) . default_instance ( ) ) ) ; <nl> EXPECT_CALL ( * connect_timer , enableTimer ( _ ) ) ; <nl> EXPECT_CALL ( cluster_manager_ , tcpConnForCluster_ ( " fake_cluster " , _ ) ) . WillOnce ( Return ( conn_info ) ) ; <nl> <nl> TEST_F ( HttpConnectionManagerImplTest , WebSocketConnectionFailure ) { <nl> conn_info . host_description_ . reset ( <nl> new Upstream : : HostImpl ( cluster_manager_ . thread_local_cluster_ . cluster_ . info_ , " newhost " , <nl> Network : : Utility : : resolveUrl ( " tcp : / / 127 . 0 . 0 . 1 : 80 " ) , <nl> - envoy : : api : : v2 : : Metadata : : default_instance ( ) , 1 , <nl> - envoy : : api : : v2 : : Locality ( ) . default_instance ( ) ) ) ; <nl> + envoy : : api : : v2 : : core : : Metadata : : default_instance ( ) , 1 , <nl> + envoy : : api : : v2 : : core : : Locality ( ) . default_instance ( ) ) ) ; <nl> EXPECT_CALL ( * connect_timer , enableTimer ( _ ) ) ; <nl> EXPECT_CALL ( cluster_manager_ , tcpConnForCluster_ ( " fake_cluster " , _ ) ) . WillOnce ( Return ( conn_info ) ) ; <nl> <nl> TEST_F ( HttpConnectionManagerImplTest , WebSocketPrefixAndAutoHostRewrite ) { <nl> conn_info . host_description_ . reset ( <nl> new Upstream : : HostImpl ( cluster_manager_ . thread_local_cluster_ . cluster_ . info_ , " newhost " , <nl> Network : : Utility : : resolveUrl ( " tcp : / / 127 . 0 . 0 . 1 : 80 " ) , <nl> - envoy : : api : : v2 : : Metadata : : default_instance ( ) , 1 , <nl> - envoy : : api : : v2 : : Locality ( ) . default_instance ( ) ) ) ; <nl> + envoy : : api : : v2 : : core : : Metadata : : default_instance ( ) , 1 , <nl> + envoy : : api : : v2 : : core : : Locality ( ) . default_instance ( ) ) ) ; <nl> EXPECT_CALL ( cluster_manager_ , tcpConnForCluster_ ( " fake_cluster " , _ ) ) . WillOnce ( Return ( conn_info ) ) ; <nl> <nl> ON_CALL ( route_config_provider_ . route_config_ - > route_ - > route_entry_ , useWebSocket ( ) ) <nl> mmm a / test / common / http / filter / fault_filter_test . cc <nl> ppp b / test / common / http / filter / fault_filter_test . cc <nl> class FaultFilterTest : public testing : : Test { <nl> <nl> void SetUpTest ( const std : : string json ) { <nl> Json : : ObjectSharedPtr config = Json : : Factory : : loadFromString ( json ) ; <nl> - envoy : : api : : v2 : : filter : : http : : HTTPFault fault ; <nl> + envoy : : config : : filter : : http : : fault : : v2 : : HTTPFault fault ; <nl> <nl> Config : : FilterJson : : translateFaultFilter ( * config , fault ) ; <nl> config_ . reset ( new FaultFilterConfig ( fault , runtime_ , " prefix . " , stats_ ) ) ; <nl> class FaultFilterTest : public testing : : Test { <nl> <nl> void faultFilterBadConfigHelper ( const std : : string & json ) { <nl> Json : : ObjectSharedPtr config = Json : : Factory : : loadFromString ( json ) ; <nl> - envoy : : api : : v2 : : filter : : http : : HTTPFault fault ; <nl> + envoy : : config : : filter : : http : : fault : : v2 : : HTTPFault fault ; <nl> EXPECT_THROW ( Config : : FilterJson : : translateFaultFilter ( * config , fault ) , EnvoyException ) ; <nl> } <nl> <nl> mmm a / test / common / http / filter / ratelimit_test . cc <nl> ppp b / test / common / http / filter / ratelimit_test . cc <nl> class HttpRateLimitFilterTest : public testing : : Test { <nl> <nl> void SetUpTest ( const std : : string json ) { <nl> Json : : ObjectSharedPtr json_config = Json : : Factory : : loadFromString ( json ) ; <nl> - envoy : : api : : v2 : : filter : : http : : RateLimit proto_config { } ; <nl> + envoy : : config : : filter : : http : : rate_limit : : v2 : : RateLimit proto_config { } ; <nl> Config : : FilterJson : : translateHttpRateLimitFilter ( * json_config , proto_config ) ; <nl> config_ . reset ( new FilterConfig ( proto_config , local_info_ , stats_store_ , runtime_ , cm_ ) ) ; <nl> <nl> TEST_F ( HttpRateLimitFilterTest , BadConfig ) { <nl> ) EOF " ; <nl> <nl> Json : : ObjectSharedPtr json_config = Json : : Factory : : loadFromString ( filter_config ) ; <nl> - envoy : : api : : v2 : : filter : : http : : RateLimit proto_config { } ; <nl> + envoy : : config : : filter : : http : : rate_limit : : v2 : : RateLimit proto_config { } ; <nl> EXPECT_THROW ( Config : : FilterJson : : translateHttpRateLimitFilter ( * json_config , proto_config ) , <nl> Json : : Exception ) ; <nl> } <nl> mmm a / test / common / http / filter / squash_filter_test . cc <nl> ppp b / test / common / http / filter / squash_filter_test . cc <nl> namespace { <nl> SquashFilterConfig constructSquashFilterConfigFromJson ( <nl> const Envoy : : Json : : Object & json , <nl> NiceMock < Envoy : : Server : : Configuration : : MockFactoryContext > & context ) { <nl> - envoy : : api : : v2 : : filter : : http : : Squash proto_config ; <nl> + envoy : : config : : filter : : http : : squash : : v2 : : Squash proto_config ; <nl> Config : : FilterJson : : translateSquashConfig ( json , proto_config ) ; <nl> return SquashFilterConfig ( proto_config , context . cluster_manager_ ) ; <nl> } <nl> class SquashFilterTest : public testing : : Test { <nl> void SetUp ( ) override { } <nl> <nl> void initFilter ( ) { <nl> - envoy : : api : : v2 : : filter : : http : : Squash p ; <nl> + envoy : : config : : filter : : http : : squash : : v2 : : Squash p ; <nl> p . set_cluster ( " squash " ) ; <nl> config_ = std : : make_shared < SquashFilterConfig > ( p , factory_context_ . cluster_manager_ ) ; <nl> <nl> mmm a / test / common / http / utility_test . cc <nl> ppp b / test / common / http / utility_test . cc <nl> TEST ( HttpUtility , createSslRedirectPath ) { <nl> namespace { <nl> <nl> Http2Settings parseHttp2SettingsFromJson ( const std : : string & json_string ) { <nl> - envoy : : api : : v2 : : Http2ProtocolOptions http2_protocol_options ; <nl> + envoy : : api : : v2 : : core : : Http2ProtocolOptions http2_protocol_options ; <nl> auto json_object_ptr = Json : : Factory : : loadFromString ( json_string ) ; <nl> Config : : ProtocolJson : : translateHttp2ProtocolOptions ( <nl> * json_object_ptr - > getObject ( " http2_settings " , true ) , http2_protocol_options ) ; <nl> mmm a / test / common / mongo / proxy_test . cc <nl> ppp b / test / common / mongo / proxy_test . cc <nl> <nl> # include < memory > <nl> # include < string > <nl> <nl> - # include " envoy / api / v2 / filter / fault . pb . h " <nl> + # include " envoy / config / filter / fault / v2 / fault . pb . h " <nl> <nl> # include " common / mongo / bson_impl . h " <nl> # include " common / mongo / codec_impl . h " <nl> class MongoProxyFilterTest : public testing : : Test { <nl> } <nl> <nl> void setupDelayFault ( bool enable_fault ) { <nl> - envoy : : api : : v2 : : filter : : FaultDelay fault { } ; <nl> + envoy : : config : : filter : : fault : : v2 : : FaultDelay fault { } ; <nl> fault . set_percent ( 50 ) ; <nl> fault . mutable_fixed_delay ( ) - > CopyFrom ( Protobuf : : util : : TimeUtil : : MillisecondsToDuration ( 10 ) ) ; <nl> <nl> mmm a / test / common / network / filter_manager_impl_test . cc <nl> ppp b / test / common / network / filter_manager_impl_test . cc <nl> TEST_F ( NetworkFilterManagerTest , RateLimitAndTcpProxy ) { <nl> . WillByDefault ( Return ( true ) ) ; <nl> <nl> Json : : ObjectSharedPtr json_config = Json : : Factory : : loadFromString ( rl_json ) ; <nl> - envoy : : api : : v2 : : filter : : network : : RateLimit proto_config { } ; <nl> + envoy : : config : : filter : : network : : rate_limit : : v2 : : RateLimit proto_config { } ; <nl> Config : : FilterJson : : translateTcpRateLimitFilter ( * json_config , proto_config ) ; <nl> <nl> RateLimit : : TcpFilter : : ConfigSharedPtr rl_config ( new RateLimit : : TcpFilter : : Config ( <nl> TEST_F ( NetworkFilterManagerTest , RateLimitAndTcpProxy ) { <nl> manager . addReadFilter ( ReadFilterSharedPtr { <nl> new RateLimit : : TcpFilter : : Instance ( rl_config , RateLimit : : ClientPtr { rl_client } ) } ) ; <nl> <nl> - envoy : : api : : v2 : : filter : : network : : TcpProxy tcp_proxy ; <nl> + envoy : : config : : filter : : network : : tcp_proxy : : v2 : : TcpProxy tcp_proxy ; <nl> tcp_proxy . set_stat_prefix ( " name " ) ; <nl> tcp_proxy . set_cluster ( " fake_cluster " ) ; <nl> Envoy : : Filter : : TcpProxyConfigSharedPtr tcp_proxy_config ( <nl> mmm a / test / common / network / resolver_impl_test . cc <nl> ppp b / test / common / network / resolver_impl_test . cc <nl> <nl> # include < list > <nl> # include < string > <nl> <nl> - # include " envoy / api / v2 / address . pb . h " <nl> + # include " envoy / api / v2 / core / address . pb . h " <nl> # include " envoy / common / exception . h " <nl> # include " envoy / network / resolver . h " <nl> # include " envoy / registry / registry . h " <nl> class IpResolverTest : public testing : : Test { <nl> } ; <nl> <nl> TEST_F ( IpResolverTest , Basic ) { <nl> - envoy : : api : : v2 : : SocketAddress socket_address ; <nl> + envoy : : api : : v2 : : core : : SocketAddress socket_address ; <nl> socket_address . set_address ( " 1 . 2 . 3 . 4 " ) ; <nl> socket_address . set_port_value ( 443 ) ; <nl> auto address = resolver_ - > resolve ( socket_address ) ; <nl> TEST_F ( IpResolverTest , Basic ) { <nl> } <nl> <nl> TEST_F ( IpResolverTest , DisallowsNamedPort ) { <nl> - envoy : : api : : v2 : : SocketAddress socket_address ; <nl> + envoy : : api : : v2 : : core : : SocketAddress socket_address ; <nl> socket_address . set_address ( " 1 . 2 . 3 . 4 " ) ; <nl> socket_address . set_named_port ( " http " ) ; <nl> EXPECT_THROW_WITH_MESSAGE ( resolver_ - > resolve ( socket_address ) , EnvoyException , <nl> fmt : : format ( " IP resolver can ' t handle port specifier type { } " , <nl> - envoy : : api : : v2 : : SocketAddress : : kNamedPort ) ) ; <nl> + envoy : : api : : v2 : : core : : SocketAddress : : kNamedPort ) ) ; <nl> } <nl> <nl> TEST ( ResolverTest , FromProtoAddress ) { <nl> - envoy : : api : : v2 : : Address ipv4_address ; <nl> + envoy : : api : : v2 : : core : : Address ipv4_address ; <nl> ipv4_address . mutable_socket_address ( ) - > set_address ( " 1 . 2 . 3 . 4 " ) ; <nl> ipv4_address . mutable_socket_address ( ) - > set_port_value ( 5 ) ; <nl> EXPECT_EQ ( " 1 . 2 . 3 . 4 : 5 " , resolveProtoAddress ( ipv4_address ) - > asString ( ) ) ; <nl> <nl> - envoy : : api : : v2 : : Address ipv6_address ; <nl> + envoy : : api : : v2 : : core : : Address ipv6_address ; <nl> ipv6_address . mutable_socket_address ( ) - > set_address ( " 1 : : 1 " ) ; <nl> ipv6_address . mutable_socket_address ( ) - > set_port_value ( 2 ) ; <nl> EXPECT_EQ ( " [ 1 : : 1 ] : 2 " , resolveProtoAddress ( ipv6_address ) - > asString ( ) ) ; <nl> <nl> - envoy : : api : : v2 : : Address pipe_address ; <nl> + envoy : : api : : v2 : : core : : Address pipe_address ; <nl> pipe_address . mutable_pipe ( ) - > set_path ( " / foo / bar " ) ; <nl> EXPECT_EQ ( " / foo / bar " , resolveProtoAddress ( pipe_address ) - > asString ( ) ) ; <nl> } <nl> TEST ( ResolverTest , FromProtoAddress ) { <nl> / / Validate correct handling of ipv4_compat field . <nl> TEST ( ResolverTest , FromProtoAddressV4Compat ) { <nl> { <nl> - envoy : : api : : v2 : : Address ipv6_address ; <nl> + envoy : : api : : v2 : : core : : Address ipv6_address ; <nl> ipv6_address . mutable_socket_address ( ) - > set_address ( " 1 : : 1 " ) ; <nl> ipv6_address . mutable_socket_address ( ) - > set_port_value ( 2 ) ; <nl> auto resolved_addr = resolveProtoAddress ( ipv6_address ) ; <nl> EXPECT_EQ ( " [ 1 : : 1 ] : 2 " , resolved_addr - > asString ( ) ) ; <nl> } <nl> { <nl> - envoy : : api : : v2 : : Address ipv6_address ; <nl> + envoy : : api : : v2 : : core : : Address ipv6_address ; <nl> ipv6_address . mutable_socket_address ( ) - > set_address ( " 1 : : 1 " ) ; <nl> ipv6_address . mutable_socket_address ( ) - > set_port_value ( 2 ) ; <nl> ipv6_address . mutable_socket_address ( ) - > set_ipv4_compat ( true ) ; <nl> TEST ( ResolverTest , FromProtoAddressV4Compat ) { <nl> <nl> class TestResolver : public Resolver { <nl> public : <nl> - InstanceConstSharedPtr resolve ( const envoy : : api : : v2 : : SocketAddress & socket_address ) override { <nl> + InstanceConstSharedPtr <nl> + resolve ( const envoy : : api : : v2 : : core : : SocketAddress & socket_address ) override { <nl> const std : : string logical = socket_address . address ( ) ; <nl> const std : : string physical = getPhysicalName ( logical ) ; <nl> const std : : string port = getPort ( socket_address ) ; <nl> class TestResolver : public Resolver { <nl> return it - > second ; <nl> } <nl> <nl> - std : : string getPort ( const envoy : : api : : v2 : : SocketAddress & socket_address ) { <nl> + std : : string getPort ( const envoy : : api : : v2 : : core : : SocketAddress & socket_address ) { <nl> switch ( socket_address . port_specifier_case ( ) ) { <nl> - case envoy : : api : : v2 : : SocketAddress : : kNamedPort : <nl> + case envoy : : api : : v2 : : core : : SocketAddress : : kNamedPort : <nl> return socket_address . named_port ( ) ; <nl> - case envoy : : api : : v2 : : SocketAddress : : kPortValue : <nl> + case envoy : : api : : v2 : : core : : SocketAddress : : kPortValue : <nl> / / default to port 0 if no port value is specified <nl> - case envoy : : api : : v2 : : SocketAddress : : PORT_SPECIFIER_NOT_SET : <nl> + case envoy : : api : : v2 : : core : : SocketAddress : : PORT_SPECIFIER_NOT_SET : <nl> return fmt : : format ( " { } " , socket_address . port_value ( ) ) ; <nl> <nl> default : <nl> TEST ( ResolverTest , NonStandardResolver ) { <nl> Registry : : InjectFactory < Resolver > register_resolver ( test_resolver ) ; <nl> <nl> { <nl> - envoy : : api : : v2 : : Address address ; <nl> + envoy : : api : : v2 : : core : : Address address ; <nl> auto socket = address . mutable_socket_address ( ) ; <nl> socket - > set_address ( " foo " ) ; <nl> socket - > set_port_value ( 5 ) ; <nl> TEST ( ResolverTest , NonStandardResolver ) { <nl> EXPECT_EQ ( " foo : 5 " , instance - > logicalName ( ) ) ; <nl> } <nl> { <nl> - envoy : : api : : v2 : : Address address ; <nl> + envoy : : api : : v2 : : core : : Address address ; <nl> auto socket = address . mutable_socket_address ( ) ; <nl> socket - > set_address ( " bar " ) ; <nl> socket - > set_named_port ( " http " ) ; <nl> TEST ( ResolverTest , NonStandardResolver ) { <nl> } <nl> <nl> TEST ( ResolverTest , UninitializedAddress ) { <nl> - envoy : : api : : v2 : : Address address ; <nl> + envoy : : api : : v2 : : core : : Address address ; <nl> EXPECT_THROW_WITH_MESSAGE ( resolveProtoAddress ( address ) , EnvoyException , <nl> " Address must be a socket or pipe : " ) ; <nl> } <nl> <nl> TEST ( ResolverTest , NoSuchResolver ) { <nl> - envoy : : api : : v2 : : Address address ; <nl> + envoy : : api : : v2 : : core : : Address address ; <nl> auto socket = address . mutable_socket_address ( ) ; <nl> socket - > set_address ( " foo " ) ; <nl> socket - > set_port_value ( 5 ) ; <nl> mmm a / test / common / network / utility_test . cc <nl> ppp b / test / common / network / utility_test . cc <nl> TEST ( NetworkUtility , AnyAddress ) { <nl> <nl> TEST ( NetworkUtility , AddressToProtobufAddress ) { <nl> { <nl> - envoy : : api : : v2 : : Address proto_address ; <nl> + envoy : : api : : v2 : : core : : Address proto_address ; <nl> Address : : Ipv4Instance address ( " 127 . 0 . 0 . 1 " ) ; <nl> Utility : : addressToProtobufAddress ( address , proto_address ) ; <nl> EXPECT_EQ ( true , proto_address . has_socket_address ( ) ) ; <nl> TEST ( NetworkUtility , AddressToProtobufAddress ) { <nl> EXPECT_EQ ( 0 , proto_address . socket_address ( ) . port_value ( ) ) ; <nl> } <nl> { <nl> - envoy : : api : : v2 : : Address proto_address ; <nl> + envoy : : api : : v2 : : core : : Address proto_address ; <nl> Address : : PipeInstance address ( " / hello " ) ; <nl> Utility : : addressToProtobufAddress ( address , proto_address ) ; <nl> EXPECT_EQ ( true , proto_address . has_pipe ( ) ) ; <nl> mmm a / test / common / protobuf / descriptor_test . cc <nl> ppp b / test / common / protobuf / descriptor_test . cc <nl> namespace Envoy { <nl> / / HAVE DONE SOMETHING BAD . Consult with the larger dev team on how to handle . <nl> TEST ( ProtoDescriptorTest , BackCompat ) { <nl> / / Hack to force linking of the service : https : / / github . com / google / protobuf / issues / 4221 <nl> - envoy : : service : : discovery : : v2 : : AdsDummy ads_dummy ; <nl> + / / TODO ( kuat ) : Remove explicit proto descriptor import . <nl> + envoy : : service : : discovery : : v2 : : AdsDummy dummy ; <nl> envoy : : service : : ratelimit : : v2 : : RateLimitRequest rls_dummy ; <nl> <nl> const auto methods = { <nl> mmm a / test / common / ratelimit / ratelimit_impl_test . cc <nl> ppp b / test / common / ratelimit / ratelimit_impl_test . cc <nl> TEST ( RateLimitGrpcFactoryTest , Create ) { <nl> Stats : : MockStore scope ; <nl> EXPECT_CALL ( async_client_manager , <nl> factoryForGrpcService ( ProtoEq ( config . grpc_service ( ) ) , Ref ( scope ) ) ) <nl> - . WillOnce ( Invoke ( [ ] ( const envoy : : api : : v2 : : GrpcService & , Stats : : Scope & ) { <nl> + . WillOnce ( Invoke ( [ ] ( const envoy : : api : : v2 : : core : : GrpcService & , Stats : : Scope & ) { <nl> return std : : make_unique < NiceMock < Grpc : : MockAsyncClientFactory > > ( ) ; <nl> } ) ) ; <nl> GrpcFactoryImpl factory ( config , async_client_manager , scope ) ; <nl> TEST ( RateLimitGrpcFactoryTest , CreateLegacy ) { <nl> config . set_cluster_name ( " foo " ) ; <nl> Grpc : : MockAsyncClientManager async_client_manager ; <nl> Stats : : MockStore scope ; <nl> - envoy : : api : : v2 : : GrpcService expected_grpc_service ; <nl> + envoy : : api : : v2 : : core : : GrpcService expected_grpc_service ; <nl> expected_grpc_service . mutable_envoy_grpc ( ) - > set_cluster_name ( " foo " ) ; <nl> EXPECT_CALL ( async_client_manager , <nl> factoryForGrpcService ( ProtoEq ( expected_grpc_service ) , Ref ( scope ) ) ) <nl> - . WillOnce ( Invoke ( [ ] ( const envoy : : api : : v2 : : GrpcService & , Stats : : Scope & ) { <nl> + . WillOnce ( Invoke ( [ ] ( const envoy : : api : : v2 : : core : : GrpcService & , Stats : : Scope & ) { <nl> return std : : make_unique < NiceMock < Grpc : : MockAsyncClientFactory > > ( ) ; <nl> } ) ) ; <nl> GrpcFactoryImpl factory ( config , async_client_manager , scope ) ; <nl> mmm a / test / common / redis / conn_pool_impl_test . cc <nl> ppp b / test / common / redis / conn_pool_impl_test . cc <nl> namespace Envoy { <nl> namespace Redis { <nl> namespace ConnPool { <nl> <nl> - envoy : : api : : v2 : : filter : : network : : RedisProxy : : ConnPoolSettings createConnPoolSettings ( ) { <nl> - envoy : : api : : v2 : : filter : : network : : RedisProxy : : ConnPoolSettings setting { } ; <nl> + envoy : : config : : filter : : network : : redis_proxy : : v2 : : RedisProxy : : ConnPoolSettings <nl> + createConnPoolSettings ( ) { <nl> + envoy : : config : : filter : : network : : redis_proxy : : v2 : : RedisProxy : : ConnPoolSettings setting { } ; <nl> setting . mutable_op_timeout ( ) - > CopyFrom ( Protobuf : : util : : TimeUtil : : MillisecondsToDuration ( 20 ) ) ; <nl> return setting ; <nl> } <nl> mmm a / test / common / redis / proxy_filter_test . cc <nl> ppp b / test / common / redis / proxy_filter_test . cc <nl> using testing : : _ ; <nl> namespace Envoy { <nl> namespace Redis { <nl> <nl> - envoy : : api : : v2 : : filter : : network : : RedisProxy parseProtoFromJson ( const std : : string & json_string ) { <nl> - envoy : : api : : v2 : : filter : : network : : RedisProxy config ; <nl> + envoy : : config : : filter : : network : : redis_proxy : : v2 : : RedisProxy <nl> + parseProtoFromJson ( const std : : string & json_string ) { <nl> + envoy : : config : : filter : : network : : redis_proxy : : v2 : : RedisProxy config ; <nl> auto json_object_ptr = Json : : Factory : : loadFromString ( json_string ) ; <nl> Config : : FilterJson : : translateRedisProxy ( * json_object_ptr , config ) ; <nl> <nl> TEST_F ( RedisProxyFilterConfigTest , Normal ) { <nl> } <nl> ) EOF " ; <nl> <nl> - envoy : : api : : v2 : : filter : : network : : RedisProxy proto_config = <nl> + envoy : : config : : filter : : network : : redis_proxy : : v2 : : RedisProxy proto_config = <nl> Envoy : : Redis : : parseProtoFromJson ( json_string ) ; <nl> ProxyFilterConfig config ( proto_config , cm_ , store_ , drain_decision_ , runtime_ ) ; <nl> EXPECT_EQ ( " fake_cluster " , config . cluster_name_ ) ; <nl> TEST_F ( RedisProxyFilterConfigTest , InvalidCluster ) { <nl> } <nl> ) EOF " ; <nl> <nl> - envoy : : api : : v2 : : filter : : network : : RedisProxy proto_config = <nl> + envoy : : config : : filter : : network : : redis_proxy : : v2 : : RedisProxy proto_config = <nl> Envoy : : Redis : : parseProtoFromJson ( json_string ) ; <nl> <nl> EXPECT_CALL ( cm_ , get ( " fake_cluster " ) ) . WillOnce ( Return ( nullptr ) ) ; <nl> TEST_F ( RedisProxyFilterConfigTest , InvalidAddedByApi ) { <nl> } <nl> ) EOF " ; <nl> <nl> - envoy : : api : : v2 : : filter : : network : : RedisProxy proto_config = <nl> + envoy : : config : : filter : : network : : redis_proxy : : v2 : : RedisProxy proto_config = <nl> Envoy : : Redis : : parseProtoFromJson ( json_string ) ; <nl> <nl> ON_CALL ( * cm_ . thread_local_cluster_ . cluster_ . info_ , addedViaApi ( ) ) . WillByDefault ( Return ( true ) ) ; <nl> class RedisProxyFilterTest : public testing : : Test , public DecoderFactory { <nl> } <nl> ) EOF " ; <nl> <nl> - envoy : : api : : v2 : : filter : : network : : RedisProxy proto_config = <nl> + envoy : : config : : filter : : network : : redis_proxy : : v2 : : RedisProxy proto_config = <nl> Envoy : : Redis : : parseProtoFromJson ( json_string ) ; <nl> NiceMock < Upstream : : MockClusterManager > cm ; <nl> config_ . reset ( new ProxyFilterConfig ( proto_config , cm , store_ , drain_decision_ , runtime_ ) ) ; <nl> mmm a / test / common / router / BUILD <nl> ppp b / test / common / router / BUILD <nl> envoy_cc_test ( <nl> " / / test / mocks / ssl : ssl_mocks " , <nl> " / / test / mocks / upstream : upstream_mocks " , <nl> " / / test / test_common : utility_lib " , <nl> - " @ envoy_api / / envoy / api / v2 / filter / http : router_cc " , <nl> + " @ envoy_api / / envoy / config / filter / http / router / v2 : router_cc " , <nl> ] , <nl> ) <nl> <nl> mmm a / test / common / router / header_formatter_test . cc <nl> ppp b / test / common / router / header_formatter_test . cc <nl> <nl> # include < string > <nl> <nl> - # include " envoy / api / v2 / base . pb . h " <nl> + # include " envoy / api / v2 / core / base . pb . h " <nl> # include " envoy / http / protocol . h " <nl> <nl> # include " common / config / metadata . h " <nl> TEST_F ( RequestInfoHeaderFormatterTest , TestFormatWithUpstreamMetadataVariable ) { <nl> std : : shared_ptr < NiceMock < Envoy : : Upstream : : MockHostDescription > > host ( <nl> new NiceMock < Envoy : : Upstream : : MockHostDescription > ( ) ) ; <nl> <nl> - envoy : : api : : v2 : : Metadata metadata = TestUtility : : parseYaml < envoy : : api : : v2 : : Metadata > ( <nl> + envoy : : api : : v2 : : core : : Metadata metadata = TestUtility : : parseYaml < envoy : : api : : v2 : : core : : Metadata > ( <nl> R " EOF ( <nl> filter_metadata : <nl> namespace : <nl> TEST ( HeaderParserTest , TestParseInternal ) { <nl> ON_CALL ( request_info , upstreamHost ( ) ) . WillByDefault ( Return ( host ) ) ; <nl> <nl> / / Metadata with percent signs in the key . <nl> - envoy : : api : : v2 : : Metadata metadata = TestUtility : : parseYaml < envoy : : api : : v2 : : Metadata > ( <nl> + envoy : : api : : v2 : : core : : Metadata metadata = TestUtility : : parseYaml < envoy : : api : : v2 : : core : : Metadata > ( <nl> R " EOF ( <nl> filter_metadata : <nl> ns : <nl> TEST ( HeaderParserTest , TestParseInternal ) { <nl> ON_CALL ( * host , metadata ( ) ) . WillByDefault ( ReturnRef ( metadata ) ) ; <nl> <nl> for ( const auto & test_case : test_cases ) { <nl> - Protobuf : : RepeatedPtrField < envoy : : api : : v2 : : HeaderValueOption > to_add ; <nl> - envoy : : api : : v2 : : HeaderValueOption * header = to_add . Add ( ) ; <nl> + Protobuf : : RepeatedPtrField < envoy : : api : : v2 : : core : : HeaderValueOption > to_add ; <nl> + envoy : : api : : v2 : : core : : HeaderValueOption * header = to_add . Add ( ) ; <nl> header - > mutable_header ( ) - > set_key ( " x - header " ) ; <nl> header - > mutable_header ( ) - > set_value ( test_case . input_ ) ; <nl> <nl> TEST ( HeaderParserTest , EvaluateEmptyHeaders ) { <nl> std : : shared_ptr < NiceMock < Envoy : : Upstream : : MockHostDescription > > host ( <nl> new NiceMock < Envoy : : Upstream : : MockHostDescription > ( ) ) ; <nl> NiceMock < Envoy : : RequestInfo : : MockRequestInfo > request_info ; <nl> - envoy : : api : : v2 : : Metadata metadata ; <nl> + envoy : : api : : v2 : : core : : Metadata metadata ; <nl> ON_CALL ( request_info , upstreamHost ( ) ) . WillByDefault ( Return ( host ) ) ; <nl> ON_CALL ( * host , metadata ( ) ) . WillByDefault ( ReturnRef ( metadata ) ) ; <nl> req_header_parser - > evaluateHeaders ( headerMap , request_info ) ; <nl> match : { prefix : " / new_endpoint " } <nl> ON_CALL ( request_info , upstreamHost ( ) ) . WillByDefault ( Return ( host ) ) ; <nl> <nl> / / Metadata with percent signs in the key . <nl> - envoy : : api : : v2 : : Metadata metadata = TestUtility : : parseYaml < envoy : : api : : v2 : : Metadata > ( <nl> + envoy : : api : : v2 : : core : : Metadata metadata = TestUtility : : parseYaml < envoy : : api : : v2 : : core : : Metadata > ( <nl> R " EOF ( <nl> filter_metadata : <nl> namespace : <nl> mmm a / test / common / router / rds_impl_test . cc <nl> ppp b / test / common / router / rds_impl_test . cc <nl> namespace Envoy { <nl> namespace Router { <nl> namespace { <nl> <nl> - envoy : : api : : v2 : : filter : : network : : HttpConnectionManager <nl> + envoy : : config : : filter : : network : : http_connection_manager : : v2 : : HttpConnectionManager <nl> parseHttpConnectionManagerFromJson ( const std : : string & json_string ) { <nl> - envoy : : api : : v2 : : filter : : network : : HttpConnectionManager http_connection_manager ; <nl> + envoy : : config : : filter : : network : : http_connection_manager : : v2 : : HttpConnectionManager <nl> + http_connection_manager ; <nl> auto json_object_ptr = Json : : Factory : : loadFromString ( json_string ) ; <nl> Envoy : : Config : : FilterJson : : translateHttpConnectionManager ( * json_object_ptr , <nl> http_connection_manager ) ; <nl> TEST_F ( RdsImplTest , UnknownCluster ) { <nl> <nl> Upstream : : ClusterManager : : ClusterInfoMap cluster_map ; <nl> EXPECT_CALL ( cm_ , clusters ( ) ) . WillOnce ( Return ( cluster_map ) ) ; <nl> - EXPECT_THROW_WITH_MESSAGE ( RouteConfigProviderUtil : : create ( <nl> - parseHttpConnectionManagerFromJson ( config_json ) , runtime_ , cm_ , <nl> - store_ , " foo . " , init_manager_ , * route_config_provider_manager_ ) , <nl> - EnvoyException , <nl> - " envoy : : api : : v2 : : ConfigSource must have a statically defined non - EDS " <nl> - " cluster : ' foo_cluster ' does not exist , was added via api , or is an " <nl> - " EDS cluster " ) ; <nl> + EXPECT_THROW_WITH_MESSAGE ( <nl> + RouteConfigProviderUtil : : create ( parseHttpConnectionManagerFromJson ( config_json ) , runtime_ , <nl> + cm_ , store_ , " foo . " , init_manager_ , <nl> + * route_config_provider_manager_ ) , <nl> + EnvoyException , <nl> + " envoy : : api : : v2 : : core : : ConfigSource must have a statically defined non - EDS " <nl> + " cluster : ' foo_cluster ' does not exist , was added via api , or is an " <nl> + " EDS cluster " ) ; <nl> } <nl> <nl> TEST_F ( RdsImplTest , DestroyDuringInitialize ) { <nl> class RouteConfigProviderManagerImplTest : public testing : : Test { <nl> NiceMock < ThreadLocal : : MockInstance > tls_ ; <nl> NiceMock < Init : : MockManager > init_manager_ ; <nl> NiceMock < Server : : MockAdmin > admin_ ; <nl> - envoy : : api : : v2 : : filter : : network : : Rds rds_ ; <nl> + envoy : : config : : filter : : network : : http_connection_manager : : v2 : : Rds rds_ ; <nl> Server : : Admin : : HandlerCb handler_callback_ ; <nl> std : : unique_ptr < RouteConfigProviderManagerImpl > route_config_provider_manager_ ; <nl> RouteConfigProviderSharedPtr provider_ ; <nl> TEST_F ( RouteConfigProviderManagerImplTest , Basic ) { <nl> ) EOF " ; <nl> <nl> Json : : ObjectSharedPtr config2 = Json : : Factory : : loadFromString ( config_json2 ) ; <nl> - envoy : : api : : v2 : : filter : : network : : Rds rds2 ; <nl> + envoy : : config : : filter : : network : : http_connection_manager : : v2 : : Rds rds2 ; <nl> Envoy : : Config : : Utility : : translateRdsConfig ( * config2 , rds2 ) ; <nl> <nl> Upstream : : ClusterManager : : ClusterInfoMap cluster_map ; <nl> mmm a / test / common / router / router_test . cc <nl> ppp b / test / common / router / router_test . cc <nl> class RouterTestBase : public testing : : Test { <nl> } <nl> <nl> std : : string upstream_zone_ { " to_az " } ; <nl> - envoy : : api : : v2 : : Locality upstream_locality_ ; <nl> + envoy : : api : : v2 : : core : : Locality upstream_locality_ ; <nl> Stats : : IsolatedStoreImpl stats_store_ ; <nl> NiceMock < Upstream : : MockClusterManager > cm_ ; <nl> NiceMock < Runtime : : MockLoader > runtime_ ; <nl> mmm a / test / common / router / router_upstream_log_test . cc <nl> ppp b / test / common / router / router_upstream_log_test . cc <nl> namespace Envoy { <nl> namespace Router { <nl> namespace { <nl> <nl> - Optional < envoy : : api : : v2 : : filter : : accesslog : : AccessLog > testUpstreamLog ( ) { <nl> + Optional < envoy : : config : : filter : : accesslog : : v2 : : AccessLog > testUpstreamLog ( ) { <nl> / / Custom format without timestamps or durations . <nl> const std : : string json_string = R " EOF ( <nl> { <nl> Optional < envoy : : api : : v2 : : filter : : accesslog : : AccessLog > testUpstreamLog ( ) { <nl> <nl> auto json_object_ptr = Json : : Factory : : loadFromString ( json_string ) ; <nl> <nl> - envoy : : api : : v2 : : filter : : accesslog : : AccessLog upstream_log ; <nl> + envoy : : config : : filter : : accesslog : : v2 : : AccessLog upstream_log ; <nl> Envoy : : Config : : FilterJson : : translateAccessLog ( * json_object_ptr , upstream_log ) ; <nl> <nl> - return Optional < envoy : : api : : v2 : : filter : : accesslog : : AccessLog > ( upstream_log ) ; <nl> + return Optional < envoy : : config : : filter : : accesslog : : v2 : : AccessLog > ( upstream_log ) ; <nl> } <nl> <nl> } / / namespace <nl> class RouterUpstreamLogTest : public testing : : Test { <nl> public : <nl> RouterUpstreamLogTest ( ) { } <nl> <nl> - void init ( Optional < envoy : : api : : v2 : : filter : : accesslog : : AccessLog > upstream_log ) { <nl> - envoy : : api : : v2 : : filter : : http : : Router router_proto ; <nl> + void init ( Optional < envoy : : config : : filter : : accesslog : : v2 : : AccessLog > upstream_log ) { <nl> + envoy : : config : : filter : : http : : router : : v2 : : Router router_proto ; <nl> <nl> if ( upstream_log . valid ( ) ) { <nl> ON_CALL ( * context_ . access_log_manager_ . file_ , write ( _ ) ) <nl> . WillByDefault ( Invoke ( [ & ] ( const std : : string & data ) { output_ . push_back ( data ) ; } ) ) ; <nl> <nl> - envoy : : api : : v2 : : filter : : accesslog : : AccessLog * current_upstream_log = <nl> + envoy : : config : : filter : : accesslog : : v2 : : AccessLog * current_upstream_log = <nl> router_proto . add_upstream_log ( ) ; <nl> current_upstream_log - > CopyFrom ( upstream_log . value ( ) ) ; <nl> } <nl> class RouterUpstreamLogTest : public testing : : Test { <nl> <nl> NiceMock < Server : : Configuration : : MockFactoryContext > context_ ; <nl> <nl> - envoy : : api : : v2 : : Locality upstream_locality_ ; <nl> + envoy : : api : : v2 : : core : : Locality upstream_locality_ ; <nl> Network : : Address : : InstanceConstSharedPtr host_address_ { <nl> Network : : Utility : : resolveUrl ( " tcp : / / 10 . 0 . 0 . 5 : 9211 " ) } ; <nl> Event : : MockTimer * response_timeout_ { } ; <nl> mmm a / test / common / upstream / BUILD <nl> ppp b / test / common / upstream / BUILD <nl> envoy_cc_test ( <nl> " / / test / mocks / upstream : upstream_mocks " , <nl> " / / test / test_common : environment_lib " , <nl> " / / test / test_common : utility_lib " , <nl> - " @ envoy_api / / envoy / api / v2 : base_cc " , <nl> + " @ envoy_api / / envoy / api / v2 / core : base_cc " , <nl> ] , <nl> ) <nl> <nl> mmm a / test / common / upstream / cds_api_impl_test . cc <nl> ppp b / test / common / upstream / cds_api_impl_test . cc <nl> class CdsApiImplTest : public testing : : Test { <nl> ) EOF " ; <nl> <nl> Json : : ObjectSharedPtr config = Json : : Factory : : loadFromString ( config_json ) ; <nl> - envoy : : api : : v2 : : ConfigSource cds_config ; <nl> + envoy : : api : : v2 : : core : : ConfigSource cds_config ; <nl> Config : : Utility : : translateCdsConfig ( * config , cds_config ) ; <nl> if ( v2_rest ) { <nl> - cds_config . mutable_api_config_source ( ) - > set_api_type ( envoy : : api : : v2 : : ApiConfigSource : : REST ) ; <nl> + cds_config . mutable_api_config_source ( ) - > set_api_type ( <nl> + envoy : : api : : v2 : : core : : ApiConfigSource : : REST ) ; <nl> } <nl> Upstream : : ClusterManager : : ClusterInfoMap cluster_map ; <nl> Upstream : : MockCluster cluster ; <nl> class CdsApiImplTest : public testing : : Test { <nl> Event : : MockTimer * interval_timer_ ; <nl> Http : : AsyncClient : : Callbacks * callbacks_ { } ; <nl> ReadyWatcher initialized_ ; <nl> - Optional < envoy : : api : : v2 : : ConfigSource > eds_config_ ; <nl> + Optional < envoy : : api : : v2 : : core : : ConfigSource > eds_config_ ; <nl> } ; <nl> <nl> / / Negative test for protoc - gen - validate constraints . <nl> TEST_F ( CdsApiImplTest , InvalidOptions ) { <nl> Json : : ObjectSharedPtr config = Json : : Factory : : loadFromString ( config_json ) ; <nl> local_info_ . node_ . set_cluster ( " " ) ; <nl> local_info_ . node_ . set_id ( " " ) ; <nl> - envoy : : api : : v2 : : ConfigSource cds_config ; <nl> + envoy : : api : : v2 : : core : : ConfigSource cds_config ; <nl> Config : : Utility : : translateCdsConfig ( * config , cds_config ) ; <nl> EXPECT_THROW ( <nl> CdsApiImpl : : create ( cds_config , eds_config_ , cm_ , dispatcher_ , random_ , local_info_ , store_ ) , <nl> mmm a / test / common / upstream / cluster_manager_impl_test . cc <nl> ppp b / test / common / upstream / cluster_manager_impl_test . cc <nl> class TestClusterManagerFactory : public ClusterManagerFactory { <nl> return clusterFromProto_ ( cluster , cm , outlier_event_logger , added_via_api ) ; <nl> } <nl> <nl> - CdsApiPtr createCds ( const envoy : : api : : v2 : : ConfigSource & , <nl> - const Optional < envoy : : api : : v2 : : ConfigSource > & , ClusterManager & ) override { <nl> + CdsApiPtr createCds ( const envoy : : api : : v2 : : core : : ConfigSource & , <nl> + const Optional < envoy : : api : : v2 : : core : : ConfigSource > & , <nl> + ClusterManager & ) override { <nl> return CdsApiPtr { createCds_ ( ) } ; <nl> } <nl> <nl> mmm a / test / common / upstream / eds_test . cc <nl> ppp b / test / common / upstream / eds_test . cc <nl> class EdsTest : public testing : : Test { <nl> } <nl> <nl> void resetCluster ( const std : : string & json_config ) { <nl> - envoy : : api : : v2 : : ConfigSource eds_config ; <nl> + envoy : : api : : v2 : : core : : ConfigSource eds_config ; <nl> eds_config . mutable_api_config_source ( ) - > add_cluster_names ( " eds " ) ; <nl> eds_config . mutable_api_config_source ( ) - > mutable_refresh_delay ( ) - > set_seconds ( 1 ) ; <nl> local_info_ . node_ . mutable_locality ( ) - > set_zone ( " us - east - 1a " ) ; <nl> mmm a / test / common / upstream / health_checker_impl_test . cc <nl> ppp b / test / common / upstream / health_checker_impl_test . cc <nl> namespace Envoy { <nl> namespace Upstream { <nl> namespace { <nl> <nl> - envoy : : api : : v2 : : HealthCheck parseHealthCheckFromJson ( const std : : string & json_string ) { <nl> - envoy : : api : : v2 : : HealthCheck health_check ; <nl> + envoy : : api : : v2 : : core : : HealthCheck parseHealthCheckFromJson ( const std : : string & json_string ) { <nl> + envoy : : api : : v2 : : core : : HealthCheck health_check ; <nl> auto json_object_ptr = Json : : Factory : : loadFromString ( json_string ) ; <nl> Config : : CdsJson : : translateHealthCheck ( * json_object_ptr , health_check ) ; <nl> return health_check ; <nl> } <nl> <nl> - envoy : : api : : v2 : : HealthCheck createGrpcHealthCheckConfig ( ) { <nl> - envoy : : api : : v2 : : HealthCheck health_check ; <nl> + envoy : : api : : v2 : : core : : HealthCheck createGrpcHealthCheckConfig ( ) { <nl> + envoy : : api : : v2 : : core : : HealthCheck health_check ; <nl> health_check . mutable_timeout ( ) - > set_seconds ( 1 ) ; <nl> health_check . mutable_interval ( ) - > set_seconds ( 1 ) ; <nl> health_check . mutable_unhealthy_threshold ( ) - > set_value ( 2 ) ; <nl> TEST ( HealthCheckerFactoryTest , MissingFieldiException ) { <nl> Runtime : : MockLoader runtime ; <nl> Runtime : : MockRandomGenerator random ; <nl> Event : : MockDispatcher dispatcher ; <nl> - envoy : : api : : v2 : : HealthCheck health_check ; <nl> + envoy : : api : : v2 : : core : : HealthCheck health_check ; <nl> / / No health checker type set <nl> EXPECT_THROW ( HealthCheckerFactory : : create ( health_check , cluster , runtime , random , dispatcher ) , <nl> EnvoyException ) ; <nl> TEST_F ( HttpHealthCheckerImplTest , ConnectionReachesWatermarkDuringCheck ) { <nl> <nl> TEST ( TcpHealthCheckMatcher , loadJsonBytes ) { <nl> { <nl> - Protobuf : : RepeatedPtrField < envoy : : api : : v2 : : HealthCheck : : Payload > repeated_payload ; <nl> + Protobuf : : RepeatedPtrField < envoy : : api : : v2 : : core : : HealthCheck : : Payload > repeated_payload ; <nl> repeated_payload . Add ( ) - > set_text ( " 39000000 " ) ; <nl> repeated_payload . Add ( ) - > set_text ( " EEEEEEEE " ) ; <nl> <nl> TEST ( TcpHealthCheckMatcher , loadJsonBytes ) { <nl> } <nl> <nl> { <nl> - Protobuf : : RepeatedPtrField < envoy : : api : : v2 : : HealthCheck : : Payload > repeated_payload ; <nl> + Protobuf : : RepeatedPtrField < envoy : : api : : v2 : : core : : HealthCheck : : Payload > repeated_payload ; <nl> repeated_payload . Add ( ) - > set_text ( " 4 " ) ; <nl> <nl> EXPECT_THROW ( TcpHealthCheckMatcher : : loadProtoBytes ( repeated_payload ) , EnvoyException ) ; <nl> } <nl> <nl> { <nl> - Protobuf : : RepeatedPtrField < envoy : : api : : v2 : : HealthCheck : : Payload > repeated_payload ; <nl> + Protobuf : : RepeatedPtrField < envoy : : api : : v2 : : core : : HealthCheck : : Payload > repeated_payload ; <nl> repeated_payload . Add ( ) - > set_text ( " gg " ) ; <nl> <nl> EXPECT_THROW ( TcpHealthCheckMatcher : : loadProtoBytes ( repeated_payload ) , EnvoyException ) ; <nl> static void add_uint8 ( Buffer : : Instance & buffer , uint8_t addend ) { <nl> } <nl> <nl> TEST ( TcpHealthCheckMatcher , match ) { <nl> - Protobuf : : RepeatedPtrField < envoy : : api : : v2 : : HealthCheck : : Payload > repeated_payload ; <nl> + Protobuf : : RepeatedPtrField < envoy : : api : : v2 : : core : : HealthCheck : : Payload > repeated_payload ; <nl> repeated_payload . Add ( ) - > set_text ( " 01 " ) ; <nl> repeated_payload . Add ( ) - > set_text ( " 02 " ) ; <nl> <nl> mmm a / test / common / upstream / load_balancer_simulation_test . cc <nl> ppp b / test / common / upstream / load_balancer_simulation_test . cc <nl> namespace Upstream { <nl> static HostSharedPtr newTestHost ( Upstream : : ClusterInfoConstSharedPtr cluster , <nl> const std : : string & url , uint32_t weight = 1 , <nl> const std : : string & zone = " " ) { <nl> - envoy : : api : : v2 : : Locality locality ; <nl> + envoy : : api : : v2 : : core : : Locality locality ; <nl> locality . set_zone ( zone ) ; <nl> return HostSharedPtr { new HostImpl ( cluster , " " , Network : : Utility : : resolveUrl ( url ) , <nl> - envoy : : api : : v2 : : Metadata : : default_instance ( ) , weight , <nl> + envoy : : api : : v2 : : core : : Metadata : : default_instance ( ) , weight , <nl> locality ) } ; <nl> } <nl> <nl> mmm a / test / common / upstream / load_stats_reporter_test . cc <nl> ppp b / test / common / upstream / load_stats_reporter_test . cc <nl> class LoadStatsReporterTest : public testing : : Test { <nl> load_stats_reporter_ - > onReceiveMessage ( std : : move ( response ) ) ; <nl> } <nl> <nl> - envoy : : api : : v2 : : Node node_ ; <nl> + envoy : : api : : v2 : : core : : Node node_ ; <nl> NiceMock < Upstream : : MockClusterManager > cm_ ; <nl> Event : : MockDispatcher dispatcher_ ; <nl> Stats : : IsolatedStoreImpl stats_store_ ; <nl> mmm a / test / common / upstream / logical_dns_cluster_test . cc <nl> ppp b / test / common / upstream / logical_dns_cluster_test . cc <nl> TEST_F ( LogicalDnsClusterTest , Basic ) { <nl> EXPECT_EQ ( " " , data . host_description_ - > locality ( ) . zone ( ) ) ; <nl> EXPECT_EQ ( " " , data . host_description_ - > locality ( ) . sub_zone ( ) ) ; <nl> EXPECT_EQ ( " foo . bar . com " , data . host_description_ - > hostname ( ) ) ; <nl> - EXPECT_EQ ( & envoy : : api : : v2 : : Metadata : : default_instance ( ) , & data . host_description_ - > metadata ( ) ) ; <nl> + EXPECT_EQ ( & envoy : : api : : v2 : : core : : Metadata : : default_instance ( ) , <nl> + & data . host_description_ - > metadata ( ) ) ; <nl> data . host_description_ - > outlierDetector ( ) . putHttpResponseCode ( 200 ) ; <nl> data . host_description_ - > healthChecker ( ) . setUnhealthy ( ) ; <nl> <nl> mmm a / test / common / upstream / sds_test . cc <nl> ppp b / test / common / upstream / sds_test . cc <nl> <nl> # include < string > <nl> # include < vector > <nl> <nl> - # include " envoy / api / v2 / base . pb . h " <nl> + # include " envoy / api / v2 / core / base . pb . h " <nl> <nl> # include " common / config / utility . h " <nl> # include " common / filesystem / filesystem_impl . h " <nl> class SdsTest : public testing : : Test { <nl> <nl> timer_ = new Event : : MockTimer ( & dispatcher_ ) ; <nl> local_info_ . node_ . mutable_locality ( ) - > set_zone ( " us - east - 1a " ) ; <nl> - envoy : : api : : v2 : : ConfigSource eds_config ; <nl> + envoy : : api : : v2 : : core : : ConfigSource eds_config ; <nl> eds_config . mutable_api_config_source ( ) - > add_cluster_names ( " sds " ) ; <nl> eds_config . mutable_api_config_source ( ) - > mutable_refresh_delay ( ) - > set_seconds ( 1 ) ; <nl> sds_cluster_ = parseSdsClusterFromJson ( raw_config , eds_config ) ; <nl> mmm a / test / common / upstream / subset_lb_test . cc <nl> ppp b / test / common / upstream / subset_lb_test . cc <nl> class SubsetLoadBalancerTest : public testing : : TestWithParam < UpdateOrder > { <nl> } <nl> <nl> HostSharedPtr makeHost ( const std : : string & url , const HostMetadata & metadata ) { <nl> - envoy : : api : : v2 : : Metadata m ; <nl> + envoy : : api : : v2 : : core : : Metadata m ; <nl> for ( const auto & m_it : metadata ) { <nl> Config : : Metadata : : mutableMetadataValue ( m , Config : : MetadataFilters : : get ( ) . ENVOY_LB , m_it . first ) <nl> . set_string_value ( m_it . second ) ; <nl> mmm a / test / common / upstream / upstream_impl_test . cc <nl> ppp b / test / common / upstream / upstream_impl_test . cc <nl> TEST ( HostImplTest , Weight ) { <nl> <nl> TEST ( HostImplTest , HostnameCanaryAndLocality ) { <nl> MockCluster cluster ; <nl> - envoy : : api : : v2 : : Metadata metadata ; <nl> + envoy : : api : : v2 : : core : : Metadata metadata ; <nl> Config : : Metadata : : mutableMetadataValue ( metadata , Config : : MetadataFilters : : get ( ) . ENVOY_LB , <nl> Config : : MetadataEnvoyLbKeys : : get ( ) . CANARY ) <nl> . set_bool_value ( true ) ; <nl> - envoy : : api : : v2 : : Locality locality ; <nl> + envoy : : api : : v2 : : core : : Locality locality ; <nl> locality . set_region ( " oceania " ) ; <nl> locality . set_zone ( " hello " ) ; <nl> locality . set_sub_zone ( " world " ) ; <nl> mmm a / test / common / upstream / utility . h <nl> ppp b / test / common / upstream / utility . h <nl> inline std : : string clustersJson ( const std : : vector < std : : string > & clusters ) { <nl> inline envoy : : api : : v2 : : Cluster parseClusterFromJson ( const std : : string & json_string ) { <nl> envoy : : api : : v2 : : Cluster cluster ; <nl> auto json_object_ptr = Json : : Factory : : loadFromString ( json_string ) ; <nl> - Config : : CdsJson : : translateCluster ( * json_object_ptr , Optional < envoy : : api : : v2 : : ConfigSource > ( ) , <nl> - cluster ) ; <nl> + Config : : CdsJson : : translateCluster ( * json_object_ptr , <nl> + Optional < envoy : : api : : v2 : : core : : ConfigSource > ( ) , cluster ) ; <nl> return cluster ; <nl> } <nl> <nl> inline envoy : : api : : v2 : : Cluster defaultStaticCluster ( const std : : string & name ) { <nl> <nl> inline envoy : : api : : v2 : : Cluster <nl> parseSdsClusterFromJson ( const std : : string & json_string , <nl> - const envoy : : api : : v2 : : ConfigSource eds_config ) { <nl> + const envoy : : api : : v2 : : core : : ConfigSource eds_config ) { <nl> envoy : : api : : v2 : : Cluster cluster ; <nl> auto json_object_ptr = Json : : Factory : : loadFromString ( json_string ) ; <nl> Config : : CdsJson : : translateCluster ( * json_object_ptr , eds_config , cluster ) ; <nl> parseSdsClusterFromJson ( const std : : string & json_string , <nl> inline HostSharedPtr makeTestHost ( ClusterInfoConstSharedPtr cluster , const std : : string & url , <nl> uint32_t weight = 1 ) { <nl> return HostSharedPtr { new HostImpl ( cluster , " " , Network : : Utility : : resolveUrl ( url ) , <nl> - envoy : : api : : v2 : : Metadata : : default_instance ( ) , weight , <nl> - envoy : : api : : v2 : : Locality ( ) ) } ; <nl> + envoy : : api : : v2 : : core : : Metadata : : default_instance ( ) , weight , <nl> + envoy : : api : : v2 : : core : : Locality ( ) ) } ; <nl> } <nl> <nl> inline HostSharedPtr makeTestHost ( ClusterInfoConstSharedPtr cluster , const std : : string & url , <nl> - const envoy : : api : : v2 : : Metadata & metadata , uint32_t weight = 1 ) { <nl> + const envoy : : api : : v2 : : core : : Metadata & metadata , <nl> + uint32_t weight = 1 ) { <nl> return HostSharedPtr { new HostImpl ( cluster , " " , Network : : Utility : : resolveUrl ( url ) , metadata , <nl> - weight , envoy : : api : : v2 : : Locality ( ) ) } ; <nl> + weight , envoy : : api : : v2 : : core : : Locality ( ) ) } ; <nl> } <nl> <nl> inline HostDescriptionConstSharedPtr makeTestHostDescription ( ClusterInfoConstSharedPtr cluster , <nl> const std : : string & url ) { <nl> - return HostDescriptionConstSharedPtr { new HostDescriptionImpl ( <nl> - cluster , " " , Network : : Utility : : resolveUrl ( url ) , envoy : : api : : v2 : : Metadata : : default_instance ( ) , <nl> - envoy : : api : : v2 : : Locality ( ) . default_instance ( ) ) } ; <nl> + return HostDescriptionConstSharedPtr { <nl> + new HostDescriptionImpl ( cluster , " " , Network : : Utility : : resolveUrl ( url ) , <nl> + envoy : : api : : v2 : : core : : Metadata : : default_instance ( ) , <nl> + envoy : : api : : v2 : : core : : Locality ( ) . default_instance ( ) ) } ; <nl> } <nl> <nl> inline HostsPerLocalitySharedPtr makeHostsPerLocality ( std : : vector < HostVector > & & locality_hosts ) { <nl> mmm a / test / config / utility . cc <nl> ppp b / test / config / utility . cc <nl> <nl> # include " test / config / utility . h " <nl> <nl> - # include " envoy / api / v2 / filter / network / http_connection_manager . pb . h " <nl> + # include " envoy / config / filter / network / http_connection_manager / v2 / http_connection_manager . pb . h " <nl> # include " envoy / http / codec . h " <nl> <nl> # include " common / common / assert . h " <nl> void ConfigHelper : : setSourceAddress ( const std : : string & address_string ) { <nl> <nl> void ConfigHelper : : setDefaultHostAndRoute ( const std : : string & domains , const std : : string & prefix ) { <nl> RELEASE_ASSERT ( ! finalized_ ) ; <nl> - envoy : : api : : v2 : : filter : : network : : HttpConnectionManager hcm_config ; <nl> + envoy : : config : : filter : : network : : http_connection_manager : : v2 : : HttpConnectionManager hcm_config ; <nl> loadHttpConnectionManager ( hcm_config ) ; <nl> <nl> auto * virtual_host = hcm_config . mutable_route_config ( ) - > mutable_virtual_hosts ( 0 ) ; <nl> void ConfigHelper : : setBufferLimits ( uint32_t upstream_buffer_limit , <nl> <nl> auto filter = getFilterFromListener ( ) ; <nl> if ( filter - > name ( ) = = " envoy . http_connection_manager " ) { <nl> - envoy : : api : : v2 : : filter : : network : : HttpConnectionManager hcm_config ; <nl> + envoy : : config : : filter : : network : : http_connection_manager : : v2 : : HttpConnectionManager hcm_config ; <nl> loadHttpConnectionManager ( hcm_config ) ; <nl> - if ( hcm_config . codec_type ( ) = = envoy : : api : : v2 : : filter : : network : : HttpConnectionManager : : HTTP2 ) { <nl> + if ( hcm_config . codec_type ( ) = = <nl> + envoy : : config : : filter : : network : : http_connection_manager : : v2 : : HttpConnectionManager : : HTTP2 ) { <nl> const uint32_t size = <nl> std : : max ( downstream_buffer_limit , Http : : Http2Settings : : MIN_INITIAL_STREAM_WINDOW_SIZE ) ; <nl> auto * options = hcm_config . mutable_http2_protocol_options ( ) ; <nl> void ConfigHelper : : addRoute ( const std : : string & domains , const std : : string & prefi <nl> envoy : : api : : v2 : : route : : RouteAction : : ClusterNotFoundResponseCode code , <nl> envoy : : api : : v2 : : route : : VirtualHost : : TlsRequirementType type ) { <nl> RELEASE_ASSERT ( ! finalized_ ) ; <nl> - envoy : : api : : v2 : : filter : : network : : HttpConnectionManager hcm_config ; <nl> + envoy : : config : : filter : : network : : http_connection_manager : : v2 : : HttpConnectionManager hcm_config ; <nl> loadHttpConnectionManager ( hcm_config ) ; <nl> <nl> auto * route_config = hcm_config . mutable_route_config ( ) ; <nl> void ConfigHelper : : addRoute ( const std : : string & domains , const std : : string & prefi <nl> <nl> void ConfigHelper : : addFilter ( const std : : string & config ) { <nl> RELEASE_ASSERT ( ! finalized_ ) ; <nl> - envoy : : api : : v2 : : filter : : network : : HttpConnectionManager hcm_config ; <nl> + envoy : : config : : filter : : network : : http_connection_manager : : v2 : : HttpConnectionManager hcm_config ; <nl> loadHttpConnectionManager ( hcm_config ) ; <nl> <nl> auto * filter_list_back = hcm_config . add_http_filters ( ) ; <nl> void ConfigHelper : : addFilter ( const std : : string & config ) { <nl> } <nl> <nl> void ConfigHelper : : setClientCodec ( <nl> - envoy : : api : : v2 : : filter : : network : : HttpConnectionManager : : CodecType type ) { <nl> + envoy : : config : : filter : : network : : http_connection_manager : : v2 : : HttpConnectionManager : : CodecType <nl> + type ) { <nl> RELEASE_ASSERT ( ! finalized_ ) ; <nl> - envoy : : api : : v2 : : filter : : network : : HttpConnectionManager hcm_config ; <nl> + envoy : : config : : filter : : network : : http_connection_manager : : v2 : : HttpConnectionManager hcm_config ; <nl> if ( loadHttpConnectionManager ( hcm_config ) ) { <nl> hcm_config . set_codec_type ( type ) ; <nl> storeHttpConnectionManager ( hcm_config ) ; <nl> envoy : : api : : v2 : : listener : : Filter * ConfigHelper : : getFilterFromListener ( ) { <nl> } <nl> <nl> bool ConfigHelper : : loadHttpConnectionManager ( <nl> - envoy : : api : : v2 : : filter : : network : : HttpConnectionManager & hcm ) { <nl> + envoy : : config : : filter : : network : : http_connection_manager : : v2 : : HttpConnectionManager & hcm ) { <nl> RELEASE_ASSERT ( ! finalized_ ) ; <nl> auto * hcm_filter = getFilterFromListener ( ) ; <nl> if ( hcm_filter ) { <nl> bool ConfigHelper : : loadHttpConnectionManager ( <nl> } <nl> <nl> void ConfigHelper : : storeHttpConnectionManager ( <nl> - const envoy : : api : : v2 : : filter : : network : : HttpConnectionManager & hcm ) { <nl> + const envoy : : config : : filter : : network : : http_connection_manager : : v2 : : HttpConnectionManager & hcm ) { <nl> RELEASE_ASSERT ( ! finalized_ ) ; <nl> auto * hcm_config_struct = getFilterFromListener ( ) - > mutable_config ( ) ; <nl> <nl> void ConfigHelper : : addConfigModifier ( ConfigModifierFunction function ) { <nl> <nl> void ConfigHelper : : addConfigModifier ( HttpModifierFunction function ) { <nl> addConfigModifier ( [ function , this ] ( envoy : : config : : bootstrap : : v2 : : Bootstrap & ) - > void { <nl> - envoy : : api : : v2 : : filter : : network : : HttpConnectionManager hcm_config ; <nl> + envoy : : config : : filter : : network : : http_connection_manager : : v2 : : HttpConnectionManager hcm_config ; <nl> loadHttpConnectionManager ( hcm_config ) ; <nl> function ( hcm_config ) ; <nl> storeHttpConnectionManager ( hcm_config ) ; <nl> mmm a / test / config / utility . h <nl> ppp b / test / config / utility . h <nl> <nl> # include < string > <nl> # include < vector > <nl> <nl> - # include " envoy / api / v2 / base . pb . h " <nl> # include " envoy / api / v2 / cds . pb . h " <nl> - # include " envoy / api / v2 / filter / network / http_connection_manager . pb . h " <nl> - # include " envoy / api / v2 / protocol . pb . h " <nl> + # include " envoy / api / v2 / core / base . pb . h " <nl> + # include " envoy / api / v2 / core / protocol . pb . h " <nl> # include " envoy / api / v2 / route / route . pb . h " <nl> # include " envoy / config / bootstrap / v2 / bootstrap . pb . h " <nl> + # include " envoy / config / filter / network / http_connection_manager / v2 / http_connection_manager . pb . h " <nl> # include " envoy / http / codes . h " <nl> <nl> # include " common / network / address_impl . h " <nl> class ConfigHelper { <nl> const std : : string & config = HTTP_PROXY_CONFIG ) ; <nl> <nl> typedef std : : function < void ( envoy : : config : : bootstrap : : v2 : : Bootstrap & ) > ConfigModifierFunction ; <nl> - typedef std : : function < void ( envoy : : api : : v2 : : filter : : network : : HttpConnectionManager & ) > <nl> + typedef std : : function < void ( <nl> + envoy : : config : : filter : : network : : http_connection_manager : : v2 : : HttpConnectionManager & ) > <nl> HttpModifierFunction ; <nl> <nl> / / A basic configuration ( admin port , cluster_0 , one listener ) with no network filters . <nl> class ConfigHelper { <nl> void addFilter ( const std : : string & filter_yaml ) ; <nl> <nl> / / Sets the client codec to the specified type . <nl> - void setClientCodec ( envoy : : api : : v2 : : filter : : network : : HttpConnectionManager : : CodecType type ) ; <nl> + void setClientCodec ( <nl> + envoy : : config : : filter : : network : : http_connection_manager : : v2 : : HttpConnectionManager : : CodecType <nl> + type ) ; <nl> <nl> / / Add the default SSL configuration . <nl> void addSslConfig ( ) ; <nl> class ConfigHelper { <nl> <nl> private : <nl> / / Load the first HCM struct from the first listener into a parsed proto . <nl> - bool loadHttpConnectionManager ( envoy : : api : : v2 : : filter : : network : : HttpConnectionManager & hcm ) ; <nl> + bool loadHttpConnectionManager ( <nl> + envoy : : config : : filter : : network : : http_connection_manager : : v2 : : HttpConnectionManager & hcm ) ; <nl> / / Stick the contents of the procided HCM proto and stuff them into the first HCM <nl> / / struct of the first listener . <nl> - void <nl> - storeHttpConnectionManager ( const envoy : : api : : v2 : : filter : : network : : HttpConnectionManager & hcm ) ; <nl> + void storeHttpConnectionManager ( <nl> + const envoy : : config : : filter : : network : : http_connection_manager : : v2 : : HttpConnectionManager & <nl> + hcm ) ; <nl> <nl> / / Snags the first filter from the first filter chain from the first listener . <nl> envoy : : api : : v2 : : listener : : Filter * getFilterFromListener ( ) ; <nl> mmm a / test / integration / BUILD <nl> ppp b / test / integration / BUILD <nl> envoy_cc_test ( <nl> deps = [ <nl> " : http_integration_lib " , <nl> " / / source / common / protobuf " , <nl> - " @ envoy_api / / envoy / api / v2 / filter / network : http_connection_manager_cc " , <nl> + " @ envoy_api / / envoy / config / filter / network / http_connection_manager / v2 : http_connection_manager_cc " , <nl> ] , <nl> ) <nl> <nl> mmm a / test / integration / README . md <nl> ppp b / test / integration / README . md <nl> config_helper_ . addConfigModifier ( [ & ] ( envoy : : config : : bootstrap : : v2 : : Bootstrap & bo <nl> <nl> An example of modifying ` HttpConnectionManager ` to change Envoy ’ s HTTP / 1 . 1 processing : <nl> ` ` ` c + + <nl> - config_helper_ . addConfigModifier ( [ & ] ( envoy : : api : : v2 : : filter : : HttpConnectionManager & hcm ) - > void { <nl> - envoy : : api : : v2 : : Http1ProtocolOptions options ; <nl> + config_helper_ . addConfigModifier ( [ & ] ( envoy : : config : : filter : : network : : http_connection_manager : : v2 : : HttpConnectionManager & hcm ) - > void { <nl> + envoy : : api : : v2 : : core : : Http1ProtocolOptions options ; <nl> options . mutable_allow_absolute_url ( ) - > set_value ( true ) ; <nl> hcm . mutable_http_protocol_options ( ) - > CopyFrom ( options ) ; <nl> } ; ) ; <nl> mmm a / test / integration / access_log_integration_test . cc <nl> ppp b / test / integration / access_log_integration_test . cc <nl> class AccessLogIntegrationTest : public HttpIntegrationTest , <nl> } ) ; <nl> <nl> config_helper_ . addConfigModifier ( <nl> - [ this ] ( envoy : : api : : v2 : : filter : : network : : HttpConnectionManager & hcm ) { <nl> + [ this ] ( envoy : : config : : filter : : network : : http_connection_manager : : v2 : : HttpConnectionManager & <nl> + hcm ) { <nl> auto * access_log = hcm . add_access_log ( ) ; <nl> access_log - > set_name ( " envoy . http_grpc_access_log " ) ; <nl> <nl> mmm a / test / integration / ads_integration_test . cc <nl> ppp b / test / integration / ads_integration_test . cc <nl> class AdsIntegrationTest : public HttpIntegrationTest , public Grpc : : GrpcClientIn <nl> ads_connection_ = fake_upstreams_ [ 0 ] - > waitForHttpConnection ( * dispatcher_ ) ; <nl> ads_stream_ = ads_connection_ - > waitForNewStream ( * dispatcher_ ) ; <nl> ads_stream_ - > startGrpcStream ( ) ; <nl> - envoy : : service : : discovery : : v2 : : AdsDummy dummy ; <nl> } <nl> <nl> FakeHttpConnectionPtr ads_connection_ ; <nl> mmm a / test / integration / cors_filter_integration_test . cc <nl> ppp b / test / integration / cors_filter_integration_test . cc <nl> class CorsFilterIntegrationTest : public HttpIntegrationTest , <nl> void initialize ( ) override { <nl> config_helper_ . addFilter ( " name : envoy . cors " ) ; <nl> config_helper_ . addConfigModifier ( <nl> - [ & ] ( envoy : : api : : v2 : : filter : : network : : HttpConnectionManager & hcm ) - > void { <nl> + [ & ] ( envoy : : config : : filter : : network : : http_connection_manager : : v2 : : HttpConnectionManager & hcm ) <nl> + - > void { <nl> auto * route_config = hcm . mutable_route_config ( ) ; <nl> auto * virtual_host = route_config - > mutable_virtual_hosts ( 0 ) ; <nl> { <nl> mmm a / test / integration / header_integration_test . cc <nl> ppp b / test / integration / header_integration_test . cc <nl> <nl> # include " envoy / api / v2 / eds . pb . h " <nl> - # include " envoy / api / v2 / filter / network / http_connection_manager . pb . h " <nl> + # include " envoy / config / filter / network / http_connection_manager / v2 / http_connection_manager . pb . h " <nl> <nl> # include " common / config / metadata . h " <nl> # include " common / config / resources . h " <nl> <nl> namespace Envoy { <nl> namespace { <nl> void disableHeaderValueOptionAppend ( <nl> - Protobuf : : RepeatedPtrField < envoy : : api : : v2 : : HeaderValueOption > & header_value_options ) { <nl> + Protobuf : : RepeatedPtrField < envoy : : api : : v2 : : core : : HeaderValueOption > & header_value_options ) { <nl> for ( auto & i : header_value_options ) { <nl> i . mutable_append ( ) - > set_value ( false ) ; <nl> } <nl> class HeaderIntegrationTest : public HttpIntegrationTest , <nl> fake_upstreams_ . clear ( ) ; <nl> } <nl> <nl> - void addHeader ( Protobuf : : RepeatedPtrField < envoy : : api : : v2 : : HeaderValueOption > * field , <nl> + void addHeader ( Protobuf : : RepeatedPtrField < envoy : : api : : v2 : : core : : HeaderValueOption > * field , <nl> const std : : string & key , const std : : string & value , bool append ) { <nl> - envoy : : api : : v2 : : HeaderValueOption * header_value_option = field - > Add ( ) ; <nl> + envoy : : api : : v2 : : core : : HeaderValueOption * header_value_option = field - > Add ( ) ; <nl> auto * mutable_header = header_value_option - > mutable_header ( ) ; <nl> mutable_header - > set_key ( key ) ; <nl> mutable_header - > set_value ( value ) ; <nl> class HeaderIntegrationTest : public HttpIntegrationTest , <nl> <nl> void initializeFilter ( HeaderMode mode , bool include_route_config_headers ) { <nl> config_helper_ . addConfigModifier ( <nl> - [ & ] ( envoy : : api : : v2 : : filter : : network : : HttpConnectionManager & hcm ) { <nl> + [ & ] ( envoy : : config : : filter : : network : : http_connection_manager : : v2 : : HttpConnectionManager & <nl> + hcm ) { <nl> / / Overwrite default config with our own . <nl> MessageUtil : : loadFromYaml ( http_connection_mgr_config , hcm ) ; <nl> <nl> mmm a / test / integration / http2_integration_test . cc <nl> ppp b / test / integration / http2_integration_test . cc <nl> void Http2RingHashIntegrationTest : : sendMultipleRequests ( <nl> <nl> TEST_P ( Http2RingHashIntegrationTest , CookieRoutingNoCookieNoTtl ) { <nl> config_helper_ . addConfigModifier ( <nl> - [ & ] ( envoy : : api : : v2 : : filter : : network : : HttpConnectionManager & hcm ) - > void { <nl> + [ & ] ( envoy : : config : : filter : : network : : http_connection_manager : : v2 : : HttpConnectionManager & hcm ) <nl> + - > void { <nl> auto * hash_policy = hcm . mutable_route_config ( ) <nl> - > mutable_virtual_hosts ( 0 ) <nl> - > mutable_routes ( 0 ) <nl> TEST_P ( Http2RingHashIntegrationTest , CookieRoutingNoCookieNoTtl ) { <nl> <nl> TEST_P ( Http2RingHashIntegrationTest , CookieRoutingNoCookieWithTtlSet ) { <nl> config_helper_ . addConfigModifier ( <nl> - [ & ] ( envoy : : api : : v2 : : filter : : network : : HttpConnectionManager & hcm ) - > void { <nl> + [ & ] ( envoy : : config : : filter : : network : : http_connection_manager : : v2 : : HttpConnectionManager & hcm ) <nl> + - > void { <nl> auto * hash_policy = hcm . mutable_route_config ( ) <nl> - > mutable_virtual_hosts ( 0 ) <nl> - > mutable_routes ( 0 ) <nl> TEST_P ( Http2RingHashIntegrationTest , CookieRoutingNoCookieWithTtlSet ) { <nl> <nl> TEST_P ( Http2RingHashIntegrationTest , CookieRoutingWithCookieNoTtl ) { <nl> config_helper_ . addConfigModifier ( <nl> - [ & ] ( envoy : : api : : v2 : : filter : : network : : HttpConnectionManager & hcm ) - > void { <nl> + [ & ] ( envoy : : config : : filter : : network : : http_connection_manager : : v2 : : HttpConnectionManager & hcm ) <nl> + - > void { <nl> auto * hash_policy = hcm . mutable_route_config ( ) <nl> - > mutable_virtual_hosts ( 0 ) <nl> - > mutable_routes ( 0 ) <nl> TEST_P ( Http2RingHashIntegrationTest , CookieRoutingWithCookieNoTtl ) { <nl> <nl> TEST_P ( Http2RingHashIntegrationTest , CookieRoutingWithCookieWithTtlSet ) { <nl> config_helper_ . addConfigModifier ( <nl> - [ & ] ( envoy : : api : : v2 : : filter : : network : : HttpConnectionManager & hcm ) - > void { <nl> + [ & ] ( envoy : : config : : filter : : network : : http_connection_manager : : v2 : : HttpConnectionManager & hcm ) <nl> + - > void { <nl> auto * hash_policy = hcm . mutable_route_config ( ) <nl> - > mutable_virtual_hosts ( 0 ) <nl> - > mutable_routes ( 0 ) <nl> mmm a / test / integration / http2_upstream_integration_test . cc <nl> ppp b / test / integration / http2_upstream_integration_test . cc <nl> TEST_P ( Http2UpstreamIntegrationTest , RouterRequestAndResponseWithZeroByteBodyBuf <nl> TEST_P ( Http2UpstreamIntegrationTest , RouterRequestAndResponseWithBodyHttp1 ) { <nl> config_helper_ . addFilter ( ConfigHelper : : DEFAULT_BUFFER_FILTER ) ; <nl> setDownstreamProtocol ( Http : : CodecClient : : Type : : HTTP1 ) ; <nl> - config_helper_ . setClientCodec ( envoy : : api : : v2 : : filter : : network : : HttpConnectionManager : : AUTO ) ; <nl> + config_helper_ . setClientCodec ( <nl> + envoy : : config : : filter : : network : : http_connection_manager : : v2 : : HttpConnectionManager : : AUTO ) ; <nl> testRouterRequestAndResponseWithBody ( 1024 , 512 , false ) ; <nl> } <nl> <nl> mmm a / test / integration / http_integration . cc <nl> ppp b / test / integration / http_integration . cc <nl> std : : string normalizeDate ( const std : : string & s ) { <nl> return std : : regex_replace ( s , date_regex , " date : Mon , 01 Jan 2017 00 : 00 : 00 GMT " ) ; <nl> } <nl> <nl> - void setAllowAbsoluteUrl ( envoy : : api : : v2 : : filter : : network : : HttpConnectionManager & hcm ) { <nl> - envoy : : api : : v2 : : Http1ProtocolOptions options ; <nl> + void setAllowAbsoluteUrl ( <nl> + envoy : : config : : filter : : network : : http_connection_manager : : v2 : : HttpConnectionManager & hcm ) { <nl> + envoy : : api : : v2 : : core : : Http1ProtocolOptions options ; <nl> options . mutable_allow_absolute_url ( ) - > set_value ( true ) ; <nl> hcm . mutable_http_protocol_options ( ) - > CopyFrom ( options ) ; <nl> } ; <nl> <nl> - envoy : : api : : v2 : : filter : : network : : HttpConnectionManager : : CodecType <nl> + envoy : : config : : filter : : network : : http_connection_manager : : v2 : : HttpConnectionManager : : CodecType <nl> typeToCodecType ( Http : : CodecClient : : Type type ) { <nl> switch ( type ) { <nl> case Http : : CodecClient : : Type : : HTTP1 : <nl> - return envoy : : api : : v2 : : filter : : network : : HttpConnectionManager : : HTTP1 ; <nl> + return envoy : : config : : filter : : network : : http_connection_manager : : v2 : : HttpConnectionManager : : <nl> + HTTP1 ; <nl> case Http : : CodecClient : : Type : : HTTP2 : <nl> - return envoy : : api : : v2 : : filter : : network : : HttpConnectionManager : : HTTP2 ; <nl> + return envoy : : config : : filter : : network : : http_connection_manager : : v2 : : HttpConnectionManager : : <nl> + HTTP2 ; <nl> default : <nl> RELEASE_ASSERT ( 0 ) ; <nl> } <nl> void HttpIntegrationTest : : testRouterDirectResponse ( ) { <nl> static const std : : string prefix ( " / " ) ; <nl> static const Http : : Code status ( Http : : Code : : OK ) ; <nl> config_helper_ . addConfigModifier ( <nl> - [ & ] ( envoy : : api : : v2 : : filter : : network : : HttpConnectionManager & hcm ) - > void { <nl> + [ & ] ( envoy : : config : : filter : : network : : http_connection_manager : : v2 : : HttpConnectionManager & hcm ) <nl> + - > void { <nl> auto * route_config = hcm . mutable_route_config ( ) ; <nl> auto * header_value_option = route_config - > mutable_response_headers_to_add ( ) - > Add ( ) ; <nl> header_value_option - > mutable_header ( ) - > set_key ( " x - additional - header " ) ; <nl> mmm a / test / integration / integration_test . cc <nl> ppp b / test / integration / integration_test . cc <nl> TEST_P ( IntegrationTest , OverlyLongHeaders ) { testOverlyLongHeaders ( ) ; } <nl> <nl> TEST_P ( IntegrationTest , UpstreamProtocolError ) { testUpstreamProtocolError ( ) ; } <nl> <nl> - void setRouteUsingWebsocket ( envoy : : api : : v2 : : filter : : network : : HttpConnectionManager & hcm ) { <nl> + void setRouteUsingWebsocket ( <nl> + envoy : : config : : filter : : network : : http_connection_manager : : v2 : : HttpConnectionManager & hcm ) { <nl> auto route = hcm . mutable_route_config ( ) - > mutable_virtual_hosts ( 0 ) - > add_routes ( ) ; <nl> route - > mutable_match ( ) - > set_prefix ( " / websocket / test " ) ; <nl> route - > mutable_route ( ) - > set_prefix_rewrite ( " / websocket " ) ; <nl> mmm a / test / integration / load_stats_integration_test . cc <nl> ppp b / test / integration / load_stats_integration_test . cc <nl> class LoadStatsIntegrationTest : public HttpIntegrationTest , <nl> config_helper_ . addConfigModifier ( [ this ] ( envoy : : config : : bootstrap : : v2 : : Bootstrap & bootstrap ) { <nl> / / Setup load reporting and corresponding gRPC cluster . <nl> auto * loadstats_config = bootstrap . mutable_cluster_manager ( ) - > mutable_load_stats_config ( ) ; <nl> - loadstats_config - > set_api_type ( envoy : : api : : v2 : : ApiConfigSource : : GRPC ) ; <nl> + loadstats_config - > set_api_type ( envoy : : api : : v2 : : core : : ApiConfigSource : : GRPC ) ; <nl> loadstats_config - > add_cluster_names ( " load_report " ) ; <nl> auto * load_report_cluster = bootstrap . mutable_static_resources ( ) - > add_clusters ( ) ; <nl> load_report_cluster - > MergeFrom ( bootstrap . static_resources ( ) . clusters ( ) [ 0 ] ) ; <nl> mmm a / test / integration / lua_integration_test . cc <nl> ppp b / test / integration / lua_integration_test . cc <nl> class LuaIntegrationTest : public HttpIntegrationTest , <nl> } ) ; <nl> <nl> config_helper_ . addConfigModifier ( <nl> - [ ] ( envoy : : api : : v2 : : filter : : network : : HttpConnectionManager & hcm ) { <nl> + [ ] ( envoy : : config : : filter : : network : : http_connection_manager : : v2 : : HttpConnectionManager & <nl> + hcm ) { <nl> hcm . mutable_route_config ( ) <nl> - > mutable_virtual_hosts ( 0 ) <nl> - > mutable_routes ( 0 ) <nl> mmm a / test / integration / ratelimit_integration_test . cc <nl> ppp b / test / integration / ratelimit_integration_test . cc <nl> class RatelimitIntegrationTest : public HttpIntegrationTest , <nl> fake_upstreams_ . back ( ) - > localAddress ( ) ) ; <nl> } ) ; <nl> config_helper_ . addConfigModifier ( <nl> - [ ] ( envoy : : api : : v2 : : filter : : network : : HttpConnectionManager & hcm ) { <nl> + [ ] ( envoy : : config : : filter : : network : : http_connection_manager : : v2 : : HttpConnectionManager & <nl> + hcm ) { <nl> auto * rate_limit = hcm . mutable_route_config ( ) <nl> - > mutable_virtual_hosts ( 0 ) <nl> - > mutable_routes ( 0 ) <nl> mmm a / test / integration / ssl_integration_test . cc <nl> ppp b / test / integration / ssl_integration_test . cc <nl> TEST_P ( SslIntegrationTest , RouterRequestAndResponseWithBodyNoBuffer ) { <nl> <nl> TEST_P ( SslIntegrationTest , RouterRequestAndResponseWithBodyNoBufferHttp2 ) { <nl> setDownstreamProtocol ( Http : : CodecClient : : Type : : HTTP2 ) ; <nl> - config_helper_ . setClientCodec ( envoy : : api : : v2 : : filter : : network : : HttpConnectionManager : : AUTO ) ; <nl> + config_helper_ . setClientCodec ( <nl> + envoy : : config : : filter : : network : : http_connection_manager : : v2 : : HttpConnectionManager : : AUTO ) ; <nl> ConnectionCreationFunction creator = [ & ] ( ) - > Network : : ClientConnectionPtr { <nl> return makeSslClientConnection ( true , false ) ; <nl> } ; <nl> mmm a / test / integration / tcp_proxy_integration_test . cc <nl> ppp b / test / integration / tcp_proxy_integration_test . cc <nl> <nl> # include " test / integration / tcp_proxy_integration_test . h " <nl> <nl> - # include " envoy / api / v2 / filter / accesslog / accesslog . pb . h " <nl> + # include " envoy / config / filter / accesslog / v2 / accesslog . pb . h " <nl> <nl> # include " common / filesystem / filesystem_impl . h " <nl> # include " common / network / utility . h " <nl> TEST_P ( TcpProxyIntegrationTest , AccessLog ) { <nl> auto * filter_chain = listener - > mutable_filter_chains ( 0 ) ; <nl> auto * config_blob = filter_chain - > mutable_filters ( 0 ) - > mutable_config ( ) ; <nl> <nl> - envoy : : api : : v2 : : filter : : network : : TcpProxy tcp_proxy_config ; <nl> + envoy : : config : : filter : : network : : tcp_proxy : : v2 : : TcpProxy tcp_proxy_config ; <nl> MessageUtil : : jsonConvert ( * config_blob , tcp_proxy_config ) ; <nl> <nl> auto * access_log = tcp_proxy_config . add_access_log ( ) ; <nl> access_log - > set_name ( " envoy . file_access_log " ) ; <nl> - envoy : : api : : v2 : : filter : : accesslog : : FileAccessLog access_log_config ; <nl> + envoy : : config : : filter : : accesslog : : v2 : : FileAccessLog access_log_config ; <nl> access_log_config . set_path ( access_log_path ) ; <nl> access_log_config . set_format ( " upstreamlocal = % UPSTREAM_LOCAL_ADDRESS % " <nl> " upstreamhost = % UPSTREAM_HOST % downstream = % DOWNSTREAM_ADDRESS % \ n " ) ; <nl> mmm a / test / integration / xfcc_integration_test . cc <nl> ppp b / test / integration / xfcc_integration_test . cc <nl> <nl> # include < regex > <nl> # include < unordered_map > <nl> <nl> - # include " envoy / api / v2 / filter / network / http_connection_manager . pb . h " <nl> + # include " envoy / config / filter / network / http_connection_manager / v2 / http_connection_manager . pb . h " <nl> <nl> # include " common / event / dispatcher_impl . h " <nl> # include " common / http / header_map_impl . h " <nl> void XfccIntegrationTest : : createUpstreams ( ) { <nl> <nl> void XfccIntegrationTest : : initialize ( ) { <nl> config_helper_ . addConfigModifier ( <nl> - [ & ] ( envoy : : api : : v2 : : filter : : network : : HttpConnectionManager & hcm ) - > void { <nl> + [ & ] ( envoy : : config : : filter : : network : : http_connection_manager : : v2 : : HttpConnectionManager & hcm ) <nl> + - > void { <nl> hcm . set_forward_client_cert_details ( fcc_ ) ; <nl> hcm . mutable_set_current_client_cert_details ( ) - > CopyFrom ( sccd_ ) ; <nl> } ) ; <nl> INSTANTIATE_TEST_CASE_P ( IpVersions , XfccIntegrationTest , <nl> testing : : ValuesIn ( TestEnvironment : : getIpVersionsForTest ( ) ) ) ; <nl> <nl> TEST_P ( XfccIntegrationTest , MtlsForwardOnly ) { <nl> - fcc_ = envoy : : api : : v2 : : filter : : network : : HttpConnectionManager : : FORWARD_ONLY ; <nl> + fcc_ = envoy : : config : : filter : : network : : http_connection_manager : : v2 : : HttpConnectionManager : : <nl> + FORWARD_ONLY ; <nl> initialize ( ) ; <nl> testRequestAndResponseWithXfccHeader ( previous_xfcc_ , previous_xfcc_ ) ; <nl> } <nl> <nl> TEST_P ( XfccIntegrationTest , MtlsAlwaysForwardOnly ) { <nl> - fcc_ = envoy : : api : : v2 : : filter : : network : : HttpConnectionManager : : ALWAYS_FORWARD_ONLY ; <nl> + fcc_ = envoy : : config : : filter : : network : : http_connection_manager : : v2 : : HttpConnectionManager : : <nl> + ALWAYS_FORWARD_ONLY ; <nl> initialize ( ) ; <nl> testRequestAndResponseWithXfccHeader ( previous_xfcc_ , previous_xfcc_ ) ; <nl> } <nl> <nl> TEST_P ( XfccIntegrationTest , MtlsSanitize ) { <nl> - fcc_ = envoy : : api : : v2 : : filter : : network : : HttpConnectionManager : : SANITIZE ; <nl> + fcc_ = <nl> + envoy : : config : : filter : : network : : http_connection_manager : : v2 : : HttpConnectionManager : : SANITIZE ; <nl> initialize ( ) ; <nl> testRequestAndResponseWithXfccHeader ( previous_xfcc_ , " " ) ; <nl> } <nl> <nl> TEST_P ( XfccIntegrationTest , MtlsSanitizeSetSubjectSan ) { <nl> - fcc_ = envoy : : api : : v2 : : filter : : network : : HttpConnectionManager : : SANITIZE_SET ; <nl> + fcc_ = envoy : : config : : filter : : network : : http_connection_manager : : v2 : : HttpConnectionManager : : <nl> + SANITIZE_SET ; <nl> sccd_ . mutable_subject ( ) - > set_value ( true ) ; <nl> sccd_ . mutable_san ( ) - > set_value ( true ) ; <nl> initialize ( ) ; <nl> TEST_P ( XfccIntegrationTest , MtlsSanitizeSetSubjectSan ) { <nl> } <nl> <nl> TEST_P ( XfccIntegrationTest , MtlsAppendForward ) { <nl> - fcc_ = envoy : : api : : v2 : : filter : : network : : HttpConnectionManager : : APPEND_FORWARD ; <nl> + fcc_ = envoy : : config : : filter : : network : : http_connection_manager : : v2 : : HttpConnectionManager : : <nl> + APPEND_FORWARD ; <nl> initialize ( ) ; <nl> testRequestAndResponseWithXfccHeader ( previous_xfcc_ , <nl> previous_xfcc_ + " , " + current_xfcc_by_hash_ ) ; <nl> } <nl> <nl> TEST_P ( XfccIntegrationTest , MtlsAppendForwardSubject ) { <nl> - fcc_ = envoy : : api : : v2 : : filter : : network : : HttpConnectionManager : : APPEND_FORWARD ; <nl> + fcc_ = envoy : : config : : filter : : network : : http_connection_manager : : v2 : : HttpConnectionManager : : <nl> + APPEND_FORWARD ; <nl> sccd_ . mutable_subject ( ) - > set_value ( true ) ; <nl> initialize ( ) ; <nl> testRequestAndResponseWithXfccHeader ( <nl> TEST_P ( XfccIntegrationTest , MtlsAppendForwardSubject ) { <nl> } <nl> <nl> TEST_P ( XfccIntegrationTest , MtlsAppendForwardSan ) { <nl> - fcc_ = envoy : : api : : v2 : : filter : : network : : HttpConnectionManager : : APPEND_FORWARD ; <nl> + fcc_ = envoy : : config : : filter : : network : : http_connection_manager : : v2 : : HttpConnectionManager : : <nl> + APPEND_FORWARD ; <nl> sccd_ . mutable_san ( ) - > set_value ( true ) ; <nl> initialize ( ) ; <nl> testRequestAndResponseWithXfccHeader ( <nl> TEST_P ( XfccIntegrationTest , MtlsAppendForwardSan ) { <nl> } <nl> <nl> TEST_P ( XfccIntegrationTest , MtlsAppendForwardSubjectSan ) { <nl> - fcc_ = envoy : : api : : v2 : : filter : : network : : HttpConnectionManager : : APPEND_FORWARD ; <nl> + fcc_ = envoy : : config : : filter : : network : : http_connection_manager : : v2 : : HttpConnectionManager : : <nl> + APPEND_FORWARD ; <nl> sccd_ . mutable_subject ( ) - > set_value ( true ) ; <nl> sccd_ . mutable_san ( ) - > set_value ( true ) ; <nl> initialize ( ) ; <nl> TEST_P ( XfccIntegrationTest , MtlsAppendForwardSubjectSan ) { <nl> } <nl> <nl> TEST_P ( XfccIntegrationTest , MtlsAppendForwardSanPreviousXfccHeaderEmpty ) { <nl> - fcc_ = envoy : : api : : v2 : : filter : : network : : HttpConnectionManager : : APPEND_FORWARD ; <nl> + fcc_ = envoy : : config : : filter : : network : : http_connection_manager : : v2 : : HttpConnectionManager : : <nl> + APPEND_FORWARD ; <nl> sccd_ . mutable_san ( ) - > set_value ( true ) ; <nl> initialize ( ) ; <nl> testRequestAndResponseWithXfccHeader ( " " , current_xfcc_by_hash_ + " ; " + client_san_ ) ; <nl> TEST_P ( XfccIntegrationTest , MtlsAppendForwardSanPreviousXfccHeaderEmpty ) { <nl> <nl> TEST_P ( XfccIntegrationTest , TlsAlwaysForwardOnly ) { <nl> / / The always_forward_only works regardless of whether the connection is TLS / mTLS . <nl> - fcc_ = envoy : : api : : v2 : : filter : : network : : HttpConnectionManager : : ALWAYS_FORWARD_ONLY ; <nl> + fcc_ = envoy : : config : : filter : : network : : http_connection_manager : : v2 : : HttpConnectionManager : : <nl> + ALWAYS_FORWARD_ONLY ; <nl> tls_ = false ; <nl> initialize ( ) ; <nl> testRequestAndResponseWithXfccHeader ( previous_xfcc_ , previous_xfcc_ ) ; <nl> TEST_P ( XfccIntegrationTest , TlsAlwaysForwardOnly ) { <nl> TEST_P ( XfccIntegrationTest , TlsEnforceSanitize ) { <nl> / / The forward_only , append_forward and sanitize_set options are not effective when the connection <nl> / / is not using Mtls . <nl> - fcc_ = envoy : : api : : v2 : : filter : : network : : HttpConnectionManager : : FORWARD_ONLY ; <nl> + fcc_ = envoy : : config : : filter : : network : : http_connection_manager : : v2 : : HttpConnectionManager : : <nl> + FORWARD_ONLY ; <nl> tls_ = false ; <nl> initialize ( ) ; <nl> testRequestAndResponseWithXfccHeader ( previous_xfcc_ , " " ) ; <nl> TEST_P ( XfccIntegrationTest , TlsEnforceSanitize ) { <nl> <nl> TEST_P ( XfccIntegrationTest , NonTlsAlwaysForwardOnly ) { <nl> / / The always_forward_only works regardless of whether the connection is TLS / mTLS . <nl> - fcc_ = envoy : : api : : v2 : : filter : : network : : HttpConnectionManager : : ALWAYS_FORWARD_ONLY ; <nl> + fcc_ = envoy : : config : : filter : : network : : http_connection_manager : : v2 : : HttpConnectionManager : : <nl> + ALWAYS_FORWARD_ONLY ; <nl> tls_ = false ; <nl> initialize ( ) ; <nl> testRequestAndResponseWithXfccHeader ( previous_xfcc_ , previous_xfcc_ ) ; <nl> TEST_P ( XfccIntegrationTest , NonTlsAlwaysForwardOnly ) { <nl> TEST_P ( XfccIntegrationTest , NonTlsEnforceSanitize ) { <nl> / / The forward_only , append_forward and sanitize_set options are not effective when the connection <nl> / / is not using Mtls . <nl> - fcc_ = envoy : : api : : v2 : : filter : : network : : HttpConnectionManager : : FORWARD_ONLY ; <nl> + fcc_ = envoy : : config : : filter : : network : : http_connection_manager : : v2 : : HttpConnectionManager : : <nl> + FORWARD_ONLY ; <nl> tls_ = false ; <nl> initialize ( ) ; <nl> testRequestAndResponseWithXfccHeader ( previous_xfcc_ , " " ) ; <nl> TEST_P ( XfccIntegrationTest , TagExtractedNameGenerationTest ) { <nl> / / the printout needs to be copied from each test parameterization and pasted into the respective <nl> / / case in the switch statement below . <nl> <nl> - fcc_ = envoy : : api : : v2 : : filter : : network : : HttpConnectionManager : : FORWARD_ONLY ; <nl> + fcc_ = envoy : : config : : filter : : network : : http_connection_manager : : v2 : : HttpConnectionManager : : <nl> + FORWARD_ONLY ; <nl> initialize ( ) ; <nl> <nl> / / Commented sample code to regenerate the map literals used below in the test log if necessary : <nl> mmm a / test / integration / xfcc_integration_test . h <nl> ppp b / test / integration / xfcc_integration_test . h <nl> class XfccIntegrationTest : public HttpIntegrationTest , <nl> Network : : ClientConnectionPtr makeTlsClientConnection ( ) ; <nl> Network : : ClientConnectionPtr makeMtlsClientConnection ( ) ; <nl> void testRequestAndResponseWithXfccHeader ( std : : string privous_xfcc , std : : string expected_xfcc ) ; <nl> - envoy : : api : : v2 : : filter : : network : : HttpConnectionManager : : ForwardClientCertDetails fcc_ ; <nl> - envoy : : api : : v2 : : filter : : network : : HttpConnectionManager : : SetCurrentClientCertDetails sccd_ ; <nl> + envoy : : config : : filter : : network : : http_connection_manager : : v2 : : HttpConnectionManager : : <nl> + ForwardClientCertDetails fcc_ ; <nl> + envoy : : config : : filter : : network : : http_connection_manager : : v2 : : HttpConnectionManager : : <nl> + SetCurrentClientCertDetails sccd_ ; <nl> bool tls_ = true ; <nl> <nl> private : <nl> mmm a / test / mocks / grpc / mocks . h <nl> ppp b / test / mocks / grpc / mocks . h <nl> class MockAsyncClientManager : public AsyncClientManager { <nl> ~ MockAsyncClientManager ( ) ; <nl> <nl> MOCK_METHOD2 ( factoryForGrpcService , <nl> - AsyncClientFactoryPtr ( const envoy : : api : : v2 : : GrpcService & grpc_service , <nl> + AsyncClientFactoryPtr ( const envoy : : api : : v2 : : core : : GrpcService & grpc_service , <nl> Stats : : Scope & scope ) ) ; <nl> } ; <nl> <nl> mmm a / test / mocks / local_info / mocks . h <nl> ppp b / test / mocks / local_info / mocks . h <nl> class MockLocalInfo : public LocalInfo { <nl> MOCK_CONST_METHOD0 ( zoneName , const std : : string ( ) ) ; <nl> MOCK_CONST_METHOD0 ( clusterName , const std : : string ( ) ) ; <nl> MOCK_CONST_METHOD0 ( nodeName , const std : : string ( ) ) ; <nl> - MOCK_CONST_METHOD0 ( node , envoy : : api : : v2 : : Node & ( ) ) ; <nl> + MOCK_CONST_METHOD0 ( node , envoy : : api : : v2 : : core : : Node & ( ) ) ; <nl> <nl> Network : : Address : : InstanceConstSharedPtr address_ ; <nl> / / TODO ( htuch ) : Make this behave closer to the real implementation , with the various property <nl> / / methods using node_ as the source of truth . <nl> - envoy : : api : : v2 : : Node node_ ; <nl> + envoy : : api : : v2 : : core : : Node node_ ; <nl> } ; <nl> <nl> } / / namespace LocalInfo <nl> mmm a / test / mocks / router / mocks . h <nl> ppp b / test / mocks / router / mocks . h <nl> class MockRouteEntry : public RouteEntry { <nl> MOCK_CONST_METHOD0 ( opaqueConfig , const std : : multimap < std : : string , std : : string > & ( ) ) ; <nl> MOCK_CONST_METHOD0 ( includeVirtualHostRateLimits , bool ( ) ) ; <nl> MOCK_CONST_METHOD0 ( corsPolicy , const CorsPolicy * ( ) ) ; <nl> - MOCK_CONST_METHOD0 ( metadata , const envoy : : api : : v2 : : Metadata & ( ) ) ; <nl> + MOCK_CONST_METHOD0 ( metadata , const envoy : : api : : v2 : : core : : Metadata & ( ) ) ; <nl> <nl> std : : string cluster_name_ { " fake_cluster " } ; <nl> std : : multimap < std : : string , std : : string > opaque_config_ ; <nl> class MockRouteConfigProviderManager : public ServerRouteConfigProviderManager { <nl> <nl> MOCK_METHOD0 ( routeConfigProviders , std : : vector < RdsRouteConfigProviderSharedPtr > ( ) ) ; <nl> MOCK_METHOD5 ( getRouteConfigProvider , <nl> - RouteConfigProviderSharedPtr ( const envoy : : api : : v2 : : filter : : network : : Rds & rds , <nl> - Upstream : : ClusterManager & cm , Stats : : Scope & scope , <nl> - const std : : string & stat_prefix , <nl> - Init : : Manager & init_manager ) ) ; <nl> + RouteConfigProviderSharedPtr ( <nl> + const envoy : : config : : filter : : network : : http_connection_manager : : v2 : : Rds & rds , <nl> + Upstream : : ClusterManager & cm , Stats : : Scope & scope , <nl> + const std : : string & stat_prefix , Init : : Manager & init_manager ) ) ; <nl> MOCK_METHOD1 ( removeRouteConfigProvider , void ( const std : : string & identifier ) ) ; <nl> } ; <nl> <nl> mmm a / test / mocks / server / mocks . h <nl> ppp b / test / mocks / server / mocks . h <nl> class MockFactoryContext : public FactoryContext { <nl> MOCK_METHOD0 ( threadLocal , ThreadLocal : : Instance & ( ) ) ; <nl> MOCK_METHOD0 ( admin , Server : : Admin & ( ) ) ; <nl> MOCK_METHOD0 ( listenerScope , Stats : : Scope & ( ) ) ; <nl> - MOCK_CONST_METHOD0 ( listenerMetadata , const envoy : : api : : v2 : : Metadata & ( ) ) ; <nl> + MOCK_CONST_METHOD0 ( listenerMetadata , const envoy : : api : : v2 : : core : : Metadata & ( ) ) ; <nl> <nl> testing : : NiceMock < AccessLog : : MockAccessLogManager > access_log_manager_ ; <nl> testing : : NiceMock < Upstream : : MockClusterManager > cluster_manager_ ; <nl> mmm a / test / mocks / upstream / cluster_info . h <nl> ppp b / test / mocks / upstream / cluster_info . h <nl> class MockClusterInfo : public ClusterInfo { <nl> MOCK_CONST_METHOD0 ( loadReportStats , ClusterLoadReportStats & ( ) ) ; <nl> MOCK_CONST_METHOD0 ( sourceAddress , const Network : : Address : : InstanceConstSharedPtr & ( ) ) ; <nl> MOCK_CONST_METHOD0 ( lbSubsetInfo , const LoadBalancerSubsetInfo & ( ) ) ; <nl> - MOCK_CONST_METHOD0 ( metadata , const envoy : : api : : v2 : : Metadata & ( ) ) ; <nl> + MOCK_CONST_METHOD0 ( metadata , const envoy : : api : : v2 : : core : : Metadata & ( ) ) ; <nl> <nl> std : : string name_ { " fake_cluster " } ; <nl> Http : : Http2Settings http2_settings_ { } ; <nl> mmm a / test / mocks / upstream / host . h <nl> ppp b / test / mocks / upstream / host . h <nl> class MockHostDescription : public HostDescription { <nl> <nl> MOCK_CONST_METHOD0 ( address , Network : : Address : : InstanceConstSharedPtr ( ) ) ; <nl> MOCK_CONST_METHOD0 ( canary , bool ( ) ) ; <nl> - MOCK_CONST_METHOD0 ( metadata , const envoy : : api : : v2 : : Metadata & ( ) ) ; <nl> + MOCK_CONST_METHOD0 ( metadata , const envoy : : api : : v2 : : core : : Metadata & ( ) ) ; <nl> MOCK_CONST_METHOD0 ( cluster , const ClusterInfo & ( ) ) ; <nl> MOCK_CONST_METHOD0 ( outlierDetector , Outlier : : DetectorHostMonitor & ( ) ) ; <nl> MOCK_CONST_METHOD0 ( healthChecker , HealthCheckHostMonitor & ( ) ) ; <nl> MOCK_CONST_METHOD0 ( hostname , const std : : string & ( ) ) ; <nl> MOCK_CONST_METHOD0 ( stats , HostStats & ( ) ) ; <nl> - MOCK_CONST_METHOD0 ( locality , const envoy : : api : : v2 : : Locality & ( ) ) ; <nl> + MOCK_CONST_METHOD0 ( locality , const envoy : : api : : v2 : : core : : Locality & ( ) ) ; <nl> <nl> std : : string hostname_ ; <nl> Network : : Address : : InstanceConstSharedPtr address_ ; <nl> class MockHost : public Host { <nl> <nl> MOCK_CONST_METHOD0 ( address , Network : : Address : : InstanceConstSharedPtr ( ) ) ; <nl> MOCK_CONST_METHOD0 ( canary , bool ( ) ) ; <nl> - MOCK_CONST_METHOD0 ( metadata , const envoy : : api : : v2 : : Metadata & ( ) ) ; <nl> + MOCK_CONST_METHOD0 ( metadata , const envoy : : api : : v2 : : core : : Metadata & ( ) ) ; <nl> MOCK_CONST_METHOD0 ( cluster , const ClusterInfo & ( ) ) ; <nl> MOCK_CONST_METHOD0 ( counters , std : : list < Stats : : CounterSharedPtr > ( ) ) ; <nl> MOCK_CONST_METHOD2 ( <nl> class MockHost : public Host { <nl> MOCK_METHOD1 ( weight , void ( uint32_t new_weight ) ) ; <nl> MOCK_CONST_METHOD0 ( used , bool ( ) ) ; <nl> MOCK_METHOD1 ( used , void ( bool new_used ) ) ; <nl> - MOCK_CONST_METHOD0 ( locality , const envoy : : api : : v2 : : Locality & ( ) ) ; <nl> + MOCK_CONST_METHOD0 ( locality , const envoy : : api : : v2 : : core : : Locality & ( ) ) ; <nl> <nl> testing : : NiceMock < MockClusterInfo > cluster_ ; <nl> testing : : NiceMock < Outlier : : MockDetectorHostMonitor > outlier_detector_ ; <nl> mmm a / test / server / config / access_log / config_test . cc <nl> ppp b / test / server / config / access_log / config_test . cc <nl> class HttpGrpcAccessLogConfigTest : public testing : : Test { <nl> ASSERT_NE ( nullptr , message_ ) ; <nl> <nl> EXPECT_CALL ( context_ . cluster_manager_ . async_client_manager_ , factoryForGrpcService ( _ , _ ) ) <nl> - . WillOnce ( Invoke ( [ ] ( const envoy : : api : : v2 : : GrpcService & , Stats : : Scope & ) { <nl> + . WillOnce ( Invoke ( [ ] ( const envoy : : api : : v2 : : core : : GrpcService & , Stats : : Scope & ) { <nl> return std : : make_unique < NiceMock < Grpc : : MockAsyncClientFactory > > ( ) ; <nl> } ) ) ; <nl> <nl> mmm a / test / server / config / http / config_test . cc <nl> ppp b / test / server / config / http / config_test . cc <nl> <nl> # include < string > <nl> <nl> - # include " envoy / api / v2 / filter / http / router . pb . h " <nl> + # include " envoy / config / filter / http / router / v2 / router . pb . h " <nl> # include " envoy / registry / registry . h " <nl> <nl> # include " common / config / filter_json . h " <nl> TEST ( HttpFilterConfigTest , ValidateFail ) { <nl> NiceMock < MockFactoryContext > context ; <nl> <nl> BufferFilterConfig buffer_factory ; <nl> - envoy : : api : : v2 : : filter : : http : : Buffer buffer_proto ; <nl> + envoy : : config : : filter : : http : : buffer : : v2 : : Buffer buffer_proto ; <nl> FaultFilterConfig fault_factory ; <nl> - envoy : : api : : v2 : : filter : : http : : HTTPFault fault_proto ; <nl> + envoy : : config : : filter : : http : : fault : : v2 : : HTTPFault fault_proto ; <nl> fault_proto . mutable_abort ( ) ; <nl> GrpcJsonTranscoderFilterConfig grpc_json_transcoder_factory ; <nl> - envoy : : api : : v2 : : filter : : http : : GrpcJsonTranscoder grpc_json_transcoder_proto ; <nl> + envoy : : config : : filter : : http : : transcoder : : v2 : : GrpcJsonTranscoder grpc_json_transcoder_proto ; <nl> LuaFilterConfig lua_factory ; <nl> - envoy : : api : : v2 : : filter : : http : : Lua lua_proto ; <nl> + envoy : : config : : filter : : http : : lua : : v2 : : Lua lua_proto ; <nl> RateLimitFilterConfig rate_limit_factory ; <nl> - envoy : : api : : v2 : : filter : : http : : RateLimit rate_limit_proto ; <nl> + envoy : : config : : filter : : http : : rate_limit : : v2 : : RateLimit rate_limit_proto ; <nl> const std : : vector < std : : pair < NamedHttpFilterConfigFactory & , Protobuf : : Message & > > filter_cases = { <nl> { buffer_factory , buffer_proto } , <nl> { fault_factory , fault_proto } , <nl> TEST ( HttpFilterConfigTest , BufferFilterIncorrectJson ) { <nl> } <nl> <nl> TEST ( HttpFilterConfigTest , BufferFilterCorrectProto ) { <nl> - envoy : : api : : v2 : : filter : : http : : Buffer config { } ; <nl> + envoy : : config : : filter : : http : : buffer : : v2 : : Buffer config { } ; <nl> config . mutable_max_request_bytes ( ) - > set_value ( 1028 ) ; <nl> config . mutable_max_request_time ( ) - > set_seconds ( 2 ) ; <nl> <nl> TEST ( HttpFilterConfigTest , BufferFilterCorrectProto ) { <nl> <nl> TEST ( HttpFilterConfigTest , BufferFilterEmptyProto ) { <nl> BufferFilterConfig factory ; <nl> - envoy : : api : : v2 : : filter : : http : : Buffer config = <nl> - * dynamic_cast < envoy : : api : : v2 : : filter : : http : : Buffer * > ( factory . createEmptyConfigProto ( ) . get ( ) ) ; <nl> + envoy : : config : : filter : : http : : buffer : : v2 : : Buffer config = <nl> + * dynamic_cast < envoy : : config : : filter : : http : : buffer : : v2 : : Buffer * > ( <nl> + factory . createEmptyConfigProto ( ) . get ( ) ) ; <nl> <nl> config . mutable_max_request_bytes ( ) - > set_value ( 1028 ) ; <nl> config . mutable_max_request_time ( ) - > set_seconds ( 2 ) ; <nl> TEST ( HttpFilterConfigTest , RateLimitFilterCorrectProto ) { <nl> ) EOF " ; <nl> <nl> Json : : ObjectSharedPtr json_config = Json : : Factory : : loadFromString ( json_string ) ; <nl> - envoy : : api : : v2 : : filter : : http : : RateLimit proto_config { } ; <nl> + envoy : : config : : filter : : http : : rate_limit : : v2 : : RateLimit proto_config { } ; <nl> Envoy : : Config : : FilterJson : : translateHttpRateLimitFilter ( * json_config , proto_config ) ; <nl> <nl> NiceMock < MockFactoryContext > context ; <nl> TEST ( HttpFilterConfigTest , RateLimitFilterEmptyProto ) { <nl> RateLimitFilterConfig factory ; <nl> <nl> Json : : ObjectSharedPtr json_config = Json : : Factory : : loadFromString ( json_string ) ; <nl> - envoy : : api : : v2 : : filter : : http : : RateLimit proto_config = <nl> - * dynamic_cast < envoy : : api : : v2 : : filter : : http : : RateLimit * > ( <nl> + envoy : : config : : filter : : http : : rate_limit : : v2 : : RateLimit proto_config = <nl> + * dynamic_cast < envoy : : config : : filter : : http : : rate_limit : : v2 : : RateLimit * > ( <nl> factory . createEmptyConfigProto ( ) . get ( ) ) ; <nl> Envoy : : Config : : FilterJson : : translateHttpRateLimitFilter ( * json_config , proto_config ) ; <nl> <nl> TEST ( HttpFilterConfigTest , FaultFilterCorrectJson ) { <nl> } <nl> <nl> TEST ( HttpFilterConfigTest , FaultFilterCorrectProto ) { <nl> - envoy : : api : : v2 : : filter : : http : : HTTPFault config { } ; <nl> + envoy : : config : : filter : : http : : fault : : v2 : : HTTPFault config { } ; <nl> config . mutable_delay ( ) - > set_percent ( 100 ) ; <nl> config . mutable_delay ( ) - > mutable_fixed_delay ( ) - > set_seconds ( 5 ) ; <nl> <nl> TEST ( HttpFilterConfigTest , FaultFilterCorrectProto ) { <nl> } <nl> <nl> TEST ( HttpFilterConfigTest , InvalidFaultFilterInProto ) { <nl> - envoy : : api : : v2 : : filter : : http : : HTTPFault config { } ; <nl> + envoy : : config : : filter : : http : : fault : : v2 : : HTTPFault config { } ; <nl> NiceMock < MockFactoryContext > context ; <nl> FaultFilterConfig factory ; <nl> EXPECT_THROW ( factory . createFilterFactoryFromProto ( config , " stats " , context ) , EnvoyException ) ; <nl> TEST ( HttpFilterConfigTest , BadRouterFilterConfig ) { <nl> } <nl> <nl> TEST ( HttpFilterConigTest , RouterV2Filter ) { <nl> - envoy : : api : : v2 : : filter : : http : : Router router_config ; <nl> + envoy : : config : : filter : : http : : router : : v2 : : Router router_config ; <nl> router_config . mutable_dynamic_stats ( ) - > set_value ( true ) ; <nl> <nl> NiceMock < MockFactoryContext > context ; <nl> mmm a / test / server / config / network / config_test . cc <nl> ppp b / test / server / config / network / config_test . cc <nl> TEST ( NetworkFilterConfigTest , ValidateFail ) { <nl> NiceMock < MockFactoryContext > context ; <nl> <nl> ClientSslAuthConfigFactory client_ssl_auth_factory ; <nl> - envoy : : api : : v2 : : filter : : network : : ClientSSLAuth client_ssl_auth_proto ; <nl> + envoy : : config : : filter : : network : : client_ssl_auth : : v2 : : ClientSSLAuth client_ssl_auth_proto ; <nl> HttpConnectionManagerFilterConfigFactory hcm_factory ; <nl> - envoy : : api : : v2 : : filter : : network : : HttpConnectionManager hcm_proto ; <nl> + envoy : : config : : filter : : network : : http_connection_manager : : v2 : : HttpConnectionManager hcm_proto ; <nl> MongoProxyFilterConfigFactory mongo_factory ; <nl> - envoy : : api : : v2 : : filter : : network : : MongoProxy mongo_proto ; <nl> + envoy : : config : : filter : : network : : mongo_proxy : : v2 : : MongoProxy mongo_proto ; <nl> RateLimitConfigFactory rate_limit_factory ; <nl> - envoy : : api : : v2 : : filter : : network : : RateLimit rate_limit_proto ; <nl> + envoy : : config : : filter : : network : : rate_limit : : v2 : : RateLimit rate_limit_proto ; <nl> RedisProxyFilterConfigFactory redis_factory ; <nl> - envoy : : api : : v2 : : filter : : network : : RedisProxy redis_proto ; <nl> + envoy : : config : : filter : : network : : redis_proxy : : v2 : : RedisProxy redis_proto ; <nl> TcpProxyConfigFactory tcp_proxy_factory ; <nl> - envoy : : api : : v2 : : filter : : network : : TcpProxy tcp_proxy_proto ; <nl> + envoy : : config : : filter : : network : : tcp_proxy : : v2 : : TcpProxy tcp_proxy_proto ; <nl> const std : : vector < std : : pair < NamedNetworkFilterConfigFactory & , Protobuf : : Message & > > filter_cases = <nl> { <nl> { client_ssl_auth_factory , client_ssl_auth_proto } , <nl> TEST ( NetworkFilterConfigTest , ValidateFail ) { <nl> } <nl> <nl> EXPECT_THROW ( FileAccessLogFactory ( ) . createAccessLogInstance ( <nl> - envoy : : api : : v2 : : filter : : accesslog : : FileAccessLog ( ) , nullptr , context ) , <nl> + envoy : : config : : filter : : accesslog : : v2 : : FileAccessLog ( ) , nullptr , context ) , <nl> ProtoValidationException ) ; <nl> } <nl> <nl> TEST ( NetworkFilterConfigTest , RedisProxyCorrectProto ) { <nl> ) EOF " ; <nl> <nl> Json : : ObjectSharedPtr json_config = Json : : Factory : : loadFromString ( json_string ) ; <nl> - envoy : : api : : v2 : : filter : : network : : RedisProxy proto_config { } ; <nl> + envoy : : config : : filter : : network : : redis_proxy : : v2 : : RedisProxy proto_config { } ; <nl> Config : : FilterJson : : translateRedisProxy ( * json_config , proto_config ) ; <nl> NiceMock < MockFactoryContext > context ; <nl> RedisProxyFilterConfigFactory factory ; <nl> TEST ( NetworkFilterConfigTest , RedisProxyEmptyProto ) { <nl> Json : : ObjectSharedPtr json_config = Json : : Factory : : loadFromString ( json_string ) ; <nl> NiceMock < MockFactoryContext > context ; <nl> RedisProxyFilterConfigFactory factory ; <nl> - envoy : : api : : v2 : : filter : : network : : RedisProxy proto_config = <nl> - * dynamic_cast < envoy : : api : : v2 : : filter : : network : : RedisProxy * > ( <nl> + envoy : : config : : filter : : network : : redis_proxy : : v2 : : RedisProxy proto_config = <nl> + * dynamic_cast < envoy : : config : : filter : : network : : redis_proxy : : v2 : : RedisProxy * > ( <nl> factory . createEmptyConfigProto ( ) . get ( ) ) ; <nl> <nl> Config : : FilterJson : : translateRedisProxy ( * json_config , proto_config ) ; <nl> TEST_P ( IpWhiteListConfigTest , ClientSslAuthCorrectProto ) { <nl> ) EOF " ; <nl> <nl> Json : : ObjectSharedPtr json_config = Json : : Factory : : loadFromString ( json_string ) ; <nl> - envoy : : api : : v2 : : filter : : network : : ClientSSLAuth proto_config { } ; <nl> + envoy : : config : : filter : : network : : client_ssl_auth : : v2 : : ClientSSLAuth proto_config { } ; <nl> Envoy : : Config : : FilterJson : : translateClientSslAuthFilter ( * json_config , proto_config ) ; <nl> NiceMock < MockFactoryContext > context ; <nl> ClientSslAuthConfigFactory factory ; <nl> TEST_P ( IpWhiteListConfigTest , ClientSslAuthEmptyProto ) { <nl> Json : : ObjectSharedPtr json_config = Json : : Factory : : loadFromString ( json_string ) ; <nl> NiceMock < MockFactoryContext > context ; <nl> ClientSslAuthConfigFactory factory ; <nl> - envoy : : api : : v2 : : filter : : network : : ClientSSLAuth proto_config = <nl> - * dynamic_cast < envoy : : api : : v2 : : filter : : network : : ClientSSLAuth * > ( <nl> + envoy : : config : : filter : : network : : client_ssl_auth : : v2 : : ClientSSLAuth proto_config = <nl> + * dynamic_cast < envoy : : config : : filter : : network : : client_ssl_auth : : v2 : : ClientSSLAuth * > ( <nl> factory . createEmptyConfigProto ( ) . get ( ) ) ; <nl> <nl> Envoy : : Config : : FilterJson : : translateClientSslAuthFilter ( * json_config , proto_config ) ; <nl> TEST ( NetworkFilterConfigTest , RatelimitCorrectProto ) { <nl> ) EOF " ; <nl> <nl> Json : : ObjectSharedPtr json_config = Json : : Factory : : loadFromString ( json_string ) ; <nl> - envoy : : api : : v2 : : filter : : network : : RateLimit proto_config { } ; <nl> + envoy : : config : : filter : : network : : rate_limit : : v2 : : RateLimit proto_config { } ; <nl> Config : : FilterJson : : translateTcpRateLimitFilter ( * json_config , proto_config ) ; <nl> <nl> NiceMock < MockFactoryContext > context ; <nl> TEST ( NetworkFilterConfigTest , RatelimitEmptyProto ) { <nl> <nl> NiceMock < MockFactoryContext > context ; <nl> RateLimitConfigFactory factory ; <nl> - envoy : : api : : v2 : : filter : : network : : RateLimit proto_config = <nl> - * dynamic_cast < envoy : : api : : v2 : : filter : : network : : RateLimit * > ( <nl> + envoy : : config : : filter : : network : : rate_limit : : v2 : : RateLimit proto_config = <nl> + * dynamic_cast < envoy : : config : : filter : : network : : rate_limit : : v2 : : RateLimit * > ( <nl> factory . createEmptyConfigProto ( ) . get ( ) ) ; <nl> Config : : FilterJson : : translateTcpRateLimitFilter ( * json_config , proto_config ) ; <nl> <nl> TEST ( AccessLogConfigTest , FileAccessLogTest ) { <nl> ProtobufTypes : : MessagePtr message = factory - > createEmptyConfigProto ( ) ; <nl> ASSERT_NE ( nullptr , message ) ; <nl> <nl> - envoy : : api : : v2 : : filter : : accesslog : : FileAccessLog file_access_log ; <nl> + envoy : : config : : filter : : accesslog : : v2 : : FileAccessLog file_access_log ; <nl> file_access_log . set_path ( " / dev / null " ) ; <nl> file_access_log . set_format ( " % START_TIME % " ) ; <nl> MessageUtil : : jsonConvert ( file_access_log , * message ) ; <nl> TEST ( AccessLogConfigTest , FileAccessLogTest ) { <nl> TEST ( TcpProxyConfigTest , TcpProxyConfigTest ) { <nl> NiceMock < MockFactoryContext > context ; <nl> TcpProxyConfigFactory factory ; <nl> - envoy : : api : : v2 : : filter : : network : : TcpProxy config = <nl> - * dynamic_cast < envoy : : api : : v2 : : filter : : network : : TcpProxy * > ( <nl> + envoy : : config : : filter : : network : : tcp_proxy : : v2 : : TcpProxy config = <nl> + * dynamic_cast < envoy : : config : : filter : : network : : tcp_proxy : : v2 : : TcpProxy * > ( <nl> factory . createEmptyConfigProto ( ) . get ( ) ) ; <nl> config . set_stat_prefix ( " prefix " ) ; <nl> config . set_cluster ( " cluster " ) ; <nl> mmm a / test / server / config / network / http_connection_manager_test . cc <nl> ppp b / test / server / config / network / http_connection_manager_test . cc <nl> namespace Server { <nl> namespace Configuration { <nl> namespace { <nl> <nl> - envoy : : api : : v2 : : filter : : network : : HttpConnectionManager <nl> + envoy : : config : : filter : : network : : http_connection_manager : : v2 : : HttpConnectionManager <nl> parseHttpConnectionManagerFromJson ( const std : : string & json_string ) { <nl> - envoy : : api : : v2 : : filter : : network : : HttpConnectionManager http_connection_manager ; <nl> + envoy : : config : : filter : : network : : http_connection_manager : : v2 : : HttpConnectionManager <nl> + http_connection_manager ; <nl> auto json_object_ptr = Json : : Factory : : loadFromString ( json_string ) ; <nl> Config : : FilterJson : : translateHttpConnectionManager ( * json_object_ptr , http_connection_manager ) ; <nl> return http_connection_manager ; <nl> mmm a / test / server / config / network / mongo_proxy_test . cc <nl> ppp b / test / server / config / network / mongo_proxy_test . cc <nl> <nl> # include < string > <nl> <nl> - # include " envoy / api / v2 / filter / network / mongo_proxy . pb . h " <nl> + # include " envoy / config / filter / network / mongo_proxy / v2 / mongo_proxy . pb . h " <nl> <nl> # include " server / config / network / mongo_proxy . h " <nl> <nl> TEST ( MongoFilterConfigTest , CorrectConfigurationNoFaults ) { <nl> } <nl> <nl> TEST ( MongoFilterConfigTest , ValidProtoConfigurationNoFaults ) { <nl> - envoy : : api : : v2 : : filter : : network : : MongoProxy config { } ; <nl> + envoy : : config : : filter : : network : : mongo_proxy : : v2 : : MongoProxy config { } ; <nl> <nl> config . set_access_log ( " path / to / access / log " ) ; <nl> config . set_stat_prefix ( " my_stat_prefix " ) ; <nl> TEST ( MongoFilterConfigTest , ValidProtoConfigurationNoFaults ) { <nl> TEST ( MongoFilterConfigTest , MongoFilterWithEmptyProto ) { <nl> NiceMock < MockFactoryContext > context ; <nl> MongoProxyFilterConfigFactory factory ; <nl> - envoy : : api : : v2 : : filter : : network : : MongoProxy config = <nl> - * dynamic_cast < envoy : : api : : v2 : : filter : : network : : MongoProxy * > ( <nl> + envoy : : config : : filter : : network : : mongo_proxy : : v2 : : MongoProxy config = <nl> + * dynamic_cast < envoy : : config : : filter : : network : : mongo_proxy : : v2 : : MongoProxy * > ( <nl> factory . createEmptyConfigProto ( ) . get ( ) ) ; <nl> config . set_access_log ( " path / to / access / log " ) ; <nl> config . set_stat_prefix ( " my_stat_prefix " ) ; <nl> TEST ( MongoFilterConfigTest , CorrectFaultConfiguration ) { <nl> } <nl> <nl> TEST ( MongoFilterConfigTest , CorrectFaultConfigurationInProto ) { <nl> - envoy : : api : : v2 : : filter : : network : : MongoProxy config { } ; <nl> + envoy : : config : : filter : : network : : mongo_proxy : : v2 : : MongoProxy config { } ; <nl> config . set_stat_prefix ( " my_stat_prefix " ) ; <nl> config . mutable_delay ( ) - > set_percent ( 50 ) ; <nl> config . mutable_delay ( ) - > mutable_fixed_delay ( ) - > set_seconds ( 500 ) ; <nl> mmm a / test / server / config / stats / config_test . cc <nl> ppp b / test / server / config / stats / config_test . cc <nl> TEST_P ( StatsConfigLoopbackTest , ValidUdpIpStatsd ) { <nl> const std : : string name = Config : : StatsSinkNames : : get ( ) . STATSD ; <nl> <nl> envoy : : config : : metrics : : v2 : : StatsdSink sink_config ; <nl> - envoy : : api : : v2 : : Address & address = * sink_config . mutable_address ( ) ; <nl> - envoy : : api : : v2 : : SocketAddress & socket_address = * address . mutable_socket_address ( ) ; <nl> - socket_address . set_protocol ( envoy : : api : : v2 : : SocketAddress : : UDP ) ; <nl> + envoy : : api : : v2 : : core : : Address & address = * sink_config . mutable_address ( ) ; <nl> + envoy : : api : : v2 : : core : : SocketAddress & socket_address = * address . mutable_socket_address ( ) ; <nl> + socket_address . set_protocol ( envoy : : api : : v2 : : core : : SocketAddress : : UDP ) ; <nl> auto loopback_flavor = Network : : Test : : getCanonicalLoopbackAddress ( GetParam ( ) ) ; <nl> socket_address . set_address ( loopback_flavor - > ip ( ) - > addressAsString ( ) ) ; <nl> socket_address . set_port_value ( 8125 ) ; <nl> TEST_P ( DogStatsdConfigLoopbackTest , ValidUdpIp ) { <nl> const std : : string name = Config : : StatsSinkNames : : get ( ) . DOG_STATSD ; <nl> <nl> envoy : : config : : metrics : : v2 : : DogStatsdSink sink_config ; <nl> - envoy : : api : : v2 : : Address & address = * sink_config . mutable_address ( ) ; <nl> - envoy : : api : : v2 : : SocketAddress & socket_address = * address . mutable_socket_address ( ) ; <nl> - socket_address . set_protocol ( envoy : : api : : v2 : : SocketAddress : : UDP ) ; <nl> + envoy : : api : : v2 : : core : : Address & address = * sink_config . mutable_address ( ) ; <nl> + envoy : : api : : v2 : : core : : SocketAddress & socket_address = * address . mutable_socket_address ( ) ; <nl> + socket_address . set_protocol ( envoy : : api : : v2 : : core : : SocketAddress : : UDP ) ; <nl> auto loopback_flavor = Network : : Test : : getCanonicalLoopbackAddress ( GetParam ( ) ) ; <nl> socket_address . set_address ( loopback_flavor - > ip ( ) - > addressAsString ( ) ) ; <nl> socket_address . set_port_value ( 8125 ) ; <nl> mmm a / test / server / http / health_check_test . cc <nl> ppp b / test / server / http / health_check_test . cc <nl> TEST ( HealthCheckFilterConfig , notFailingWhenNotPassThroughAndTimeoutNotSetJson ) <nl> <nl> TEST ( HealthCheckFilterConfig , failsWhenNotPassThroughButTimeoutSetProto ) { <nl> Server : : Configuration : : HealthCheckFilterConfig healthCheckFilterConfig ; <nl> - envoy : : api : : v2 : : filter : : http : : HealthCheck config { } ; <nl> + envoy : : config : : filter : : http : : health_check : : v2 : : HealthCheck config { } ; <nl> NiceMock < Server : : Configuration : : MockFactoryContext > context ; <nl> <nl> config . mutable_pass_through_mode ( ) - > set_value ( false ) ; <nl> TEST ( HealthCheckFilterConfig , failsWhenNotPassThroughButTimeoutSetProto ) { <nl> <nl> TEST ( HealthCheckFilterConfig , notFailingWhenNotPassThroughAndTimeoutNotSetProto ) { <nl> Server : : Configuration : : HealthCheckFilterConfig healthCheckFilterConfig ; <nl> - envoy : : api : : v2 : : filter : : http : : HealthCheck config { } ; <nl> + envoy : : config : : filter : : http : : health_check : : v2 : : HealthCheck config { } ; <nl> NiceMock < Server : : Configuration : : MockFactoryContext > context ; <nl> <nl> config . mutable_pass_through_mode ( ) - > set_value ( false ) ; <nl> TEST ( HealthCheckFilterConfig , notFailingWhenNotPassThroughAndTimeoutNotSetProto ) <nl> TEST ( HealthCheckFilterConfig , HealthCheckFilterWithEmptyProto ) { <nl> Server : : Configuration : : HealthCheckFilterConfig healthCheckFilterConfig ; <nl> NiceMock < Server : : Configuration : : MockFactoryContext > context ; <nl> - envoy : : api : : v2 : : filter : : http : : HealthCheck config = <nl> - * dynamic_cast < envoy : : api : : v2 : : filter : : http : : HealthCheck * > ( <nl> + envoy : : config : : filter : : http : : health_check : : v2 : : HealthCheck config = <nl> + * dynamic_cast < envoy : : config : : filter : : http : : health_check : : v2 : : HealthCheck * > ( <nl> healthCheckFilterConfig . createEmptyConfigProto ( ) . get ( ) ) ; <nl> <nl> config . mutable_pass_through_mode ( ) - > set_value ( false ) ; <nl> mmm a / test / server / lds_api_test . cc <nl> ppp b / test / server / lds_api_test . cc <nl> class LdsApiTest : public testing : : Test { <nl> ) EOF " ; <nl> <nl> Json : : ObjectSharedPtr config = Json : : Factory : : loadFromString ( config_json ) ; <nl> - envoy : : api : : v2 : : ConfigSource lds_config ; <nl> + envoy : : api : : v2 : : core : : ConfigSource lds_config ; <nl> Config : : Utility : : translateLdsConfig ( * config , lds_config ) ; <nl> if ( v2_rest ) { <nl> - lds_config . mutable_api_config_source ( ) - > set_api_type ( envoy : : api : : v2 : : ApiConfigSource : : REST ) ; <nl> + lds_config . mutable_api_config_source ( ) - > set_api_type ( <nl> + envoy : : api : : v2 : : core : : ApiConfigSource : : REST ) ; <nl> } <nl> Upstream : : ClusterManager : : ClusterInfoMap cluster_map ; <nl> Upstream : : MockCluster cluster ; <nl> TEST_F ( LdsApiTest , UnknownCluster ) { <nl> ) EOF " ; <nl> <nl> Json : : ObjectSharedPtr config = Json : : Factory : : loadFromString ( config_json ) ; <nl> - envoy : : api : : v2 : : ConfigSource lds_config ; <nl> + envoy : : api : : v2 : : core : : ConfigSource lds_config ; <nl> Config : : Utility : : translateLdsConfig ( * config , lds_config ) ; <nl> Upstream : : ClusterManager : : ClusterInfoMap cluster_map ; <nl> EXPECT_CALL ( cluster_manager_ , clusters ( ) ) . WillOnce ( Return ( cluster_map ) ) ; <nl> - EXPECT_THROW_WITH_MESSAGE ( LdsApi ( lds_config , cluster_manager_ , dispatcher_ , random_ , init_ , <nl> - local_info_ , store_ , listener_manager_ ) , <nl> - EnvoyException , <nl> - " envoy : : api : : v2 : : ConfigSource must have a statically defined non - EDS " <nl> - " cluster : ' foo_cluster ' does not exist , was added via api , or is an " <nl> - " EDS cluster " ) ; <nl> + EXPECT_THROW_WITH_MESSAGE ( <nl> + LdsApi ( lds_config , cluster_manager_ , dispatcher_ , random_ , init_ , local_info_ , store_ , <nl> + listener_manager_ ) , <nl> + EnvoyException , <nl> + " envoy : : api : : v2 : : core : : ConfigSource must have a statically defined non - EDS " <nl> + " cluster : ' foo_cluster ' does not exist , was added via api , or is an " <nl> + " EDS cluster " ) ; <nl> } <nl> <nl> TEST_F ( LdsApiTest , BadLocalInfo ) { <nl> TEST_F ( LdsApiTest , BadLocalInfo ) { <nl> ) EOF " ; <nl> <nl> Json : : ObjectSharedPtr config = Json : : Factory : : loadFromString ( config_json ) ; <nl> - envoy : : api : : v2 : : ConfigSource lds_config ; <nl> + envoy : : api : : v2 : : core : : ConfigSource lds_config ; <nl> Config : : Utility : : translateLdsConfig ( * config , lds_config ) ; <nl> Upstream : : ClusterManager : : ClusterInfoMap cluster_map ; <nl> Upstream : : MockCluster cluster ; <nl>
Update data - plane - api ( core and filter packages ) ( )
envoyproxy/envoy
c932e50c34a11dd382dca9c5daf2026d4686daa9
2018-02-04T04:17:47Z
mmm a / editor / export_template_manager . cpp <nl> ppp b / editor / export_template_manager . cpp <nl> void ExportTemplateManager : : _install_from_file ( const String & p_file , bool p_use_ <nl> version = data_str ; <nl> } <nl> <nl> - fc + + ; <nl> + if ( file . get_file ( ) . size ( ) ! = 0 ) { <nl> + fc + + ; <nl> + } <nl> + <nl> ret = unzGoToNextFile ( pkg ) ; <nl> } <nl> <nl> void ExportTemplateManager : : _install_from_file ( const String & p_file , bool p_use_ <nl> <nl> String file = String ( fname ) . get_file ( ) ; <nl> <nl> + if ( file . size ( ) = = 0 ) { <nl> + ret = unzGoToNextFile ( pkg ) ; <nl> + continue ; <nl> + } <nl> + <nl> Vector < uint8_t > data ; <nl> data . resize ( info . uncompressed_size ) ; <nl> <nl>
Fix export templates installation error . . .
godotengine/godot
bf37bd94b6c3604f760abea691973b4b2d09e622
2018-07-17T14:14:20Z
mmm a / Docker / README . md <nl> ppp b / Docker / README . md <nl> curl http : / / 127 . 0 . 0 . 1 : 8888 / v1 / chain / get_info <nl> docker - compose logs nodeosd <nl> ` ` ` <nl> <nl> + The ` blocks ` data are stored under ` - - data - dir ` by default , and the wallet files are stored under ` - - wallet - dir ` by default , of course you can change these as you want . <nl> \ No newline at end of file <nl>
add doc for change
EOSIO/eos
68dc68613007f8dc48f7f5cb922c5019cd99e869
2018-04-19T14:02:33Z
mmm a / src / doc / palette . cpp <nl> ppp b / src / doc / palette . cpp <nl> void Palette : : makeGradient ( int from , int to ) <nl> int r2 , g2 , b2 , a2 ; <nl> int i , n ; <nl> <nl> - ASSERT ( from > = 0 & & from < = 255 ) ; <nl> - ASSERT ( to > = 0 & & to < = 255 ) ; <nl> + ASSERT ( from > = 0 & & from < size ( ) ) ; <nl> + ASSERT ( to > = 0 & & to < size ( ) ) ; <nl> <nl> if ( from > to ) <nl> std : : swap ( from , to ) ; <nl>
Fix asserts in Palette : : makeGradient ( )
aseprite/aseprite
0ec21a461a3377c2f3a498b5dfc747cb830f3a87
2015-08-11T15:43:29Z
mmm a / tests / common . sh <nl> ppp b / tests / common . sh <nl> function build_sketches ( ) <nl> echo " Build failed ( $ 1 ) " <nl> echo " Build log : " <nl> cat build . log <nl> + set - e <nl> return $ result <nl> fi <nl> rm build . log <nl>
ci : fix - e flag not restored in build_sketches on error
esp8266/Arduino
3363be0063ffdb8ad9bfcb07982912b1c7c7fafb
2017-05-20T04:13:20Z
mmm a / src / mongo / db / pipeline / SConscript <nl> ppp b / src / mongo / db / pipeline / SConscript <nl> docSourceEnv . Library ( <nl> target = ' document_source ' , <nl> source = [ <nl> ' document_source . cpp ' , <nl> + ' document_source_bucket . cpp ' , <nl> ' document_source_coll_stats . cpp ' , <nl> ' document_source_count . cpp ' , <nl> ' document_source_geo_near . cpp ' , <nl> mmm a / src / mongo / db / pipeline / document_source . h <nl> ppp b / src / mongo / db / pipeline / document_source . h <nl> class DocumentSourceGraphLookUp final : public DocumentSourceNeedsMongod { <nl> long long _outputIndex ; <nl> } ; <nl> <nl> + <nl> class DocumentSourceSortByCount final { <nl> public : <nl> static std : : vector < boost : : intrusive_ptr < DocumentSource > > createFromBson ( <nl> class DocumentSourceCount final { <nl> DocumentSourceCount ( ) = default ; <nl> } ; <nl> <nl> + class DocumentSourceBucket final { <nl> + public : <nl> + static std : : vector < boost : : intrusive_ptr < DocumentSource > > createFromBson ( <nl> + BSONElement elem , const boost : : intrusive_ptr < ExpressionContext > & pExpCtx ) ; <nl> + <nl> + private : <nl> + DocumentSourceBucket ( ) = default ; <nl> + } ; <nl> + <nl> / * * <nl> * Provides a document source interface to retrieve collection - level statistics for a given <nl> * collection . <nl> new file mode 100644 <nl> index 000000000000 . . 6018402113b0 <nl> mmm / dev / null <nl> ppp b / src / mongo / db / pipeline / document_source_bucket . cpp <nl> <nl> + / * * <nl> + * Copyright ( C ) 2016 MongoDB Inc . <nl> + * <nl> + * This program is free software : you can redistribute it and / or modify <nl> + * it under the terms of the GNU Affero General Public License , version 3 , <nl> + * as published by the Free Software Foundation . <nl> + * <nl> + * This program is distributed in the hope that it will be useful , <nl> + * but WITHOUT ANY WARRANTY ; without even the implied warranty of <nl> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the <nl> + * GNU Affero General Public License for more details . <nl> + * <nl> + * You should have received a copy of the GNU Affero General Public License <nl> + * along with this program . If not , see < http : / / www . gnu . org / licenses / > . <nl> + * <nl> + * As a special exception , the copyright holders give permission to link the <nl> + * code of portions of this program with the OpenSSL library under certain <nl> + * conditions as described in each individual source file and distribute <nl> + * linked combinations including the program with the OpenSSL library . You <nl> + * must comply with the GNU Affero General Public License in all respects for <nl> + * all of the code used other than as permitted herein . If you modify file ( s ) <nl> + * with this exception , you may extend this exception to your version of the <nl> + * file ( s ) , but you are not obligated to do so . If you do not wish to do so , <nl> + * delete this exception statement from your version . If you delete this <nl> + * exception statement from all source files in the program , then also delete <nl> + * it in the license file . <nl> + * / <nl> + <nl> + # include " mongo / db / pipeline / document_source . h " <nl> + <nl> + namespace mongo { <nl> + <nl> + using boost : : intrusive_ptr ; <nl> + using std : : vector ; <nl> + <nl> + REGISTER_DOCUMENT_SOURCE_ALIAS ( bucket , DocumentSourceBucket : : createFromBson ) ; <nl> + <nl> + namespace { <nl> + intrusive_ptr < ExpressionConstant > getExpressionConstant ( BSONElement expressionElem , <nl> + VariablesParseState vps ) { <nl> + auto expr = Expression : : parseOperand ( expressionElem , vps ) - > optimize ( ) ; <nl> + return dynamic_cast < ExpressionConstant * > ( expr . get ( ) ) ; <nl> + } <nl> + } / / namespace <nl> + <nl> + vector < intrusive_ptr < DocumentSource > > DocumentSourceBucket : : createFromBson ( <nl> + BSONElement elem , const intrusive_ptr < ExpressionContext > & pExpCtx ) { <nl> + uassert ( 40201 , <nl> + str : : stream ( ) < < " Argument to $ bucket stage must be an object , but found type : " <nl> + < < typeName ( elem . type ( ) ) <nl> + < < " . " , <nl> + elem . type ( ) = = BSONType : : Object ) ; <nl> + <nl> + const BSONObj bucketObj = elem . embeddedObject ( ) ; <nl> + BSONObjBuilder groupObjBuilder ; <nl> + BSONObjBuilder switchObjBuilder ; <nl> + <nl> + VariablesIdGenerator idGenerator ; <nl> + VariablesParseState vps ( & idGenerator ) ; <nl> + <nl> + vector < Value > boundaryValues ; <nl> + BSONElement groupByField ; <nl> + Value defaultValue ; <nl> + <nl> + bool outputFieldSpecified = false ; <nl> + for ( auto & & argument : bucketObj ) { <nl> + const auto argName = argument . fieldNameStringData ( ) ; <nl> + if ( " groupBy " = = argName ) { <nl> + groupByField = argument ; <nl> + <nl> + const bool groupByIsExpressionInObject = groupByField . type ( ) = = BSONType : : Object & & <nl> + groupByField . embeddedObject ( ) . firstElementFieldName ( ) [ 0 ] = = ' $ ' ; <nl> + <nl> + const bool groupByIsPrefixedPath = <nl> + groupByField . type ( ) = = BSONType : : String & & groupByField . valueStringData ( ) [ 0 ] = = ' $ ' ; <nl> + uassert ( 40202 , <nl> + str : : stream ( ) < < " The $ bucket ' groupBy ' field must be defined as a $ - prefixed " <nl> + " path or an expression , but found : " <nl> + < < groupByField . toString ( false , false ) <nl> + < < " . " , <nl> + groupByIsExpressionInObject | | groupByIsPrefixedPath ) ; <nl> + } else if ( " boundaries " = = argName ) { <nl> + uassert ( <nl> + 40200 , <nl> + str : : stream ( ) < < " The $ bucket ' boundaries ' field must be an array , but found type : " <nl> + < < typeName ( argument . type ( ) ) <nl> + < < " . " , <nl> + argument . type ( ) = = BSONType : : Array ) ; <nl> + <nl> + for ( auto & & boundaryElem : argument . embeddedObject ( ) ) { <nl> + auto exprConst = getExpressionConstant ( boundaryElem , vps ) ; <nl> + uassert ( 40191 , <nl> + str : : stream ( ) < < " The $ bucket ' boundaries ' field must be an array of " <nl> + " constant values , but found value : " <nl> + < < boundaryElem . toString ( false , false ) <nl> + < < " . " , <nl> + exprConst ) ; <nl> + boundaryValues . push_back ( exprConst - > getValue ( ) ) ; <nl> + } <nl> + <nl> + uassert ( 40192 , <nl> + str : : stream ( ) <nl> + < < " The $ bucket ' boundaries ' field must have at least 2 values , but found " <nl> + < < boundaryValues . size ( ) <nl> + < < " value ( s ) . " , <nl> + boundaryValues . size ( ) > = 2 ) ; <nl> + <nl> + / / Make sure that the boundaries are unique , sorted in ascending order , and have the <nl> + / / same canonical type . <nl> + for ( size_t i = 1 ; i < boundaryValues . size ( ) ; + + i ) { <nl> + Value lower = boundaryValues [ i - 1 ] ; <nl> + Value upper = boundaryValues [ i ] ; <nl> + int lowerCanonicalType = canonicalizeBSONType ( lower . getType ( ) ) ; <nl> + int upperCanonicalType = canonicalizeBSONType ( upper . getType ( ) ) ; <nl> + <nl> + uassert ( 40193 , <nl> + str : : stream ( ) < < " All values in the the ' boundaries ' option to $ bucket " <nl> + " must have the same type . Found conflicting types " <nl> + < < typeName ( lower . getType ( ) ) <nl> + < < " and " <nl> + < < typeName ( upper . getType ( ) ) <nl> + < < " . " , <nl> + lowerCanonicalType = = upperCanonicalType ) ; <nl> + uassert ( 40194 , <nl> + str : : stream ( ) <nl> + < < " The ' boundaries ' option to $ bucket must be sorted , but elements " <nl> + < < i - 1 <nl> + < < " and " <nl> + < < i <nl> + < < " are not in ascending order ( " <nl> + < < lower . toString ( ) <nl> + < < " is not less than " <nl> + < < upper . toString ( ) <nl> + < < " ) . " , <nl> + lower < upper ) ; <nl> + } <nl> + } else if ( " default " = = argName ) { <nl> + / / If there is a default , make sure that it parses to a constant expression then add <nl> + / / default to switch . <nl> + auto exprConst = getExpressionConstant ( argument , vps ) ; <nl> + uassert ( 40195 , <nl> + str : : stream ( ) <nl> + < < " The $ bucket ' default ' field must be a constant expression , but found : " <nl> + < < argument . toString ( false , false ) <nl> + < < " . " , <nl> + exprConst ) ; <nl> + <nl> + defaultValue = exprConst - > getValue ( ) ; <nl> + defaultValue . addToBsonObj ( & switchObjBuilder , " default " ) ; <nl> + } else if ( " output " = = argName ) { <nl> + outputFieldSpecified = true ; <nl> + uassert ( <nl> + 40196 , <nl> + str : : stream ( ) < < " The $ bucket ' output ' field must be an object , but found type : " <nl> + < < typeName ( argument . type ( ) ) <nl> + < < " . " , <nl> + argument . type ( ) = = BSONType : : Object ) ; <nl> + <nl> + for ( auto & & outputElem : argument . embeddedObject ( ) ) { <nl> + groupObjBuilder . append ( outputElem ) ; <nl> + } <nl> + } else { <nl> + uasserted ( 40197 , str : : stream ( ) < < " Unrecognized option to $ bucket : " < < argName < < " . " ) ; <nl> + } <nl> + } <nl> + <nl> + const bool isMissingRequiredField = groupByField . eoo ( ) | | boundaryValues . empty ( ) ; <nl> + uassert ( 40198 , <nl> + " $ bucket requires ' groupBy ' and ' boundaries ' to be specified . " , <nl> + ! isMissingRequiredField ) ; <nl> + <nl> + Value lowerValue = boundaryValues . front ( ) ; <nl> + Value upperValue = boundaryValues . back ( ) ; <nl> + if ( canonicalizeBSONType ( defaultValue . getType ( ) ) = = <nl> + canonicalizeBSONType ( lowerValue . getType ( ) ) ) { <nl> + / / If the default has the same canonical type as the bucket ' s boundaries , then make sure <nl> + / / the default is less than the lowest boundary or greater than or equal to the highest <nl> + / / boundary . <nl> + const bool hasValidDefault = <nl> + defaultValue < lowerValue | | Value : : compare ( defaultValue , upperValue ) > = 0 ; <nl> + uassert ( 40199 , <nl> + " The $ bucket ' default ' field must be less than the lowest boundary or greater than " <nl> + " or equal to the highest boundary . " , <nl> + hasValidDefault ) ; <nl> + } <nl> + <nl> + / / Make the branches for the $ switch expression . <nl> + BSONArrayBuilder branchesBuilder ; <nl> + for ( size_t i = 1 ; i < boundaryValues . size ( ) ; + + i ) { <nl> + Value lower = boundaryValues [ i - 1 ] ; <nl> + Value upper = boundaryValues [ i ] ; <nl> + BSONObj caseExpr = <nl> + BSON ( " $ and " < < BSON_ARRAY ( BSON ( " $ gte " < < BSON_ARRAY ( groupByField < < lower ) ) <nl> + < < BSON ( " $ lt " < < BSON_ARRAY ( groupByField < < upper ) ) ) ) ; <nl> + branchesBuilder . append ( BSON ( " case " < < caseExpr < < " then " < < lower ) ) ; <nl> + } <nl> + <nl> + / / Add the $ switch expression to the group BSON object . <nl> + switchObjBuilder . append ( " branches " , branchesBuilder . arr ( ) ) ; <nl> + groupObjBuilder . append ( " _id " , BSON ( " $ switch " < < switchObjBuilder . obj ( ) ) ) ; <nl> + <nl> + / / If no output is specified , add a count field by default . <nl> + if ( ! outputFieldSpecified ) { <nl> + groupObjBuilder . append ( " count " , BSON ( " $ sum " < < 1 ) ) ; <nl> + } <nl> + <nl> + BSONObj groupObj = BSON ( " $ group " < < groupObjBuilder . obj ( ) ) ; <nl> + BSONObj sortObj = BSON ( " $ sort " < < BSON ( " _id " < < 1 ) ) ; <nl> + <nl> + auto groupSource = DocumentSourceGroup : : createFromBson ( groupObj . firstElement ( ) , pExpCtx ) ; <nl> + auto sortSource = DocumentSourceSort : : createFromBson ( sortObj . firstElement ( ) , pExpCtx ) ; <nl> + <nl> + return { groupSource , sortSource } ; <nl> + } <nl> + } / / namespace mongo <nl> mmm a / src / mongo / db / pipeline / document_source_test . cpp <nl> ppp b / src / mongo / db / pipeline / document_source_test . cpp <nl> TEST_F ( InvalidCountSpec , PeriodInStringSpec ) { <nl> } <nl> } / / namespace DocumentSourceCount <nl> <nl> + namespace DocumentSourceBucket { <nl> + using mongo : : DocumentSourceBucket ; <nl> + using mongo : : DocumentSourceGroup ; <nl> + using mongo : : DocumentSourceSort ; <nl> + using mongo : : DocumentSourceMock ; <nl> + using std : : vector ; <nl> + using boost : : intrusive_ptr ; <nl> + <nl> + class BucketReturnsGroupAndSort : public Mock : : Base , public unittest : : Test { <nl> + public : <nl> + void testCreateFromBsonResult ( BSONObj bucketSpec , Value expectedGroupExplain ) { <nl> + vector < intrusive_ptr < DocumentSource > > result = <nl> + DocumentSourceBucket : : createFromBson ( bucketSpec . firstElement ( ) , ctx ( ) ) ; <nl> + <nl> + ASSERT_EQUALS ( result . size ( ) , 2UL ) ; <nl> + <nl> + const auto * groupStage = dynamic_cast < DocumentSourceGroup * > ( result [ 0 ] . get ( ) ) ; <nl> + ASSERT ( groupStage ) ; <nl> + <nl> + const auto * sortStage = dynamic_cast < DocumentSourceSort * > ( result [ 1 ] . get ( ) ) ; <nl> + ASSERT ( sortStage ) ; <nl> + <nl> + / / Serialize the DocumentSourceGroup and DocumentSourceSort from $ bucket so that we can <nl> + / / check the explain output to make sure $ group and $ sort have the correct fields . <nl> + const bool explain = true ; <nl> + vector < Value > explainedStages ; <nl> + groupStage - > serializeToArray ( explainedStages , explain ) ; <nl> + sortStage - > serializeToArray ( explainedStages , explain ) ; <nl> + ASSERT_EQUALS ( explainedStages . size ( ) , 2UL ) ; <nl> + <nl> + auto groupExplain = explainedStages [ 0 ] ; <nl> + ASSERT_EQ ( groupExplain [ " $ group " ] , expectedGroupExplain ) ; <nl> + <nl> + auto sortExplain = explainedStages [ 1 ] ; <nl> + <nl> + auto expectedSortExplain = Value { Document { { " sortKey " , Document { { " _id " , 1 } } } } } ; <nl> + ASSERT_EQ ( sortExplain [ " $ sort " ] , expectedSortExplain ) ; <nl> + } <nl> + } ; <nl> + <nl> + TEST_F ( BucketReturnsGroupAndSort , BucketUsesDefaultOutputWhenNoOutputSpecified ) { <nl> + const auto spec = <nl> + fromjson ( " { $ bucket : { groupBy : ' $ x ' , boundaries : [ 0 , 2 ] , default : ' other ' } } " ) ; <nl> + auto expectedGroupExplain = <nl> + Value ( fromjson ( " { _id : { $ switch : { branches : [ { case : { $ and : [ { $ gte : [ ' $ x ' , { $ const : " <nl> + " 0 } ] } , { $ lt : [ ' $ x ' , { $ const : 2 } ] } ] } , then : { $ const : 0 } } ] , default : " <nl> + " { $ const : ' other ' } } } , count : { $ sum : { $ const : 1 } } } " ) ) ; <nl> + <nl> + testCreateFromBsonResult ( spec , expectedGroupExplain ) ; <nl> + } <nl> + <nl> + TEST_F ( BucketReturnsGroupAndSort , BucketSucceedsWhenOutputSpecified ) { <nl> + const auto spec = fromjson ( <nl> + " { $ bucket : { groupBy : ' $ x ' , boundaries : [ 0 , 2 ] , output : { number : { $ sum : 1 } } } } " ) ; <nl> + auto expectedGroupExplain = Value ( fromjson ( <nl> + " { _id : { $ switch : { branches : [ { case : { $ and : [ { $ gte : [ ' $ x ' , { $ const : 0 } ] } , { $ lt : " <nl> + " [ ' $ x ' , { $ const : 2 } ] } ] } , then : { $ const : 0 } } ] } } , number : { $ sum : { $ const : 1 } } } " ) ) ; <nl> + <nl> + testCreateFromBsonResult ( spec , expectedGroupExplain ) ; <nl> + } <nl> + <nl> + TEST_F ( BucketReturnsGroupAndSort , BucketSucceedsWhenNoDefaultSpecified ) { <nl> + const auto spec = fromjson ( " { $ bucket : { groupBy : ' $ x ' , boundaries : [ 0 , 2 ] } } " ) ; <nl> + auto expectedGroupExplain = Value ( fromjson ( <nl> + " { _id : { $ switch : { branches : [ { case : { $ and : [ { $ gte : [ ' $ x ' , { $ const : 0 } ] } , { $ lt : " <nl> + " [ ' $ x ' , { $ const : 2 } ] } ] } , then : { $ const : 0 } } ] } } , count : { $ sum : { $ const : 1 } } } " ) ) ; <nl> + <nl> + testCreateFromBsonResult ( spec , expectedGroupExplain ) ; <nl> + } <nl> + <nl> + TEST_F ( BucketReturnsGroupAndSort , BucketSucceedsWhenBoundariesAreSameCanonicalType ) { <nl> + const auto spec = fromjson ( " { $ bucket : { groupBy : ' $ x ' , boundaries : [ 0 , 1 . 5 ] } } " ) ; <nl> + auto expectedGroupExplain = Value ( fromjson ( <nl> + " { _id : { $ switch : { branches : [ { case : { $ and : [ { $ gte : [ ' $ x ' , { $ const : 0 } ] } , { $ lt : " <nl> + " [ ' $ x ' , { $ const : 1 . 5 } ] } ] } , then : { $ const : 0 } } ] } } , count : { $ sum : { $ const : 1 } } } " ) ) ; <nl> + <nl> + testCreateFromBsonResult ( spec , expectedGroupExplain ) ; <nl> + } <nl> + <nl> + TEST_F ( BucketReturnsGroupAndSort , BucketSucceedsWhenBoundariesAreConstantExpressions ) { <nl> + const auto spec = fromjson ( " { $ bucket : { groupBy : ' $ x ' , boundaries : [ 0 , { $ add : [ 4 , 5 ] } ] } } " ) ; <nl> + auto expectedGroupExplain = Value ( fromjson ( <nl> + " { _id : { $ switch : { branches : [ { case : { $ and : [ { $ gte : [ ' $ x ' , { $ const : 0 } ] } , { $ lt : " <nl> + " [ ' $ x ' , { $ const : 9 } ] } ] } , then : { $ const : 0 } } ] } } , count : { $ sum : { $ const : 1 } } } " ) ) ; <nl> + <nl> + testCreateFromBsonResult ( spec , expectedGroupExplain ) ; <nl> + } <nl> + <nl> + TEST_F ( BucketReturnsGroupAndSort , BucketSucceedsWhenDefaultIsConstantExpression ) { <nl> + const auto spec = <nl> + fromjson ( " { $ bucket : { groupBy : ' $ x ' , boundaries : [ 0 , 1 ] , default : { $ add : [ 4 , 5 ] } } } " ) ; <nl> + auto expectedGroupExplain = <nl> + Value ( fromjson ( " { _id : { $ switch : { branches : [ { case : { $ and : [ { $ gte : [ ' $ x ' , { $ const : " <nl> + " 0 } ] } , { $ lt : [ ' $ x ' , { $ const : 1 } ] } ] } , then : { $ const : 0 } } ] , default : " <nl> + " { $ const : 9 } } } , count : { $ sum : { $ const : 1 } } } " ) ) ; <nl> + <nl> + testCreateFromBsonResult ( spec , expectedGroupExplain ) ; <nl> + } <nl> + <nl> + TEST_F ( BucketReturnsGroupAndSort , BucketSucceedsWithMultipleBoundaryValues ) { <nl> + auto spec = fromjson ( " { $ bucket : { groupBy : ' $ x ' , boundaries : [ 0 , 1 , 2 ] } } " ) ; <nl> + auto expectedGroupExplain = <nl> + Value ( fromjson ( " { _id : { $ switch : { branches : [ { case : { $ and : [ { $ gte : [ ' $ x ' , { $ const : " <nl> + " 0 } ] } , { $ lt : [ ' $ x ' , { $ const : 1 } ] } ] } , then : { $ const : 0 } } , { case : { $ and " <nl> + " : [ { $ gte : [ ' $ x ' , { $ const : 1 } ] } , { $ lt : [ ' $ x ' , { $ const : 2 } ] } ] } , then : " <nl> + " { $ const : 1 } } ] } } , count : { $ sum : { $ const : 1 } } } " ) ) ; <nl> + <nl> + testCreateFromBsonResult ( spec , expectedGroupExplain ) ; <nl> + } <nl> + <nl> + class InvalidBucketSpec : public Mock : : Base , public unittest : : Test { <nl> + public : <nl> + vector < intrusive_ptr < DocumentSource > > createBucket ( BSONObj bucketSpec ) { <nl> + return DocumentSourceBucket : : createFromBson ( bucketSpec . firstElement ( ) , ctx ( ) ) ; <nl> + } <nl> + } ; <nl> + <nl> + TEST_F ( InvalidBucketSpec , BucketFailsWithNonObject ) { <nl> + auto spec = fromjson ( " { $ bucket : 1 } " ) ; <nl> + ASSERT_THROWS_CODE ( createBucket ( spec ) , UserException , 40201 ) ; <nl> + <nl> + spec = fromjson ( " { $ bucket : ' test ' } " ) ; <nl> + ASSERT_THROWS_CODE ( createBucket ( spec ) , UserException , 40201 ) ; <nl> + } <nl> + <nl> + TEST_F ( InvalidBucketSpec , BucketFailsWithUnknownField ) { <nl> + const auto spec = <nl> + fromjson ( " { $ bucket : { groupBy : ' $ x ' , boundaries : [ 0 , 1 , 2 ] , unknown : ' field ' } } " ) ; <nl> + ASSERT_THROWS_CODE ( createBucket ( spec ) , UserException , 40197 ) ; <nl> + } <nl> + <nl> + TEST_F ( InvalidBucketSpec , BucketFailsWithNoGroupBy ) { <nl> + const auto spec = fromjson ( " { $ bucket : { boundaries : [ 0 , 1 , 2 ] } } " ) ; <nl> + ASSERT_THROWS_CODE ( createBucket ( spec ) , UserException , 40198 ) ; <nl> + } <nl> + <nl> + TEST_F ( InvalidBucketSpec , BucketFailsWithNoBoundaries ) { <nl> + const auto spec = fromjson ( " { $ bucket : { groupBy : ' $ x ' } } " ) ; <nl> + ASSERT_THROWS_CODE ( createBucket ( spec ) , UserException , 40198 ) ; <nl> + } <nl> + <nl> + TEST_F ( InvalidBucketSpec , BucketFailsWithNonExpressionGroupBy ) { <nl> + auto spec = fromjson ( " { $ bucket : { groupBy : { test : ' obj ' } , boundaries : [ 0 , 1 , 2 ] } } " ) ; <nl> + ASSERT_THROWS_CODE ( createBucket ( spec ) , UserException , 40202 ) ; <nl> + <nl> + spec = fromjson ( " { $ bucket : { groupBy : ' test ' , boundaries : [ 0 , 1 , 2 ] } } " ) ; <nl> + ASSERT_THROWS_CODE ( createBucket ( spec ) , UserException , 40202 ) ; <nl> + <nl> + spec = fromjson ( " { $ bucket : { groupBy : 1 , boundaries : [ 0 , 1 , 2 ] } } " ) ; <nl> + ASSERT_THROWS_CODE ( createBucket ( spec ) , UserException , 40202 ) ; <nl> + } <nl> + <nl> + TEST_F ( InvalidBucketSpec , BucketFailsWithNonArrayBoundaries ) { <nl> + auto spec = fromjson ( " { $ bucket : { groupBy : ' $ x ' , boundaries : ' test ' } } " ) ; <nl> + ASSERT_THROWS_CODE ( createBucket ( spec ) , UserException , 40200 ) ; <nl> + <nl> + spec = fromjson ( " { $ bucket : { groupBy : ' $ x ' , boundaries : 1 } } " ) ; <nl> + ASSERT_THROWS_CODE ( createBucket ( spec ) , UserException , 40200 ) ; <nl> + <nl> + spec = fromjson ( " { $ bucket : { groupBy : ' $ x ' , boundaries : { test : ' obj ' } } } " ) ; <nl> + ASSERT_THROWS_CODE ( createBucket ( spec ) , UserException , 40200 ) ; <nl> + } <nl> + <nl> + TEST_F ( InvalidBucketSpec , BucketFailsWithNotEnoughBoundaries ) { <nl> + auto spec = fromjson ( " { $ bucket : { groupBy : ' $ x ' , boundaries : [ 0 ] } } " ) ; <nl> + ASSERT_THROWS_CODE ( createBucket ( spec ) , UserException , 40192 ) ; <nl> + <nl> + spec = fromjson ( " { $ bucket : { groupBy : ' $ x ' , boundaries : [ ] } } " ) ; <nl> + ASSERT_THROWS_CODE ( createBucket ( spec ) , UserException , 40192 ) ; <nl> + } <nl> + <nl> + TEST_F ( InvalidBucketSpec , BucketFailsWithNonConstantValueBoundaries ) { <nl> + const auto spec = fromjson ( " { $ bucket : { groupBy : ' $ x ' , boundaries : [ ' $ x ' , ' $ y ' , ' $ z ' ] } } " ) ; <nl> + ASSERT_THROWS_CODE ( createBucket ( spec ) , UserException , 40191 ) ; <nl> + } <nl> + <nl> + TEST_F ( InvalidBucketSpec , BucketFailsWithMixedTypesBoundaries ) { <nl> + const auto spec = fromjson ( " { $ bucket : { groupBy : ' $ x ' , boundaries : [ 0 , ' test ' ] } } " ) ; <nl> + ASSERT_THROWS_CODE ( createBucket ( spec ) , UserException , 40193 ) ; <nl> + } <nl> + <nl> + TEST_F ( InvalidBucketSpec , BucketFailsWithNonUniqueBoundaries ) { <nl> + auto spec = fromjson ( " { $ bucket : { groupBy : ' $ x ' , boundaries : [ 1 , 1 , 2 , 3 ] } } " ) ; <nl> + ASSERT_THROWS_CODE ( createBucket ( spec ) , UserException , 40194 ) ; <nl> + <nl> + spec = fromjson ( " { $ bucket : { groupBy : ' $ x ' , boundaries : [ ' a ' , ' b ' , ' b ' , ' c ' ] } } " ) ; <nl> + ASSERT_THROWS_CODE ( createBucket ( spec ) , UserException , 40194 ) ; <nl> + } <nl> + <nl> + TEST_F ( InvalidBucketSpec , BucketFailsWithNonSortedBoundaries ) { <nl> + const auto spec = fromjson ( " { $ bucket : { groupBy : ' $ x ' , boundaries : [ 4 , 5 , 3 , 6 ] } } " ) ; <nl> + ASSERT_THROWS_CODE ( createBucket ( spec ) , UserException , 40194 ) ; <nl> + } <nl> + <nl> + TEST_F ( InvalidBucketSpec , BucketFailsWithNonConstantExpressionDefault ) { <nl> + const auto spec = <nl> + fromjson ( " { $ bucket : { groupBy : ' $ x ' , boundaries : [ 0 , 1 , 2 ] , default : ' $ x ' } } " ) ; <nl> + ASSERT_THROWS_CODE ( createBucket ( spec ) , UserException , 40195 ) ; <nl> + } <nl> + <nl> + TEST_F ( InvalidBucketSpec , BucketFailsWhenDefaultIsInBoundariesRange ) { <nl> + auto spec = fromjson ( " { $ bucket : { groupBy : ' $ x ' , boundaries : [ 1 , 2 , 4 ] , default : 3 } } " ) ; <nl> + ASSERT_THROWS_CODE ( createBucket ( spec ) , UserException , 40199 ) ; <nl> + <nl> + spec = fromjson ( " { $ bucket : { groupBy : ' $ x ' , boundaries : [ 1 , 2 , 4 ] , default : 1 } } " ) ; <nl> + ASSERT_THROWS_CODE ( createBucket ( spec ) , UserException , 40199 ) ; <nl> + } <nl> + <nl> + TEST_F ( InvalidBucketSpec , GroupFailsForBucketWithInvalidOutputField ) { <nl> + auto spec = fromjson ( " { $ bucket : { groupBy : ' $ x ' , boundaries : [ 1 , 2 , 3 ] , output : ' test ' } } " ) ; <nl> + ASSERT_THROWS_CODE ( createBucket ( spec ) , UserException , 40196 ) ; <nl> + <nl> + spec = fromjson ( <nl> + " { $ bucket : { groupBy : ' $ x ' , boundaries : [ 1 , 2 , 3 ] , output : { number : ' test ' } } } " ) ; <nl> + ASSERT_THROWS_CODE ( createBucket ( spec ) , UserException , 15951 ) ; <nl> + <nl> + spec = fromjson ( <nl> + " { $ bucket : { groupBy : ' $ x ' , boundaries : [ 1 , 2 , 3 ] , output : { ' test . test ' : { $ sum : " <nl> + " 1 } } } } " ) ; <nl> + ASSERT_THROWS_CODE ( createBucket ( spec ) , UserException , 16414 ) ; <nl> + } <nl> + <nl> + TEST_F ( InvalidBucketSpec , SwitchFailsForBucketWhenNoDefaultSpecified ) { <nl> + const auto spec = fromjson ( " { $ bucket : { groupBy : ' $ x ' , boundaries : [ 1 , 2 , 3 ] } } " ) ; <nl> + vector < intrusive_ptr < DocumentSource > > bucketStages = createBucket ( spec ) ; <nl> + <nl> + ASSERT_EQUALS ( bucketStages . size ( ) , 2UL ) ; <nl> + <nl> + auto * groupStage = dynamic_cast < DocumentSourceGroup * > ( bucketStages [ 0 ] . get ( ) ) ; <nl> + ASSERT ( groupStage ) ; <nl> + <nl> + const auto * sortStage = dynamic_cast < DocumentSourceSort * > ( bucketStages [ 1 ] . get ( ) ) ; <nl> + ASSERT ( sortStage ) ; <nl> + <nl> + auto doc = DOC ( " x " < < 4 ) ; <nl> + auto source = DocumentSourceMock : : create ( doc ) ; <nl> + groupStage - > setSource ( source . get ( ) ) ; <nl> + ASSERT_THROWS_CODE ( groupStage - > getNext ( ) , UserException , 40066 ) ; <nl> + } <nl> + } / / namespace DocumentSourceBucket <nl> + <nl> class All : public Suite { <nl> public : <nl> All ( ) : Suite ( " documentsource " ) { } <nl>
SERVER - 23815 add $ bucket aggregation stage
mongodb/mongo
d7bae36fa7ceabda22946903a6dee2b895d24559
2016-07-07T17:38:24Z
mmm a / fdbserver / MasterProxyServer . actor . cpp <nl> ppp b / fdbserver / MasterProxyServer . actor . cpp <nl> struct TransactionRateInfo { <nl> <nl> void reset ( double elapsed ) { <nl> limit = std : : min ( 0 . 0 , limit ) + rate * elapsed ; / / Adjust the limit based on the full elapsed interval in order to properly erase a deficit <nl> - limit = std : : min ( limit , rate * std : : min ( elapsed , SERVER_KNOBS - > START_TRANSACTION_BATCH_INTERVAL_MAX ) ) ; / / Don ' t allow the rate to exceed what would be allowed in the maximum batch interval <nl> + limit = std : : min ( limit , rate * SERVER_KNOBS - > START_TRANSACTION_BATCH_INTERVAL_MAX ) ; / / Don ' t allow the rate to exceed what would be allowed in the maximum batch interval <nl> limit = std : : min ( limit , SERVER_KNOBS - > START_TRANSACTION_MAX_TRANSACTIONS_TO_START ) ; <nl> } <nl> <nl>
Simplify logic by removing an unneeded condition .
apple/foundationdb
b2af17fb0843c253e002ea7eaaaf5133a907dc0b
2019-08-15T15:23:13Z
mmm a / lib / browser / desktop - capturer . js <nl> ppp b / lib / browser / desktop - capturer . js <nl> ipcMain . on ( electronSources , ( event , captureWindow , captureScreen , thumbnailSize , <nl> / / reference from requestsQueue to make the module not send the result to it . <nl> event . sender . once ( ' destroyed ' , ( ) = > { <nl> request . webContents = null <nl> - return <nl> } ) <nl> } ) <nl> <nl> desktopCapturer . emit = ( event , name , sources ) = > { <nl> } <nl> } ) <nl> <nl> - if ( handledWebContents ! = null ) { <nl> + if ( handledWebContents ) { <nl> handledWebContents . send ( capturerResult ( handledRequest . id ) , result ) <nl> } <nl> <nl> - / / Check the queue to see whether there is other same request . If has , handle <nl> - / / it for reducing redunplicated ` desktopCaptuer . startHandling ` calls . <nl> - <nl> + / / Check the queue to see whether there is another identical request & handle <nl> requestsQueue . forEach ( request = > { <nl> const webContents = request . webContents <nl> if ( deepEqual ( handledRequest . options , request . options ) ) { <nl> - if ( webContents ! = null ) { <nl> - webContents . send ( capturerResult ( request . id ) , result ) <nl> - } <nl> + if ( webContents ) webContents . send ( capturerResult ( request . id ) , result ) <nl> } else { <nl> unhandledRequestsQueue . push ( request ) <nl> } <nl> mmm a / lib / renderer / api / desktop - capturer . js <nl> ppp b / lib / renderer / api / desktop - capturer . js <nl> const incrementId = ( ) = > { <nl> return currentId <nl> } <nl> <nl> - / / | options . type | can not be empty and has to include ' window ' or ' screen ' . <nl> + / / | options . types | can ' t be empty and must be an array <nl> function isValid ( options ) { <nl> - const types = ( options ! = null ) ? options . types : undefined <nl> - return ( types ! = null ) & & Array . isArray ( options . types ) <nl> + const types = options ? options . types : undefined <nl> + return Array . isArray ( types ) <nl> } <nl> <nl> exports . getSources = function ( options , callback ) { <nl>
update reviewed items
electron/electron
7593bec6876cb3427d0e669f4198ce5f850b554a
2017-10-24T23:36:06Z
mmm a / fdbserver / RestoreMaster . actor . cpp <nl> ppp b / fdbserver / RestoreMaster . actor . cpp <nl> ACTOR static Future < Version > processRestoreRequest ( Reference < RestoreMasterData > <nl> state KeyRangeMap < Version > rangeVersions ( minRangeVersion , allKeys . end ) ; <nl> if ( SERVER_KNOBS - > FASTRESTORE_GET_RANGE_VERSIONS_EXPENSIVE ) { <nl> wait ( buildRangeVersions ( & rangeVersions , & rangeFiles , request . url ) ) ; <nl> + } else { <nl> + / / Debug purpose , dump range versions <nl> + auto ranges = rangeVersions . ranges ( ) ; <nl> + int i = 0 ; <nl> + for ( auto r = ranges . begin ( ) ; r ! = ranges . end ( ) ; + + r ) { <nl> + TraceEvent ( SevDebug , " SingleRangeVersion " ) <nl> + . detail ( " RangeIndex " , i + + ) <nl> + . detail ( " RangeBegin " , r - > begin ( ) ) <nl> + . detail ( " RangeEnd " , r - > end ( ) ) <nl> + . detail ( " RangeVersion " , r - > value ( ) ) ; <nl> + } <nl> } <nl> <nl> wait ( distributeRestoreSysInfo ( self , & rangeVersions ) ) ; <nl> mmm a / fdbserver / workloads / BackupAndParallelRestoreCorrectness . actor . cpp <nl> ppp b / fdbserver / workloads / BackupAndParallelRestoreCorrectness . actor . cpp <nl> struct BackupAndParallelRestoreCorrectnessWorkload : TestWorkload { <nl> <nl> TraceEvent ( " BAFRW_Restore " , randomID ) <nl> . detail ( " LastBackupContainer " , lastBackupContainer - > getURL ( ) ) <nl> - . detail ( " MinRestorableVersion " , desc . minRestorableVersion . get ( ) ) <nl> - . detail ( " MaxRestorableVersion " , desc . maxRestorableVersion . get ( ) ) <nl> - . detail ( " ContiguousLogEnd " , desc . contiguousLogEnd . get ( ) ) <nl> + . detail ( " MinRestorableVersion " , <nl> + desc . minRestorableVersion . present ( ) ? desc . minRestorableVersion . get ( ) : - 1 ) <nl> + . detail ( " MaxRestorableVersion " , <nl> + desc . maxRestorableVersion . present ( ) ? desc . maxRestorableVersion . get ( ) : - 1 ) <nl> + . detail ( " ContiguousLogEnd " , desc . contiguousLogEnd . present ( ) ? desc . contiguousLogEnd . get ( ) : - 1 ) <nl> . detail ( " TargetVersion " , targetVersion ) ; <nl> <nl> state std : : vector < Future < Version > > restores ; <nl>
Fix : Segmentation fault when get status in BackupAndParallelRestore workload
apple/foundationdb
52dba96f070513c72bd2abf2601dbf05ca75902a
2020-04-17T20:40:32Z
mmm a / src / btree / operations . cc <nl> ppp b / src / btree / operations . cc <nl> void find_keyvalue_location_for_read ( <nl> void apply_keyvalue_change ( <nl> value_sizer_t * sizer , <nl> keyvalue_location_t * kv_loc , <nl> - const btree_key_t * key , repli_timestamp_t tstamp , expired_t expired , <nl> + const btree_key_t * key , repli_timestamp_t tstamp , <nl> const value_deleter_t * detacher , <nl> key_modification_callback_t * km_callback ) { <nl> key_modification_proof_t km_proof <nl> void apply_keyvalue_change ( <nl> } else { <nl> / / Delete the value if it ' s there . <nl> if ( kv_loc - > there_originally_was_value ) { <nl> - guarantee ( expired = = expired_t : : NO ) ; <nl> - <nl> rassert ( tstamp ! = repli_timestamp_t : : invalid , " Deletes need a valid timestamp now . " ) ; <nl> { <nl> buf_write_t write ( & kv_loc - > buf ) ; <nl> void apply_keyvalue_change ( <nl> } <nl> population_change = - 1 ; <nl> kv_loc - > stats - > pm_keys_set . record ( ) ; <nl> - / / RSI : Remove pm_keys_expired . <nl> } else { <nl> population_change = 0 ; <nl> } <nl> mmm a / src / btree / operations . hpp <nl> ppp b / src / btree / operations . hpp <nl> void find_keyvalue_location_for_read ( <nl> keyvalue_location_t * keyvalue_location_out , <nl> btree_stats_t * stats , profile : : trace_t * trace ) ; <nl> <nl> - enum class expired_t { NO } ; <nl> - <nl> void apply_keyvalue_change ( <nl> value_sizer_t * sizer , <nl> keyvalue_location_t * kv_loc , <nl> - const btree_key_t * key , repli_timestamp_t tstamp , expired_t expired , <nl> + const btree_key_t * key , repli_timestamp_t tstamp , <nl> const value_deleter_t * detacher , <nl> key_modification_callback_t * km_callback ) ; <nl> <nl> mmm a / src / btree / slice . hpp <nl> ppp b / src / btree / slice . hpp <nl> class btree_stats_t { <nl> btree_collection_membership ( parent , & btree_collection , " btree - " + identifier ) , <nl> pm_keys_read ( secs_to_ticks ( 1 ) ) , <nl> pm_keys_set ( secs_to_ticks ( 1 ) ) , <nl> - pm_keys_expired ( secs_to_ticks ( 1 ) ) , <nl> pm_keys_membership ( & btree_collection , <nl> & pm_keys_read , " keys_read " , <nl> - & pm_keys_set , " keys_set " , <nl> - & pm_keys_expired , " keys_expired " ) <nl> + & pm_keys_set , " keys_set " ) <nl> { } <nl> <nl> perfmon_collection_t btree_collection ; <nl> perfmon_membership_t btree_collection_membership ; <nl> perfmon_rate_monitor_t <nl> pm_keys_read , <nl> - pm_keys_set , <nl> - pm_keys_expired ; <nl> + pm_keys_set ; <nl> perfmon_multi_membership_t pm_keys_membership ; <nl> } ; <nl> <nl> mmm a / src / rdb_protocol / btree . cc <nl> ppp b / src / rdb_protocol / btree . cc <nl> void kv_location_delete ( keyvalue_location_t * kv_location , <nl> rdb_value_sizer_t sizer ( block_size ) ; <nl> null_key_modification_callback_t null_cb ; <nl> apply_keyvalue_change ( & sizer , kv_location , key . btree_key ( ) , timestamp , <nl> - expired_t : : NO , deletion_context - > balancing_detacher ( ) , & null_cb ) ; <nl> + deletion_context - > balancing_detacher ( ) , & null_cb ) ; <nl> } <nl> <nl> void kv_location_set ( keyvalue_location_t * kv_location , <nl> void kv_location_set ( keyvalue_location_t * kv_location , <nl> null_key_modification_callback_t null_cb ; <nl> rdb_value_sizer_t sizer ( block_size ) ; <nl> apply_keyvalue_change ( & sizer , kv_location , key . btree_key ( ) , <nl> - timestamp , expired_t : : NO , <nl> + timestamp , <nl> deletion_context - > balancing_detacher ( ) , & null_cb ) ; <nl> } <nl> <nl> void kv_location_set ( keyvalue_location_t * kv_location , <nl> null_key_modification_callback_t null_cb ; <nl> rdb_value_sizer_t sizer ( kv_location - > buf . cache ( ) - > max_block_size ( ) ) ; <nl> apply_keyvalue_change ( & sizer , kv_location , key . btree_key ( ) , timestamp , <nl> - expired_t : : NO , <nl> deletion_context - > balancing_detacher ( ) , & null_cb ) ; <nl> } <nl> <nl>
Removed expiration from the btree code .
rethinkdb/rethinkdb
2bd27f31399614dc2717e4adb67b43184891a0e4
2014-04-22T01:08:36Z
mmm a / editor / project_manager . cpp <nl> ppp b / editor / project_manager . cpp <nl> struct ProjectItem { <nl> String conf ; <nl> uint64_t last_modified ; <nl> bool favorite ; <nl> + bool grayed ; <nl> ProjectItem ( ) { } <nl> - ProjectItem ( const String & p_project , const String & p_path , const String & p_conf , uint64_t p_last_modified , bool p_favorite = false ) { <nl> + ProjectItem ( const String & p_project , const String & p_path , const String & p_conf , uint64_t p_last_modified , bool p_favorite = false , bool p_grayed = false ) { <nl> project = p_project ; <nl> path = p_path ; <nl> conf = p_conf ; <nl> last_modified = p_last_modified ; <nl> favorite = p_favorite ; <nl> + grayed = p_grayed ; <nl> } <nl> _FORCE_INLINE_ bool operator < ( const ProjectItem & l ) const { return last_modified > l . last_modified ; } <nl> _FORCE_INLINE_ bool operator = = ( const ProjectItem & l ) const { return project = = l . project ; } <nl> void ProjectManager : : _load_recent_projects ( ) { <nl> String project = _name . get_slice ( " / " , 1 ) ; <nl> String conf = path . plus_file ( " project . godot " ) ; <nl> bool favorite = ( _name . begins_with ( " favorite_projects / " ) ) ? true : false ; <nl> + bool grayed = false ; <nl> <nl> uint64_t last_modified = 0 ; <nl> if ( FileAccess : : exists ( conf ) ) { <nl> void ProjectManager : : _load_recent_projects ( ) { <nl> if ( cache_modified > last_modified ) <nl> last_modified = cache_modified ; <nl> } <nl> - <nl> - ProjectItem item ( project , path , conf , last_modified , favorite ) ; <nl> - if ( favorite ) <nl> - favorite_projects . push_back ( item ) ; <nl> - else <nl> - projects . push_back ( item ) ; <nl> } else { <nl> - / / project doesn ' t exist on disk but it ' s in the XML settings file <nl> - EditorSettings : : get_singleton ( ) - > erase ( _name ) ; / / remove it <nl> + grayed = true ; <nl> } <nl> + <nl> + ProjectItem item ( project , path , conf , last_modified , favorite , grayed ) ; <nl> + if ( favorite ) <nl> + favorite_projects . push_back ( item ) ; <nl> + else <nl> + projects . push_back ( item ) ; <nl> } <nl> <nl> projects . sort ( ) ; <nl> void ProjectManager : : _load_recent_projects ( ) { <nl> String path = item . path ; <nl> String conf = item . conf ; <nl> bool is_favorite = item . favorite ; <nl> + bool is_grayed = item . grayed ; <nl> <nl> Ref < ConfigFile > cf = memnew ( ConfigFile ) ; <nl> - Error err = cf - > load ( conf ) ; <nl> - ERR_CONTINUE ( err ! = OK ) ; <nl> + Error cf_err = cf - > load ( conf ) ; <nl> <nl> String project_name = TTR ( " Unnamed Project " ) ; <nl> <nl> - if ( cf - > has_section_key ( " application " , " config / name " ) ) { <nl> + if ( cf_err = = OK & & cf - > has_section_key ( " application " , " config / name " ) ) { <nl> project_name = static_cast < String > ( cf - > get_value ( " application " , " config / name " ) ) . xml_unescape ( ) ; <nl> } <nl> <nl> void ProjectManager : : _load_recent_projects ( ) { <nl> continue ; <nl> <nl> Ref < Texture > icon ; <nl> - if ( cf - > has_section_key ( " application " , " config / icon " ) ) { <nl> + if ( cf_err = = OK & & cf - > has_section_key ( " application " , " config / icon " ) ) { <nl> String appicon = cf - > get_value ( " application " , " config / icon " ) ; <nl> if ( appicon ! = " " ) { <nl> Ref < Image > img ; <nl> void ProjectManager : : _load_recent_projects ( ) { <nl> } <nl> <nl> String main_scene ; <nl> - if ( cf - > has_section_key ( " application " , " run / main_scene " ) ) { <nl> + if ( cf_err = = OK & & cf - > has_section_key ( " application " , " run / main_scene " ) ) { <nl> main_scene = cf - > get_value ( " application " , " run / main_scene " ) ; <nl> + } else { <nl> + main_scene = " " ; <nl> } <nl> <nl> selected_list_copy . erase ( project ) ; <nl> void ProjectManager : : _load_recent_projects ( ) { <nl> hb - > add_child ( tf ) ; <nl> <nl> VBoxContainer * vb = memnew ( VBoxContainer ) ; <nl> + if ( is_grayed ) <nl> + vb - > set_modulate ( Color ( 0 . 5 , 0 . 5 , 0 . 5 ) ) ; <nl> vb - > set_name ( " project " ) ; <nl> vb - > set_h_size_flags ( SIZE_EXPAND_FILL ) ; <nl> hb - > add_child ( vb ) ; <nl> void ProjectManager : : _open_project_confirm ( ) { <nl> for ( Map < String , String > : : Element * E = selected_list . front ( ) ; E ; E = E - > next ( ) ) { <nl> const String & selected = E - > key ( ) ; <nl> String path = EditorSettings : : get_singleton ( ) - > get ( " projects / " + selected ) ; <nl> + String conf = path + " / project . godot " ; <nl> + if ( ! FileAccess : : exists ( conf ) ) { <nl> + dialog_error - > set_text ( TTR ( " Can ' t open project " ) ) ; <nl> + dialog_error - > popup_centered_minsize ( ) ; <nl> + return ; <nl> + } <nl> + <nl> print_line ( " OPENING : " + path + " ( " + selected + " ) " ) ; <nl> <nl> List < String > args ; <nl> ProjectManager : : ProjectManager ( ) { <nl> run_error_diag = memnew ( AcceptDialog ) ; <nl> gui_base - > add_child ( run_error_diag ) ; <nl> run_error_diag - > set_title ( TTR ( " Can ' t run project " ) ) ; <nl> + <nl> + dialog_error = memnew ( AcceptDialog ) ; <nl> + gui_base - > add_child ( dialog_error ) ; <nl> } <nl> <nl> ProjectManager : : ~ ProjectManager ( ) { <nl> mmm a / editor / project_manager . h <nl> ppp b / editor / project_manager . h <nl> class ProjectManager : public Control { <nl> ConfirmationDialog * multi_run_ask ; <nl> ConfirmationDialog * multi_scan_ask ; <nl> AcceptDialog * run_error_diag ; <nl> + AcceptDialog * dialog_error ; <nl> NewProjectDialog * npdialog ; <nl> ScrollContainer * scroll ; <nl> VBoxContainer * scroll_childs ; <nl>
Merge pull request from marcelofg55 / project_grayed
godotengine/godot
8e82bf42a870bc0ef8d41203f42a8d7217adf695
2017-09-11T21:23:33Z
mmm a / filament / include / filament / Scene . h <nl> ppp b / filament / include / filament / Scene . h <nl> class UTILS_PUBLIC Scene : public FilamentAPI { <nl> public : <nl> <nl> / * * <nl> - * Set the SkyBox , <nl> + * Sets the SkyBox . <nl> * <nl> * The Skybox is drawn last and covers all pixels not touched by geometry . <nl> * <nl> class UTILS_PUBLIC Scene : public FilamentAPI { <nl> * @ return The total number of Light objects in the Scene . <nl> * / <nl> size_t getLightCount ( ) const noexcept ; <nl> + <nl> + / * * <nl> + * Returns true if the given entity is in the Scene . <nl> + * <nl> + * @ return Whether the given entity is in the Scene . <nl> + * / <nl> + bool hasEntity ( utils : : Entity entity ) const noexcept ; <nl> } ; <nl> <nl> } / / namespace filament <nl> mmm a / filament / include / filament / TransformManager . h <nl> ppp b / filament / include / filament / TransformManager . h <nl> class UTILS_PUBLIC TransformManager : public FilamentAPI { <nl> void destroy ( utils : : Entity e ) noexcept ; <nl> <nl> / * * <nl> - * Re - parent an entity to a new one . <nl> + * Re - parents an entity to a new one . <nl> * @ param i The instance of the transform component to re - parent <nl> * @ param newParent The instance of the new parent transform <nl> * @ attention It is an error to re - parent an entity to a descendant and will cause undefined behaviour . <nl> class UTILS_PUBLIC TransformManager : public FilamentAPI { <nl> void setParent ( Instance i , Instance newParent ) noexcept ; <nl> <nl> / * * <nl> - * Set a local transform of a transform component . <nl> + * Returns the parent of a transform component , or the null entity if it is a root . <nl> + * @ param i The instance of the transform component to query . <nl> + * / <nl> + utils : : Entity getParent ( Instance i ) const noexcept ; <nl> + <nl> + / * * <nl> + * Returns the number of children of a transform component . <nl> + * @ param i The instance of the transform component to query . <nl> + * @ return The number of children of the queried component . <nl> + * / <nl> + size_t getChildCount ( Instance i ) const noexcept ; <nl> + <nl> + / * * <nl> + * Gets a list of children for a transform component . <nl> + * <nl> + * @ param i The instance of the transform component to query . <nl> + * @ param chidren Pointer to array - of - Entity . The array must have at least " count " elements . <nl> + * @ param count The maximum number of children to retrieve . <nl> + * @ return The number of children written to the pointer . <nl> + * / <nl> + size_t getChildren ( Instance i , utils : : Entity * children , size_t count ) const noexcept ; <nl> + <nl> + / * * <nl> + * Sets a local transform of a transform component . <nl> * @ param ci The instance of the transform component to set the local transform to . <nl> * @ param localTransform The local transform ( i . e . relative to the parent ) . <nl> * @ see getTransform ( ) <nl> mmm a / filament / src / Scene . cpp <nl> ppp b / filament / src / Scene . cpp <nl> size_t FScene : : getLightCount ( ) const noexcept { <nl> return count ; <nl> } <nl> <nl> + bool FScene : : hasEntity ( Entity entity ) const noexcept { <nl> + return mEntities . find ( entity ) ! = mEntities . end ( ) ; <nl> + } <nl> + <nl> void FScene : : setSkybox ( FSkybox const * skybox ) noexcept { <nl> std : : swap ( mSkybox , skybox ) ; <nl> if ( skybox ) { <nl> size_t Scene : : getLightCount ( ) const noexcept { <nl> return upcast ( this ) - > getLightCount ( ) ; <nl> } <nl> <nl> + bool Scene : : hasEntity ( Entity entity ) const noexcept { <nl> + return upcast ( this ) - > hasEntity ( entity ) ; <nl> + } <nl> + <nl> } / / namespace filament <nl> mmm a / filament / src / components / TransformManager . cpp <nl> ppp b / filament / src / components / TransformManager . cpp <nl> void FTransformManager : : setParent ( Instance i , Instance parent ) noexcept { <nl> } <nl> } <nl> <nl> + Entity FTransformManager : : getParent ( Instance i ) const noexcept { <nl> + i = mManager [ i ] . parent ; <nl> + return i ? mManager . getEntity ( i ) : Entity ( ) ; <nl> + } <nl> + <nl> + size_t FTransformManager : : getChildCount ( Instance i ) const noexcept { <nl> + size_t count = 0 ; <nl> + for ( Instance ci = mManager [ i ] . firstChild ; ci ; ci = mManager [ ci ] . next , + + count ) ; <nl> + return count ; <nl> + } <nl> + <nl> + size_t FTransformManager : : getChildren ( Instance i , utils : : Entity * children , <nl> + size_t count ) const noexcept { <nl> + Instance ci = mManager [ i ] . firstChild ; <nl> + size_t numWritten = 0 ; <nl> + while ( ci & & numWritten < count ) { <nl> + children [ numWritten + + ] = mManager . getEntity ( ci ) ; <nl> + ci = mManager [ ci ] . next ; <nl> + } <nl> + return numWritten ; <nl> + } <nl> + <nl> void FTransformManager : : destroy ( Entity e ) noexcept { <nl> / / update the reference of the element we ' re removing <nl> auto & manager = mManager ; <nl> void TransformManager : : setParent ( Instance i , Instance newParent ) noexcept { <nl> upcast ( this ) - > setParent ( i , newParent ) ; <nl> } <nl> <nl> + utils : : Entity TransformManager : : getParent ( Instance i ) const noexcept { <nl> + return upcast ( this ) - > getParent ( i ) ; <nl> + } <nl> + <nl> + size_t TransformManager : : getChildCount ( Instance i ) const noexcept { <nl> + return upcast ( this ) - > getChildCount ( i ) ; <nl> + } <nl> + <nl> + size_t TransformManager : : getChildren ( Instance i , utils : : Entity * children , <nl> + size_t count ) const noexcept { <nl> + return upcast ( this ) - > getChildren ( i , children , count ) ; <nl> + } <nl> + <nl> void TransformManager : : openLocalTransformTransaction ( ) noexcept { <nl> upcast ( this ) - > openLocalTransformTransaction ( ) ; <nl> } <nl> mmm a / filament / src / components / TransformManager . h <nl> ppp b / filament / src / components / TransformManager . h <nl> class UTILS_PRIVATE FTransformManager : public TransformManager { <nl> <nl> void setParent ( Instance i , Instance newParent ) noexcept ; <nl> <nl> + utils : : Entity getParent ( Instance i ) const noexcept ; <nl> + <nl> + size_t getChildCount ( Instance i ) const noexcept ; <nl> + <nl> + size_t getChildren ( Instance i , utils : : Entity * children , size_t count ) const noexcept ; <nl> + <nl> void openLocalTransformTransaction ( ) noexcept ; <nl> <nl> void commitLocalTransformTransaction ( ) noexcept ; <nl> mmm a / filament / src / details / Scene . h <nl> ppp b / filament / src / details / Scene . h <nl> class FScene : public Scene { <nl> <nl> size_t getRenderableCount ( ) const noexcept ; <nl> size_t getLightCount ( ) const noexcept ; <nl> + bool hasEntity ( utils : : Entity entity ) const noexcept ; <nl> <nl> public : <nl> / * <nl>
Add new queries to TransformManager and Scene .
google/filament
08af0f06bc3b3c95cdb965e0ea49bb300b1bf2a7
2019-02-28T10:17:18Z
mmm a / lib / SILGen / RValue . cpp <nl> ppp b / lib / SILGen / RValue . cpp <nl> static void copyOrInitValuesInto ( Initialization * init , <nl> init - > finishInitialization ( gen ) ; <nl> } <nl> <nl> + static unsigned <nl> + expectedExplosionSize ( CanType type ) { <nl> + auto tuple = dyn_cast < TupleType > ( type ) ; <nl> + if ( ! tuple ) <nl> + return 1 ; <nl> + unsigned total = 0 ; <nl> + for ( unsigned i = 0 ; i < tuple - > getNumElements ( ) ; + + i ) { <nl> + total + = expectedExplosionSize ( tuple . getElementType ( i ) ) ; <nl> + } <nl> + return total ; <nl> + } <nl> <nl> RValue : : RValue ( ArrayRef < ManagedValue > values , CanType type ) <nl> : values ( values . begin ( ) , values . end ( ) ) , type ( type ) , elementsToBeAdded ( 0 ) { <nl> + <nl> + assert ( values . size ( ) = = expectedExplosionSize ( type ) <nl> + & & " creating rvalue with wrong number of pre - exploded elements " ) ; <nl> + <nl> if ( values . size ( ) = = 1 & & values [ 0 ] . isInContext ( ) ) { <nl> values = ArrayRef < ManagedValue > ( ) ; <nl> type = CanType ( ) ; <nl> RValue : : RValue ( ArrayRef < ManagedValue > values , CanType type ) <nl> <nl> } <nl> <nl> + RValue RValue : : withPreExplodedElements ( ArrayRef < ManagedValue > values , <nl> + CanType type ) { <nl> + return RValue ( values , type ) ; <nl> + } <nl> + <nl> RValue : : RValue ( SILGenFunction & gen , SILLocation l , CanType formalType , <nl> ManagedValue v ) <nl> : type ( formalType ) , elementsToBeAdded ( 0 ) <nl> mmm a / lib / SILGen / RValue . h <nl> ppp b / lib / SILGen / RValue . h <nl> class RValue { <nl> / / / Private constructor used by copy ( ) . <nl> RValue ( const RValue & copied , SILGenFunction & gen , SILLocation l ) ; <nl> <nl> + / / / Construct an RValue from a pre - exploded set of <nl> + / / / ManagedValues . Used to implement the extractElement * methods . <nl> + RValue ( ArrayRef < ManagedValue > values , CanType type ) ; <nl> + <nl> public : <nl> / / / Creates an invalid RValue object , in a " used " state . <nl> RValue ( ) : elementsToBeAdded ( Used ) { } <nl> class RValue { <nl> <nl> / / / Construct an RValue from a pre - exploded set of <nl> / / / ManagedValues . Used to implement the extractElement * methods . <nl> - RValue ( ArrayRef < ManagedValue > values , CanType type ) ; <nl> + static RValue withPreExplodedElements ( ArrayRef < ManagedValue > values , <nl> + CanType type ) ; <nl> <nl> / / / Create an RValue to which values will be subsequently added using <nl> / / / addElement ( ) , with the level of tuple expansion in the input specified <nl> mmm a / lib / SILGen / SILGenApply . cpp <nl> ppp b / lib / SILGen / SILGenApply . cpp <nl> static Callee prepareArchetypeCallee ( SILGenFunction & gen , SILLocation loc , <nl> LValue : : forAddress ( selfLV , AbstractionPattern ( formalTy ) , <nl> formalTy ) ) ; <nl> } else { <nl> - selfValue = ArgumentSource ( loc , RValue ( address , formalTy ) ) ; <nl> + selfValue = ArgumentSource ( loc , RValue ( gen , loc , formalTy , address ) ) ; <nl> } <nl> } ; <nl> <nl> class SILGenApply : public Lowering : : ExprVisitor < SILGenApply > { <nl> auto metatype = std : : move ( selfValue ) . getAsSingleValue ( SGF ) ; <nl> auto allocated = allocateObjCObject ( metatype , loc ) ; <nl> auto allocatedType = allocated . getType ( ) . getSwiftRValueType ( ) ; <nl> - selfValue = ArgumentSource ( loc , RValue ( allocated , allocatedType ) ) ; <nl> + selfValue = ArgumentSource ( loc , RValue ( SGF , loc , <nl> + allocatedType , allocated ) ) ; <nl> } else { <nl> / / For non - Objective - C initializers , we have an allocating <nl> / / initializer to call . <nl> static RValue emitStringLiteral ( SILGenFunction & SGF , Expr * E , StringRef Str , <nl> <nl> CanType ty = <nl> TupleType : : get ( TypeElts , SGF . getASTContext ( ) ) - > getCanonicalType ( ) ; <nl> - return RValue ( Elts , ty ) ; <nl> + return RValue : : withPreExplodedElements ( Elts , ty ) ; <nl> } <nl> <nl> / / / Emit a raw apply operation , performing no additional lowering of <nl> void SILGenFunction : : emitSetAccessor ( SILLocation loc , SILDeclRef set , <nl> SmallVector < ManagedValue , 4 > Elts ; <nl> std : : move ( setValue ) . getAll ( Elts ) ; <nl> std : : move ( subscripts ) . getAll ( Elts ) ; <nl> - setValue = RValue ( Elts , accessType . getInput ( ) ) ; <nl> + setValue = RValue : : withPreExplodedElements ( Elts , accessType . getInput ( ) ) ; <nl> } else { <nl> setValue . rewriteType ( accessType . getInput ( ) ) ; <nl> } <nl> emitMaterializeForSetAccessor ( SILLocation loc , SILDeclRef materializeForSet , <nl> if ( subscripts ) { <nl> std : : move ( subscripts ) . getAll ( elts ) ; <nl> } <nl> - return RValue ( elts , accessType . getInput ( ) ) ; <nl> + return RValue : : withPreExplodedElements ( elts , accessType . getInput ( ) ) ; <nl> } ( ) ; <nl> emission . addCallSite ( loc , ArgumentSource ( loc , std : : move ( args ) ) , accessType ) ; <nl> / / ( buffer , optionalCallback ) <nl> mmm a / lib / SILGen / SILGenBuiltin . cpp <nl> ppp b / lib / SILGen / SILGenBuiltin . cpp <nl> static ManagedValue emitBuiltinAssign ( SILGenFunction & gen , <nl> / * isStrict * / true ) ; <nl> <nl> / / Build the value to be assigned , reconstructing tuples if needed . <nl> - RValue src ( args . slice ( 0 , args . size ( ) - 1 ) , assignFormalType ) ; <nl> + auto src = RValue : : withPreExplodedElements ( args . slice ( 0 , args . size ( ) - 1 ) , <nl> + assignFormalType ) ; <nl> <nl> std : : move ( src ) . assignInto ( gen , loc , addr ) ; <nl> <nl> mmm a / lib / SILGen / SILGenConvert . cpp <nl> ppp b / lib / SILGen / SILGenConvert . cpp <nl> SILGenFunction : : emitOptionalToOptional ( SILLocation loc , <nl> <nl> / / Inject that into the result type if the result is address - only . <nl> if ( resultTL . isAddressOnly ( ) ) { <nl> - ArgumentSource resultValueRV ( loc , RValue ( resultValue , resultValueTy ) ) ; <nl> + ArgumentSource resultValueRV ( loc , RValue ( * this , loc , <nl> + resultValueTy , resultValue ) ) ; <nl> emitInjectOptionalValueInto ( loc , std : : move ( resultValueRV ) , <nl> result , resultTL ) ; <nl> } else { <nl> mmm a / lib / SILGen / SILGenExpr . cpp <nl> ppp b / lib / SILGen / SILGenExpr . cpp <nl> emitRValueForDecl ( SILLocation loc , ConcreteDeclRef declRef , Type ncRefType , <nl> Scalar = emitConversionToSemanticRValue ( loc , Scalar , <nl> getTypeLowering ( refType ) ) ; <nl> / / emitConversionToSemanticRValue always produces a + 1 strong result . <nl> - return RValue ( emitManagedRValueWithCleanup ( Scalar ) , refType ) ; <nl> + return RValue ( * this , loc , <nl> + refType , emitManagedRValueWithCleanup ( Scalar ) ) ; <nl> } <nl> <nl> auto Result = ManagedValue : : forUnmanaged ( Scalar ) ; <nl> class AutoreleasingWritebackComponent : public LogicalPathComponent { <nl> CanUnmanagedStorageType : : get ( refType ) ) ; <nl> SILValue unowned = gen . B . createRefToUnmanaged ( loc , owned , unownedType ) ; <nl> <nl> - return RValue ( ManagedValue : : forUnmanaged ( unowned ) , refType ) ; <nl> + / / A reference type should never be exploded . <nl> + return RValue : : withPreExplodedElements ( ManagedValue : : forUnmanaged ( unowned ) , <nl> + refType ) ; <nl> } <nl> <nl> / / / Compare ' this ' lvalue and the ' rhs ' lvalue ( which is guaranteed to have <nl> mmm a / lib / SILGen / SILGenLValue . cpp <nl> ppp b / lib / SILGen / SILGenLValue . cpp <nl> namespace { <nl> CanType type = subscripts . getType ( ) ; <nl> SmallVector < ManagedValue , 4 > values ; <nl> std : : move ( subscripts ) . getAll ( values ) ; <nl> - subscripts = RValue ( values , type ) ; <nl> - borrowedSubscripts = RValue ( values , type ) ; <nl> + subscripts = RValue : : withPreExplodedElements ( values , type ) ; <nl> + borrowedSubscripts = RValue : : withPreExplodedElements ( values , type ) ; <nl> optSubscripts = & borrowedSubscripts ; <nl> } <nl> return new GetterSetterComponent ( decl , IsSuper , IsDirectAccessorUse , <nl> mmm a / lib / SILGen / SILGenPoly . cpp <nl> ppp b / lib / SILGen / SILGenPoly . cpp <nl> RValue Transform : : transform ( RValue & & input , <nl> auto result = transform ( std : : move ( input ) . getScalarValue ( ) , <nl> inputOrigType , inputSubstType , <nl> outputOrigType , outputSubstType , ctxt ) ; <nl> - return RValue ( result , outputSubstType ) ; <nl> + return RValue ( SGF , Loc , outputSubstType , result ) ; <nl> } <nl> <nl> / / Okay , we have a tuple . The output type will also be a tuple unless <nl> RValue Transform : : transform ( RValue & & input , <nl> return RValue ( ) ; <nl> } <nl> <nl> - return RValue ( outputExpansion , outputTupleType ) ; <nl> + return RValue : : withPreExplodedElements ( outputExpansion , outputTupleType ) ; <nl> } <nl> <nl> / / Single @ objc protocol value metatypes can be converted to the ObjC <nl> new file mode 100644 <nl> index 000000000000 . . 81382b498602 <nl> mmm / dev / null <nl> ppp b / test / SILGen / for_loop_tuple_destructure_reabstraction . swift <nl> <nl> + / / RUN : % target - swift - frontend - emit - silgen - verify % s <nl> + <nl> + protocol P { } <nl> + <nl> + func for_loop_tuple_destructure_reabstraction ( _ x : [ ( P , P . Protocol ) ] ) { <nl> + for ( a , b ) in x { _ = ( a , b ) } <nl> + } <nl> + <nl>
SILGen : Purge misuses of pre - exploded RValue constructor .
apple/swift
66a2b6a0e2199fc689aa7deeaf3daf360d47cb65
2016-12-05T22:55:59Z
mmm a / folly / futures / ThreadWheelTimekeeper . cpp <nl> ppp b / folly / futures / ThreadWheelTimekeeper . cpp <nl> struct WTCallback : public std : : enable_shared_from_this < WTCallback > , <nl> / / This is not racing with timeoutExpired anymore because this is called <nl> / / through Future , which means Core is still alive and keeping a ref count <nl> / / on us , so what timeouExpired is doing won ' t make the object go away <nl> - base_ - > runInEventBaseThread ( [ me = shared_from_this ( ) , ew = std : : move ( ew ) ] { <nl> - me - > cancelTimeout ( ) ; <nl> - / / Don ' t need Promise anymore , break the circular reference <nl> - auto promise = me - > stealPromise ( ) ; <nl> - if ( ! promise . isFulfilled ( ) ) { <nl> - promise . setException ( std : : move ( ew ) ) ; <nl> - } <nl> - } ) ; <nl> + base_ - > runInEventBaseThread ( <nl> + [ me = shared_from_this ( ) , ew = std : : move ( ew ) ] ( ) mutable { <nl> + me - > cancelTimeout ( ) ; <nl> + / / Don ' t need Promise anymore , break the circular reference <nl> + auto promise = me - > stealPromise ( ) ; <nl> + if ( ! promise . isFulfilled ( ) ) { <nl> + promise . setException ( std : : move ( ew ) ) ; <nl> + } <nl> + } ) ; <nl> } <nl> } ; <nl> <nl>
Fix move - of - const in ThreadWheelTimekeeper
facebook/folly
256126750aff8f05004e45bcc4aff6d4752ccf0a
2018-09-20T02:36:47Z
mmm a / modules / core / doc / basic_structures . rst <nl> ppp b / modules / core / doc / basic_structures . rst <nl> Various Mat constructors <nl> <nl> : param sizes : Array of integers specifying an n - dimensional array shape . <nl> <nl> - : param type : Array type . Use ` ` CV_8UC1 , . . . , CV_64FC4 ` ` to create 1 - 4 channel matrices , or ` ` CV_8UC ( n ) , . . . , CV_64FC ( n ) ` ` to create multi - channel ( up to ` ` CV_MAX_CN ` ` channels ) matrices . <nl> + : param type : Array type . Use ` ` CV_8UC1 , . . . , CV_64FC4 ` ` to create 1 - 4 channel matrices , or ` ` CV_8UC ( n ) , . . . , CV_64FC ( n ) ` ` to create multi - channel ( up to ` ` CV_CN_MAX ` ` channels ) matrices . <nl> <nl> : param s : An optional value to initialize each matrix element with . To set all the matrix elements to the particular value after the construction , use the assignment operator ` ` Mat : : operator = ( const Scalar & value ) ` ` . <nl> <nl>
Merge pull request from a0byte : 2 . 4
opencv/opencv
1eb322fa5dd7a52430c705ab261673ead43de6eb
2013-10-15T07:51:40Z
mmm a / tensorflow / compiler / xla / client / client_library . cc <nl> ppp b / tensorflow / compiler / xla / client / client_library . cc <nl> ClientLibrary : : GetOrCreateCompileOnlyClient ( <nl> return cl ; <nl> } <nl> <nl> + / * static * / void ClientLibrary : : DestroyLocalInstances ( ) { <nl> + ClientLibrary & client_library = Singleton ( ) ; <nl> + tensorflow : : mutex_lock lock ( client_library . service_mutex_ ) ; <nl> + <nl> + client_library . local_instances_ . clear ( ) ; <nl> + client_library . compile_only_instances_ . clear ( ) ; <nl> + } <nl> + <nl> } / / namespace xla <nl> mmm a / tensorflow / compiler / xla / client / client_library . h <nl> ppp b / tensorflow / compiler / xla / client / client_library . h <nl> class ClientLibrary { <nl> static StatusOr < CompileOnlyClient * > GetOrCreateCompileOnlyClient ( <nl> perftools : : gputools : : Platform * platform = nullptr ) ; <nl> <nl> + / / Clears the local instance and compile only instance caches . The client <nl> + / / pointers returned by the previous GetOrCreateLocalClient ( ) or <nl> + / / GetOrCreateCompileOnlyClient ( ) invocations are not valid anymore . <nl> + static void DestroyLocalInstances ( ) ; <nl> + <nl> private : <nl> / / Returns the singleton instance of ClientLibrary . <nl> static ClientLibrary & Singleton ( ) ; <nl>
Internal change .
tensorflow/tensorflow
19290f0567366bcdd3eb7adfe0f830a053cc1314
2017-07-26T03:31:16Z
mmm a / src / mongo / db / catalog / validate_adaptor . cpp <nl> ppp b / src / mongo / db / catalog / validate_adaptor . cpp <nl> Status ValidateAdaptor : : validateRecord ( OperationContext * opCtx , <nl> <nl> if ( ! descriptor - > isMultikey ( ) & & <nl> iam - > shouldMarkIndexAsMultikey ( <nl> - { documentKeySet . begin ( ) , documentKeySet . end ( ) } , <nl> + documentKeySet . size ( ) , <nl> { multikeyMetadataKeys . begin ( ) , multikeyMetadataKeys . end ( ) } , <nl> multikeyPaths ) ) { <nl> std : : string msg = str : : stream ( ) <nl> mmm a / src / mongo / db / index / index_access_method . cpp <nl> ppp b / src / mongo / db / index / index_access_method . cpp <nl> Status AbstractIndexAccessMethod : : insertKeys ( OperationContext * opCtx , <nl> result - > numInserted + = keys . size ( ) + multikeyMetadataKeys . size ( ) ; <nl> } <nl> <nl> - if ( shouldMarkIndexAsMultikey ( keys , multikeyMetadataKeys , multikeyPaths ) ) { <nl> + if ( shouldMarkIndexAsMultikey ( keys . size ( ) , multikeyMetadataKeys , multikeyPaths ) ) { <nl> _btreeState - > setMultikey ( opCtx , multikeyPaths ) ; <nl> } <nl> return Status : : OK ( ) ; <nl> Status AbstractIndexAccessMethod : : update ( OperationContext * opCtx , <nl> } <nl> <nl> if ( shouldMarkIndexAsMultikey ( <nl> - { ticket . newKeys . begin ( ) , ticket . newKeys . end ( ) } , <nl> + ticket . newKeys . size ( ) , <nl> { ticket . newMultikeyMetadataKeys . begin ( ) , ticket . newMultikeyMetadataKeys . end ( ) } , <nl> ticket . newMultikeyPaths ) ) { <nl> _btreeState - > setMultikey ( opCtx , ticket . newMultikeyPaths ) ; <nl> Status AbstractIndexAccessMethod : : BulkBuilderImpl : : insert ( OperationContext * opCt <nl> <nl> _isMultiKey = _isMultiKey | | <nl> _real - > shouldMarkIndexAsMultikey ( <nl> - { keys . begin ( ) , keys . end ( ) } , <nl> + keys . size ( ) , <nl> { _multikeyMetadataKeys . begin ( ) , _multikeyMetadataKeys . end ( ) } , <nl> multikeyPaths ) ; <nl> <nl> void AbstractIndexAccessMethod : : getKeys ( const BSONObj & obj , <nl> } <nl> <nl> bool AbstractIndexAccessMethod : : shouldMarkIndexAsMultikey ( <nl> - const vector < KeyString : : Value > & keys , <nl> + size_t numberOfKeys , <nl> const vector < KeyString : : Value > & multikeyMetadataKeys , <nl> const MultikeyPaths & multikeyPaths ) const { <nl> - return ( keys . size ( ) > 1 | | isMultikeyFromPaths ( multikeyPaths ) ) ; <nl> + return numberOfKeys > 1 | | isMultikeyFromPaths ( multikeyPaths ) ; <nl> } <nl> <nl> SortedDataInterface * AbstractIndexAccessMethod : : getSortedDataInterface ( ) const { <nl> mmm a / src / mongo / db / index / index_access_method . h <nl> ppp b / src / mongo / db / index / index_access_method . h <nl> class IndexAccessMethod { <nl> * document , return ' true ' if the index should be marked as multikey and ' false ' otherwise . <nl> * / <nl> virtual bool shouldMarkIndexAsMultikey ( <nl> - const std : : vector < KeyString : : Value > & keys , <nl> + size_t numberOfKeys , <nl> const std : : vector < KeyString : : Value > & multikeyMetadataKeys , <nl> const MultikeyPaths & multikeyPaths ) const = 0 ; <nl> <nl> class AbstractIndexAccessMethod : public IndexAccessMethod { <nl> MultikeyPaths * multikeyPaths , <nl> boost : : optional < RecordId > id = boost : : none ) const final ; <nl> <nl> - bool shouldMarkIndexAsMultikey ( const std : : vector < KeyString : : Value > & keys , <nl> + bool shouldMarkIndexAsMultikey ( size_t numberOfKeys , <nl> const std : : vector < KeyString : : Value > & multikeyMetadataKeys , <nl> const MultikeyPaths & multikeyPaths ) const override ; <nl> <nl> mmm a / src / mongo / db / index / wildcard_access_method . cpp <nl> ppp b / src / mongo / db / index / wildcard_access_method . cpp <nl> WildcardAccessMethod : : WildcardAccessMethod ( IndexCatalogEntry * wildcardState , <nl> getSortedDataInterface ( ) - > getOrdering ( ) ) { } <nl> <nl> bool WildcardAccessMethod : : shouldMarkIndexAsMultikey ( <nl> - const std : : vector < KeyString : : Value > & keys , <nl> + size_t numberOfKeys , <nl> const std : : vector < KeyString : : Value > & multikeyMetadataKeys , <nl> const MultikeyPaths & multikeyPaths ) const { <nl> return ! multikeyMetadataKeys . empty ( ) ; <nl> mmm a / src / mongo / db / index / wildcard_access_method . h <nl> ppp b / src / mongo / db / index / wildcard_access_method . h <nl> class WildcardAccessMethod final : public AbstractIndexAccessMethod { <nl> * more multikey metadata keys have been generated ; that is , if the ' multikeyMetadataKeys ' <nl> * vector is non - empty . <nl> * / <nl> - bool shouldMarkIndexAsMultikey ( const std : : vector < KeyString : : Value > & keys , <nl> + bool shouldMarkIndexAsMultikey ( size_t numberOfKeys , <nl> const std : : vector < KeyString : : Value > & multikeyMetadataKeys , <nl> const MultikeyPaths & multikeyPaths ) const final ; <nl> <nl>
SERVER - 44098 Pass only number of keys in shouldMarkIndexAsMultiKey
mongodb/mongo
48706d5d2779e16e4f4183bc0fd6343510cb17e0
2019-10-22T16:51:40Z
mmm a / src / python / grpcio / grpc / _cython / _cygrpc / completion_queue . pyx . pxi <nl> ppp b / src / python / grpcio / grpc / _cython / _cygrpc / completion_queue . pyx . pxi <nl> cdef class CompletionQueue : <nl> def __cinit__ ( self ) : <nl> grpc_init ( ) <nl> with nogil : <nl> - self . c_completion_queue = grpc_completion_queue_create ( NULL ) <nl> + self . c_completion_queue = grpc_completion_queue_create ( GRPC_CQ_NEXT , GRPC_CQ_DEFAULT_POLLING , NULL ) <nl> self . is_shutting_down = False <nl> self . is_shutdown = False <nl> <nl> mmm a / src / python / grpcio / grpc / _cython / _cygrpc / grpc . pxi <nl> ppp b / src / python / grpcio / grpc / _cython / _cygrpc / grpc . pxi <nl> cdef extern from " grpc / grpc . h " : <nl> void grpc_init ( ) nogil <nl> void grpc_shutdown ( ) nogil <nl> <nl> - grpc_completion_queue * grpc_completion_queue_create ( void * reserved ) nogil <nl> + ctypedef enum grpc_cq_completion_type : <nl> + GRPC_CQ_NEXT = 1 <nl> + GRPC_CQ_PLUCK = 2 <nl> + <nl> + ctypedef enum grpc_cq_polling_type : <nl> + GRPC_CQ_DEFAULT_POLLING <nl> + GRPC_CQ_NON_LISTENING <nl> + GRPC_CQ_NON_POLLING <nl> + <nl> + grpc_completion_queue * grpc_completion_queue_create ( <nl> + grpc_cq_completion_type completion_type , <nl> + grpc_cq_polling_type polling_type , <nl> + void * reserved ) nogil <nl> + <nl> grpc_event grpc_completion_queue_next ( grpc_completion_queue * cq , <nl> gpr_timespec deadline , <nl> void * reserved ) nogil <nl>
Python : Completion queue creation API changes
grpc/grpc
b4a6f908caf27996e0474c3f482e8929dfb3126c
2017-03-06T18:57:34Z
mmm a / tensorflow / python / eager / graph_callable . py <nl> ppp b / tensorflow / python / eager / graph_callable . py <nl> def _get_graph_callable_inputs ( shape_and_dtypes ) : <nl> ret . append ( _get_graph_callable_inputs ( x ) ) <nl> else : <nl> raise errors . InvalidArgumentError ( <nl> - None , None , " shape_and_dtypes not ShapeAndDtype , type : % s " % type ( x ) ) <nl> + None , None , " Expected the argument to @ graph_callable to be a " <nl> + " ( possibly nested ) list or tuple of ShapeAndDtype objects , " <nl> + " but got an object of type : % s " % type ( x ) ) <nl> <nl> return tuple ( ret ) if isinstance ( shape_and_dtypes , tuple ) else ret <nl> <nl> def _graph_callable_internal ( func , shape_and_dtypes ) : <nl> <nl> Args : <nl> func : The tfe Python function to compile . <nl> - shape_and_dtypes : A list of type ShapeAndDtype . <nl> + shape_and_dtypes : A possibly nested list or tuple of ShapeAndDtype objects . <nl> <nl> Raises : <nl> ValueError : If any one of func ' s outputs is not a Tensor . <nl> def foo ( x ) : <nl> ret = foo ( tfe . Tensor ( 2 . 0 ) ) # ` ret ` here now is a Tensor with value 9 . 0 . <nl> ` ` ` <nl> Args : <nl> - shape_and_dtypes : A list of type ShapeAndDtype that specifies shape and type <nl> - information for each of the callable ' s arguments . The length of this list <nl> - must be equal to the number of arguments accepted by the wrapped function . <nl> + shape_and_dtypes : A possibly nested list or tuple of ShapeAndDtype objects <nl> + that specifies shape and type information for each of the callable ' s <nl> + arguments . The length of this list must be equal to the number of <nl> + arguments accepted by the wrapped function . <nl> <nl> Returns : <nl> A callable graph object . <nl>
Improve error message for @ graph_callable argument check
tensorflow/tensorflow
d1dc152b5c97b5b58314a6959543311ced35deed
2017-11-09T01:09:39Z
mmm a / src / apps / Menu / Menu / MenuController . m <nl> ppp b / src / apps / Menu / Menu / MenuController . m <nl> @ interface MenuController ( ) <nl> @ implementation MenuController <nl> <nl> - ( void ) setup { <nl> - KarabinerKitCoreConfigurationModel * coreConfigurationModel = <nl> - [ KarabinerKitConfigurationManager sharedManager ] . coreConfigurationModel ; <nl> - if ( ! coreConfigurationModel . globalConfigurationShowInMenuBar & & <nl> - ! coreConfigurationModel . globalConfigurationShowProfileNameInMenuBar ) { <nl> - [ NSApp terminate : nil ] ; <nl> + { <nl> + KarabinerKitCoreConfigurationModel * coreConfigurationModel = [ KarabinerKitConfigurationManager sharedManager ] . coreConfigurationModel ; <nl> + if ( ! coreConfigurationModel . globalConfigurationShowInMenuBar & & <nl> + ! coreConfigurationModel . globalConfigurationShowProfileNameInMenuBar ) { <nl> + [ NSApp terminate : nil ] ; <nl> + } <nl> } <nl> <nl> self . menuIcon = [ NSImage imageNamed : @ " MenuIcon " ] ; <nl> - ( void ) setup { <nl> object : nil <nl> queue : [ NSOperationQueue mainQueue ] <nl> usingBlock : ^ ( NSNotification * note ) { <nl> - if ( ! coreConfigurationModel . globalConfigurationShowInMenuBar & & ! coreConfigurationModel . globalConfigurationShowProfileNameInMenuBar ) { <nl> + KarabinerKitCoreConfigurationModel * coreConfigurationModel = [ KarabinerKitConfigurationManager sharedManager ] . coreConfigurationModel ; <nl> + if ( ! coreConfigurationModel . globalConfigurationShowInMenuBar & & <nl> + ! coreConfigurationModel . globalConfigurationShowProfileNameInMenuBar ) { <nl> [ NSApp terminate : nil ] ; <nl> } <nl> [ self setStatusItemImage ] ; <nl> mmm a / src / core / console_user_server / include / configuration_manager . hpp <nl> ppp b / src / core / console_user_server / include / configuration_manager . hpp <nl> class configuration_manager final { <nl> <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> / / Launch menu <nl> - if ( core_configuration - > get_global_configuration ( ) . get_show_in_menu_bar ( ) ) { <nl> + if ( core_configuration - > get_global_configuration ( ) . get_show_in_menu_bar ( ) | | <nl> + core_configuration - > get_global_configuration ( ) . get_show_profile_name_in_menu_bar ( ) ) { <nl> application_launcher : : launch_menu ( ) ; <nl> } <nl> } <nl>
fix around menu
pqrs-org/Karabiner-Elements
7819ce4553b8863bcb01d28f4c334a8572c352da
2017-09-05T01:03:59Z
mmm a / xbmc / cores / dvdplayer / DVDCodecs / Video / VDPAU . cpp <nl> ppp b / xbmc / cores / dvdplayer / DVDCodecs / Video / VDPAU . cpp <nl> void CMixer : : ProcessPicture ( ) <nl> past_surfaces [ 1 ] = m_mixerInput [ 2 ] . videoSurface ; <nl> } <nl> past_surfaces [ 0 ] = m_mixerInput [ 1 ] . videoSurface ; <nl> - futu_surfaces [ 0 ] = m_mixerInput [ 1 ] . videoSurface ; <nl> - futu_surfaces [ 1 ] = m_mixerInput [ 1 ] . videoSurface ; <nl> + futu_surfaces [ 0 ] = m_mixerInput [ 0 ] . videoSurface ; <nl> + futu_surfaces [ 1 ] = m_mixerInput [ 0 ] . videoSurface ; <nl> <nl> if ( m_mixerInput [ 0 ] . DVDPic . pts ! = DVD_NOPTS_VALUE & & <nl> m_mixerInput [ 1 ] . DVDPic . pts ! = DVD_NOPTS_VALUE ) <nl>
vdpau : correct field order for deinterlacing , credits to zgreg
xbmc/xbmc
1791755182ccb5dd70e7284cb1007c9b208157e9
2013-11-05T07:15:22Z
mmm a / cocos / ui / UIText . cpp <nl> ppp b / cocos / ui / UIText . cpp <nl> bool Text : : init ( ) <nl> Text * Text : : create ( const std : : string & textContent , const std : : string & fontName , int fontSize ) <nl> { <nl> Text * text = new ( std : : nothrow ) Text ; <nl> - if ( text & & text - > init ( textContent , fontName , fontSize ) ) { <nl> + if ( text & & text - > init ( textContent , fontName , fontSize ) ) <nl> + { <nl> text - > autorelease ( ) ; <nl> return text ; <nl> } <nl> Text * Text : : create ( const std : : string & textContent , const std : : string & fontName , <nl> bool Text : : init ( const std : : string & textContent , const std : : string & fontName , int fontSize ) <nl> { <nl> bool ret = true ; <nl> - do { <nl> - if ( ! Widget : : init ( ) ) { <nl> + do <nl> + { <nl> + if ( ! Widget : : init ( ) ) <nl> + { <nl> ret = false ; <nl> break ; <nl> } <nl> ssize_t Text : : getStringLength ( ) const <nl> <nl> void Text : : setFontSize ( int size ) <nl> { <nl> - if ( _type = = Type : : SYSTEM ) { <nl> + if ( _type = = Type : : SYSTEM ) <nl> + { <nl> _labelRenderer - > setSystemFontSize ( size ) ; <nl> } <nl> - else { <nl> + else <nl> + { <nl> TTFConfig config = _labelRenderer - > getTTFConfig ( ) ; <nl> config . fontSize = size ; <nl> _labelRenderer - > setTTFConfig ( config ) ; <nl> void Text : : setFontName ( const std : : string & name ) <nl> _labelRenderer - > setTTFConfig ( config ) ; <nl> _type = Type : : TTF ; <nl> } <nl> - else { <nl> + else <nl> + { <nl> _labelRenderer - > setSystemFontName ( name ) ; <nl> if ( _type = = Type : : TTF ) <nl> { <nl> Text : : Type Text : : getType ( ) const <nl> void Text : : setTextAreaSize ( const Size & size ) <nl> { <nl> _labelRenderer - > setDimensions ( size . width , size . height ) ; <nl> + if ( ! _ignoreSize ) <nl> + { <nl> + _customSize = size ; <nl> + } <nl> updateContentSizeWithTextureSize ( _labelRenderer - > getContentSize ( ) ) ; <nl> _labelRendererAdaptDirty = true ; <nl> } <nl> const Size & Text : : getTextAreaSize ( ) const <nl> void Text : : setTextHorizontalAlignment ( TextHAlignment alignment ) <nl> { <nl> _labelRenderer - > setHorizontalAlignment ( alignment ) ; <nl> - updateContentSizeWithTextureSize ( _labelRenderer - > getContentSize ( ) ) ; <nl> - _labelRendererAdaptDirty = true ; <nl> } <nl> <nl> TextHAlignment Text : : getTextHorizontalAlignment ( ) const <nl> TextHAlignment Text : : getTextHorizontalAlignment ( ) const <nl> void Text : : setTextVerticalAlignment ( TextVAlignment alignment ) <nl> { <nl> _labelRenderer - > setVerticalAlignment ( alignment ) ; <nl> - updateContentSizeWithTextureSize ( _labelRenderer - > getContentSize ( ) ) ; <nl> - _labelRendererAdaptDirty = true ; <nl> } <nl> <nl> TextVAlignment Text : : getTextVerticalAlignment ( ) const <nl> mmm a / cocos / ui / UIText . h <nl> ppp b / cocos / ui / UIText . h <nl> class CC_GUI_DLL Text : public Widget <nl> * / <nl> virtual std : : string getDescription ( ) const override ; <nl> <nl> + / * * <nl> + * Set the rendering size of the text , you should call this method <nl> + * along with calling ` ignoreContentAdaptWithSize ( false ) ` , otherwise the text area <nl> + * size is caculated by the real size of the text content <nl> + * @ param size The text rendering area size <nl> + * <nl> + * / <nl> void setTextAreaSize ( const Size & size ) ; <nl> <nl> const Size & getTextAreaSize ( ) const ; <nl> mmm a / tests / cpp - tests / Classes / UITest / CocoStudioGUITest / CocosGUIScene . cpp <nl> ppp b / tests / cpp - tests / Classes / UITest / CocoStudioGUITest / CocosGUIScene . cpp <nl> g_guisTests [ ] = <nl> UISceneManager * sceneManager = UISceneManager : : sharedUISceneManager ( ) ; <nl> sceneManager - > setCurrentUISceneId ( kUITextTest ) ; <nl> sceneManager - > setMinUISceneId ( kUITextTest ) ; <nl> - sceneManager - > setMaxUISceneId ( kUITextTest_TTF ) ; <nl> + sceneManager - > setMaxUISceneId ( kUITextTest_IgnoreConentSize ) ; <nl> Scene * scene = sceneManager - > currentUIScene ( ) ; <nl> Director : : getInstance ( ) - > replaceScene ( scene ) ; <nl> } <nl> mmm a / tests / cpp - tests / Classes / UITest / CocoStudioGUITest / UISceneManager . cpp <nl> ppp b / tests / cpp - tests / Classes / UITest / CocoStudioGUITest / UISceneManager . cpp <nl> static const char * s_testArray [ ] = <nl> " UITextTest_LineWrap " , <nl> " UILabelTest_Effect " , <nl> " UITextTest_TTF " , <nl> + " UITextTest_IgnoreConentSize " , <nl> " UITextBMFontTest " , <nl> <nl> " UITextFieldTest " , <nl> Scene * UISceneManager : : currentUIScene ( ) <nl> <nl> case kUITextTest_TTF : <nl> return UITextTest_TTF : : sceneWithTitle ( s_testArray [ _currentUISceneId ] ) ; <nl> - <nl> + case kUITextTest_IgnoreConentSize : <nl> + return UITextTest_IgnoreConentSize : : sceneWithTitle ( s_testArray [ _currentUISceneId ] ) ; <nl> case kUITextFieldTest : <nl> return UITextFieldTest : : sceneWithTitle ( s_testArray [ _currentUISceneId ] ) ; <nl> <nl> mmm a / tests / cpp - tests / Classes / UITest / CocoStudioGUITest / UISceneManager . h <nl> ppp b / tests / cpp - tests / Classes / UITest / CocoStudioGUITest / UISceneManager . h <nl> enum <nl> kUITextAtlasTest , <nl> kUITextTest , <nl> kUITextTest_LineWrap , <nl> - <nl> kUILabelTest_Effect , <nl> kUITextTest_TTF , <nl> + kUITextTest_IgnoreConentSize , <nl> + <nl> kUITextBMFontTest , <nl> kUITextFieldTest , <nl> kUITextFieldTest_MaxLength , <nl> mmm a / tests / cpp - tests / Classes / UITest / CocoStudioGUITest / UITextTest / UITextTest . cpp <nl> ppp b / tests / cpp - tests / Classes / UITest / CocoStudioGUITest / UITextTest / UITextTest . cpp <nl> bool UITextTest_TTF : : init ( ) <nl> text - > setPosition ( Vec2 ( widgetSize . width / 2 . 0f , widgetSize . height / 2 . 0f + text - > getContentSize ( ) . height / 4 . 0f ) ) ; <nl> _uiLayer - > addChild ( text ) ; <nl> <nl> + return true ; <nl> + } <nl> + return false ; <nl> + } <nl> + <nl> + / / UITextTest_IgnoreConentSize <nl> + <nl> + bool UITextTest_IgnoreConentSize : : init ( ) <nl> + { <nl> + if ( UIScene : : init ( ) ) <nl> + { <nl> + Size widgetSize = _widget - > getContentSize ( ) ; <nl> + <nl> + Text * leftText = Text : : create ( " ignore conent " , <nl> + " fonts / Marker Felt . ttf " , 10 ) ; <nl> + leftText - > setPosition ( Vec2 ( widgetSize . width / 2 . 0f - 50 , <nl> + widgetSize . height / 2 . 0f ) ) ; <nl> + leftText - > ignoreContentAdaptWithSize ( false ) ; <nl> + leftText - > setTextAreaSize ( Size ( 60 , 60 ) ) ; <nl> + leftText - > setString ( " Text line with break \ nText line with break \ nText line with break \ nText line with break \ n " ) ; <nl> + leftText - > setTouchScaleChangeEnabled ( true ) ; <nl> + leftText - > setTouchEnabled ( true ) ; <nl> + _uiLayer - > addChild ( leftText ) ; <nl> + <nl> + <nl> + Text * rightText = Text : : create ( " ignore conent " , <nl> + " fonts / Marker Felt . ttf " , 10 ) ; <nl> + rightText - > setPosition ( Vec2 ( widgetSize . width / 2 . 0f + 50 , <nl> + widgetSize . height / 2 . 0f ) ) ; <nl> + rightText - > setString ( " Text line with break \ nText line with break \ nText line with break \ nText line with break \ n " ) ; <nl> + / / note : setTextAreaSize must be used with ignoreContentAdaptWithSize ( false ) <nl> + rightText - > setTextAreaSize ( Size ( 100 , 30 ) ) ; <nl> + rightText - > ignoreContentAdaptWithSize ( false ) ; <nl> + _uiLayer - > addChild ( rightText ) ; <nl> + <nl> + <nl> + auto halighButton = Button : : create ( ) ; <nl> + halighButton - > setTitleText ( " Alignment Right " ) ; <nl> + halighButton - > addClickEventListener ( [ = ] ( Ref * ) { <nl> + leftText - > setTextHorizontalAlignment ( TextHAlignment : : RIGHT ) ; <nl> + rightText - > setTextHorizontalAlignment ( TextHAlignment : : RIGHT ) ; <nl> + } ) ; <nl> + halighButton - > setPosition ( Vec2 ( widgetSize . width / 2 - 50 , <nl> + widgetSize . height / 2 - 50 ) ) ; <nl> + _uiLayer - > addChild ( halighButton ) ; <nl> + <nl> + <nl> return true ; <nl> } <nl> return false ; <nl> mmm a / tests / cpp - tests / Classes / UITest / CocoStudioGUITest / UITextTest / UITextTest . h <nl> ppp b / tests / cpp - tests / Classes / UITest / CocoStudioGUITest / UITextTest / UITextTest . h <nl> class UITextTest_TTF : public UIScene <nl> UI_SCENE_CREATE_FUNC ( UITextTest_TTF ) <nl> } ; <nl> <nl> + class UITextTest_IgnoreConentSize : public UIScene <nl> + { <nl> + public : <nl> + bool init ( ) ; <nl> + protected : <nl> + UI_SCENE_CREATE_FUNC ( UITextTest_IgnoreConentSize ) <nl> + } ; <nl> + <nl> # endif / * defined ( __TestCpp__UITextTest__ ) * / <nl>
Merge pull request from andyque / fixTextIgnoreContentSizeIssue
cocos2d/cocos2d-x
e8cff91bd7475ca9e58bc448505a594e728fefad
2014-11-27T01:57:33Z
mmm a / dbms / src / DataStreams / copyData . cpp <nl> ppp b / dbms / src / DataStreams / copyData . cpp <nl> <nl> # include < DataStreams / IProfilingBlockInputStream . h > <nl> # include < DataStreams / IBlockOutputStream . h > <nl> # include < DataStreams / copyData . h > <nl> + # include < Common / Stopwatch . h > <nl> + # include < common / logger_useful . h > <nl> + # include < iomanip > <nl> <nl> <nl> namespace DB <nl> void copyDataImpl ( IBlockInputStream & from , IBlockOutputStream & to , TCancelCall <nl> from . readPrefix ( ) ; <nl> to . writePrefix ( ) ; <nl> <nl> - while ( Block block = from . read ( ) ) <nl> + size_t num_blocks = 0 ; <nl> + double total_blocks_time = 0 ; <nl> + size_t slowest_block_number = 0 ; <nl> + double slowest_block_time = 0 ; <nl> + <nl> + while ( true ) <nl> { <nl> + Stopwatch watch ; <nl> + Block block = from . read ( ) ; <nl> + double elapsed = watch . elapsedSeconds ( ) ; <nl> + <nl> + if ( num_blocks = = 0 | | elapsed > slowest_block_time ) <nl> + { <nl> + slowest_block_number = num_blocks ; <nl> + slowest_block_time = elapsed ; <nl> + } <nl> + <nl> + total_blocks_time + = elapsed ; <nl> + + + num_blocks ; <nl> + <nl> + if ( ! block ) <nl> + break ; <nl> + <nl> if ( is_cancelled ( ) ) <nl> break ; <nl> <nl> void copyDataImpl ( IBlockInputStream & from , IBlockOutputStream & to , TCancelCall <nl> if ( is_cancelled ( ) ) <nl> return ; <nl> <nl> - from . readSuffix ( ) ; <nl> - to . writeSuffix ( ) ; <nl> + auto log = & Poco : : Logger : : get ( " copyData " ) ; <nl> + bool print_dbg = num_blocks > 2 ; <nl> + <nl> + if ( print_dbg ) <nl> + { <nl> + LOG_DEBUG ( log , " Read " < < num_blocks < < " blocks . It took " < < std : : fixed < < total_blocks_time < < " seconds , average " <nl> + < < std : : fixed < < total_blocks_time / num_blocks * 1000 < < " ms , the slowest block # " < < slowest_block_number <nl> + < < " was read for " < < std : : fixed < < slowest_block_time * 1000 < < " ms " ) ; <nl> + } <nl> + <nl> + { <nl> + Stopwatch watch ; <nl> + to . writeSuffix ( ) ; <nl> + if ( num_blocks > 1 ) <nl> + LOG_DEBUG ( log , " It took " < < std : : fixed < < watch . elapsedSeconds ( ) < < " for writeSuffix ( ) " ) ; <nl> + } <nl> + { <nl> + Stopwatch watch ; <nl> + from . readSuffix ( ) ; <nl> + if ( num_blocks > 1 ) <nl> + LOG_DEBUG ( log , " It took " < < std : : fixed < < watch . elapsedSeconds ( ) < < " seconds for readSuffix ( ) " ) ; <nl> + } <nl> } <nl> <nl> <nl> mmm a / dbms / src / Server / ClusterCopier . cpp <nl> ppp b / dbms / src / Server / ClusterCopier . cpp <nl> void DB : : TaskCluster : : reloadSettings ( const Poco : : Util : : AbstractConfiguration & c <nl> if ( config . has ( prefix + " settings_push " ) ) <nl> settings_push . loadSettingsFromConfig ( prefix + " settings_push " , config ) ; <nl> <nl> + auto set_default_value = [ ] ( auto & & setting , auto & & default_value ) <nl> + { <nl> + setting = setting . changed ? setting . value : default_value ; <nl> + } ; <nl> + <nl> / / / Override important settings <nl> - settings_pull . load_balancing = LoadBalancing : : NEAREST_HOSTNAME ; <nl> settings_pull . readonly = 1 ; <nl> - settings_pull . max_threads = 1 ; <nl> - settings_pull . max_block_size = settings_pull . max_block_size . changed ? settings_pull . max_block_size . value : 8192UL ; <nl> - settings_pull . preferred_block_size_bytes = 0 ; <nl> - <nl> - settings_push . insert_distributed_timeout = 0 ; <nl> settings_push . insert_distributed_sync = 1 ; <nl> + set_default_value ( settings_pull . load_balancing , LoadBalancing : : NEAREST_HOSTNAME ) ; <nl> + set_default_value ( settings_pull . max_threads , 1 ) ; <nl> + set_default_value ( settings_pull . max_block_size , 8192UL ) ; <nl> + set_default_value ( settings_pull . preferred_block_size_bytes , 0 ) ; <nl> + set_default_value ( settings_push . insert_distributed_timeout , 0 ) ; <nl> } <nl> <nl> <nl> class ClusterCopier <nl> status_paths . emplace_back ( task_shard_partition . getShardStatusPath ( ) ) ; <nl> } <nl> <nl> - zkutil : : Stat stat ; <nl> std : : vector < int64_t > zxid1 , zxid2 ; <nl> <nl> try <nl> { <nl> - / / Check that state is Finished and remember zxid <nl> + std : : vector < zkutil : : ZooKeeper : : GetFuture > get_futures ; <nl> for ( const String & path : status_paths ) <nl> + get_futures . emplace_back ( zookeeper - > asyncGet ( path ) ) ; <nl> + <nl> + / / Check that state is Finished and remember zxid <nl> + for ( auto & future : get_futures ) <nl> { <nl> - TaskStateWithOwner status = TaskStateWithOwner : : fromString ( zookeeper - > get ( path , & stat ) ) ; <nl> + auto res = future . get ( ) ; <nl> + <nl> + TaskStateWithOwner status = TaskStateWithOwner : : fromString ( res . value ) ; <nl> if ( status . state ! = TaskState : : Finished ) <nl> { <nl> - LOG_INFO ( log , " The task " < < path < < " is being rewritten by " < < status . owner <nl> - < < " . Partition will be rechecked " ) ; <nl> + LOG_INFO ( log , " The task " < < res . value < < " is being rewritten by " < < status . owner < < " . Partition will be rechecked " ) ; <nl> return false ; <nl> } <nl> - zxid1 . push_back ( stat . pzxid ) ; <nl> + <nl> + zxid1 . push_back ( res . stat . pzxid ) ; <nl> } <nl> <nl> / / Check that partition is not dirty <nl> class ClusterCopier <nl> return false ; <nl> } <nl> <nl> + get_futures . clear ( ) ; <nl> + for ( const String & path : status_paths ) <nl> + get_futures . emplace_back ( zookeeper - > asyncGet ( path ) ) ; <nl> + <nl> / / Remember zxid of states again <nl> - for ( const auto & path : status_paths ) <nl> + for ( auto & future : get_futures ) <nl> { <nl> - zookeeper - > exists ( path , & stat ) ; <nl> - zxid2 . push_back ( stat . pzxid ) ; <nl> + auto res = future . get ( ) ; <nl> + zxid2 . push_back ( res . stat . pzxid ) ; <nl> } <nl> } <nl> catch ( const zkutil : : KeeperException & e ) <nl> class ClusterCopier <nl> BlockIO io_select = InterpreterFactory : : get ( query_select_ast , context_select ) - > execute ( ) ; <nl> BlockIO io_insert = InterpreterFactory : : get ( query_insert_ast , context_insert ) - > execute ( ) ; <nl> <nl> - input = std : : make_shared < AsynchronousBlockInputStream > ( io_select . in ) ; <nl> + input = io_select . in ; <nl> output = io_insert . out ; <nl> } <nl> <nl> mmm a / dbms / src / Storages / Distributed / DistributedBlockOutputStream . cpp <nl> ppp b / dbms / src / Storages / Distributed / DistributedBlockOutputStream . cpp <nl> <nl> # include < ext / scope_guard . h > <nl> <nl> # include < Poco / DirectoryIterator . h > <nl> + # include < Poco / DateTimeFormatter . h > <nl> <nl> # include < future > <nl> # include < condition_variable > <nl> void DistributedBlockOutputStream : : writeSync ( const Block & block ) <nl> <nl> inserted_blocks + = 1 ; <nl> inserted_rows + = block . rows ( ) ; <nl> + last_block_finish_time = time ( nullptr ) ; <nl> } <nl> <nl> <nl> void DistributedBlockOutputStream : : writeSuffix ( ) <nl> { <nl> + auto log_performance = [ this ] ( ) <nl> + { <nl> + double elapsed = watch . elapsedSeconds ( ) ; <nl> + LOG_DEBUG ( log , " It took " < < std : : fixed < < std : : setprecision ( 1 ) < < elapsed < < " sec . to insert " < < inserted_blocks < < " blocks " <nl> + < < " , " < < std : : fixed < < std : : setprecision ( 1 ) < < inserted_rows / elapsed < < " rows per second " <nl> + < < " . " < < getCurrentStateDescription ( ) ) ; <nl> + } ; <nl> + <nl> if ( insert_sync & & pool ) <nl> { <nl> + auto format_ts = [ ] ( time_t ts ) { <nl> + WriteBufferFromOwnString wb ; <nl> + writeDateTimeText ( ts , wb ) ; <nl> + return wb . str ( ) ; <nl> + } ; <nl> + <nl> + LOG_DEBUG ( log , " Writing suffix , the last block was at " < < format_ts ( last_block_finish_time ) ) ; <nl> + <nl> finished_jobs_count = 0 ; <nl> for ( auto & shard_jobs : per_shard_jobs ) <nl> for ( JobReplica & job : shard_jobs . replicas_jobs ) <nl> { <nl> if ( job . stream ) <nl> - pool - > schedule ( [ & job ] ( ) { job . stream - > writeSuffix ( ) ; } ) ; <nl> + { <nl> + pool - > schedule ( [ & job ] ( ) { <nl> + job . stream - > writeSuffix ( ) ; <nl> + } ) ; <nl> + } <nl> } <nl> <nl> try <nl> { <nl> pool - > wait ( ) ; <nl> + log_performance ( ) ; <nl> } <nl> catch ( Exception & exception ) <nl> { <nl> + log_performance ( ) ; <nl> exception . addMessage ( getCurrentStateDescription ( ) ) ; <nl> throw ; <nl> } <nl> - <nl> - double elapsed = watch . elapsedSeconds ( ) ; <nl> - LOG_DEBUG ( log , " It took " < < std : : fixed < < std : : setprecision ( 1 ) < < elapsed < < " sec . to insert " < < inserted_blocks < < " blocks " <nl> - < < " , " < < std : : fixed < < std : : setprecision ( 1 ) < < inserted_rows / elapsed < < " rows per second " <nl> - < < " . " < < getCurrentStateDescription ( ) ) ; <nl> } <nl> } <nl> <nl> mmm a / dbms / src / Storages / Distributed / DistributedBlockOutputStream . h <nl> ppp b / dbms / src / Storages / Distributed / DistributedBlockOutputStream . h <nl> <nl> # include < Interpreters / Cluster . h > <nl> # include < Interpreters / Context . h > <nl> <nl> + <nl> namespace Poco <nl> { <nl> class Logger ; <nl> class DistributedBlockOutputStream : public IBlockOutputStream <nl> std : : optional < ThreadPool > pool ; <nl> ThrottlerPtr throttler ; <nl> String query_string ; <nl> + time_t last_block_finish_time = 0 ; <nl> <nl> struct JobReplica <nl> { <nl> mmm a / dbms / tests / integration / test_cluster_copier / task_month_to_week_description . xml <nl> ppp b / dbms / tests / integration / test_cluster_copier / task_month_to_week_description . xml <nl> <nl> < ! - - Common setting for pull and push operations - - > <nl> < settings > <nl> < connect_timeout > 1 < / connect_timeout > <nl> + < max_block_size > 2 < / max_block_size > <nl> < / settings > <nl> <nl> < settings_pull > <nl>
Speedup partition check , add more preformance output . [ # CLICKHOUSE - 2 ]
ClickHouse/ClickHouse
d25338582db8b20f9080449912c55dba01c28c21
2018-05-14T14:14:58Z
mmm a / cocos2dx / CCScheduler . cpp <nl> ppp b / cocos2dx / CCScheduler . cpp <nl> void Timer : : update ( float dt ) <nl> ( _target - > * _selector ) ( _elapsed ) ; <nl> } <nl> <nl> - if ( _scriptHandler ) <nl> + if ( 0 ! = _scriptHandler ) <nl> { <nl> - ScriptEngineManager : : sharedManager ( ) - > getScriptEngine ( ) - > executeSchedule ( _scriptHandler , _elapsed ) ; <nl> + SchedulerScriptEvent data ; <nl> + memset ( & data , 0 , sizeof ( SchedulerScriptEvent ) ) ; <nl> + data . handler = _scriptHandler ; <nl> + data . elapse = _elapsed ; <nl> + ScriptEvent event ( kScheduleEvent , & data ) ; <nl> + ScriptEngineManager : : sharedManager ( ) - > getScriptEngine ( ) - > sendEvent ( & event ) ; <nl> } <nl> _elapsed = 0 ; <nl> } <nl> void Timer : : update ( float dt ) <nl> ( _target - > * _selector ) ( _elapsed ) ; <nl> } <nl> <nl> - if ( _scriptHandler ) <nl> + if ( 0 ! = _scriptHandler ) <nl> { <nl> - ScriptEngineManager : : sharedManager ( ) - > getScriptEngine ( ) - > executeSchedule ( _scriptHandler , _elapsed ) ; <nl> + SchedulerScriptEvent data ; <nl> + memset ( & data , 0 , sizeof ( SchedulerScriptEvent ) ) ; <nl> + data . handler = _scriptHandler ; <nl> + data . elapse = _elapsed ; <nl> + ScriptEvent event ( kScheduleEvent , & data ) ; <nl> + ScriptEngineManager : : sharedManager ( ) - > getScriptEngine ( ) - > sendEvent ( & event ) ; <nl> } <nl> <nl> _elapsed = _elapsed - _delay ; <nl> void Timer : : update ( float dt ) <nl> ( _target - > * _selector ) ( _elapsed ) ; <nl> } <nl> <nl> - if ( _scriptHandler ) <nl> + if ( 0 ! = _scriptHandler ) <nl> { <nl> - ScriptEngineManager : : sharedManager ( ) - > getScriptEngine ( ) - > executeSchedule ( _scriptHandler , _elapsed ) ; <nl> + SchedulerScriptEvent data ; <nl> + memset ( & data , 0 , sizeof ( SchedulerScriptEvent ) ) ; <nl> + data . handler = _scriptHandler ; <nl> + data . elapse = _elapsed ; <nl> + ScriptEvent event ( kScheduleEvent , & data ) ; <nl> + ScriptEngineManager : : sharedManager ( ) - > getScriptEngine ( ) - > sendEvent ( & event ) ; <nl> } <nl> <nl> _elapsed = 0 ; <nl> mmm a / cocos2dx / actions / CCActionInstant . cpp <nl> ppp b / cocos2dx / actions / CCActionInstant . cpp <nl> void CallFunc : : execute ( ) { <nl> ( _selectorTarget - > * _callFunc ) ( ) ; <nl> } else if ( _function ) <nl> _function ( ) ; <nl> - if ( _scriptHandler ) { <nl> - ScriptEngineManager : : sharedManager ( ) - > getScriptEngine ( ) - > executeCallFuncActionEvent ( this ) ; <nl> + if ( 0 ! = _scriptHandler ) { <nl> + ScriptEvent event ( kCallFuncEvent , NULL ) ; <nl> + ScriptEngineManager : : sharedManager ( ) - > getScriptEngine ( ) - > sendEvent ( & event , ( void * ) this ) ; <nl> } <nl> } <nl> <nl> mmm a / cocos2dx / base_nodes / CCNode . cpp <nl> ppp b / cocos2dx / base_nodes / CCNode . cpp <nl> void Node : : cleanup ( ) <nl> this - > stopAllActions ( ) ; <nl> this - > unscheduleAllSelectors ( ) ; <nl> <nl> - if ( _scriptType ! = kScriptTypeNone ) <nl> + if ( _scriptType = = kScriptTypeLua ) <nl> + { <nl> + int action = kNodeOnCleanup ; <nl> + ScriptEvent scriptEvent ( kNodeEvent , ( void * ) & action ) ; <nl> + ScriptEngineManager : : sharedManager ( ) - > getScriptEngine ( ) - > sendEvent ( & scriptEvent , ( void * ) this ) ; <nl> + } <nl> + else if ( _scriptType ! = kScriptTypeJavascript ) <nl> { <nl> ScriptEngineManager : : sharedManager ( ) - > getScriptEngine ( ) - > executeNodeEvent ( this , kNodeOnCleanup ) ; <nl> } <nl> void Node : : onEnter ( ) <nl> <nl> _running = true ; <nl> <nl> - if ( _scriptType ! = kScriptTypeNone ) <nl> + if ( _scriptType = = kScriptTypeLua ) <nl> + { <nl> + int action = kNodeOnEnter ; <nl> + ScriptEvent scriptEvent ( kNodeEvent , ( void * ) & action ) ; <nl> + ScriptEngineManager : : sharedManager ( ) - > getScriptEngine ( ) - > sendEvent ( & scriptEvent , ( void * ) this ) ; <nl> + } <nl> + else if ( _scriptType = = kScriptTypeJavascript ) <nl> { <nl> ScriptEngineManager : : sharedManager ( ) - > getScriptEngine ( ) - > executeNodeEvent ( this , kNodeOnEnter ) ; <nl> } <nl> void Node : : onEnterTransitionDidFinish ( ) <nl> <nl> arrayMakeObjectsPerformSelector ( _children , onEnterTransitionDidFinish , Node * ) ; <nl> <nl> - if ( _scriptType = = kScriptTypeJavascript ) <nl> + if ( _scriptType = = kScriptTypeLua ) <nl> + { <nl> + int action = kNodeOnEnterTransitionDidFinish ; <nl> + ScriptEvent scriptEvent ( kNodeEvent , ( void * ) & action ) ; <nl> + ScriptEngineManager : : sharedManager ( ) - > getScriptEngine ( ) - > sendEvent ( & scriptEvent , ( void * ) this ) ; <nl> + } <nl> + else if ( _scriptType = = kScriptTypeJavascript ) <nl> { <nl> ScriptEngineManager : : sharedManager ( ) - > getScriptEngine ( ) - > executeNodeEvent ( this , kNodeOnEnterTransitionDidFinish ) ; <nl> } <nl> void Node : : onEnterTransitionDidFinish ( ) <nl> void Node : : onExitTransitionDidStart ( ) <nl> { <nl> arrayMakeObjectsPerformSelector ( _children , onExitTransitionDidStart , Node * ) ; <nl> - <nl> - if ( _scriptType = = kScriptTypeJavascript ) <nl> + if ( _scriptType = = kScriptTypeLua ) <nl> + { <nl> + int action = kNodeOnExitTransitionDidStart ; <nl> + ScriptEvent scriptEvent ( kNodeEvent , ( void * ) & action ) ; <nl> + ScriptEngineManager : : sharedManager ( ) - > getScriptEngine ( ) - > sendEvent ( & scriptEvent , ( void * ) this ) ; <nl> + } <nl> + else if ( _scriptType = = kScriptTypeJavascript ) <nl> { <nl> ScriptEngineManager : : sharedManager ( ) - > getScriptEngine ( ) - > executeNodeEvent ( this , kNodeOnExitTransitionDidStart ) ; <nl> } <nl> void Node : : onExit ( ) <nl> this - > pauseSchedulerAndActions ( ) ; <nl> <nl> _running = false ; <nl> - <nl> - if ( _scriptType ! = kScriptTypeNone ) <nl> + if ( _scriptType = = kScriptTypeLua ) <nl> + { <nl> + int action = kNodeOnExit ; <nl> + ScriptEvent scriptEvent ( kNodeEvent , ( void * ) & action ) ; <nl> + ScriptEngineManager : : sharedManager ( ) - > getScriptEngine ( ) - > sendEvent ( & scriptEvent , ( void * ) this ) ; <nl> + } <nl> + else if ( _scriptType = = kScriptTypeJavascript ) <nl> { <nl> ScriptEngineManager : : sharedManager ( ) - > getScriptEngine ( ) - > executeNodeEvent ( this , kNodeOnExit ) ; <nl> } <nl> void Node : : pauseSchedulerAndActions ( ) <nl> / / override me <nl> void Node : : update ( float fDelta ) <nl> { <nl> - if ( _updateScriptHandler ) <nl> + if ( 0 ! = _updateScriptHandler ) <nl> { <nl> - ScriptEngineManager : : sharedManager ( ) - > getScriptEngine ( ) - > executeSchedule ( _updateScriptHandler , fDelta , this ) ; <nl> + / / only lua use <nl> + SchedulerScriptEvent data ; <nl> + memset ( & data , 0 , sizeof ( SchedulerScriptEvent ) ) ; <nl> + data . handler = _updateScriptHandler ; <nl> + data . elapse = fDelta ; <nl> + ScriptEvent event ( kScheduleEvent , & data ) ; <nl> + ScriptEngineManager : : sharedManager ( ) - > getScriptEngine ( ) - > sendEvent ( & event ) ; <nl> } <nl> <nl> if ( _componentContainer & & ! _componentContainer - > isEmpty ( ) ) <nl> mmm a / cocos2dx / layers_scenes_transitions_nodes / CCLayer . cpp <nl> ppp b / cocos2dx / layers_scenes_transitions_nodes / CCLayer . cpp <nl> void Layer : : unregisterScriptTouchHandler ( void ) <nl> <nl> int Layer : : excuteScriptTouchHandler ( int nEventType , Touch * pTouch ) <nl> { <nl> - return ScriptEngineManager : : sharedManager ( ) - > getScriptEngine ( ) - > executeLayerTouchEvent ( this , nEventType , pTouch ) ; <nl> + if ( kScriptTypeLua = = _scriptType ) <nl> + { <nl> + LayerTouchScriptEvent data ; <nl> + data . actionType = nEventType ; <nl> + data . touch = pTouch ; <nl> + ScriptEvent event ( kLayerTouchEvent , & data ) ; <nl> + return ScriptEngineManager : : sharedManager ( ) - > getScriptEngine ( ) - > sendEvent ( & event , this ) ; <nl> + } <nl> + else if ( kScriptTypeJavascript = = _scriptType ) <nl> + { <nl> + return ScriptEngineManager : : sharedManager ( ) - > getScriptEngine ( ) - > executeLayerTouchEvent ( this , nEventType , pTouch ) ; <nl> + } <nl> + / / can not reach it <nl> + return 0 ; <nl> } <nl> <nl> int Layer : : excuteScriptTouchHandler ( int nEventType , Set * pTouches ) <nl> { <nl> - return ScriptEngineManager : : sharedManager ( ) - > getScriptEngine ( ) - > executeLayerTouchesEvent ( this , nEventType , pTouches ) ; <nl> + if ( kScriptTypeLua = = _scriptType ) <nl> + { <nl> + LayerTouchesScriptEvent data ; <nl> + data . actionType = nEventType ; <nl> + data . touches = pTouches ; <nl> + ScriptEvent event ( kLayerTouchesEvent , & data ) ; <nl> + return ScriptEngineManager : : sharedManager ( ) - > getScriptEngine ( ) - > sendEvent ( & event , this ) ; <nl> + } <nl> + else if ( kScriptTypeJavascript = = _scriptType ) <nl> + { <nl> + return ScriptEngineManager : : sharedManager ( ) - > getScriptEngine ( ) - > executeLayerTouchesEvent ( this , nEventType , pTouches ) ; <nl> + } <nl> + return 0 ; <nl> } <nl> <nl> / / / isTouchEnabled getter <nl> void Layer : : setAccelerometerInterval ( double interval ) { <nl> void Layer : : didAccelerate ( Acceleration * pAccelerationValue ) <nl> { <nl> CC_UNUSED_PARAM ( pAccelerationValue ) ; <nl> - if ( _scriptType ! = kScriptTypeNone ) <nl> - { <nl> - ScriptEngineManager : : sharedManager ( ) - > getScriptEngine ( ) - > executeAccelerometerEvent ( this , pAccelerationValue ) ; <nl> - } <nl> + if ( kScriptTypeJavascript = = _scriptType ) <nl> + { <nl> + ScriptEvent event ( kAccelerometerEvent , ( void * ) pAccelerationValue ) ; <nl> + ScriptEngineManager : : sharedManager ( ) - > getScriptEngine ( ) - > sendEvent ( & event , this ) ; <nl> + } <nl> + else if ( kScriptTypeLua = = _scriptType ) <nl> + { <nl> + ScriptEngineManager : : sharedManager ( ) - > getScriptEngine ( ) - > executeAccelerometerEvent ( this , pAccelerationValue ) ; <nl> + } <nl> } <nl> <nl> void Layer : : registerScriptAccelerateHandler ( int nHandler ) <nl> void Layer : : unregisterScriptKeypadHandler ( void ) <nl> <nl> void Layer : : keyBackClicked ( void ) <nl> { <nl> - if ( _scriptKeypadHandlerEntry | | _scriptType = = kScriptTypeJavascript ) <nl> + if ( NULL ! = _scriptKeypadHandlerEntry & & 0 ! = _scriptKeypadHandlerEntry - > getHandler ( ) ) <nl> + { <nl> + int action = kTypeBackClicked ; <nl> + ScriptEvent event ( kLayerKeypadEvent , ( void * ) & action ) ; <nl> + ScriptEngineManager : : sharedManager ( ) - > getScriptEngine ( ) - > sendEvent ( & event , this ) ; <nl> + } <nl> + else if ( kScriptTypeJavascript = = _scriptType ) <nl> { <nl> ScriptEngineManager : : sharedManager ( ) - > getScriptEngine ( ) - > executeLayerKeypadEvent ( this , kTypeBackClicked ) ; <nl> } <nl> void Layer : : keyBackClicked ( void ) <nl> <nl> void Layer : : keyMenuClicked ( void ) <nl> { <nl> - if ( _scriptKeypadHandlerEntry ) <nl> + if ( NULL ! = _scriptKeypadHandlerEntry & & 0 ! = _scriptKeypadHandlerEntry - > getHandler ( ) ) <nl> { <nl> - ScriptEngineManager : : sharedManager ( ) - > getScriptEngine ( ) - > executeLayerKeypadEvent ( this , kTypeMenuClicked ) ; <nl> + int action = kTypeMenuClicked ; <nl> + ScriptEvent event ( kLayerKeypadEvent , ( void * ) & action ) ; <nl> + ScriptEngineManager : : sharedManager ( ) - > getScriptEngine ( ) - > sendEvent ( & event , this ) ; <nl> } <nl> } <nl> <nl> mmm a / cocos2dx / menu_nodes / CCMenuItem . cpp <nl> ppp b / cocos2dx / menu_nodes / CCMenuItem . cpp <nl> void MenuItem : : activate ( ) <nl> _callback ( this ) ; <nl> } <nl> <nl> - if ( kScriptTypeNone ! = _scriptType ) <nl> + if ( kScriptTypeLua = = _scriptType ) <nl> + { <nl> + ScriptEvent scriptEvent ( kMenuItemEvent , NULL ) ; <nl> + ScriptEngineManager : : sharedManager ( ) - > getScriptEngine ( ) - > sendEvent ( & scriptEvent , ( void * ) this ) ; <nl> + } <nl> + else if ( kScriptTypeJavascript = = _scriptType ) <nl> { <nl> ScriptEngineManager : : sharedManager ( ) - > getScriptEngine ( ) - > executeMenuItemEvent ( this ) ; <nl> } <nl> mmm a / cocos2dx / script_support / CCScriptSupport . h <nl> ppp b / cocos2dx / script_support / CCScriptSupport . h <nl> class TouchScriptHandlerEntry : public ScriptHandlerEntry <nl> bool _swallowsTouches ; <nl> } ; <nl> <nl> + enum ScriptEventType <nl> + { <nl> + kNodeEvent = 0 , <nl> + kMenuItemEvent , <nl> + kNotificationEvent , <nl> + kCallFuncEvent , <nl> + kScheduleEvent , <nl> + kLayerTouchesEvent , <nl> + kLayerTouchEvent , <nl> + kLayerKeypadEvent , <nl> + kAccelerometerEvent , <nl> + kCommonEvent , <nl> + } ; <nl> + <nl> + struct SchedulerScriptEvent <nl> + { <nl> + / / lua use <nl> + int handler ; <nl> + float elapse ; <nl> + / / js use <nl> + Node * node ; <nl> + } ; <nl> + <nl> + struct LayerTouchesScriptEvent <nl> + { <nl> + int actionType ; <nl> + Set * touches ; <nl> + } ; <nl> + <nl> + struct LayerTouchScriptEvent <nl> + { <nl> + int actionType ; <nl> + Touch * touch ; <nl> + } ; <nl> + <nl> + struct CommonScriptEvent <nl> + { <nl> + / / now , only use lua <nl> + int handler ; <nl> + char eventName [ 64 ] ; <nl> + Object * eventSource ; <nl> + char eventSourceClassName [ 64 ] ; <nl> + CommonScriptEvent ( int inHandler , const char * name , Object * source = NULL , const char * className = NULL ) <nl> + { <nl> + handler = inHandler ; <nl> + strncpy ( eventName , name , 64 ) ; <nl> + if ( NULL ! = source ) <nl> + { <nl> + eventSource = source ; <nl> + } <nl> + else <nl> + { <nl> + eventSource = NULL ; <nl> + } <nl> + <nl> + if ( NULL = = className ) <nl> + { <nl> + memset ( eventSourceClassName , 0 , 64 * sizeof ( char ) ) ; <nl> + } <nl> + else <nl> + { <nl> + strncpy ( eventSourceClassName , className , 64 ) ; <nl> + } <nl> + } <nl> + } ; <nl> + <nl> + struct ScriptEvent <nl> + { <nl> + ScriptEventType type ; <nl> + void * data ; <nl> + ScriptEvent ( ScriptEventType inType , void * inData ) <nl> + { <nl> + type = inType ; <nl> + data = inData ; <nl> + } <nl> + } ; <nl> <nl> / / Don ' t make ScriptEngineProtocol inherits from Object since setScriptEngine is invoked only once in AppDelegate . cpp , <nl> / / It will affect the lifecycle of ScriptCore instance , the autorelease pool will be destroyed before destructing ScriptCore . <nl> class CC_DLL ScriptEngineProtocol <nl> * / <nl> virtual bool handleAssert ( const char * msg ) = 0 ; <nl> <nl> - / / handle the script func begin <nl> - enum EventType <nl> - { <nl> - kNodeEvent , <nl> - kMenuItemEvent , <nl> - kNotificationEvent , <nl> - kCallFuncEvent , <nl> - kScheduleEvent , <nl> - kLayerTouchesEvent , <nl> - kLayerTouchersEvents , <nl> - kLayerKeypadEvent , <nl> - kEcuteAccelerometerEvent , <nl> - kNormalEvent , <nl> - } ; <nl> - <nl> - struct EventMessage <nl> - { <nl> - EventType type ; <nl> - void * data ; <nl> - EventMessage ( EventType inType , void * inData ) <nl> - { <nl> - type = inType ; <nl> - data = inData ; <nl> - } <nl> - } ; <nl> - / * handle the script func unified <nl> - * / <nl> - virtual int handleEvent ( int handler , void * nativeObject , EventMessage * message ) { return - 1 ; } <nl> - / / handle the script func end <nl> + / / when trigger a script event , call this func , add params needed into ScriptEvent object . nativeObject is object triggering the event , can be NULL in lua <nl> + virtual int sendEvent ( ScriptEvent * message , void * nativeObject = NULL ) { return - 1 ; } <nl> + / / <nl> } ; <nl> <nl> / * * <nl> mmm a / cocos2dx / support / CCNotificationCenter . cpp <nl> ppp b / cocos2dx / support / CCNotificationCenter . cpp <nl> void NotificationCenter : : postNotification ( const char * name , Object * object ) <nl> if ( ! strcmp ( name , observer - > getName ( ) ) & & ( observer - > getObject ( ) = = object | | observer - > getObject ( ) = = NULL | | object = = NULL ) ) <nl> { <nl> if ( 0 ! = observer - > getHandler ( ) ) <nl> - { <nl> - ScriptEngineProtocol * engine = ScriptEngineManager : : sharedManager ( ) - > getScriptEngine ( ) ; <nl> - engine - > executeNotificationEvent ( this , name ) ; <nl> + { <nl> + ScriptEvent scriptEvent ( kNotificationEvent , ( void * ) name ) ; <nl> + ScriptEngineManager : : sharedManager ( ) - > getScriptEngine ( ) - > sendEvent ( & scriptEvent , ( void * ) this ) ; <nl> } <nl> else <nl> { <nl> mmm a / extensions / GUI / CCControlExtension / CCControl . cpp <nl> ppp b / extensions / GUI / CCControlExtension / CCControl . cpp <nl> void Control : : sendActionsForControlEvents ( ControlEvent controlEvents ) <nl> if ( kScriptTypeNone ! = _scriptType ) <nl> { <nl> int nHandler = this - > getHandleOfControlEvent ( controlEvents ) ; <nl> - if ( - 1 ! = nHandler ) { <nl> - ScriptEngineManager : : sharedManager ( ) - > getScriptEngine ( ) - > executeEvent ( nHandler , " " , this ) ; <nl> + if ( 0 ! = nHandler ) <nl> + { <nl> + cocos2d : : CommonScriptEvent data ( nHandler , " " , ( Object * ) this ) ; <nl> + cocos2d : : ScriptEvent event ( cocos2d : : kCommonEvent , ( void * ) & data ) ; <nl> + cocos2d : : ScriptEngineManager : : sharedManager ( ) - > getScriptEngine ( ) - > sendEvent ( & event ) ; <nl> } <nl> } <nl> } <nl> int Control : : getHandleOfControlEvent ( ControlEvent controlEvent ) <nl> if ( _mapHandleOfControlEvent . end ( ) ! = Iter ) <nl> return Iter - > second ; <nl> <nl> - return - 1 ; <nl> + return 0 ; <nl> } <nl> NS_CC_EXT_END <nl> mmm a / extensions / GUI / CCEditBox / CCEditBoxImplAndroid . cpp <nl> ppp b / extensions / GUI / CCEditBox / CCEditBoxImplAndroid . cpp <nl> static void editBoxCallbackFunc ( const char * pText , void * ctx ) <nl> <nl> EditBox * pEditBox = thiz - > getEditBox ( ) ; <nl> if ( NULL ! = pEditBox & & 0 ! = pEditBox - > getScriptEditBoxHandler ( ) ) <nl> - { <nl> - cocos2d : : ScriptEngineProtocol * pEngine = cocos2d : : ScriptEngineManager : : sharedManager ( ) - > getScriptEngine ( ) ; <nl> - pEngine - > executeEvent ( pEditBox - > getScriptEditBoxHandler ( ) , " changed " , pEditBox ) ; <nl> - pEngine - > executeEvent ( pEditBox - > getScriptEditBoxHandler ( ) , " ended " , pEditBox ) ; <nl> - pEngine - > executeEvent ( pEditBox - > getScriptEditBoxHandler ( ) , " return " , pEditBox ) ; <nl> + { <nl> + CommonScriptEvent data ( pEditBox - > getScriptEditBoxHandler ( ) , " changed " , pEditBox ) ; <nl> + ScriptEvent event ( kCommonEvent , ( void * ) & data ) ; <nl> + ScriptEngineManager : : sharedManager ( ) - > getScriptEngine ( ) - > sendEvent ( & event ) ; <nl> + memset ( data . eventName , 0 , 64 * sizeof ( char ) ) ; <nl> + strncpy ( data . eventName , " ended " , 64 ) ; <nl> + event . data = ( void * ) & data ; <nl> + ScriptEngineManager : : sharedManager ( ) - > getScriptEngine ( ) - > sendEvent ( & event ) ; <nl> + memset ( data . eventName , 0 , 64 * sizeof ( char ) ) ; <nl> + strncpy ( data . eventName , " return " , 64 ) ; <nl> + event . data = ( void * ) & data ; <nl> + ScriptEngineManager : : sharedManager ( ) - > getScriptEngine ( ) - > sendEvent ( & event ) ; <nl> } <nl> } <nl> <nl> void EditBoxImplAndroid : : openKeyboard ( ) <nl> } <nl> EditBox * pEditBox = this - > getEditBox ( ) ; <nl> if ( NULL ! = pEditBox & & 0 ! = pEditBox - > getScriptEditBoxHandler ( ) ) <nl> - { <nl> - cocos2d : : ScriptEngineProtocol * pEngine = cocos2d : : ScriptEngineManager : : sharedManager ( ) - > getScriptEngine ( ) ; <nl> - pEngine - > executeEvent ( pEditBox - > getScriptEditBoxHandler ( ) , " began " , pEditBox ) ; <nl> + { <nl> + CommonScriptEvent data ( pEditBox - > getScriptEditBoxHandler ( ) , " began " , pEditBox ) ; <nl> + ScriptEvent event ( cocos2d : : kCommonEvent , ( void * ) & data ) ; <nl> + ScriptEngineManager : : sharedManager ( ) - > getScriptEngine ( ) - > sendEvent ( & event ) ; <nl> } <nl> <nl> showEditTextDialogJNI ( _placeHolder . c_str ( ) , <nl> mmm a / extensions / GUI / CCEditBox / CCEditBoxImplIOS . mm <nl> ppp b / extensions / GUI / CCEditBox / CCEditBoxImplIOS . mm <nl> - ( BOOL ) textFieldShouldBeginEditing : ( UITextField * ) sender / / return NO to <nl> <nl> cocos2d : : extension : : EditBox * pEditBox = getEditBoxImplIOS ( ) - > getEditBox ( ) ; <nl> if ( NULL ! = pEditBox & & 0 ! = pEditBox - > getScriptEditBoxHandler ( ) ) <nl> - { <nl> - cocos2d : : ScriptEngineProtocol * pEngine = cocos2d : : ScriptEngineManager : : sharedManager ( ) - > getScriptEngine ( ) ; <nl> - pEngine - > executeEvent ( pEditBox - > getScriptEditBoxHandler ( ) , " began " , pEditBox ) ; <nl> + { <nl> + cocos2d : : CommonScriptEvent data ( pEditBox - > getScriptEditBoxHandler ( ) , " began " , pEditBox ) ; <nl> + cocos2d : : ScriptEvent event ( cocos2d : : kCommonEvent , ( void * ) & data ) ; <nl> + cocos2d : : ScriptEngineManager : : sharedManager ( ) - > getScriptEngine ( ) - > sendEvent ( & event ) ; <nl> } <nl> return YES ; <nl> } <nl> - ( BOOL ) textFieldShouldEndEditing : ( UITextField * ) sender <nl> cocos2d : : extension : : EditBox * pEditBox = getEditBoxImplIOS ( ) - > getEditBox ( ) ; <nl> if ( NULL ! = pEditBox & & 0 ! = pEditBox - > getScriptEditBoxHandler ( ) ) <nl> { <nl> - cocos2d : : ScriptEngineProtocol * pEngine = cocos2d : : ScriptEngineManager : : sharedManager ( ) - > getScriptEngine ( ) ; <nl> - pEngine - > executeEvent ( pEditBox - > getScriptEditBoxHandler ( ) , " ended " , pEditBox ) ; <nl> - pEngine - > executeEvent ( pEditBox - > getScriptEditBoxHandler ( ) , " return " , pEditBox ) ; <nl> + cocos2d : : CommonScriptEvent data ( pEditBox - > getScriptEditBoxHandler ( ) , " ended " , pEditBox ) ; <nl> + cocos2d : : ScriptEvent event ( cocos2d : : kCommonEvent , ( void * ) & data ) ; <nl> + cocos2d : : ScriptEngineManager : : sharedManager ( ) - > getScriptEngine ( ) - > sendEvent ( & event ) ; <nl> + memset ( data . eventName , 0 , 64 * sizeof ( char ) ) ; <nl> + strncpy ( data . eventName , " return " , 64 ) ; <nl> + event . data = ( void * ) & data ; <nl> + cocos2d : : ScriptEngineManager : : sharedManager ( ) - > getScriptEngine ( ) - > sendEvent ( & event ) ; <nl> } <nl> <nl> if ( editBox_ ! = nil ) <nl> - ( void ) textChanged <nl> cocos2d : : extension : : EditBox * pEditBox = getEditBoxImplIOS ( ) - > getEditBox ( ) ; <nl> if ( NULL ! = pEditBox & & 0 ! = pEditBox - > getScriptEditBoxHandler ( ) ) <nl> { <nl> - cocos2d : : ScriptEngineProtocol * pEngine = cocos2d : : ScriptEngineManager : : sharedManager ( ) - > getScriptEngine ( ) ; <nl> - pEngine - > executeEvent ( pEditBox - > getScriptEditBoxHandler ( ) , " changed " , pEditBox ) ; <nl> + cocos2d : : CommonScriptEvent data ( pEditBox - > getScriptEditBoxHandler ( ) , " changed " , pEditBox ) ; <nl> + cocos2d : : ScriptEvent event ( cocos2d : : kCommonEvent , ( void * ) & data ) ; <nl> + cocos2d : : ScriptEngineManager : : sharedManager ( ) - > getScriptEngine ( ) - > sendEvent ( & event ) ; <nl> } <nl> <nl> } <nl> mmm a / extensions / GUI / CCEditBox / CCEditBoxImplMac . mm <nl> ppp b / extensions / GUI / CCEditBox / CCEditBoxImplMac . mm <nl> - ( BOOL ) textFieldShouldBeginEditing : ( NSTextField * ) sender / / return NO to <nl> cocos2d : : extension : : EditBox * pEditBox = getEditBoxImplMac ( ) - > getEditBox ( ) ; <nl> if ( NULL ! = pEditBox & & 0 ! = pEditBox - > getScriptEditBoxHandler ( ) ) <nl> { <nl> - cocos2d : : ScriptEngineProtocol * pEngine = cocos2d : : ScriptEngineManager : : sharedManager ( ) - > getScriptEngine ( ) ; <nl> - pEngine - > executeEvent ( pEditBox - > getScriptEditBoxHandler ( ) , " began " , pEditBox ) ; <nl> + cocos2d : : CommonScriptEvent data ( pEditBox - > getScriptEditBoxHandler ( ) , " began " , pEditBox ) ; <nl> + cocos2d : : ScriptEvent event ( kCommonEvent , ( void * ) & data ) ; <nl> + cocos2d : : ScriptEngineManager : : sharedManager ( ) - > getScriptEngine ( ) - > sendEvent ( & event ) ; <nl> } <nl> return YES ; <nl> } <nl> - ( BOOL ) textFieldShouldEndEditing : ( NSTextField * ) sender <nl> cocos2d : : extension : : EditBox * pEditBox = getEditBoxImplMac ( ) - > getEditBox ( ) ; <nl> if ( NULL ! = pEditBox & & 0 ! = pEditBox - > getScriptEditBoxHandler ( ) ) <nl> { <nl> - cocos2d : : ScriptEngineProtocol * pEngine = cocos2d : : ScriptEngineManager : : sharedManager ( ) - > getScriptEngine ( ) ; <nl> - pEngine - > executeEvent ( pEditBox - > getScriptEditBoxHandler ( ) , " ended " , pEditBox ) ; <nl> - pEngine - > executeEvent ( pEditBox - > getScriptEditBoxHandler ( ) , " return " , pEditBox ) ; <nl> + cocos2d : : CommonScriptEvent data ( pEditBox - > getScriptEditBoxHandler ( ) , " ended " , pEditBox ) ; <nl> + cocos2d : : ScriptEvent event ( kCommonEvent , ( void * ) & data ) ; <nl> + cocos2d : : ScriptEngineManager : : sharedManager ( ) - > getScriptEngine ( ) - > sendEvent ( & event ) ; <nl> + memset ( data . eventName , 0 , 64 * sizeof ( char ) ) ; <nl> + strncpy ( data . eventName , " return " , 64 ) ; <nl> + event . data = ( void * ) & data ; <nl> + cocos2d : : ScriptEngineManager : : sharedManager ( ) - > getScriptEngine ( ) - > sendEvent ( & event ) ; <nl> } <nl> return YES ; <nl> } <nl> - ( void ) controlTextDidChange : ( NSNotification * ) notification <nl> cocos2d : : extension : : EditBox * pEditBox = getEditBoxImplMac ( ) - > getEditBox ( ) ; <nl> if ( NULL ! = pEditBox & & 0 ! = pEditBox - > getScriptEditBoxHandler ( ) ) <nl> { <nl> - cocos2d : : ScriptEngineProtocol * pEngine = cocos2d : : ScriptEngineManager : : sharedManager ( ) - > getScriptEngine ( ) ; <nl> - pEngine - > executeEvent ( pEditBox - > getScriptEditBoxHandler ( ) , " changed " , pEditBox ) ; <nl> + cocos2d : : CommonScriptEvent data ( pEditBox - > getScriptEditBoxHandler ( ) , " changed " , pEditBox ) ; <nl> + cocos2d : : ScriptEvent event ( kCommonEvent , ( void * ) & data ) ; <nl> + cocos2d : : ScriptEngineManager : : sharedManager ( ) - > getScriptEngine ( ) - > sendEvent ( & event ) ; <nl> } <nl> } <nl> <nl> mmm a / extensions / GUI / CCEditBox / CCEditBoxImplTizen . cpp <nl> ppp b / extensions / GUI / CCEditBox / CCEditBoxImplTizen . cpp <nl> static void editBoxCallbackFunc ( const char * pText , void * ctx ) <nl> <nl> EditBox * pEditBox = thiz - > getEditBox ( ) ; <nl> if ( NULL ! = pEditBox & & 0 ! = pEditBox - > getScriptEditBoxHandler ( ) ) <nl> - { <nl> - cocos2d : : ScriptEngineProtocol * pEngine = cocos2d : : ScriptEngineManager : : sharedManager ( ) - > getScriptEngine ( ) ; <nl> - pEngine - > executeEvent ( pEditBox - > getScriptEditBoxHandler ( ) , " changed " , pEditBox ) ; <nl> - pEngine - > executeEvent ( pEditBox - > getScriptEditBoxHandler ( ) , " ended " , pEditBox ) ; <nl> - pEngine - > executeEvent ( pEditBox - > getScriptEditBoxHandler ( ) , " return " , pEditBox ) ; <nl> + { <nl> + CommonScriptEvent data ( pEditBox - > getScriptEditBoxHandler ( ) , " changed " , pEditBox ) ; <nl> + ScriptEvent event ( kCommonEvent , ( void * ) & data ) ; <nl> + ScriptEngineManager : : sharedManager ( ) - > getScriptEngine ( ) - > sendEvent ( & event ) ; <nl> + memset ( data . eventName , 0 , 64 * sizeof ( char ) ) ; <nl> + strncpy ( data . eventName , " ended " , 64 ) ; <nl> + event . data = ( void * ) & data ; <nl> + ScriptEngineManager : : sharedManager ( ) - > getScriptEngine ( ) - > sendEvent ( & event ) ; <nl> + memset ( data . eventName , 0 , 64 * sizeof ( char ) ) ; <nl> + strncpy ( data . eventName , " return " , 64 ) ; <nl> + event . data = ( void * ) & data ; <nl> + ScriptEngineManager : : sharedManager ( ) - > getScriptEngine ( ) - > sendEvent ( & event ) ; <nl> } <nl> } <nl> <nl> void EditBoxImplTizen : : openKeyboard ( ) <nl> EditBox * pEditBox = this - > getEditBox ( ) ; <nl> if ( NULL ! = pEditBox & & 0 ! = pEditBox - > getScriptEditBoxHandler ( ) ) <nl> { <nl> - cocos2d : : ScriptEngineProtocol * pEngine = cocos2d : : ScriptEngineManager : : sharedManager ( ) - > getScriptEngine ( ) ; <nl> - pEngine - > executeEvent ( pEditBox - > getScriptEditBoxHandler ( ) , " began " , pEditBox ) ; <nl> + CommonScriptEvent data ( pEditBox - > getScriptEditBoxHandler ( ) , " began " , pEditBox ) ; <nl> + ScriptEvent event ( kCommonEvent , ( void * ) & data ) ; <nl> + ScriptEngineManager : : sharedManager ( ) - > getScriptEngine ( ) - > sendEvent ( & event ) ; <nl> } <nl> <nl> KeypadStyle keypadStyle = KEYPAD_STYLE_NORMAL ; <nl> mmm a / extensions / GUI / CCEditBox / CCEditBoxImplWin . cpp <nl> ppp b / extensions / GUI / CCEditBox / CCEditBoxImplWin . cpp <nl> static void editBoxCallbackFunc ( const char * pText , void * ctx ) <nl> EditBox * pEditBox = thiz - > getEditBox ( ) ; <nl> if ( NULL ! = pEditBox & & 0 ! = pEditBox - > getScriptEditBoxHandler ( ) ) <nl> { <nl> - cocos2d : : ScriptEngineProtocol * pEngine = cocos2d : : ScriptEngineManager : : sharedManager ( ) - > getScriptEngine ( ) ; <nl> - pEngine - > executeEvent ( pEditBox - > getScriptEditBoxHandler ( ) , " changed " , pEditBox ) ; <nl> - pEngine - > executeEvent ( pEditBox - > getScriptEditBoxHandler ( ) , " ended " , pEditBox ) ; <nl> - pEngine - > executeEvent ( pEditBox - > getScriptEditBoxHandler ( ) , " return " , pEditBox ) ; <nl> + CommonScriptEvent data ( pEditBox - > getScriptEditBoxHandler ( ) , " changed " , pEditBox ) ; <nl> + ScriptEvent event ( kCommonEvent , ( void * ) & data ) ; <nl> + ScriptEngineManager : : sharedManager ( ) - > getScriptEngine ( ) - > sendEvent ( & event ) ; <nl> + memset ( data . eventName , 0 , 64 * sizeof ( char ) ) ; <nl> + strncpy ( data . eventName , " ended " , 64 ) ; <nl> + event . data = ( void * ) & data ; <nl> + ScriptEngineManager : : sharedManager ( ) - > getScriptEngine ( ) - > sendEvent ( & event ) ; <nl> + memset ( data . eventName , 0 , 64 * sizeof ( char ) ) ; <nl> + strncpy ( data . eventName , " return " , 64 ) ; <nl> + event . data = ( void * ) & data ; <nl> + ScriptEngineManager : : sharedManager ( ) - > getScriptEngine ( ) - > sendEvent ( & event ) ; <nl> } <nl> } <nl> <nl> void EditBoxImplWin : : openKeyboard ( ) <nl> EditBox * pEditBox = this - > getEditBox ( ) ; <nl> if ( NULL ! = pEditBox & & 0 ! = pEditBox - > getScriptEditBoxHandler ( ) ) <nl> { <nl> - cocos2d : : ScriptEngineProtocol * pEngine = cocos2d : : ScriptEngineManager : : sharedManager ( ) - > getScriptEngine ( ) ; <nl> - pEngine - > executeEvent ( pEditBox - > getScriptEditBoxHandler ( ) , " began " , pEditBox ) ; <nl> + CommonScriptEvent data ( pEditBox - > getScriptEditBoxHandler ( ) , " began " , pEditBox ) ; <nl> + ScriptEvent event ( kCommonEvent , ( void * ) & data ) ; <nl> + ScriptEngineManager : : sharedManager ( ) - > getScriptEngine ( ) - > sendEvent ( & event ) ; <nl> } <nl> <nl> std : : string placeHolder = _labelPlaceHolder - > getString ( ) ; <nl> mmm a / scripting / lua / cocos2dx_support / CCLuaEngine . cpp <nl> ppp b / scripting / lua / cocos2dx_support / CCLuaEngine . cpp <nl> int LuaEngine : : reallocateScriptHandler ( int nHandler ) <nl> return nRet ; <nl> } <nl> <nl> - int LuaEngine : : handleEvent ( int handler , void * nativeObject , EventMessage * message ) <nl> + int LuaEngine : : sendEvent ( ScriptEvent * message , void * nativeObject ) <nl> { <nl> - if ( NULL = = nativeObject | | NULL = = message | | 0 = = handler ) <nl> + if ( NULL = = message ) <nl> return 0 ; <nl> - <nl> switch ( message - > type ) <nl> { <nl> - case ScriptEngineProtocol : : kNodeEvent : <nl> + case kNodeEvent : <nl> + { <nl> + return handleNodeEvent ( message - > data , nativeObject ) ; <nl> + } <nl> + break ; <nl> + case kMenuItemEvent : <nl> + { <nl> + return handleMenuItemEvent ( nativeObject ) ; <nl> + } <nl> + break ; <nl> + case kNotificationEvent : <nl> + { <nl> + return handleNotificationEvent ( message - > data , nativeObject ) ; <nl> + } <nl> + break ; <nl> + case kCallFuncEvent : <nl> + { <nl> + return handleCallFuncActionEvent ( message - > data , nativeObject ) ; <nl> + } <nl> + break ; <nl> + case kScheduleEvent : <nl> + { <nl> + return handleScheduler ( message - > data ) ; <nl> + } <nl> + break ; <nl> + case kLayerTouchesEvent : <nl> + { <nl> + return handleLayerTouchesEvent ( message - > data , nativeObject ) ; <nl> + } <nl> + break ; <nl> + case kLayerTouchEvent : <nl> + { <nl> + return handleLayerTouchEvent ( message - > data , nativeObject ) ; <nl> + } <nl> + break ; <nl> + case kLayerKeypadEvent : <nl> + { <nl> + return handleLayerKeypadEvent ( message - > data , nativeObject ) ; <nl> + } <nl> + break ; <nl> + case kAccelerometerEvent : <nl> { <nl> - handleNodeEvent ( nativeObject , message - > data ) ; <nl> + return handleAccelerometerEvent ( message - > data , nativeObject ) ; <nl> } <nl> break ; <nl> - case ScriptEngineProtocol : : kMenuItemEvent : <nl> + case kCommonEvent : <nl> { <nl> - handleMenuItemEvent ( nativeObject , message - > data ) ; <nl> + return handleCommonEvent ( message - > data ) ; <nl> } <nl> break ; <nl> default : <nl> int LuaEngine : : handleEvent ( int handler , void * nativeObject , EventMessage * message ) <nl> return 0 ; <nl> } <nl> <nl> - int LuaEngine : : handleNodeEvent ( void * nativeObject , void * data ) <nl> + int LuaEngine : : handleNodeEvent ( void * data , void * nativeObject ) <nl> { <nl> if ( NULL = = nativeObject | | NULL = = data ) <nl> return 0 ; <nl> <nl> Node * node = ( Node * ) ( nativeObject ) ; <nl> - if ( NULL = = node ) <nl> - return 0 ; <nl> <nl> int handler = node - > getScriptHandler ( ) ; <nl> if ( 0 = = handler ) <nl> int LuaEngine : : handleNodeEvent ( void * nativeObject , void * data ) <nl> return ret ; <nl> } <nl> <nl> - int LuaEngine : : handleMenuItemEvent ( void * nativeObject , void * data ) <nl> + int LuaEngine : : handleMenuItemEvent ( void * nativeObject ) <nl> { <nl> - if ( NULL = = nativeObject | | NULL = = data ) <nl> + if ( NULL = = nativeObject ) <nl> return 0 ; <nl> <nl> MenuItem * menuItem = ( MenuItem * ) ( nativeObject ) ; <nl> - if ( NULL = = menuItem ) <nl> - return 0 ; <nl> <nl> int handler = menuItem - > getScriptTapHandler ( ) ; <nl> if ( 0 = = handler ) <nl> int LuaEngine : : handleMenuItemEvent ( void * nativeObject , void * data ) <nl> return ret ; <nl> } <nl> <nl> + int LuaEngine : : handleNotificationEvent ( void * data , void * nativeObject ) <nl> + { <nl> + if ( NULL = = nativeObject | | NULL = = data ) <nl> + return 0 ; <nl> + <nl> + NotificationCenter * center = ( NotificationCenter * ) ( nativeObject ) ; <nl> + <nl> + int handler = center - > getObserverHandlerByName ( ( const char * ) data ) ; <nl> + <nl> + if ( 0 = = handler ) <nl> + return 0 ; <nl> + / / Be care <nl> + _stack - > pushString ( ( const char * ) data ) ; <nl> + int ret = _stack - > executeFunctionByHandler ( handler , 1 ) ; <nl> + _stack - > clean ( ) ; <nl> + return ret ; <nl> + } <nl> + <nl> + int LuaEngine : : handleCallFuncActionEvent ( void * data , void * nativeObject ) <nl> + { <nl> + if ( NULL = = nativeObject ) <nl> + return 0 ; <nl> + CallFunc * callFunc = ( CallFunc * ) nativeObject ; <nl> + int handler = callFunc - > getScriptHandler ( ) ; <nl> + Object * target = ( Object * ) data ; <nl> + if ( NULL ! = target ) <nl> + { <nl> + _stack - > pushObject ( target , " CCNode " ) ; <nl> + } <nl> + int ret = _stack - > executeFunctionByHandler ( handler , target ? 1 : 0 ) ; <nl> + _stack - > clean ( ) ; <nl> + return ret ; <nl> + } <nl> + <nl> + int LuaEngine : : handleScheduler ( void * data ) <nl> + { <nl> + if ( NULL = = data ) <nl> + return 0 ; <nl> + <nl> + SchedulerScriptEvent * schedulerInfo = ( SchedulerScriptEvent * ) data ; <nl> + <nl> + _stack - > pushFloat ( schedulerInfo - > elapse ) ; <nl> + int ret = _stack - > executeFunctionByHandler ( schedulerInfo - > handler , 1 ) ; <nl> + _stack - > clean ( ) ; <nl> + <nl> + return ret ; <nl> + } <nl> + <nl> + int LuaEngine : : handleLayerTouchesEvent ( void * data , void * nativeObject ) <nl> + { <nl> + if ( NULL = = nativeObject | | NULL = = data ) <nl> + return 0 ; <nl> + <nl> + Layer * layer = ( Layer * ) nativeObject ; <nl> + LayerTouchesScriptEvent * info = ( LayerTouchesScriptEvent * ) data ; <nl> + if ( NULL = = info - > touches ) <nl> + return 0 ; <nl> + <nl> + TouchScriptHandlerEntry * scriptHandlerEntry = layer - > getScriptTouchHandlerEntry ( ) ; <nl> + if ( NULL = = scriptHandlerEntry | | 0 = = scriptHandlerEntry - > getHandler ( ) ) <nl> + return 0 ; <nl> + switch ( info - > actionType ) <nl> + { <nl> + case CCTOUCHBEGAN : <nl> + _stack - > pushString ( " began " ) ; <nl> + break ; <nl> + <nl> + case CCTOUCHMOVED : <nl> + _stack - > pushString ( " moved " ) ; <nl> + break ; <nl> + <nl> + case CCTOUCHENDED : <nl> + _stack - > pushString ( " ended " ) ; <nl> + break ; <nl> + <nl> + case CCTOUCHCANCELLED : <nl> + _stack - > pushString ( " cancelled " ) ; <nl> + break ; <nl> + <nl> + default : <nl> + return 0 ; <nl> + } <nl> + <nl> + Director * pDirector = Director : : sharedDirector ( ) ; <nl> + lua_State * L = _stack - > getLuaState ( ) ; <nl> + lua_newtable ( L ) ; <nl> + int i = 1 ; <nl> + for ( SetIterator it = info - > touches - > begin ( ) ; it ! = info - > touches - > end ( ) ; + + it ) <nl> + { <nl> + Touch * pTouch = ( Touch * ) * it ; <nl> + Point pt = pDirector - > convertToGL ( pTouch - > getLocationInView ( ) ) ; <nl> + lua_pushnumber ( L , pt . x ) ; <nl> + lua_rawseti ( L , - 2 , i + + ) ; <nl> + lua_pushnumber ( L , pt . y ) ; <nl> + lua_rawseti ( L , - 2 , i + + ) ; <nl> + lua_pushinteger ( L , pTouch - > getID ( ) ) ; <nl> + lua_rawseti ( L , - 2 , i + + ) ; <nl> + } <nl> + int ret = _stack - > executeFunctionByHandler ( scriptHandlerEntry - > getHandler ( ) , 2 ) ; <nl> + _stack - > clean ( ) ; <nl> + return ret ; <nl> + } <nl> + <nl> + int LuaEngine : : handleLayerTouchEvent ( void * data , void * nativeObject ) <nl> + { <nl> + if ( NULL = = nativeObject | | NULL = = data ) <nl> + return 0 ; <nl> + <nl> + Layer * layer = ( Layer * ) nativeObject ; <nl> + LayerTouchScriptEvent * info = ( LayerTouchScriptEvent * ) data ; <nl> + if ( NULL = = info - > touch ) <nl> + return 0 ; <nl> + <nl> + TouchScriptHandlerEntry * scriptHandlerEntry = layer - > getScriptTouchHandlerEntry ( ) ; <nl> + if ( NULL = = scriptHandlerEntry | | 0 = = scriptHandlerEntry - > getHandler ( ) ) <nl> + return 0 ; <nl> + <nl> + <nl> + switch ( info - > actionType ) <nl> + { <nl> + case CCTOUCHBEGAN : <nl> + _stack - > pushString ( " began " ) ; <nl> + break ; <nl> + <nl> + case CCTOUCHMOVED : <nl> + _stack - > pushString ( " moved " ) ; <nl> + break ; <nl> + <nl> + case CCTOUCHENDED : <nl> + _stack - > pushString ( " ended " ) ; <nl> + break ; <nl> + <nl> + case CCTOUCHCANCELLED : <nl> + _stack - > pushString ( " cancelled " ) ; <nl> + break ; <nl> + <nl> + default : <nl> + return 0 ; <nl> + } <nl> + <nl> + const Point pt = Director : : sharedDirector ( ) - > convertToGL ( info - > touch - > getLocationInView ( ) ) ; <nl> + _stack - > pushFloat ( pt . x ) ; <nl> + _stack - > pushFloat ( pt . y ) ; <nl> + int ret = _stack - > executeFunctionByHandler ( scriptHandlerEntry - > getHandler ( ) , 3 ) ; <nl> + _stack - > clean ( ) ; <nl> + return ret ; <nl> + } <nl> + <nl> + int LuaEngine : : handleLayerKeypadEvent ( void * data , void * nativeObject ) <nl> + { <nl> + if ( NULL = = nativeObject | | NULL = = data ) <nl> + return 0 ; <nl> + <nl> + Layer * layer = ( Layer * ) ( nativeObject ) ; <nl> + ScriptHandlerEntry * pScriptHandlerEntry = layer - > getScriptKeypadHandlerEntry ( ) ; <nl> + if ( NULL = = pScriptHandlerEntry | | 0 = = pScriptHandlerEntry - > getHandler ( ) ) <nl> + return 0 ; <nl> + <nl> + int action = * ( ( int * ) ( data ) ) ; <nl> + <nl> + switch ( action ) <nl> + { <nl> + case kTypeBackClicked : <nl> + _stack - > pushString ( " backClicked " ) ; <nl> + break ; <nl> + <nl> + case kTypeMenuClicked : <nl> + _stack - > pushString ( " menuClicked " ) ; <nl> + break ; <nl> + <nl> + default : <nl> + return 0 ; <nl> + } <nl> + int ret = _stack - > executeFunctionByHandler ( pScriptHandlerEntry - > getHandler ( ) , 1 ) ; <nl> + _stack - > clean ( ) ; <nl> + return ret ; <nl> + } <nl> + <nl> + int LuaEngine : : handleAccelerometerEvent ( void * data , void * nativeObject ) <nl> + { <nl> + if ( NULL = = nativeObject | | NULL = = data ) <nl> + return 0 ; <nl> + <nl> + Layer * layer = ( Layer * ) ( nativeObject ) ; <nl> + <nl> + ScriptHandlerEntry * scriptHandlerEntry = layer - > getScriptAccelerateHandlerEntry ( ) ; <nl> + if ( NULL = = scriptHandlerEntry | | 0 = = scriptHandlerEntry - > getHandler ( ) ) <nl> + return 0 ; <nl> + <nl> + Acceleration * accelerationValue = ( Acceleration * ) data ; <nl> + _stack - > pushFloat ( accelerationValue - > x ) ; <nl> + _stack - > pushFloat ( accelerationValue - > y ) ; <nl> + _stack - > pushFloat ( accelerationValue - > z ) ; <nl> + _stack - > pushFloat ( accelerationValue - > timestamp ) ; <nl> + int ret = _stack - > executeFunctionByHandler ( scriptHandlerEntry - > getHandler ( ) , 4 ) ; <nl> + _stack - > clean ( ) ; <nl> + return ret ; <nl> + return 0 ; <nl> + } <nl> + <nl> + int LuaEngine : : handleCommonEvent ( void * data ) <nl> + { <nl> + if ( NULL = = data ) <nl> + return 0 ; <nl> + <nl> + CommonScriptEvent * commonInfo = ( CommonScriptEvent * ) data ; <nl> + if ( NULL = = commonInfo - > eventName | | 0 = = commonInfo - > handler ) <nl> + return 0 ; <nl> + <nl> + _stack - > pushString ( commonInfo - > eventName ) ; <nl> + if ( NULL ! = commonInfo - > eventSource ) <nl> + { <nl> + if ( NULL ! = commonInfo - > eventSourceClassName & & strlen ( commonInfo - > eventSourceClassName ) > 0 ) <nl> + { <nl> + _stack - > pushObject ( commonInfo - > eventSource , commonInfo - > eventSourceClassName ) ; <nl> + } <nl> + else <nl> + { <nl> + _stack - > pushObject ( commonInfo - > eventSource , " CCObject " ) ; <nl> + } <nl> + } <nl> + int ret = _stack - > executeFunctionByHandler ( commonInfo - > handler , commonInfo - > eventSource ? 2 : 1 ) ; <nl> + _stack - > clean ( ) ; <nl> + return ret ; <nl> + } <nl> + <nl> NS_CC_END <nl> mmm a / scripting / lua / cocos2dx_support / CCLuaEngine . h <nl> ppp b / scripting / lua / cocos2dx_support / CCLuaEngine . h <nl> class LuaEngine : public ScriptEngineProtocol <nl> <nl> virtual bool handleAssert ( const char * msg ) ; <nl> <nl> - virtual int handleEvent ( int handler , void * nativeObject , EventMessage * message ) ; <nl> + virtual int sendEvent ( ScriptEvent * message , void * nativeObject = NULL ) ; <nl> private : <nl> - int handleNodeEvent ( void * nativeObject , void * data ) ; <nl> - int handleMenuItemEvent ( void * nativeObject , void * data ) ; <nl> - <nl> + int handleNodeEvent ( void * data , void * nativeObject ) ; <nl> + int handleMenuItemEvent ( void * nativeObject ) ; <nl> + int handleNotificationEvent ( void * data , void * nativeObject ) ; <nl> + int handleCallFuncActionEvent ( void * data , void * nativeObject ) ; <nl> + int handleScheduler ( void * data ) ; <nl> + int handleLayerTouchesEvent ( void * data , void * nativeObject ) ; <nl> + int handleLayerTouchEvent ( void * data , void * nativeObject ) ; <nl> + int handleLayerKeypadEvent ( void * data , void * nativeObject ) ; <nl> + int handleAccelerometerEvent ( void * data , void * nativeObject ) ; <nl> + int handleCommonEvent ( void * data ) ; <nl> private : <nl> LuaEngine ( void ) <nl> : _stack ( NULL ) <nl> mmm a / scripting / lua / cocos2dx_support / LuaOpengl . cpp . REMOVED . git - id <nl> ppp b / scripting / lua / cocos2dx_support / LuaOpengl . cpp . REMOVED . git - id <nl> @ @ - 1 + 1 @ @ <nl> - fb7e01e5b657a41142a4774075e84a7436010de3 <nl> \ No newline at end of file <nl> + 014ec1c1422ae9a346307e5e2cbeeaa36b6ca7a5 <nl> \ No newline at end of file <nl> mmm a / scripting / lua / cocos2dx_support / LuaScrollView . cpp <nl> ppp b / scripting / lua / cocos2dx_support / LuaScrollView . cpp <nl> class LuaScrollView : public ScrollView , public ScrollViewDelegate <nl> if ( NULL ! = luaView ) <nl> { <nl> int nHandler = luaView - > getScriptHandler ( LuaScrollView : : kScrollViewScriptScroll ) ; <nl> - if ( - 1 ! = nHandler ) <nl> + if ( 0 ! = nHandler ) <nl> { <nl> - ScriptEngineManager : : sharedManager ( ) - > getScriptEngine ( ) - > executeEvent ( nHandler , " " ) ; <nl> + CommonScriptEvent data ( nHandler , " " ) ; <nl> + ScriptEvent event ( kCommonEvent , ( void * ) & data ) ; <nl> + ScriptEngineManager : : sharedManager ( ) - > getScriptEngine ( ) - > sendEvent ( & event ) ; <nl> } <nl> } <nl> } <nl> class LuaScrollView : public ScrollView , public ScrollViewDelegate <nl> if ( NULL ! = luaView ) <nl> { <nl> int nHandler = luaView - > getScriptHandler ( LuaScrollView : : kScrollViewScriptZoom ) ; <nl> - if ( - 1 ! = nHandler ) <nl> + if ( 0 ! = nHandler ) <nl> { <nl> - ScriptEngineManager : : sharedManager ( ) - > getScriptEngine ( ) - > executeEvent ( nHandler , " " ) ; <nl> + CommonScriptEvent data ( nHandler , " " ) ; <nl> + ScriptEvent event ( kCommonEvent , ( void * ) & data ) ; <nl> + ScriptEngineManager : : sharedManager ( ) - > getScriptEngine ( ) - > sendEvent ( & event ) ; <nl> } <nl> } <nl> } <nl> class LuaScrollView : public ScrollView , public ScrollViewDelegate <nl> <nl> if ( _mapScriptHandler . end ( ) ! = Iter ) <nl> return Iter - > second ; <nl> - return - 1 ; <nl> + return 0 ; <nl> } <nl> private : <nl> std : : map < int , int > _mapScriptHandler ; <nl> mmm a / scripting / lua / cocos2dx_support / Lua_web_socket . cpp <nl> ppp b / scripting / lua / cocos2dx_support / Lua_web_socket . cpp <nl> class LuaWebSocket : public WebSocket , public WebSocket : : Delegate <nl> if ( _mapScriptHandler . end ( ) ! = Iter ) <nl> return Iter - > second ; <nl> <nl> - return - 1 ; <nl> + return 0 ; <nl> } <nl> <nl> void InitScriptHandleMap ( ) <nl> class LuaWebSocket : public WebSocket , public WebSocket : : Delegate <nl> LuaWebSocket * luaWs = dynamic_cast < LuaWebSocket * > ( ws ) ; <nl> if ( NULL ! = luaWs ) { <nl> int nHandler = luaWs - > getScriptHandler ( LuaWebSocket : : kWebSocketScriptHandlerOpen ) ; <nl> - if ( - 1 ! = nHandler ) { <nl> - ScriptEngineManager : : sharedManager ( ) - > getScriptEngine ( ) - > executeEvent ( nHandler , " " ) ; <nl> + if ( 0 ! = nHandler ) { <nl> + CommonScriptEvent data ( nHandler , " " ) ; <nl> + ScriptEvent event ( kCommonEvent , ( void * ) & data ) ; <nl> + ScriptEngineManager : : sharedManager ( ) - > getScriptEngine ( ) - > sendEvent ( & event ) ; <nl> } <nl> } <nl> } <nl> class LuaWebSocket : public WebSocket , public WebSocket : : Delegate <nl> if ( NULL ! = luaWs ) { <nl> if ( data . isBinary ) { <nl> int nHandler = luaWs - > getScriptHandler ( LuaWebSocket : : kWebSocketScriptHandlerMessage ) ; <nl> - if ( - 1 ! = nHandler ) { <nl> + if ( 0 ! = nHandler ) { <nl> SendBinaryMessageToLua ( nHandler , ( const unsigned char * ) data . bytes , data . len ) ; <nl> } <nl> } <nl> else { <nl> <nl> int nHandler = luaWs - > getScriptHandler ( LuaWebSocket : : kWebSocketScriptHandlerMessage ) ; <nl> - if ( - 1 ! = nHandler ) { <nl> - ScriptEngineManager : : sharedManager ( ) - > getScriptEngine ( ) - > executeEvent ( nHandler , data . bytes ) ; <nl> + if ( 0 ! = nHandler ) { <nl> + CommonScriptEvent commonData ( nHandler , data . bytes ) ; <nl> + ScriptEvent event ( kCommonEvent , ( void * ) & commonData ) ; <nl> + ScriptEngineManager : : sharedManager ( ) - > getScriptEngine ( ) - > sendEvent ( & event ) ; <nl> } <nl> } <nl> } <nl> class LuaWebSocket : public WebSocket , public WebSocket : : Delegate <nl> LuaWebSocket * luaWs = dynamic_cast < LuaWebSocket * > ( ws ) ; <nl> if ( NULL ! = luaWs ) { <nl> int nHandler = luaWs - > getScriptHandler ( LuaWebSocket : : kWebSocketScriptHandlerClose ) ; <nl> - if ( - 1 ! = nHandler ) { <nl> - ScriptEngineManager : : sharedManager ( ) - > getScriptEngine ( ) - > executeEvent ( nHandler , " " ) ; <nl> + if ( 0 ! = nHandler ) <nl> + { <nl> + CommonScriptEvent data ( nHandler , " " ) ; <nl> + ScriptEvent event ( kCommonEvent , ( void * ) & data ) ; <nl> + ScriptEngineManager : : sharedManager ( ) - > getScriptEngine ( ) - > sendEvent ( & event ) ; <nl> } <nl> } <nl> } <nl> class LuaWebSocket : public WebSocket , public WebSocket : : Delegate <nl> LuaWebSocket * luaWs = dynamic_cast < LuaWebSocket * > ( ws ) ; <nl> if ( NULL ! = luaWs ) { <nl> int nHandler = luaWs - > getScriptHandler ( LuaWebSocket : : kWebSocketScriptHandlerError ) ; <nl> - if ( - 1 ! = nHandler ) { <nl> - ScriptEngineManager : : sharedManager ( ) - > getScriptEngine ( ) - > executeEvent ( nHandler , " " ) ; <nl> + if ( 0 ! = nHandler ) <nl> + { <nl> + CommonScriptEvent data ( nHandler , " " ) ; <nl> + ScriptEvent event ( kCommonEvent , ( void * ) & data ) ; <nl> + ScriptEngineManager : : sharedManager ( ) - > getScriptEngine ( ) - > sendEvent ( & event ) ; <nl> } <nl> } <nl> } <nl>
issue : make some execute funs into one funs in ScriptEngineProtocol
cocos2d/cocos2d-x
9b08cee01f004021550782fdd2865ee33d46ef53
2013-07-02T07:23:51Z
mmm a / CMakeLists . txt <nl> ppp b / CMakeLists . txt <nl> write_version ( ) <nl> set_default_configuration_release ( ) <nl> <nl> # - - Options <nl> + # # User options <nl> option ( BUILD_C_DOC " Build documentation for C APIs using Doxygen . " OFF ) <nl> option ( USE_OPENMP " Build with OpenMP support . " ON ) <nl> option ( BUILD_STATIC_LIB " Build static library " OFF ) <nl> + option ( RABIT_BUILD_MPI " Build MPI " OFF ) <nl> # # Bindings <nl> option ( JVM_BINDINGS " Build JVM bindings " OFF ) <nl> option ( R_LIB " Build shared library for R package " OFF ) <nl> address , leak , undefined and thread . " ) <nl> option ( PLUGIN_LZ4 " Build lz4 plugin " OFF ) <nl> option ( PLUGIN_DENSE_PARSER " Build dense parser plugin " OFF ) <nl> option ( PLUGIN_RMM " Build with RAPIDS Memory Manager ( RMM ) " OFF ) <nl> - # # TODO : 1 . Add check if DPC + + compiler is used for building <nl> + # # TODO : 1 . Add check if DPC + + compiler is used for building <nl> option ( PLUGIN_UPDATER_ONEAPI " DPC + + updater " OFF ) <nl> option ( ADD_PKGCONFIG " Add xgboost . pc into system . " ON ) <nl> <nl> endif ( ENABLE_ALL_WARNINGS ) <nl> target_link_libraries ( objxgboost PUBLIC dmlc ) <nl> <nl> # rabit <nl> - set ( RABIT_BUILD_DMLC OFF ) <nl> - set ( DMLC_ROOT $ { xgboost_SOURCE_DIR } / dmlc - core ) <nl> - set ( RABIT_WITH_R_LIB $ { R_LIB } ) <nl> add_subdirectory ( rabit ) <nl> <nl> if ( RABIT_MOCK ) <nl> install ( DIRECTORY $ { xgboost_SOURCE_DIR } / include / xgboost <nl> # <nl> # https : / / github . com / dmlc / xgboost / issues / 6085 <nl> if ( BUILD_STATIC_LIB ) <nl> - set ( INSTALL_TARGETS xgboost runxgboost objxgboost ) <nl> + set ( INSTALL_TARGETS xgboost runxgboost objxgboost rabit ) <nl> else ( BUILD_STATIC_LIB ) <nl> set ( INSTALL_TARGETS xgboost runxgboost ) <nl> endif ( BUILD_STATIC_LIB ) <nl> mmm a / Jenkinsfile <nl> ppp b / Jenkinsfile <nl> def BuildCPU ( ) { <nl> # We want to make sure that we use the configured header build / dmlc / build_config . h instead of include / dmlc / build_config_default . h . <nl> # See discussion at https : / / github . com / dmlc / xgboost / issues / 5510 <nl> $ { dockerRun } $ { container_type } $ { docker_binary } tests / ci_build / build_via_cmake . sh - DPLUGIN_LZ4 = ON - DPLUGIN_DENSE_PARSER = ON <nl> - $ { dockerRun } $ { container_type } $ { docker_binary } build / testxgboost <nl> + $ { dockerRun } $ { container_type } $ { docker_binary } ctest <nl> " " " <nl> / / Sanitizer test <nl> def docker_extra_params = " CI_DOCKER_EXTRA_PARAMS_INIT = ' - e ASAN_SYMBOLIZER_PATH = / usr / bin / llvm - symbolizer - e ASAN_OPTIONS = symbolize = 1 - e UBSAN_OPTIONS = print_stacktrace = 1 : log_path = ubsan_error . log - - cap - add SYS_PTRACE ' " <nl> sh " " " <nl> $ { dockerRun } $ { container_type } $ { docker_binary } tests / ci_build / build_via_cmake . sh - DUSE_SANITIZER = ON - DENABLED_SANITIZERS = " address ; leak ; undefined " \ <nl> - DCMAKE_BUILD_TYPE = Debug - DSANITIZER_PATH = / usr / lib / x86_64 - linux - gnu / <nl> - $ { docker_extra_params } $ { dockerRun } $ { container_type } $ { docker_binary } build / testxgboost <nl> + $ { docker_extra_params } $ { dockerRun } $ { container_type } $ { docker_binary } ctest <nl> " " " <nl> <nl> stash name : ' xgboost_cli ' , includes : ' xgboost ' <nl> def BuildCPUNonOmp ( ) { <nl> " " " <nl> echo " Running Non - OpenMP C + + test . . . " <nl> sh " " " <nl> - $ { dockerRun } $ { container_type } $ { docker_binary } build / testxgboost <nl> + $ { dockerRun } $ { container_type } $ { docker_binary } ctest <nl> " " " <nl> deleteDir ( ) <nl> } <nl> mmm a / rabit / CMakeLists . txt <nl> ppp b / rabit / CMakeLists . txt <nl> <nl> cmake_minimum_required ( VERSION 3 . 3 ) <nl> <nl> - project ( rabit VERSION 0 . 3 . 0 LANGUAGES CXX ) <nl> - <nl> - if ( ( $ { CMAKE_VERSION } VERSION_GREATER 3 . 13 ) OR ( $ { CMAKE_VERSION } VERSION_EQUAL 3 . 13 ) ) <nl> - # This allows user to specify ` RABIT_BUILD_DMLC ` and others as CMake variable . <nl> - cmake_policy ( SET CMP0077 NEW ) <nl> - endif ( ( $ { CMAKE_VERSION } VERSION_GREATER 3 . 13 ) OR ( $ { CMAKE_VERSION } VERSION_EQUAL 3 . 13 ) ) <nl> - <nl> - option ( RABIT_BUILD_TESTS " Build rabit tests " OFF ) <nl> - option ( RABIT_BUILD_MPI " Build MPI " OFF ) <nl> - option ( RABIT_BUILD_DMLC " Include DMLC_CORE in build " OFF ) <nl> - option ( RABIT_WITH_R_LIB " Fit the strict environment of R " OFF ) <nl> - <nl> - option ( DMLC_ROOT " Specify root of external dmlc core . " ) <nl> - # by default point to xgboost / dmlc - core <nl> - set ( DMLC_ROOT $ { CMAKE_CURRENT_LIST_DIR } / . . / dmlc - core ) <nl> - <nl> - # moved from xgboost build <nl> if ( R_LIB OR MINGW OR WIN32 ) <nl> add_library ( rabit src / engine_empty . cc src / c_api . cc ) <nl> set ( rabit_libs rabit ) <nl> set_target_properties ( rabit <nl> - PROPERTIES CXX_STANDARD 11 <nl> - CXX_STANDARD_REQUIRED ON <nl> - POSITION_INDEPENDENT_CODE ON ) <nl> + PROPERTIES CXX_STANDARD 14 <nl> + CXX_STANDARD_REQUIRED ON <nl> + POSITION_INDEPENDENT_CODE ON ) <nl> else ( ) <nl> find_package ( Threads REQUIRED ) <nl> - add_library ( rabit_empty src / engine_empty . cc src / c_api . cc ) <nl> - add_library ( rabit_base src / allreduce_base . cc src / engine_base . cc src / c_api . cc ) <nl> <nl> add_library ( rabit src / allreduce_base . cc src / allreduce_robust . cc src / engine . cc src / c_api . cc ) <nl> add_library ( rabit_mock_static src / allreduce_base . cc src / allreduce_robust . cc src / engine_mock . cc src / c_api . cc ) <nl> add_library ( rabit_mock SHARED src / allreduce_base . cc src / allreduce_robust . cc src / engine_mock . cc src / c_api . cc ) <nl> - target_link_libraries ( rabit Threads : : Threads ) <nl> - target_link_libraries ( rabit_mock_static Threads : : Threads ) <nl> - target_link_libraries ( rabit_mock Threads : : Threads ) <nl> + target_link_libraries ( rabit Threads : : Threads dmlc ) <nl> + target_link_libraries ( rabit_mock_static Threads : : Threads dmlc ) <nl> + target_link_libraries ( rabit_mock Threads : : Threads dmlc ) <nl> <nl> - set ( rabit_libs rabit rabit_base rabit_empty rabit_mock rabit_mock_static ) <nl> - set_target_properties ( rabit rabit_base rabit_empty rabit_mock rabit_mock_static <nl> - PROPERTIES CXX_STANDARD 11 <nl> + set ( rabit_libs rabit rabit_mock rabit_mock_static ) <nl> + set_target_properties ( rabit rabit_mock rabit_mock_static <nl> + PROPERTIES CXX_STANDARD 14 <nl> CXX_STANDARD_REQUIRED ON <nl> POSITION_INDEPENDENT_CODE ON ) <nl> - ENDIF ( R_LIB OR MINGW OR WIN32 ) <nl> + endif ( R_LIB OR MINGW OR WIN32 ) <nl> <nl> if ( RABIT_BUILD_MPI ) <nl> find_package ( MPI REQUIRED ) <nl> endif ( ) <nl> <nl> # place binaries and libraries according to GNU standards <nl> include ( GNUInstallDirs ) <nl> - set ( CMAKE_ARCHIVE_OUTPUT_DIRECTORY $ { CMAKE_BINARY_DIR } / $ { CMAKE_INSTALL_LIBDIR } ) <nl> - set ( CMAKE_LIBRARY_OUTPUT_DIRECTORY $ { CMAKE_BINARY_DIR } / $ { CMAKE_INSTALL_LIBDIR } ) <nl> - set ( CMAKE_RUNTIME_OUTPUT_DIRECTORY $ { CMAKE_BINARY_DIR } / $ { CMAKE_INSTALL_BINDIR } ) <nl> <nl> # we use this to get code coverage <nl> if ( ( CMAKE_CONFIGURATION_TYPES STREQUAL " Debug " ) AND ( CMAKE_CXX_COMPILER_ID MATCHES GNU ) ) <nl> if ( ( CMAKE_CONFIGURATION_TYPES STREQUAL " Debug " ) AND ( CMAKE_CXX_COMPILER_ID MATC <nl> endforeach ( ) <nl> endif ( ( CMAKE_CONFIGURATION_TYPES STREQUAL " Debug " ) AND ( CMAKE_CXX_COMPILER_ID MATCHES GNU ) ) <nl> <nl> - if ( RABIT_BUILD_DMLC ) <nl> - set ( DMLC_ROOT $ { CMAKE_CURRENT_LIST_DIR } / dmlc - core ) <nl> - endif ( ) <nl> - <nl> - if ( DMLC_ROOT ) <nl> - message ( " DMLC_ROOT point to " $ { DMLC_ROOT } ) <nl> - endif ( DMLC_ROOT ) <nl> - <nl> foreach ( lib $ { rabit_libs } ) <nl> target_include_directories ( $ { lib } PUBLIC <nl> - " $ < BUILD_INTERFACE : $ { rabit_SOURCE_DIR } / include > " <nl> - " $ < BUILD_INTERFACE : $ { DMLC_ROOT } / include > " ) <nl> + " $ < BUILD_INTERFACE : $ { xgboost_SOURCE_DIR } / rabit / include > " <nl> + " $ < BUILD_INTERFACE : $ { xgboost_SOURCE_DIR } / dmlc - core / include > " ) <nl> endforeach ( ) <nl> <nl> - if ( RABIT_BUILD_TESTS ) <nl> + if ( GOOGLE_TEST AND ( NOT WIN32 ) ) <nl> enable_testing ( ) <nl> - add_subdirectory ( $ { rabit_SOURCE_DIR } / test / cpp ) <nl> <nl> # rabit mock based integration tests <nl> list ( REMOVE_ITEM rabit_libs " rabit_mock_static " ) # remove here to avoid installing it <nl> if ( RABIT_BUILD_TESTS ) <nl> foreach ( test $ { tests } ) <nl> add_executable ( $ { test } test / $ { test } . cc ) <nl> target_link_libraries ( $ { test } rabit_mock_static ) <nl> - set_target_properties ( $ { test } PROPERTIES CXX_STANDARD 11 CXX_STANDARD_REQUIRED ON ) <nl> - install ( TARGETS $ { test } DESTINATION test ) # Why are we installing these ? ? <nl> + set_target_properties ( $ { test } PROPERTIES CXX_STANDARD 14 CXX_STANDARD_REQUIRED ON ) <nl> + add_test ( NAME $ { test } COMMAND $ { test } WORKING_DIRECTORY $ { xgboost_BINARY_DIR } ) <nl> endforeach ( ) <nl> <nl> if ( RABIT_BUILD_MPI ) <nl> add_executable ( speed_test_mpi test / speed_test . cc ) <nl> target_link_libraries ( speed_test_mpi rabit_mpi ) <nl> - install ( TARGETS speed_test_mpi DESTINATION test ) <nl> - endif ( ) <nl> - endif ( RABIT_BUILD_TESTS ) <nl> - <nl> - # Installation ( https : / / github . com / forexample / package - example ) { <nl> - <nl> - # Layout . This works for all platforms : <nl> - # * < prefix > / lib / cmake / < PROJECT - NAME > <nl> - # * < prefix > / lib / <nl> - # * < prefix > / include / <nl> - set ( CMAKE_INSTALL_PREFIX " $ { rabit_SOURCE_DIR } " ) <nl> - set ( config_install_dir " lib / cmake / $ { PROJECT_NAME } " ) <nl> - set ( include_install_dir " include " ) <nl> - <nl> - set ( generated_dir " $ { CMAKE_CURRENT_BINARY_DIR } / generated " ) <nl> - <nl> - # Configuration <nl> - set ( version_config " $ { generated_dir } / $ { PROJECT_NAME } ConfigVersion . cmake " ) <nl> - set ( project_config " $ { generated_dir } / $ { PROJECT_NAME } Config . cmake " ) <nl> - set ( TARGETS_EXPORT_NAME " $ { PROJECT_NAME } Targets " ) <nl> - set ( namespace " $ { PROJECT_NAME } : : " ) <nl> - <nl> - # Include module with fuction ' write_basic_package_version_file ' <nl> - include ( CMakePackageConfigHelpers ) <nl> - <nl> - # Configure ' < PROJECT - NAME > ConfigVersion . cmake ' <nl> - # Use : <nl> - # * PROJECT_VERSION <nl> - write_basic_package_version_file ( <nl> - " $ { version_config } " COMPATIBILITY SameMajorVersion <nl> - ) <nl> - <nl> - # Configure ' < PROJECT - NAME > Config . cmake ' <nl> - # Use variables : <nl> - # * TARGETS_EXPORT_NAME <nl> - # * PROJECT_NAME <nl> - configure_package_config_file ( <nl> - " cmake / Config . cmake . in " <nl> - " $ { project_config } " <nl> - INSTALL_DESTINATION " $ { config_install_dir } " <nl> - ) <nl> - <nl> - # Targets : <nl> - # * < prefix > / lib / librabit . a <nl> - # * < prefix > / lib / librabit_base <nl> - # * < prefix > / lib / librabit_empty <nl> - # * header location after install : < prefix > / include / rabit / rabit . h <nl> - # * headers can be included by C + + code ` # include < rabit / rabit . h > ` <nl> - install ( <nl> - TARGETS $ { rabit_libs } <nl> - EXPORT " $ { TARGETS_EXPORT_NAME } " <nl> - LIBRARY DESTINATION " lib " <nl> - ARCHIVE DESTINATION " lib " <nl> - RUNTIME DESTINATION " bin " <nl> - INCLUDES DESTINATION " $ { include_install_dir } " <nl> - ) <nl> + add_test ( NAME speed_test_mpi COMMAND speed_test_mpi WORKING_DIRECTORY $ { xgboost_BINARY_DIR } ) <nl> + endif ( RABIT_BUILD_MPI ) <nl> + endif ( GOOGLE_TEST AND ( NOT WIN32 ) ) <nl> <nl> # Headers : <nl> + set ( include_install_dir " include " ) <nl> install ( <nl> - DIRECTORY " include / " <nl> - DESTINATION " $ { include_install_dir } " <nl> - FILES_MATCHING PATTERN " * . h " <nl> - ) <nl> - <nl> - # Config <nl> - # * < prefix > / lib / cmake / rabit / rabitConfig . cmake <nl> - # * < prefix > / lib / cmake / rabit / rabitConfigVersion . cmake <nl> - install ( <nl> - FILES " $ { project_config } " " $ { version_config } " <nl> - DESTINATION " $ { config_install_dir } " <nl> - ) <nl> - <nl> - # Config <nl> - # * < prefix > / lib / cmake / Foo / FooTargets . cmake <nl> - install ( <nl> - EXPORT " $ { TARGETS_EXPORT_NAME } " <nl> - NAMESPACE " $ { namespace } " <nl> - DESTINATION " $ { config_install_dir } " <nl> - ) <nl> - # } <nl> + DIRECTORY " include / " <nl> + DESTINATION " $ { include_install_dir } " <nl> + FILES_MATCHING PATTERN " * . h " <nl> + ) <nl> deleted file mode 100644 <nl> index 9216d080ce . . 0000000000 <nl> mmm a / rabit / test / cpp / CMakeLists . txt <nl> ppp / dev / null <nl> <nl> - find_package ( GTest REQUIRED ) <nl> - <nl> - add_executable ( <nl> - unit_tests <nl> - test_io . cc <nl> - test_utils . cc <nl> - allreduce_robust_test . cc <nl> - allreduce_base_test . cc <nl> - allreduce_mock_test . cc <nl> - test_main . cpp ) <nl> - <nl> - target_link_libraries ( <nl> - unit_tests PRIVATE <nl> - GTest : : GTest GTest : : Main <nl> - rabit_base rabit_mock rabit ) <nl> - <nl> - target_include_directories ( unit_tests PUBLIC <nl> - " $ < BUILD_INTERFACE : $ { rabit_SOURCE_DIR } / include > " <nl> - " $ < BUILD_INTERFACE : $ { DMLC_ROOT } / include > " ) <nl> - <nl> - set_target_properties ( unit_tests <nl> - PROPERTIES <nl> - CXX_STANDARD 11 <nl> - CXX_STANDARD_REQUIRED ON <nl> - RUNTIME_OUTPUT_DIRECTORY $ { rabit_BINARY_DIR } <nl> - RUNTIME_OUTPUT_DIRECTORY_DEBUG $ { rabit_BINARY_DIR } <nl> - RUNTIME_OUTPUT_DIRECTORY_RELEASE $ { rabit_BINARY_DIR } ) <nl> - <nl> - add_test ( <nl> - NAME TestRabitLib <nl> - COMMAND unit_tests <nl> - WORKING_DIRECTORY $ { rabit_BINARY_DIR } ) <nl> deleted file mode 100644 <nl> index 9962980c21 . . 0000000000 <nl> mmm a / rabit / test / cpp / README . md <nl> ppp / dev / null <nl> @ @ - 1 + 0 , 0 @ @ <nl> - Unittests for Rabit <nl> deleted file mode 100644 <nl> index 65a3dd50b9 . . 0000000000 <nl> mmm a / rabit / test / cpp / allreduce_base_test . cpp <nl> ppp / dev / null <nl> <nl> - # define RABIT_CXXTESTDEFS_H <nl> - # include < gtest / gtest . h > <nl> - <nl> - # include < string > <nl> - # include < iostream > <nl> - # include " . . / . . / src / allreduce_base . h " <nl> - <nl> - TEST ( allreduce_base , init_task ) <nl> - { <nl> - rabit : : engine : : AllreduceBase base ; <nl> - <nl> - std : : string rabit_task_id = " rabit_task_id = 1 " ; <nl> - char cmd [ rabit_task_id . size ( ) + 1 ] ; <nl> - std : : copy ( rabit_task_id . begin ( ) , rabit_task_id . end ( ) , cmd ) ; <nl> - cmd [ rabit_task_id . size ( ) ] = ' \ 0 ' ; <nl> - <nl> - char * argv [ ] = { cmd } ; <nl> - base . Init ( 1 , argv ) ; <nl> - EXPECT_EQ ( base . task_id , " 1 " ) ; <nl> - } <nl> - <nl> - TEST ( allreduce_base , init_with_cache_on ) <nl> - { <nl> - rabit : : engine : : AllreduceBase base ; <nl> - <nl> - std : : string rabit_task_id = " rabit_task_id = 1 " ; <nl> - char cmd [ rabit_task_id . size ( ) + 1 ] ; <nl> - std : : copy ( rabit_task_id . begin ( ) , rabit_task_id . end ( ) , cmd ) ; <nl> - cmd [ rabit_task_id . size ( ) ] = ' \ 0 ' ; <nl> - <nl> - std : : string rabit_bootstrap_cache = " rabit_bootstrap_cache = 1 " ; <nl> - char cmd2 [ rabit_bootstrap_cache . size ( ) + 1 ] ; <nl> - std : : copy ( rabit_bootstrap_cache . begin ( ) , rabit_bootstrap_cache . end ( ) , cmd2 ) ; <nl> - cmd2 [ rabit_bootstrap_cache . size ( ) ] = ' \ 0 ' ; <nl> - <nl> - std : : string rabit_debug = " rabit_debug = 1 " ; <nl> - char cmd3 [ rabit_debug . size ( ) + 1 ] ; <nl> - std : : copy ( rabit_debug . begin ( ) , rabit_debug . end ( ) , cmd3 ) ; <nl> - cmd3 [ rabit_debug . size ( ) ] = ' \ 0 ' ; <nl> - <nl> - char * argv [ ] = { cmd , cmd2 , cmd3 } ; <nl> - base . Init ( 3 , argv ) ; <nl> - EXPECT_EQ ( base . task_id , " 1 " ) ; <nl> - EXPECT_EQ ( base . rabit_bootstrap_cache , 1 ) ; <nl> - EXPECT_EQ ( base . rabit_debug , 1 ) ; <nl> - } <nl> - <nl> - TEST ( allreduce_base , init_with_ring_reduce ) <nl> - { <nl> - rabit : : engine : : AllreduceBase base ; <nl> - <nl> - std : : string rabit_task_id = " rabit_task_id = 1 " ; <nl> - char cmd [ rabit_task_id . size ( ) + 1 ] ; <nl> - std : : copy ( rabit_task_id . begin ( ) , rabit_task_id . end ( ) , cmd ) ; <nl> - cmd [ rabit_task_id . size ( ) ] = ' \ 0 ' ; <nl> - <nl> - std : : string rabit_reduce_ring_mincount = " rabit_reduce_ring_mincount = 1 " ; <nl> - char cmd2 [ rabit_reduce_ring_mincount . size ( ) + 1 ] ; <nl> - std : : copy ( rabit_reduce_ring_mincount . begin ( ) , rabit_reduce_ring_mincount . end ( ) , cmd2 ) ; <nl> - cmd2 [ rabit_reduce_ring_mincount . size ( ) ] = ' \ 0 ' ; <nl> - <nl> - char * argv [ ] = { cmd , cmd2 } ; <nl> - base . Init ( 2 , argv ) ; <nl> - EXPECT_EQ ( base . task_id , " 1 " ) ; <nl> - EXPECT_EQ ( base . reduce_ring_mincount , 1 ) ; <nl> - } <nl> deleted file mode 100644 <nl> index 5d03dc71a9 . . 0000000000 <nl> mmm a / rabit / test / cpp / allreduce_mock_test . cc <nl> ppp / dev / null <nl> <nl> - # define RABIT_CXXTESTDEFS_H <nl> - # include < gtest / gtest . h > <nl> - <nl> - # include < string > <nl> - # include < iostream > <nl> - # include " . . / . . / src / allreduce_mock . h " <nl> - <nl> - TEST ( allreduce_mock , mock_allreduce ) <nl> - { <nl> - rabit : : engine : : AllreduceMock m ; <nl> - <nl> - std : : string mock_str = " mock = 0 , 0 , 0 , 0 " ; <nl> - char cmd [ mock_str . size ( ) + 1 ] ; <nl> - std : : copy ( mock_str . begin ( ) , mock_str . end ( ) , cmd ) ; <nl> - cmd [ mock_str . size ( ) ] = ' \ 0 ' ; <nl> - <nl> - char * argv [ ] = { cmd } ; <nl> - m . Init ( 1 , argv ) ; <nl> - m . rank = 0 ; <nl> - EXPECT_THROW ( m . Allreduce ( nullptr , 0 , 0 , nullptr , nullptr , nullptr ) , dmlc : : Error ) ; <nl> - } <nl> - <nl> - TEST ( allreduce_mock , mock_broadcast ) <nl> - { <nl> - rabit : : engine : : AllreduceMock m ; <nl> - std : : string mock_str = " mock = 0 , 1 , 2 , 0 " ; <nl> - char cmd [ mock_str . size ( ) + 1 ] ; <nl> - std : : copy ( mock_str . begin ( ) , mock_str . end ( ) , cmd ) ; <nl> - cmd [ mock_str . size ( ) ] = ' \ 0 ' ; <nl> - char * argv [ ] = { cmd } ; <nl> - m . Init ( 1 , argv ) ; <nl> - m . rank = 0 ; <nl> - m . version_number = 1 ; <nl> - m . seq_counter = 2 ; <nl> - EXPECT_THROW ( m . Broadcast ( nullptr , 0 , 0 ) , dmlc : : Error ) ; <nl> - } <nl> deleted file mode 100644 <nl> index 6eb025ac93 . . 0000000000 <nl> mmm a / rabit / test / cpp / test_main . cpp <nl> ppp / dev / null <nl> <nl> - # include " gtest / gtest . h " <nl> - <nl> - int main ( int argc , char * * argv ) <nl> - { <nl> - : : testing : : InitGoogleTest ( & argc , argv ) ; <nl> - : : testing : : FLAGS_gtest_death_test_style = " threadsafe " ; <nl> - return RUN_ALL_TESTS ( ) ; <nl> - } <nl> similarity index 85 % <nl> rename from rabit / test / cpp / allreduce_base_test . cc <nl> rename to tests / cpp / rabit / allreduce_base_test . cc <nl> mmm a / rabit / test / cpp / allreduce_base_test . cc <nl> ppp b / tests / cpp / rabit / allreduce_base_test . cc <nl> <nl> # define RABIT_CXXTESTDEFS_H <nl> + # if ! defined ( _WIN32 ) <nl> # include < gtest / gtest . h > <nl> <nl> # include < string > <nl> # include < iostream > <nl> - # include " . . / . . / src / allreduce_base . h " <nl> + # include " . . / . . / . . / rabit / src / allreduce_base . h " <nl> <nl> - TEST ( allreduce_base , init_task ) <nl> + TEST ( AllreduceBase , InitTask ) <nl> { <nl> rabit : : engine : : AllreduceBase base ; <nl> <nl> TEST ( allreduce_base , init_task ) <nl> EXPECT_EQ ( base . task_id , " 1 " ) ; <nl> } <nl> <nl> - TEST ( allreduce_base , init_with_cache_on ) <nl> + TEST ( AllreduceBase , InitWithCacheOn ) <nl> { <nl> rabit : : engine : : AllreduceBase base ; <nl> <nl> TEST ( allreduce_base , init_with_cache_on ) <nl> char * argv [ ] = { cmd , cmd2 , cmd3 } ; <nl> base . Init ( 3 , argv ) ; <nl> EXPECT_EQ ( base . task_id , " 1 " ) ; <nl> - EXPECT_EQ ( base . rabit_bootstrap_cache , 1 ) ; <nl> + EXPECT_TRUE ( base . rabit_bootstrap_cache ) ; <nl> EXPECT_EQ ( base . rabit_debug , 1 ) ; <nl> } <nl> <nl> - TEST ( allreduce_base , init_with_ring_reduce ) <nl> + TEST ( AllreduceBase , InitWithRingReduce ) <nl> { <nl> rabit : : engine : : AllreduceBase base ; <nl> <nl> TEST ( allreduce_base , init_with_ring_reduce ) <nl> char * argv [ ] = { cmd , cmd2 } ; <nl> base . Init ( 2 , argv ) ; <nl> EXPECT_EQ ( base . task_id , " 1 " ) ; <nl> - EXPECT_EQ ( base . reduce_ring_mincount , 1 ) ; <nl> + EXPECT_EQ ( base . reduce_ring_mincount , 1ul ) ; <nl> } <nl> + # endif / / ! defined ( _WIN32 ) <nl> similarity index 74 % <nl> rename from rabit / test / cpp / allreduce_mock_test . cpp <nl> rename to tests / cpp / rabit / allreduce_mock_test . cc <nl> mmm a / rabit / test / cpp / allreduce_mock_test . cpp <nl> ppp b / tests / cpp / rabit / allreduce_mock_test . cc <nl> <nl> # define RABIT_CXXTESTDEFS_H <nl> + # if ! defined ( _WIN32 ) <nl> # include < gtest / gtest . h > <nl> <nl> # include < string > <nl> # include < iostream > <nl> - # include < dmlc / logging . h > <nl> - # include " . . / . . / src / allreduce_mock . h " <nl> + # include " . . / . . / . . / rabit / src / allreduce_mock . h " <nl> <nl> - TEST ( allreduce_mock , mock_allreduce ) <nl> + TEST ( AllreduceMock , MockAllreduce ) <nl> { <nl> rabit : : engine : : AllreduceMock m ; <nl> <nl> TEST ( allreduce_mock , mock_allreduce ) <nl> char * argv [ ] = { cmd } ; <nl> m . Init ( 1 , argv ) ; <nl> m . rank = 0 ; <nl> - EXPECT_THROW ( { m . Allreduce ( nullptr , 0 , 0 , nullptr , nullptr , nullptr ) ; } , dmlc : : Error ) ; <nl> + EXPECT_THROW ( m . Allreduce ( nullptr , 0 , 0 , nullptr , nullptr , nullptr ) , dmlc : : Error ) ; <nl> } <nl> <nl> - TEST ( allreduce_mock , mock_broadcast ) <nl> + TEST ( AllreduceMock , MockBroadcast ) <nl> { <nl> rabit : : engine : : AllreduceMock m ; <nl> std : : string mock_str = " mock = 0 , 1 , 2 , 0 " ; <nl> TEST ( allreduce_mock , mock_broadcast ) <nl> m . rank = 0 ; <nl> m . version_number = 1 ; <nl> m . seq_counter = 2 ; <nl> - EXPECT_THROW ( { m . Broadcast ( nullptr , 0 , 0 ) ; } , dmlc : : Error ) ; <nl> + EXPECT_THROW ( m . Broadcast ( nullptr , 0 , 0 ) , dmlc : : Error ) ; <nl> } <nl> <nl> - TEST ( allreduce_mock , mock_gather ) <nl> + TEST ( AllreduceMock , MockGather ) <nl> { <nl> rabit : : engine : : AllreduceMock m ; <nl> std : : string mock_str = " mock = 3 , 13 , 22 , 0 " ; <nl> TEST ( allreduce_mock , mock_gather ) <nl> m . seq_counter = 22 ; <nl> EXPECT_THROW ( { m . Allgather ( nullptr , 0 , 0 , 0 , 0 ) ; } , dmlc : : Error ) ; <nl> } <nl> + # endif / / ! defined ( _WIN32 ) <nl> similarity index 85 % <nl> rename from rabit / test / cpp / allreduce_robust_test . cc <nl> rename to tests / cpp / rabit / allreduce_robust_test . cc <nl> mmm a / rabit / test / cpp / allreduce_robust_test . cc <nl> ppp b / tests / cpp / rabit / allreduce_robust_test . cc <nl> <nl> # define RABIT_CXXTESTDEFS_H <nl> + # if ! defined ( _WIN32 ) <nl> # include < gtest / gtest . h > <nl> <nl> # include < chrono > <nl> # include < string > <nl> # include < iostream > <nl> - # include " . . / . . / src / allreduce_robust . h " <nl> + # include " . . / . . / . . / rabit / src / allreduce_robust . h " <nl> <nl> - inline void mockerr ( const char * fmt , . . . ) { EXPECT_STRCASEEQ ( fmt , " [ % d ] exit due to time out % d s \ n " ) ; } <nl> - inline void mockassert ( bool val , const char * fmt , . . . ) { } <nl> + inline void MockErr ( const char * fmt , . . . ) { EXPECT_STRCASEEQ ( fmt , " [ % d ] exit due to time out % d s \ n " ) ; } <nl> + inline void MockAssert ( bool val , const char * fmt , . . . ) { } <nl> rabit : : engine : : AllreduceRobust : : ReturnType err_type ( rabit : : engine : : AllreduceRobust : : ReturnTypeEnum : : kSockError ) ; <nl> rabit : : engine : : AllreduceRobust : : ReturnType succ_type ( rabit : : engine : : AllreduceRobust : : ReturnTypeEnum : : kSuccess ) ; <nl> <nl> - TEST ( allreduce_robust , sync_error_timeout ) <nl> + TEST ( AllreduceRobust , SyncErrorTimeout ) <nl> { <nl> rabit : : engine : : AllreduceRobust m ; <nl> <nl> TEST ( allreduce_robust , sync_error_timeout ) <nl> char * argv [ ] = { cmd , cmd1 } ; <nl> m . Init ( 2 , argv ) ; <nl> m . rank = 0 ; <nl> - m . rabit_bootstrap_cache = 1 ; <nl> - m . _error = mockerr ; <nl> - m . _assert = mockassert ; <nl> + m . rabit_bootstrap_cache = true ; <nl> + m . error_ = MockErr ; <nl> + m . assert_ = MockAssert ; <nl> EXPECT_EQ ( m . CheckAndRecover ( err_type ) , false ) ; <nl> std : : this_thread : : sleep_for ( std : : chrono : : milliseconds ( 1500 ) ) ; <nl> - EXPECT_EQ ( m . rabit_timeout_task . get ( ) , false ) ; <nl> + EXPECT_EQ ( m . rabit_timeout_task_ . get ( ) , false ) ; <nl> } <nl> <nl> - TEST ( allreduce_robust , sync_error_reset ) <nl> + TEST ( AllreduceRobust , SyncErrorReset ) <nl> { <nl> rabit : : engine : : AllreduceRobust m ; <nl> <nl> TEST ( allreduce_robust , sync_error_reset ) <nl> char * argv [ ] = { cmd , cmd1 , cmd2 } ; <nl> m . Init ( 3 , argv ) ; <nl> m . rank = 0 ; <nl> - m . _assert = mockassert ; <nl> + m . assert_ = MockAssert ; <nl> EXPECT_EQ ( m . CheckAndRecover ( err_type ) , false ) ; <nl> std : : this_thread : : sleep_for ( std : : chrono : : milliseconds ( 100 ) ) ; <nl> EXPECT_EQ ( m . CheckAndRecover ( succ_type ) , true ) ; <nl> - EXPECT_EQ ( m . rabit_timeout_task . get ( ) , true ) ; <nl> + EXPECT_EQ ( m . rabit_timeout_task_ . get ( ) , true ) ; <nl> m . Shutdown ( ) ; <nl> } <nl> <nl> - TEST ( allreduce_robust , sync_success_error_timeout ) <nl> + TEST ( AllreduceRobust , SyncSuccessErrorTimeout ) <nl> { <nl> rabit : : engine : : AllreduceRobust m ; <nl> <nl> TEST ( allreduce_robust , sync_success_error_timeout ) <nl> char * argv [ ] = { cmd , cmd1 , cmd2 } ; <nl> m . Init ( 3 , argv ) ; <nl> m . rank = 0 ; <nl> - m . rabit_bootstrap_cache = 1 ; <nl> - m . _assert = mockassert ; <nl> - m . _error = mockerr ; <nl> + m . rabit_bootstrap_cache = true ; <nl> + m . assert_ = MockAssert ; <nl> + m . error_ = MockErr ; <nl> EXPECT_EQ ( m . CheckAndRecover ( succ_type ) , true ) ; <nl> std : : this_thread : : sleep_for ( std : : chrono : : milliseconds ( 100 ) ) ; <nl> EXPECT_EQ ( m . CheckAndRecover ( err_type ) , false ) ; <nl> std : : this_thread : : sleep_for ( std : : chrono : : milliseconds ( 1500 ) ) ; <nl> - EXPECT_EQ ( m . rabit_timeout_task . get ( ) , false ) ; <nl> + EXPECT_EQ ( m . rabit_timeout_task_ . get ( ) , false ) ; <nl> } <nl> <nl> - TEST ( allreduce_robust , sync_success_error_success ) <nl> + TEST ( AllreduceRobust , SyncSuccessErrorSuccess ) <nl> { <nl> rabit : : engine : : AllreduceRobust m ; <nl> <nl> TEST ( allreduce_robust , sync_success_error_success ) <nl> char * argv [ ] = { cmd , cmd1 , cmd2 } ; <nl> m . Init ( 3 , argv ) ; <nl> m . rank = 0 ; <nl> - m . rabit_bootstrap_cache = 1 ; <nl> - m . _assert = mockassert ; <nl> + m . rabit_bootstrap_cache = true ; <nl> + m . assert_ = MockAssert ; <nl> EXPECT_EQ ( m . CheckAndRecover ( succ_type ) , true ) ; <nl> std : : this_thread : : sleep_for ( std : : chrono : : milliseconds ( 10 ) ) ; <nl> <nl> TEST ( allreduce_robust , sync_success_error_success ) <nl> std : : this_thread : : sleep_for ( std : : chrono : : milliseconds ( 10 ) ) ; <nl> EXPECT_EQ ( m . CheckAndRecover ( succ_type ) , true ) ; <nl> std : : this_thread : : sleep_for ( std : : chrono : : milliseconds ( 1100 ) ) ; <nl> - EXPECT_EQ ( m . rabit_timeout_task . get ( ) , true ) ; <nl> + EXPECT_EQ ( m . rabit_timeout_task_ . get ( ) , true ) ; <nl> m . Shutdown ( ) ; <nl> } <nl> <nl> - TEST ( allreduce_robust , sync_error_no_reset_timeout ) <nl> + TEST ( AllreduceRobust , SyncErrorNoResetTimeout ) <nl> { <nl> rabit : : engine : : AllreduceRobust m ; <nl> <nl> TEST ( allreduce_robust , sync_error_no_reset_timeout ) <nl> char * argv [ ] = { cmd , cmd1 , cmd2 } ; <nl> m . Init ( 3 , argv ) ; <nl> m . rank = 0 ; <nl> - m . rabit_bootstrap_cache = 1 ; <nl> - m . _assert = mockassert ; <nl> - m . _error = mockerr ; <nl> + m . rabit_bootstrap_cache = true ; <nl> + m . assert_ = MockAssert ; <nl> + m . error_ = MockErr ; <nl> auto start = std : : chrono : : system_clock : : now ( ) ; <nl> <nl> EXPECT_EQ ( m . CheckAndRecover ( err_type ) , false ) ; <nl> TEST ( allreduce_robust , sync_error_no_reset_timeout ) <nl> <nl> EXPECT_EQ ( m . CheckAndRecover ( err_type ) , false ) ; <nl> <nl> - m . rabit_timeout_task . wait ( ) ; <nl> + m . rabit_timeout_task_ . wait ( ) ; <nl> auto end = std : : chrono : : system_clock : : now ( ) ; <nl> std : : chrono : : duration < double > diff = end - start ; <nl> <nl> - EXPECT_EQ ( m . rabit_timeout_task . get ( ) , false ) ; <nl> + EXPECT_EQ ( m . rabit_timeout_task_ . get ( ) , false ) ; <nl> / / expect second error don ' t overwrite / reset timeout task <nl> EXPECT_LT ( diff . count ( ) , 2 ) ; <nl> } <nl> <nl> - TEST ( allreduce_robust , no_timeout_shut_down ) <nl> + TEST ( AllreduceRobust , NoTimeoutShutDown ) <nl> { <nl> rabit : : engine : : AllreduceRobust m ; <nl> <nl> TEST ( allreduce_robust , no_timeout_shut_down ) <nl> m . Shutdown ( ) ; <nl> } <nl> <nl> - TEST ( allreduce_robust , shut_down_before_timeout ) <nl> + TEST ( AllreduceRobust , ShutDownBeforeTimeout ) <nl> { <nl> rabit : : engine : : AllreduceRobust m ; <nl> <nl> TEST ( allreduce_robust , shut_down_before_timeout ) <nl> m . rank = 0 ; <nl> rabit : : engine : : AllreduceRobust : : LinkRecord a ; <nl> m . err_link = & a ; <nl> - <nl> + <nl> EXPECT_EQ ( m . CheckAndRecover ( err_type ) , false ) ; <nl> std : : this_thread : : sleep_for ( std : : chrono : : milliseconds ( 10 ) ) ; <nl> m . Shutdown ( ) ; <nl> - } <nl> \ No newline at end of file <nl> + } <nl> + # endif / / ! defined ( _WIN32 ) <nl> similarity index 88 % <nl> rename from rabit / test / cpp / test_io . cc <nl> rename to tests / cpp / rabit / test_io . cc <nl> mmm a / rabit / test / cpp / test_io . cc <nl> ppp b / tests / cpp / rabit / test_io . cc <nl> TEST ( MemoryFixSizeBuffer , Seek ) { <nl> size_t constexpr kSize { 64 } ; <nl> std : : vector < int32_t > memory ( kSize ) ; <nl> utils : : MemoryFixSizeBuffer buf ( memory . data ( ) , memory . size ( ) ) ; <nl> - buf . Seek ( utils : : MemoryFixSizeBuffer : : SeekEnd ) ; <nl> + buf . Seek ( utils : : MemoryFixSizeBuffer : : kSeekEnd ) ; <nl> size_t end = buf . Tell ( ) ; <nl> ASSERT_EQ ( end , kSize ) ; <nl> } <nl> similarity index 100 % <nl> rename from rabit / test / cpp / test_utils . cc <nl> rename to tests / cpp / rabit / test_utils . cc <nl>
Refactor rabit tests ( )
dmlc/xgboost
3dcd85fab5a6d068141260548872e7107be9730c
2020-09-09T04:30:29Z
mmm a / src / regexp / regexp - parser . cc <nl> ppp b / src / regexp / regexp - parser . cc <nl> void RegExpParser : : ScanForCaptures ( ) { <nl> if ( current ( ) ! = ' < ' ) break ; <nl> <nl> if ( FLAG_harmony_regexp_lookbehind ) { <nl> - / / TODO ( jgruber ) : To be more future - proof we could test for <nl> - / / IdentifierStart here once it becomes clear whether group names <nl> - / / allow unicode escapes . <nl> - / / https : / / github . com / tc39 / proposal - regexp - named - groups / issues / 23 <nl> Advance ( ) ; <nl> if ( current ( ) = = ' = ' | | current ( ) = = ' ! ' ) break ; <nl> } <nl> const ZoneVector < uc16 > * RegExpParser : : ParseCaptureGroupName ( ) { <nl> <nl> / / Convert unicode escapes . <nl> if ( c = = ' \ \ ' & & current ( ) = = ' u ' ) { <nl> - / / TODO ( jgruber ) : Reconsider this once the spec has settled . <nl> - / / https : / / github . com / tc39 / proposal - regexp - named - groups / issues / 23 <nl> Advance ( scan_mode ) ; <nl> if ( ! ParseUnicodeEscape ( & c ) ) { <nl> ReportError ( CStrVector ( " Invalid Unicode escape sequence " ) ) ; <nl> mmm a / test / mjsunit / harmony / regexp - named - captures . js <nl> ppp b / test / mjsunit / harmony / regexp - named - captures . js <nl> assertThrows ( " / \ \ 1 ( ? < = a ) . / u " , SyntaxError ) ; <nl> assertThrows ( " / \ \ 1 ( ? < ! a ) . / u " , SyntaxError ) ; <nl> assertEquals ( [ " a " , " a " ] , / \ 1 ( ? < a > . ) / u . exec ( " abcd " ) ) ; <nl> <nl> + / / Unicode escapes in capture names . <nl> + assertTrue ( / ( ? < a \ uD801 \ uDCA4 > . ) / u . test ( " a " ) ) ; / / \ u Lead \ u Trail <nl> + assertThrows ( " / ( ? < a \ \ uD801 > . ) / u " , SyntaxError ) ; / / \ u Lead <nl> + assertThrows ( " / ( ? < a \ \ uDCA4 > . ) / u " , SyntaxError ) ; / / \ u Trail <nl> + assertTrue ( / ( ? < \ u0041 > . ) / u . test ( " a " ) ) ; / / \ u NonSurrogate <nl> + assertTrue ( / ( ? < \ u { 0041 } > . ) / u . test ( " a " ) ) ; / / \ u { Non - surrogate } <nl> + assertTrue ( / ( ? < a \ u { 104A4 } > . ) / u . test ( " a " ) ) ; / / \ u { Surrogate , ID_Continue } <nl> + assertThrows ( " / ( ? < a \ \ u { 110000 } > . ) / u " , SyntaxError ) ; / / \ u { Out - of - bounds } <nl> + assertThrows ( " / ( ? < a \ uD801 > . ) / u " , SyntaxError ) ; / / Lead <nl> + assertThrows ( " / ( ? < a \ uDCA4 > . ) / u " , SyntaxError ) ; / / Trail <nl> + assertTrue ( RegExp ( " ( ? < \ u { 0041 } > . ) " , " u " ) . test ( " a " ) ) ; / / Non - surrogate <nl> + assertTrue ( RegExp ( " ( ? < a \ u { 104A4 } > . ) " , " u " ) . test ( " a " ) ) ; / / Surrogate , ID_Continue <nl> + <nl> + assertThrows ( " / ( ? < a \ \ uD801 \ uDCA4 > . ) / " , SyntaxError ) ; <nl> + assertThrows ( " / ( ? < a \ \ uD801 > . ) / " , SyntaxError ) ; <nl> + assertThrows ( " / ( ? < a \ \ uDCA4 > . ) / " , SyntaxError ) ; <nl> + assertTrue ( / ( ? < \ u0041 > . ) / . test ( " a " ) ) ; <nl> + assertThrows ( " / ( ? < \ \ u { 0041 } > . ) / " , SyntaxError ) ; <nl> + assertThrows ( " / ( ? < a \ \ u { 104A4 } > . ) / " , SyntaxError ) ; <nl> + assertThrows ( " / ( ? < a \ \ u { 10FFFF } > . ) / " , SyntaxError ) ; <nl> + assertThrows ( " / ( ? < a \ uD801 > . ) / " , SyntaxError ) ; / / Lead <nl> + assertThrows ( " / ( ? < a \ uDCA4 > . ) / " , SyntaxError ) ; / / Trail <nl> + assertTrue ( RegExp ( " ( ? < \ u { 0041 } > . ) " ) . test ( " a " ) ) ; / / Non - surrogate <nl> + assertTrue ( RegExp ( " ( ? < a \ u { 104A4 } > . ) " ) . test ( " a " ) ) ; / / Surrogate , ID_Continue <nl> + <nl> / / @ @ replace with a callable replacement argument ( no named captures ) . <nl> { <nl> let result = " abcd " . replace ( / ( . ) ( . ) / u , ( match , fst , snd , offset , str ) = > { <nl>
[ regexp ] Updates for unicode escapes in capture names
v8/v8
f3b848fe5d1dcca6a2e490e5b5674d551f7d27db
2017-04-07T08:57:42Z
mmm a / appveyor . yml <nl> ppp b / appveyor . yml <nl> environment : <nl> platform : x64 <nl> configuration : Release <nl> <nl> - - FLAVOR : VS 2019 x64 Debug Coverage <nl> - APPVEYOR_BUILD_WORKER_IMAGE : Visual Studio 2019 <nl> - coverage : 1 <nl> - platform : x64 <nl> - configuration : Debug <nl> - <nl> - - FLAVOR : VS 2019 x64 Debug Examples <nl> + - FLAVOR : VS 2019 x64 Debug Coverage Examples <nl> APPVEYOR_BUILD_WORKER_IMAGE : Visual Studio 2019 <nl> examples : 1 <nl> + coverage : 1 <nl> platform : x64 <nl> configuration : Debug <nl> <nl> mmm a / codecov . yml <nl> ppp b / codecov . yml <nl> coverage : <nl> <nl> codecov : <nl> branch : master <nl> + max_report_age : off <nl> <nl> comment : <nl> layout : " diff " <nl> mmm a / tools / misc / appveyorBuildConfigurationScript . bat <nl> ppp b / tools / misc / appveyorBuildConfigurationScript . bat <nl> if " % CONFIGURATION % " = = " Debug " ( <nl> @ REM # coverage needs to build the special helper as well as the main <nl> cmake - Htools / misc - Bbuild - misc - A % PLATFORM % | | exit / b ! ERRORLEVEL ! <nl> cmake - - build build - misc | | exit / b ! ERRORLEVEL ! <nl> - cmake - H . - BBuild - A % PLATFORM % - DUSE_WMAIN = % wmain % - DMEMORYCHECK_COMMAND = build - misc \ Debug \ CoverageHelper . exe - DMEMORYCHECK_COMMAND_OPTIONS = - - sep - - - DMEMORYCHECK_TYPE = Valgrind | | exit / b ! ERRORLEVEL ! | | exit / b ! ERRORLEVEL ! <nl> + cmake - H . - BBuild - A % PLATFORM % - DUSE_WMAIN = % wmain % - DMEMORYCHECK_COMMAND = build - misc \ Debug \ CoverageHelper . exe - DMEMORYCHECK_COMMAND_OPTIONS = - - sep - - - DMEMORYCHECK_TYPE = Valgrind - DCATCH_BUILD_EXAMPLES = % examples % - DCATCH_BUILD_EXTRA_TESTS = % examples % | | exit / b ! ERRORLEVEL ! <nl> ) else ( <nl> @ REM # We know that coverage is 0 <nl> cmake - H . - BBuild - A % PLATFORM % - DUSE_WMAIN = % wmain % - DCATCH_BUILD_EXAMPLES = % examples % - DCATCH_BUILD_EXTRA_TESTS = % examples % | | exit / b ! ERRORLEVEL ! <nl>
Fix coverage collection on AppVeyor
catchorg/Catch2
a7b3e087a03f6ba33100c842445f16757d545fc0
2020-01-31T13:44:40Z
new file mode 100644 <nl> index 000000000000 . . ac0a5206e9b8 <nl> mmm / dev / null <nl> ppp b / jstests / queryoptimizer7 . js <nl> <nl> + / / Some unsatisfiable constraint tests . <nl> + <nl> + t = db . jstests_queryoptimizer7 ; <nl> + <nl> + function assertPlanWasRecorded ( query ) { <nl> + assert . eq ( ' BtreeCursor a_1 ' , t . find ( query ) . explain ( true ) . oldPlan . cursor ) ; <nl> + } <nl> + <nl> + function assertNoPlanWasRecorded ( query ) { <nl> + assert ( ! t . find ( query ) . explain ( true ) . oldPlan ) ; <nl> + } <nl> + <nl> + / / A query plan can be recorded and reused in the presence of a single key index <nl> + / / constraint that would be impossible for a single key index , but is unindexed . <nl> + t . drop ( ) ; <nl> + t . ensureIndex ( { a : 1 } ) ; <nl> + t . find ( { a : 1 , b : 1 , c : { $ gt : 5 , $ lt : 5 } } ) . itcount ( ) ; <nl> + assertPlanWasRecorded ( { a : 1 , b : 1 , c : { $ gt : 5 , $ lt : 5 } } ) ; <nl> + <nl> + / / A query plan for an indexed unsatisfiable single key index constraint is not recorded . <nl> + t . drop ( ) ; <nl> + t . ensureIndex ( { a : 1 } ) ; <nl> + t . find ( { a : { $ gt : 5 , $ lt : 5 } , b : 1 } ) . itcount ( ) ; <nl> + assertNoPlanWasRecorded ( { a : { $ gt : 5 , $ lt : 5 } , b : 1 } ) ; <nl> + <nl> + / / A query plan for an unsatisfiable multikey index constraint is not recorded . <nl> + t . drop ( ) ; <nl> + t . ensureIndex ( { a : 1 } ) ; <nl> + t . find ( { a : { $ in : [ ] } , b : 1 } ) . itcount ( ) ; <nl> + assertNoPlanWasRecorded ( { a : { $ in : [ ] } , b : 1 } ) ; <nl> mmm a / src / mongo / db / queryoptimizer . cpp <nl> ppp b / src / mongo / db / queryoptimizer . cpp <nl> namespace mongo { <nl> NamespaceDetailsTransient & nsd = NamespaceDetailsTransient : : get_inlock ( frsp . ns ( ) ) ; <nl> / / TODO Maybe it would make sense to return the index with the lowest <nl> / / nscanned if there are two possibilities . <nl> - if ( frsp . _singleKey . matchPossible ( ) ) { <nl> + { <nl> QueryPattern pattern = frsp . _singleKey . pattern ( order ) ; <nl> BSONObj oldIdx = nsd . indexForPattern ( pattern ) ; <nl> if ( ! oldIdx . isEmpty ( ) ) { <nl> namespace mongo { <nl> return make_pair ( oldIdx , oldNScanned ) ; <nl> } <nl> } <nl> - if ( frsp . _multiKey . matchPossible ( ) ) { <nl> + { <nl> QueryPattern pattern = frsp . _multiKey . pattern ( order ) ; <nl> BSONObj oldIdx = nsd . indexForPattern ( pattern ) ; <nl> if ( ! oldIdx . isEmpty ( ) ) { <nl>
allow looking up query plans if there is an unindexed single key index unsatisfiable query constraint ; avoid checking satisfiability when looking up recorded plans
mongodb/mongo
e68bf57ddef3e68b0a639fae3157db89ad8b36f7
2012-01-19T01:31:09Z
mmm a / db / dur_recover . cpp <nl> ppp b / db / dur_recover . cpp <nl> namespace mongo { <nl> } <nl> uassert ( 13534 , str : : stream ( ) < < " recovery error couldn ' t open " < < fn , file . is_open ( ) ) ; <nl> <nl> - / / TODO ( mathias ) add length method to File and enable these asserts <nl> - / / They are less important now that we are using write ( ) rather than mmap <nl> - # if 0 <nl> if ( cmdLine . durOptions & CmdLine : : DurDumpJournal ) <nl> - log ( ) < < " opened " < < fn < < ' ' < < f - > length ( ) / 1024 . 0 / 1024 . 0 < < endl ; <nl> - uassert ( 13543 , str : : stream ( ) < < " recovery error file has length zero " < < fn , f - > length ( ) ) ; <nl> - assert ( ofs < f - > length ( ) ) ; <nl> - # endif <nl> + log ( ) < < " opened " < < fn < < ' ' < < file . len ( ) / 1024 . 0 / 1024 . 0 < < endl ; <nl> } <nl> <nl> return file ; <nl>
Use File : : len ( )
mongodb/mongo
c76a27e18dd95a58cf70f27ab2ab75f20e456710
2010-12-22T07:24:01Z
mmm a / scene / 2d / sprite . cpp <nl> ppp b / scene / 2d / sprite . cpp <nl> bool Sprite : : _edit_is_selected_on_click ( const Point2 & p_point , double p_toleranc <nl> <nl> Vector2 q = ( ( p_point - dst_rect . position ) / dst_rect . size ) * src_rect . size + src_rect . position ; <nl> <nl> - Ref < Image > image = texture - > get_data ( ) ; <nl> + Ref < Image > image ; <nl> + Ref < AtlasTexture > atlasTexture = texture ; <nl> + if ( atlasTexture . is_null ( ) ) { <nl> + image = texture - > get_data ( ) ; <nl> + } else { <nl> + ERR_FAIL_COND_V ( atlasTexture - > get_atlas ( ) . is_null ( ) , false ) ; <nl> + <nl> + image = atlasTexture - > get_atlas ( ) - > get_data ( ) ; <nl> + <nl> + Rect2 region = atlasTexture - > get_region ( ) ; <nl> + Rect2 margin = atlasTexture - > get_margin ( ) ; <nl> + <nl> + q - = margin . position ; <nl> + <nl> + if ( ( q . x > region . size . width ) | | ( q . y > region . size . height ) ) { <nl> + return false ; <nl> + } <nl> + <nl> + q + = region . position ; <nl> + } <nl> + <nl> ERR_FAIL_COND_V ( image . is_null ( ) , false ) ; <nl> <nl> image - > lock ( ) ; <nl>
Fix selection of Sprites using AtlasTexture in the editor .
godotengine/godot
a01ba4523b3132e6307d222fc20c704eabbb87fb
2018-03-02T18:17:47Z
mmm a / docs / conf . py <nl> ppp b / docs / conf . py <nl> def run ( self ) : <nl> " h " : " c " , <nl> } <nl> breathe_show_define_initializer = True <nl> + c_id_attributes = [ ' LIGHTGBM_C_EXPORT ' ] <nl> <nl> # - - Options for HTML output mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> mmm a / docs / requirements . txt <nl> ppp b / docs / requirements . txt <nl> <nl> - r requirements_base . txt <nl> - breathe < 4 . 15 <nl> + breathe <nl> mmm a / docs / requirements_base . txt <nl> ppp b / docs / requirements_base . txt <nl> <nl> - sphinx < 3 . 0 <nl> + sphinx <nl> sphinx_rtd_theme > = 0 . 3 <nl> mock ; python_version < ' 3 ' <nl>
be compatible with Sphinx 3 ( )
microsoft/LightGBM
30607d80fbf389fb504cf0428f48394ede1fc7fd
2020-04-22T18:47:52Z
mmm a / doc / contribute . rst <nl> ppp b / doc / contribute . rst <nl> Everyone is more than welcome to contribute . It is a way to make the project bet <nl> * * Guidelines * * <nl> <nl> * ` Submit Pull Request ` _ <nl> + * ` Running Formatting Checks Locally ` _ <nl> + <nl> + - ` Linter ` _ <nl> + - ` Clang - tidy ` _ <nl> + - ` Running checks inside a Docker container ( Recommended ) ` _ <nl> + <nl> * ` Git Workflow Howtos ` _ <nl> <nl> - ` How to resolve conflict with master ` _ <nl> Everyone is more than welcome to contribute . It is a way to make the project bet <nl> * ` Documents ` _ <nl> * ` Testcases ` _ <nl> * ` Sanitizers ` _ <nl> - * ` clang - tidy ` _ <nl> * ` Examples ` _ <nl> * ` Core Library ` _ <nl> * ` Python Package ` _ <nl> Submit Pull Request <nl> - Fix the problems reported by automatic checks <nl> - If you are contributing a new module , consider add a testcase in ` tests < https : / / github . com / dmlc / xgboost / tree / master / tests > ` _ . <nl> <nl> + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * <nl> + Running Formatting Checks Locally <nl> + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * <nl> + <nl> + Once you submit a pull request to ` dmlc / xgboost < https : / / github . com / dmlc / xgboost > ` _ , we perform <nl> + two automatic checks to enforce coding style conventions . <nl> + <nl> + Linter <nl> + = = = = = = <nl> + We use ` pylint < https : / / github . com / PyCQA / pylint > ` _ and ` cpplint < https : / / github . com / cpplint / cpplint > ` _ to enforce style convention and find potential errors . Linting is especially useful for Python , as we can catch many errors that would have otherwise occured at run - time . <nl> + <nl> + To run this check locally , run the following command from the top level source tree : <nl> + <nl> + . . code - block : : bash <nl> + <nl> + cd / path / to / xgboost / <nl> + make lint <nl> + <nl> + This command requires the Python packages pylint and cpplint . <nl> + <nl> + . . note : : Having issue ? Try Docker container <nl> + <nl> + If you are running into issues running the command above , consider using our Docker container . See : ref : ` linting_inside_docker ` . <nl> + <nl> + Clang - tidy <nl> + = = = = = = = = = = <nl> + ` Clang - tidy < https : / / clang . llvm . org / extra / clang - tidy / > ` _ is an advance linter for C + + code , made by the LLVM team . We use it to conform our C + + codebase to modern C + + practices and conventions . <nl> + <nl> + To run this check locally , run the following command from the top level source tree : <nl> + <nl> + . . code - block : : bash <nl> + <nl> + cd / path / to / xgboost / <nl> + python3 tests / ci_build / tidy . py - - gtest - path = / path / to / google - test <nl> + <nl> + where ` ` - - gtest - path ` ` option specifies the full path of Google Test library . <nl> + <nl> + Also , the script accepts two optional integer arguments , namely ` ` - - cpp ` ` and ` ` - - cuda ` ` . By default they are both set to 1 , meaning that both C + + and CUDA code will be checked . If the CUDA toolkit is not installed on your machine , you ' ll encounter an error . To exclude CUDA source from linting , use : <nl> + <nl> + . . code - block : : bash <nl> + <nl> + cd / path / to / xgboost / <nl> + python3 tests / ci_build / tidy . py - - cuda = 0 - - gtest - path = / path / to / google - test <nl> + <nl> + Similarly , if you want to exclude C + + source from linting : <nl> + <nl> + . . code - block : : bash <nl> + <nl> + cd / path / to / xgboost / <nl> + python3 tests / ci_build / tidy . py - - cpp = 0 - - gtest - path = / path / to / google - test <nl> + <nl> + . . note : : Having issue ? Try Docker container <nl> + <nl> + If you are running into issues running the command above , consider using our Docker container . See : ref : ` linting_inside_docker ` . <nl> + <nl> + . . _linting_inside_docker : <nl> + <nl> + Running checks inside a Docker container ( Recommended ) <nl> + = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = <nl> + If you have access to Docker on your machine , you can use a Docker container to automatically setup the right environment , so that you can be sure the right packages and dependencies will be available . <nl> + <nl> + . . code - block : : bash <nl> + <nl> + tests / ci_build / ci_build . sh clang_tidy docker - - build - arg CUDA_VERSION = 9 . 2 tests / ci_build / clang_tidy . sh <nl> + tests / ci_build / ci_build . sh cpu docker make lint <nl> + <nl> + This will run the formatting checks inside the same Docker container that ` our testing server < https : / / xgboost - ci . net > ` _ uses . <nl> + <nl> * * * * * * * * * * * * * * * * * * * <nl> Git Workflow Howtos <nl> * * * * * * * * * * * * * * * * * * * <nl> environment variable : <nl> <nl> For details , please consult ` official documentation < https : / / github . com / google / sanitizers / wiki > ` _ for sanitizers . <nl> <nl> - * * * * * * * * * * <nl> - clang - tidy <nl> - * * * * * * * * * * <nl> - To run clang - tidy on both C + + and CUDA source code , run the following command <nl> - from the top level source tree : <nl> - <nl> - . . code - block : : bash <nl> - <nl> - cd / path / to / xgboost / <nl> - python3 tests / ci_build / tidy . py - - gtest - path = / path / to / google - test <nl> - <nl> - The script requires the full path of Google Test library via the ` ` - - gtest - path ` ` argument . <nl> - <nl> - Also , the script accepts two optional integer arguments , namely ` ` - - cpp ` ` and ` ` - - cuda ` ` . <nl> - By default they are both set to 1 . If you want to exclude CUDA source from <nl> - linting , use : <nl> - <nl> - . . code - block : : bash <nl> - <nl> - cd / path / to / xgboost / <nl> - python3 tests / ci_build / tidy . py - - cuda = 0 <nl> - <nl> - Similarly , if you want to exclude C + + source from linting : <nl> - <nl> - . . code - block : : bash <nl> - <nl> - cd / path / to / xgboost / <nl> - python3 tests / ci_build / tidy . py - - cpp = 0 <nl> - <nl> * * * * * * * * <nl> Examples <nl> * * * * * * * * <nl>
Add instruction to run formatting checks locally [ skip ci ] ( )
dmlc/xgboost
1f98f18cb891996724af0d8d911059c1b896a053
2019-06-24T07:09:09Z
mmm a / jvm - packages / xgboost4j - spark / src / main / scala / ml / dmlc / xgboost4j / scala / spark / XGBoost . scala <nl> ppp b / jvm - packages / xgboost4j - spark / src / main / scala / ml / dmlc / xgboost4j / scala / spark / XGBoost . scala <nl> object XGBoost extends Serializable { <nl> " instance of TrackerConf . " ) <nl> } <nl> val tracker = startTracker ( nWorkers , trackerConf ) <nl> - val overridedConfMap = overrideParamMapAccordingtoTaskCPUs ( params , trainingData . sparkContext ) <nl> - val boosters = buildDistributedBoosters ( trainingData , overridedConfMap , <nl> - tracker . getWorkerEnvs , nWorkers , round , obj , eval , useExternalMemory , missing ) <nl> - val sparkJobThread = new Thread ( ) { <nl> - override def run ( ) { <nl> - / / force the job <nl> - boosters . foreachPartition ( ( ) = > _ ) <nl> + try { <nl> + val overridedConfMap = overrideParamMapAccordingtoTaskCPUs ( params , trainingData . sparkContext ) <nl> + val boosters = buildDistributedBoosters ( trainingData , overridedConfMap , <nl> + tracker . getWorkerEnvs , nWorkers , round , obj , eval , useExternalMemory , missing ) <nl> + val sparkJobThread = new Thread ( ) { <nl> + override def run ( ) { <nl> + / / force the job <nl> + boosters . foreachPartition ( ( ) = > _ ) <nl> + } <nl> } <nl> + sparkJobThread . setUncaughtExceptionHandler ( tracker ) <nl> + sparkJobThread . start ( ) <nl> + val isClsTask = isClassificationTask ( params ) <nl> + val trackerReturnVal = tracker . waitFor ( 0L ) <nl> + logger . info ( s " Rabit returns with exit code $ trackerReturnVal " ) <nl> + postTrackerReturnProcessing ( trackerReturnVal , boosters , overridedConfMap , sparkJobThread , <nl> + isClsTask ) <nl> + } finally { <nl> + tracker . stop ( ) <nl> } <nl> - sparkJobThread . setUncaughtExceptionHandler ( tracker ) <nl> - sparkJobThread . start ( ) <nl> - val isClsTask = isClassificationTask ( params ) <nl> - val trackerReturnVal = tracker . waitFor ( 0L ) <nl> - logger . info ( s " Rabit returns with exit code $ trackerReturnVal " ) <nl> - postTrackerReturnProcessing ( trackerReturnVal , boosters , overridedConfMap , sparkJobThread , <nl> - isClsTask ) <nl> } <nl> <nl> private def postTrackerReturnProcessing ( <nl> mmm a / jvm - packages / xgboost4j / src / main / java / ml / dmlc / xgboost4j / java / IRabitTracker . java <nl> ppp b / jvm - packages / xgboost4j / src / main / java / ml / dmlc / xgboost4j / java / IRabitTracker . java <nl> <nl> * brokers connections between workers . <nl> * / <nl> public interface IRabitTracker extends Thread . UncaughtExceptionHandler { <nl> - public enum TrackerStatus { <nl> + enum TrackerStatus { <nl> SUCCESS ( 0 ) , INTERRUPTED ( 1 ) , TIMEOUT ( 2 ) , FAILURE ( 3 ) ; <nl> <nl> private int statusCode ; <nl> public int getStatusCode ( ) { <nl> <nl> Map < String , String > getWorkerEnvs ( ) ; <nl> boolean start ( long workerConnectionTimeout ) ; <nl> + void stop ( ) ; <nl> / / taskExecutionTimeout has no effect in current version of XGBoost . <nl> int waitFor ( long taskExecutionTimeout ) ; <nl> } <nl> mmm a / jvm - packages / xgboost4j / src / main / java / ml / dmlc / xgboost4j / java / RabitTracker . java <nl> ppp b / jvm - packages / xgboost4j / src / main / java / ml / dmlc / xgboost4j / java / RabitTracker . java <nl> private boolean startTrackerProcess ( ) { <nl> } <nl> } <nl> <nl> - private void stop ( ) { <nl> + public void stop ( ) { <nl> if ( trackerProcess . get ( ) ! = null ) { <nl> trackerProcess . get ( ) . destroy ( ) ; <nl> } <nl> mmm a / jvm - packages / xgboost4j / src / main / scala / ml / dmlc / xgboost4j / scala / rabit / RabitTracker . scala <nl> ppp b / jvm - packages / xgboost4j / src / main / scala / ml / dmlc / xgboost4j / scala / rabit / RabitTracker . scala <nl> private [ scala ] class RabitTracker ( numWorkers : Int , port : Option [ Int ] = None , <nl> } <nl> } <nl> <nl> + def stop ( ) : Unit = { <nl> + if ( ! system . isTerminated ) { <nl> + system . shutdown ( ) <nl> + } <nl> + } <nl> + <nl> / * * <nl> * Get a Map of necessary environment variables to initiate Rabit workers . <nl> * <nl>
[ jvm - packages ] Deterministically XGBoost training on exception ( )
dmlc/xgboost
0db37c05bdcd56885a6eef2e1158b9c77eddefbe
2017-06-13T03:19:28Z
mmm a / CocosDenshion / android / opensl / cddandroidOpenSLEngine . h <nl> ppp b / CocosDenshion / android / opensl / cddandroidOpenSLEngine . h <nl> namespace CocosDenshion { <nl> void setBackgroundMusicVolume ( float volume ) ; <nl> float getEffectsVolume ( ) ; <nl> void setEffectsVolume ( float volume ) ; <nl> - unsigned int playEffect ( const char * pszFilePath , bool bLoop ) ; <nl> + unsigned int playEffect ( const char * pszFilePath , <nl> + bool bLoop = false , <nl> + float pitch = 1 . 0f , float pan = 0 . 0f , <nl> + float gain = 1 . 0f ) ; <nl> void pauseEffect ( unsigned int nSoundId ) ; <nl> void pauseAllEffects ( ) ; <nl> void resumeEffect ( unsigned int nSoundId ) ; <nl>
cddandroidOpenSLEngine . h with updated method declaration
cocos2d/cocos2d-x
c4fe5de7a4e96456550d8b32a513f9fc6ff096dc
2013-08-05T09:05:45Z
mmm a / src / qtlibtorrent / qbtsession . cpp <nl> ppp b / src / qtlibtorrent / qbtsession . cpp <nl> QBtSession : : QBtSession ( ) <nl> LSDEnabled ( false ) , <nl> DHTEnabled ( false ) , current_dht_port ( 0 ) , queueingEnabled ( false ) , <nl> m_torrentExportEnabled ( false ) , <nl> - m_finishedTorrentExportEnabled ( false ) <nl> + m_finishedTorrentExportEnabled ( false ) , <nl> + m_randomPortEnabled ( false ) <nl> # ifndef DISABLE_GUI <nl> , geoipDBLoaded ( false ) , resolve_countries ( false ) <nl> # endif <nl> , m_tracker ( 0 ) , m_shutdownAct ( NO_SHUTDOWN ) , <nl> - m_upnp ( 0 ) , m_natpmp ( 0 ) , m_dynDNSUpdater ( 0 ) , <nl> - m_randomPortEnabled ( false ) <nl> + m_upnp ( 0 ) , m_natpmp ( 0 ) , m_dynDNSUpdater ( 0 ) <nl> { <nl> BigRatioTimer = new QTimer ( this ) ; <nl> BigRatioTimer - > setInterval ( 10000 ) ; <nl>
Fix gcc warning [ - Wreorder ] .
qbittorrent/qBittorrent
da561ccd38d6c9b188545b0be48e3a53a82df430
2013-09-14T13:11:04Z
mmm a / src / serialize . h <nl> ppp b / src / serialize . h <nl> class CDataStream <nl> Init ( nTypeIn , nVersionIn ) ; <nl> } <nl> <nl> - CDataStream ( const std : : vector < unsigned char > & vchIn , int nTypeIn , int nVersionIn ) : vch ( ( char * ) & vchIn . begin ( ) [ 0 ] , ( char * ) & vchIn . end ( ) [ 0 ] ) <nl> + CDataStream ( const std : : vector < unsigned char > & vchIn , int nTypeIn , int nVersionIn ) : vch ( vchIn . begin ( ) , vchIn . end ( ) ) <nl> { <nl> Init ( nTypeIn , nVersionIn ) ; <nl> } <nl>
Merge pull request
bitcoin/bitcoin
7a04f3d708faab4af1f1a6aeddc5a6a4db3849a5
2014-09-23T18:20:58Z
mmm a / hphp / hack / src / decl / direct_decl_smart_constructors . rs <nl> ppp b / hphp / hack / src / decl / direct_decl_smart_constructors . rs <nl> impl < ' a > FlattenSmartConstructors < ' a , State < ' a > > for DirectDeclSmartConstructors <nl> Node : : TraitUse ( self . alloc ( names ) ) <nl> } <nl> <nl> + fn make_trait_use_conflict_resolution ( <nl> + & mut self , <nl> + _keyword : Self : : R , <nl> + names : Self : : R , <nl> + _left_brace : Self : : R , <nl> + _clauses : Self : : R , <nl> + _right_brace : Self : : R , <nl> + ) - > Self : : R { <nl> + Node : : TraitUse ( self . alloc ( names ) ) <nl> + } <nl> + <nl> fn make_require_clause ( <nl> & mut self , <nl> _keyword : Self : : R , <nl> new file mode 100644 <nl> index 00000000000 . . 0b8e5b0a6bb <nl> mmm / dev / null <nl> ppp b / hphp / hack / test / decl / trait_use_conflict_resolution . php <nl> <nl> + < ? hh / / strict <nl> + <nl> + class C { <nl> + use T { x as y ; } <nl> + } <nl> new file mode 100644 <nl> index 00000000000 . . 3e62ca79f64 <nl> mmm / dev / null <nl> ppp b / hphp / hack / test / decl / trait_use_conflict_resolution . php . exp <nl> <nl> + [ ( " \ \ C " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> + sc_name = ( [ 3 : 7 - 8 ] , " \ \ C " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = [ ] ; sc_extends = [ ] ; <nl> + sc_uses = <nl> + [ ( Rhint ( root | trait_use_conflict_resolution . php line 4 , characters 7 - 7 ) , <nl> + ( Tapply ( ( [ 4 : 7 - 8 ] , " \ \ T " ) , [ ] ) ) ) ] ; <nl> + sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> + sc_implements = [ ] ; sc_implements_dynamic = false ; sc_consts = [ ] ; <nl> + sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> + sc_constructor = None ; sc_static_methods = [ ] ; sc_methods = [ ] ; <nl> + sc_user_attributes = [ ] ; sc_enum_type = None } ) ) <nl> + ] <nl> + <nl> + They matched ! <nl> new file mode 100644 <nl> index 00000000000 . . f2a63dc3c75 <nl> mmm / dev / null <nl> ppp b / hphp / hack / test / decl / trait_use_conflict_resolution . php . typecheck . exp <nl> <nl> + File " trait_use_conflict_resolution . php " , line 4 , characters 11 - 11 : <nl> + Trait use as is a PHP feature that is unsupported in Hack ( Naming [ 2102 ] ) <nl> + File " trait_use_conflict_resolution . php " , line 4 , characters 7 - 7 : <nl> + Unbound name : ` T ` ( a trait ) ( Naming [ 2049 ] ) <nl>
Handle trait use conflict resolution
facebook/hhvm
fe0e13846ca6368b8ec51f5c8efdab32d7864a26
2020-11-06T03:26:13Z
mmm a / modules / planning / common / planning_gflags . cc <nl> ppp b / modules / planning / common / planning_gflags . cc <nl> DEFINE_string ( scenario_side_pass_config_file , <nl> " / apollo / modules / planning / conf / scenario_side_pass_config . pb . txt " , <nl> " The side pass scenario configuration file " ) ; <nl> DEFINE_string ( scenario_side_pass_stage_obstacle_approach , <nl> - " SCENATIO_SIDE_PASS_STAGE_OBSTACLE_APPROACH " , <nl> + " SCENARIO_SIDE_PASS_STAGE_OBSTACLE_APPROACH " , <nl> " stage 1 : obstacle_approach " ) ; <nl> DEFINE_string ( scenario_side_pass_stage_path_generation , <nl> - " SCENATIO_SIDE_PASS_STAGE_PATH_GENERATION " , <nl> + " SCENARIO_SIDE_PASS_STAGE_PATH_GENERATION " , <nl> " stage 2 : path_generation " ) ; <nl> DEFINE_string ( scenario_side_pass_stage_waitpoint_stop , <nl> - " SCENATIO_SIDE_PASS_STAGE_WAITPOINT_STOP " , <nl> + " SCENARIO_SIDE_PASS_STAGE_WAITPOINT_STOP " , <nl> " stage 3 : waitpoint_stop " ) ; <nl> DEFINE_string ( scenario_side_pass_stage_safety_detection , <nl> - " SCENATIO_SIDE_PASS_STAGE_SAFETY_DETECTION " , <nl> + " SCENARIO_SIDE_PASS_STAGE_SAFETY_DETECTION " , <nl> " stage 4 : safety_detection " ) ; <nl> DEFINE_string ( scenario_side_pass_stage_obstacle_pass , <nl> - " SCENATIO_SIDE_PASS_STAGE_OBSTACLE_PASS " , <nl> + " SCENARIO_SIDE_PASS_STAGE_OBSTACLE_PASS " , <nl> " stage 5 : obstacle_pass " ) ; <nl> / / / stop_sign_unprotected <nl> DEFINE_string ( scenario_stop_sign_unprotected_config_file , <nl> DEFINE_string ( scenario_stop_sign_unprotected_config_file , <nl> " scenario_stop_sign_unprotected_config . pb . txt " , <nl> " The stop_sign_unprotected scenario configuration file " ) ; <nl> DEFINE_string ( scenario_stop_sign_unprotected_stage_stop , <nl> - " SCENATIO_STOP_SIGN_UNPROTECTED_STAGE_STOP " , " stage 1 : stop " ) ; <nl> + " SCENARIO_STOP_SIGN_UNPROTECTED_STAGE_STOP " , " stage 1 : stop " ) ; <nl> DEFINE_string ( scenario_stop_sign_unprotected_stage_creep , <nl> - " SCENATIO_STOP_SIGN_UNPROTECTED_STAGE_CREEP " , " stage 2 : creep " ) ; <nl> + " SCENARIO_STOP_SIGN_UNPROTECTED_STAGE_CREEP " , " stage 2 : creep " ) ; <nl> DEFINE_string ( scenario_stop_sign_unprotected_stage_cruise , <nl> - " SCENATIO_STOP_SIGN_UNPROTECTED_STAGE_CRUISE " , " stage 3 : cruise " ) ; <nl> + " SCENARIO_STOP_SIGN_UNPROTECTED_STAGE_CRUISE " , " stage 3 : cruise " ) ; <nl> <nl> DEFINE_string ( planning_adapter_config_filename , <nl> " / apollo / modules / planning / conf / adapter . conf " , <nl> mmm a / modules / planning / conf / scenario_stop_sign_unprotected_config . pb . txt <nl> ppp b / modules / planning / conf / scenario_stop_sign_unprotected_config . pb . txt <nl> <nl> scenario_type : STOP_SIGN_UNPROTECTED <nl> stage : { <nl> - stage_name : " SCENATIO_STOP_SIGN_UNPROTECTED_STAGE_STOP " <nl> + stage_name : " SCENARIO_STOP_SIGN_UNPROTECTED_STAGE_STOP " <nl> enabled : true <nl> } <nl> stage : { <nl> - stage_name : " SCENATIO_STOP_SIGN_UNPROTECTED_STAGE_CREEP " <nl> + stage_name : " SCENARIO_STOP_SIGN_UNPROTECTED_STAGE_CREEP " <nl> enabled : false <nl> task : DECIDER_CREEP <nl> } <nl> stage : { <nl> - stage_name : " SCENATIO_STOP_SIGN_UNPROTECTED_STAGE_CRUISE " <nl> + stage_name : " SCENARIO_STOP_SIGN_UNPROTECTED_STAGE_CRUISE " <nl> enabled : true <nl> task : DP_POLY_PATH_OPTIMIZER <nl> task : PATH_DECIDER <nl> mmm a / modules / planning / scenarios / lane_follow / lane_follow_scenario . cc <nl> ppp b / modules / planning / scenarios / lane_follow / lane_follow_scenario . cc <nl> using common : : TrajectoryPoint ; <nl> using common : : math : : Vec2d ; <nl> using common : : time : : Clock ; <nl> <nl> - int LaneFollowScenario : : current_stage_index_ = 0 ; <nl> - <nl> namespace { <nl> constexpr double kPathOptimizationFallbackCost = 2e4 ; <nl> constexpr double kSpeedOptimizationFallbackCost = 2e4 ; <nl> Status LaneFollowScenario : : Process ( const TrajectoryPoint & planning_start_point , <nl> Frame * frame ) { <nl> status_ = STATUS_PROCESSING ; <nl> <nl> - if ( ! InitTasks ( config_ , current_stage_index_ , & tasks_ ) ) { <nl> + / / init tasks <nl> + std : : string stage_name = " " ; <nl> + if ( stage_ = = LaneFollowStage : : CRUISE ) { <nl> + stage_name = " " ; <nl> + } else if ( stage_ = = LaneFollowStage : : DONE ) { <nl> + return Status ( ErrorCode : : OK , " side_pass DONE " ) ; <nl> + } <nl> + if ( ! InitTasks ( config_ , stage_name , & tasks_ ) ) { <nl> return Status ( ErrorCode : : PLANNING_ERROR , " failed to init tasks " ) ; <nl> } <nl> <nl> mmm a / modules / planning / scenarios / lane_follow / lane_follow_scenario . h <nl> ppp b / modules / planning / scenarios / lane_follow / lane_follow_scenario . h <nl> class LaneFollowScenario : public Scenario { <nl> const Frame & frame ) const override ; <nl> <nl> private : <nl> + enum LaneFollowStage { <nl> + CRUISE = 1 , <nl> + DONE = 2 , <nl> + } ; <nl> + <nl> void RegisterTasks ( ) ; <nl> <nl> common : : Status PlanOnReferenceLine ( <nl> class LaneFollowScenario : public Scenario { <nl> const std : : string & name , const double time_diff_ms ) ; <nl> <nl> private : <nl> - static int current_stage_index_ ; <nl> std : : vector < std : : unique_ptr < Task > > tasks_ ; <nl> ScenarioConfig config_ ; <nl> + LaneFollowStage stage_ = CRUISE ; <nl> SpeedProfileGenerator speed_profile_generator_ ; <nl> } ; <nl> <nl> mmm a / modules / planning / scenarios / scenario . cc <nl> ppp b / modules / planning / scenarios / scenario . cc <nl> ScenarioConfig : : ScenarioType Scenario : : scenario_type ( ) const { <nl> } <nl> <nl> bool Scenario : : InitTasks ( const ScenarioConfig & config , <nl> - const int current_stage_index , <nl> + const std : : string & stage_name , <nl> std : : vector < std : : unique_ptr < Task > > * tasks ) { <nl> - CHECK_GT ( config . stage_size ( ) , current_stage_index ) ; <nl> - ScenarioConfig : : Stage stage = config . stage ( current_stage_index ) ; <nl> + CHECK_GT ( config . stage_size ( ) , 0 ) ; <nl> + <nl> + ScenarioConfig : : Stage stage ; <nl> + bool stage_found = false ; <nl> + for ( int i = 0 ; i < config . stage_size ( ) ; + + i ) { <nl> + if ( config . stage ( i ) . stage_name ( ) = = stage_name ) { <nl> + stage = config . stage ( i ) ; <nl> + stage_found = true ; <nl> + } <nl> + } <nl> + if ( ! stage_found ) { <nl> + return false ; <nl> + } <nl> <nl> / / get all scenario_task_configs <nl> std : : vector < ScenarioConfig : : ScenarioTaskConfig > task_configs ; <nl> mmm a / modules / planning / scenarios / scenario . h <nl> ppp b / modules / planning / scenarios / scenario . h <nl> class Scenario { <nl> <nl> protected : <nl> bool InitTasks ( const ScenarioConfig & config , <nl> - const int current_stage_index , <nl> + const std : : string & stage_name , <nl> std : : vector < std : : unique_ptr < Task > > * tasks ) ; <nl> <nl> protected : <nl> mmm a / modules / planning / scenarios / side_pass / side_pass_scenario . cc <nl> ppp b / modules / planning / scenarios / side_pass / side_pass_scenario . cc <nl> using common : : TrajectoryPoint ; <nl> using common : : math : : Vec2d ; <nl> using common : : time : : Clock ; <nl> <nl> - int SidePassScenario : : current_stage_index_ = 0 ; <nl> - <nl> namespace { <nl> constexpr double kPathOptimizationFallbackCost = 2e4 ; <nl> constexpr double kSpeedOptimizationFallbackCost = 2e4 ; <nl> Status SidePassScenario : : Process ( const TrajectoryPoint & planning_start_point , <nl> Frame * frame ) { <nl> status_ = STATUS_PROCESSING ; <nl> <nl> - if ( ! InitTasks ( config_ , current_stage_index_ , & tasks_ ) ) { <nl> + / / init tasks <nl> + std : : string stage_name = " " ; <nl> + if ( stage_ = = SidePassStage : : OBSTACLE_APPROACH ) { <nl> + stage_name = FLAGS_scenario_side_pass_stage_obstacle_approach ; <nl> + } else if ( stage_ = = SidePassStage : : PATH_GENERATION ) { <nl> + stage_name = FLAGS_scenario_side_pass_stage_path_generation ; <nl> + } else if ( stage_ = = SidePassStage : : WAITPOINT_STOP ) { <nl> + stage_name = FLAGS_scenario_side_pass_stage_waitpoint_stop ; <nl> + } else if ( stage_ = = SidePassStage : : SAFETY_DETECTION ) { <nl> + stage_name = FLAGS_scenario_side_pass_stage_safety_detection ; <nl> + } else if ( stage_ = = SidePassStage : : OBSTACLE_PASS ) { <nl> + stage_name = FLAGS_scenario_side_pass_stage_obstacle_pass ; <nl> + } else if ( stage_ = = SidePassStage : : DONE ) { <nl> + status_ = STATUS_DONE ; <nl> + return Status ( ErrorCode : : OK , " side_pass DONE " ) ; <nl> + } <nl> + if ( ! InitTasks ( config_ , stage_name , & tasks_ ) ) { <nl> return Status ( ErrorCode : : PLANNING_ERROR , " failed to init tasks " ) ; <nl> } <nl> <nl> / / TODO ( all ) <nl> <nl> - / / get current stage <nl> - const std : : string stage_name = <nl> - config_ . stage ( current_stage_index_ ) . stage_name ( ) ; <nl> - SidePassStage stage = SidePassStage : : OBSTACLE_APPROACH ; <nl> - if ( stage_name = = FLAGS_scenario_side_pass_stage_obstacle_approach ) { <nl> - stage = SidePassStage : : OBSTACLE_APPROACH ; <nl> - } else if ( stage_name = = FLAGS_scenario_side_pass_stage_path_generation ) { <nl> - stage = SidePassStage : : PATH_GENERATION ; <nl> - } else if ( stage_name = = FLAGS_scenario_side_pass_stage_waitpoint_stop ) { <nl> - stage = SidePassStage : : WAITPOINT_STOP ; <nl> - } else if ( stage_name = = FLAGS_scenario_side_pass_stage_safety_detection ) { <nl> - stage = SidePassStage : : SAFETY_DETECTION ; <nl> - } else if ( stage_name = = FLAGS_scenario_side_pass_stage_obstacle_pass ) { <nl> - stage = SidePassStage : : OBSTACLE_PASS ; <nl> - } else { <nl> - return Status ( ErrorCode : : PLANNING_ERROR , " incorrect stage name in config " ) ; <nl> - } <nl> - <nl> Status status = Status ( ErrorCode : : PLANNING_ERROR , <nl> " Failed to process stage in side pass . " ) ; <nl> - switch ( stage ) { <nl> + switch ( stage_ ) { <nl> case SidePassStage : : OBSTACLE_APPROACH : { <nl> status = ApproachObstacle ( planning_start_point , frame ) ; <nl> break ; <nl> Status SidePassScenario : : Process ( const TrajectoryPoint & planning_start_point , <nl> break ; <nl> } <nl> <nl> - if ( current_stage_index_ < config_ . stage_size ( ) - 1 ) { <nl> - current_stage_index_ + + ; <nl> - } else { <nl> - status_ = STATUS_DONE ; <nl> - } <nl> - <nl> return status ; <nl> } <nl> <nl> mmm a / modules / planning / scenarios / side_pass / side_pass_scenario . h <nl> ppp b / modules / planning / scenarios / side_pass / side_pass_scenario . h <nl> class SidePassScenario : public Scenario { <nl> WAITPOINT_STOP = 3 , <nl> SAFETY_DETECTION = 4 , <nl> OBSTACLE_PASS = 5 , <nl> + DONE = 6 , <nl> } ; <nl> <nl> void RegisterTasks ( ) ; <nl> class SidePassScenario : public Scenario { <nl> const common : : TrajectoryPoint & planning_start_point , Frame * frame ) ; <nl> <nl> private : <nl> - static int current_stage_index_ ; <nl> std : : vector < std : : unique_ptr < Task > > tasks_ ; <nl> ScenarioConfig config_ ; <nl> + SidePassStage stage_ = OBSTACLE_APPROACH ; <nl> SpeedProfileGenerator speed_profile_generator_ ; <nl> PathData path_ ; <nl> double wait_point_s = 0 ; <nl> mmm a / modules / planning / scenarios / stop_sign_unprotected / stop_sign_unprotected . cc <nl> ppp b / modules / planning / scenarios / stop_sign_unprotected / stop_sign_unprotected . cc <nl> using common : : ErrorCode ; <nl> using common : : Status ; <nl> using common : : TrajectoryPoint ; <nl> <nl> - int StopSignUnprotectedScenario : : current_stage_index_ = 0 ; <nl> - <nl> void StopSignUnprotectedScenario : : RegisterTasks ( ) { <nl> task_factory_ . Register ( DP_POLY_PATH_OPTIMIZER , <nl> [ ] ( ) - > Task * { return new DpPolyPathOptimizer ( ) ; } ) ; <nl> Status StopSignUnprotectedScenario : : Process ( <nl> Frame * frame ) { <nl> status_ = STATUS_PROCESSING ; <nl> <nl> - if ( ! InitTasks ( config_ , current_stage_index_ , & tasks_ ) ) { <nl> + / / init tasks <nl> + std : : string stage_name = " " ; <nl> + if ( stage_ = = StopSignUnprotectedStage : : STOP ) { <nl> + stage_name = FLAGS_scenario_stop_sign_unprotected_stage_stop ; <nl> + } else if ( stage_ = = StopSignUnprotectedStage : : CREEP ) { <nl> + stage_name = FLAGS_scenario_stop_sign_unprotected_stage_creep ; <nl> + } else if ( stage_ = = StopSignUnprotectedStage : : CRUISE ) { <nl> + stage_name = FLAGS_scenario_stop_sign_unprotected_stage_cruise ; <nl> + } else if ( stage_ = = StopSignUnprotectedStage : : DONE ) { <nl> + status_ = STATUS_DONE ; <nl> + return Status ( ErrorCode : : OK , " stop_sign_unprotected DONE " ) ; <nl> + } <nl> + if ( ! InitTasks ( config_ , stage_name , & tasks_ ) ) { <nl> return Status ( ErrorCode : : PLANNING_ERROR , " failed to init tasks " ) ; <nl> } <nl> <nl> / / TODO ( all ) <nl> <nl> - if ( current_stage_index_ < config_ . stage_size ( ) - 1 ) { <nl> - current_stage_index_ + + ; <nl> - } else { <nl> - status_ = STATUS_DONE ; <nl> - } <nl> return Status : : OK ( ) ; <nl> } <nl> <nl> mmm a / modules / planning / scenarios / stop_sign_unprotected / stop_sign_unprotected . h <nl> ppp b / modules / planning / scenarios / stop_sign_unprotected / stop_sign_unprotected . h <nl> <nl> # pragma once <nl> <nl> # include < memory > <nl> + # include < string > <nl> # include < vector > <nl> <nl> # include " modules / planning / proto / planning . pb . h " <nl> class StopSignUnprotectedScenario : public Scenario { <nl> const Frame & frame ) const override ; <nl> <nl> private : <nl> + enum StopSignUnprotectedStage { <nl> + STOP = 1 , <nl> + CREEP = 2 , <nl> + CRUISE = 3 , <nl> + DONE = 4 , <nl> + } ; <nl> + <nl> void RegisterTasks ( ) ; <nl> <nl> private : <nl> - static int current_stage_index_ ; <nl> std : : vector < std : : unique_ptr < Task > > tasks_ ; <nl> ScenarioConfig config_ ; <nl> + StopSignUnprotectedStage stage_ = STOP ; <nl> SpeedProfileGenerator speed_profile_generator_ ; <nl> } ; <nl> <nl>
planning : scenarion : update stage change driven by scenario itself not conf
ApolloAuto/apollo
f5998681b13108d7d60c19448eb322b89cae3331
2018-10-10T07:41:56Z
mmm a / . gitignore <nl> ppp b / . gitignore <nl> <nl> json_unit <nl> json_benchmarks <nl> <nl> + fuzz - testing <nl> + <nl> + * . dSYM <nl> + <nl> working <nl> <nl> html <nl> mmm a / Makefile <nl> ppp b / Makefile <nl> all : json_unit <nl> <nl> # clean up <nl> clean : <nl> - rm - f json_unit json_benchmarks <nl> + rm - fr json_unit json_benchmarks fuzz fuzz - testing * . dSYM <nl> <nl> <nl> # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> doctest : <nl> make check_output - C doc <nl> <nl> <nl> + # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> + # fuzzing <nl> + # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> + <nl> + # the overall fuzz testing target <nl> + fuzz_testing : <nl> + rm - fr fuzz - testing <nl> + mkdir - p fuzz - testing fuzz - testing / testcases fuzz - testing / out <nl> + $ ( MAKE ) fuzz CXX = afl - clang + + <nl> + mv fuzz fuzz - testing <nl> + find test / json_tests - size - 5k - name * json | xargs - I { } cp " { } " fuzz - testing / testcases <nl> + @ echo " Execute : afl - fuzz - i fuzz - testing / testcases - o fuzz - testing / out fuzz - testing / fuzz " <nl> + <nl> + # the fuzzer binary <nl> + fuzz : test / fuzz . cpp src / json . hpp <nl> + $ ( CXX ) - std = c + + 11 $ ( CXXFLAGS ) $ ( FLAGS ) $ ( CPPFLAGS ) - I src $ < $ ( LDFLAGS ) - o $ @ <nl> + <nl> + <nl> # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> # static analyzer <nl> # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> pretty : <nl> - - indent - col1 - comments - - pad - oper - - pad - header - - align - pointer = type \ <nl> - - align - reference = type - - add - brackets - - convert - tabs - - close - templates \ <nl> - - lineend = linux - - preserve - date - - suffix = none \ <nl> - src / json . hpp src / json . hpp . re2c test / unit . cpp benchmarks / benchmarks . cpp doc / examples / * . cpp <nl> + src / json . hpp src / json . hpp . re2c test / unit . cpp test / fuzz . cpp benchmarks / benchmarks . cpp doc / examples / * . cpp <nl> <nl> <nl> # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> mmm a / README . md <nl> ppp b / README . md <nl> I deeply appreciate the help of the following people . <nl> - [ Corbin Hughes ] ( https : / / github . com / nibroc ) fixed some typos in the contribution guidelines . <nl> - [ twelsby ] ( https : / / github . com / twelsby ) fixed the array subscript operator , an issue that failed the MSVC build , and floating - point parsing / dumping . He further added support for unsigned integer numbers . <nl> - [ Volker Diels - Grabsch ] ( https : / / github . com / vog ) fixed a link in the README file . <nl> + - [ msm - ] ( https : / / github . com / msm - ) added support for american fuzzy lop . <nl> <nl> Thanks a lot for helping out ! <nl> <nl> mmm a / test / catch . hpp <nl> ppp b / test / catch . hpp <nl> <nl> / * <nl> - * Catch v1 . 3 . 1 <nl> - * Generated : 2015 - 12 - 09 18 : 10 : 29 . 846134 <nl> + * Catch v1 . 3 . 4 <nl> + * Generated : 2016 - 02 - 10 19 : 24 : 03 . 089683 <nl> * mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> * This file has been merged from multiple headers . Please don ' t edit it directly <nl> * Copyright ( c ) 2012 Two Blue Cubes Ltd . All rights reserved . <nl> namespace Matchers { <nl> virtual ~ StartsWith ( ) ; <nl> <nl> virtual bool match ( std : : string const & expr ) const { <nl> - return m_data . adjustString ( expr ) . find ( m_data . m_str ) = = 0 ; <nl> + return startsWith ( m_data . adjustString ( expr ) , m_data . m_str ) ; <nl> } <nl> virtual std : : string toString ( ) const { <nl> return " starts with : \ " " + m_data . m_str + " \ " " + m_data . toStringSuffix ( ) ; <nl> namespace Matchers { <nl> virtual ~ EndsWith ( ) ; <nl> <nl> virtual bool match ( std : : string const & expr ) const { <nl> - return m_data . adjustString ( expr ) . find ( m_data . m_str ) = = expr . size ( ) - m_data . m_str . size ( ) ; <nl> + return endsWith ( m_data . adjustString ( expr ) , m_data . m_str ) ; <nl> } <nl> virtual std : : string toString ( ) const { <nl> return " ends with : \ " " + m_data . m_str + " \ " " + m_data . toStringSuffix ( ) ; <nl> namespace Catch { <nl> __catchResult . useActiveException ( Catch : : ResultDisposition : : Normal ) ; \ <nl> } \ <nl> INTERNAL_CATCH_REACT ( __catchResult ) \ <nl> - } while ( Catch : : isTrue ( false & & ( expr ) ) ) / / expr here is never evaluated at runtime but it forces the compiler to give it a look <nl> + } while ( Catch : : isTrue ( false & & static_cast < bool > ( expr ) ) ) / / expr here is never evaluated at runtime but it forces the compiler to give it a look <nl> <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> # define INTERNAL_CATCH_IF ( expr , resultDisposition , macroName ) \ <nl> namespace Catch { <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> # define INTERNAL_CHECK_THAT ( arg , matcher , resultDisposition , macroName ) \ <nl> do { \ <nl> - Catch : : ResultBuilder __catchResult ( macroName , CATCH_INTERNAL_LINEINFO , # arg " " # matcher , resultDisposition ) ; \ <nl> + Catch : : ResultBuilder __catchResult ( macroName , CATCH_INTERNAL_LINEINFO , # arg " , " # matcher , resultDisposition ) ; \ <nl> try { \ <nl> std : : string matcherAsString = ( matcher ) . toString ( ) ; \ <nl> __catchResult \ <nl> namespace Catch { <nl> # define STITCH_CLARA_OPEN_NAMESPACE namespace Catch { <nl> / / # included from : . . / external / clara . h <nl> <nl> + / / Version 0 . 0 . 1 . 1 <nl> + <nl> / / Only use header guard if we are not using an outer namespace <nl> # if ! defined ( TWOBLUECUBES_CLARA_H_INCLUDED ) | | defined ( STITCH_CLARA_OPEN_NAMESPACE ) <nl> <nl> namespace Catch { <nl> # include < string > <nl> # include < vector > <nl> # include < sstream > <nl> + # include < algorithm > <nl> <nl> / / Use optional outer namespace <nl> # ifdef STITCH_TBC_TEXT_FORMAT_OUTER_NAMESPACE <nl> namespace Tbc { <nl> # endif / / TBC_TEXT_FORMAT_H_INCLUDED <nl> <nl> / / mmmmmmmmm - - end of # include from tbc_text_format . h mmmmmmmmm - - <nl> - / / . . . . . . . . . . . back in / Users / philnash / Dev / OSS / Clara / srcs / clara . h <nl> + / / . . . . . . . . . . . back in clara . h <nl> <nl> # undef STITCH_TBC_TEXT_FORMAT_OPEN_NAMESPACE <nl> <nl> + / / mmmmmmmmm - - # included from clara_compilers . h mmmmmmmmm - - <nl> + <nl> + # ifndef TWOBLUECUBES_CLARA_COMPILERS_H_INCLUDED <nl> + # define TWOBLUECUBES_CLARA_COMPILERS_H_INCLUDED <nl> + <nl> + / / Detect a number of compiler features - mostly C + + 11 / 14 conformance - by compiler <nl> + / / The following features are defined : <nl> + / / <nl> + / / CLARA_CONFIG_CPP11_NULLPTR : is nullptr supported ? <nl> + / / CLARA_CONFIG_CPP11_NOEXCEPT : is noexcept supported ? <nl> + / / CLARA_CONFIG_CPP11_GENERATED_METHODS : The delete and default keywords for compiler generated methods <nl> + / / CLARA_CONFIG_CPP11_OVERRIDE : is override supported ? <nl> + / / CLARA_CONFIG_CPP11_UNIQUE_PTR : is unique_ptr supported ( otherwise use auto_ptr ) <nl> + <nl> + / / CLARA_CONFIG_CPP11_OR_GREATER : Is C + + 11 supported ? <nl> + <nl> + / / CLARA_CONFIG_VARIADIC_MACROS : are variadic macros supported ? <nl> + <nl> + / / In general each macro has a _NO_ < feature name > form <nl> + / / ( e . g . CLARA_CONFIG_CPP11_NO_NULLPTR ) which disables the feature . <nl> + / / Many features , at point of detection , define an _INTERNAL_ macro , so they <nl> + / / can be combined , en - mass , with the _NO_ forms later . <nl> + <nl> + / / All the C + + 11 features can be disabled with CLARA_CONFIG_NO_CPP11 <nl> + <nl> + # ifdef __clang__ <nl> + <nl> + # if __has_feature ( cxx_nullptr ) <nl> + # define CLARA_INTERNAL_CONFIG_CPP11_NULLPTR <nl> + # endif <nl> + <nl> + # if __has_feature ( cxx_noexcept ) <nl> + # define CLARA_INTERNAL_CONFIG_CPP11_NOEXCEPT <nl> + # endif <nl> + <nl> + # endif / / __clang__ <nl> + <nl> + / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> + / / GCC <nl> + # ifdef __GNUC__ <nl> + <nl> + # if __GNUC__ = = 4 & & __GNUC_MINOR__ > = 6 & & defined ( __GXX_EXPERIMENTAL_CXX0X__ ) <nl> + # define CLARA_INTERNAL_CONFIG_CPP11_NULLPTR <nl> + # endif <nl> + <nl> + / / - otherwise more recent versions define __cplusplus > = 201103L <nl> + / / and will get picked up below <nl> + <nl> + # endif / / __GNUC__ <nl> + <nl> + / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> + / / Visual C + + <nl> + # ifdef _MSC_VER <nl> + <nl> + # if ( _MSC_VER > = 1600 ) <nl> + # define CLARA_INTERNAL_CONFIG_CPP11_NULLPTR <nl> + # define CLARA_INTERNAL_CONFIG_CPP11_UNIQUE_PTR <nl> + # endif <nl> + <nl> + # if ( _MSC_VER > = 1900 ) / / ( VC + + 13 ( VS2015 ) ) <nl> + # define CLARA_INTERNAL_CONFIG_CPP11_NOEXCEPT <nl> + # define CLARA_INTERNAL_CONFIG_CPP11_GENERATED_METHODS <nl> + # endif <nl> + <nl> + # endif / / _MSC_VER <nl> + <nl> + / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> + / / C + + language feature support <nl> + <nl> + / / catch all support for C + + 11 <nl> + # if defined ( __cplusplus ) & & __cplusplus > = 201103L <nl> + <nl> + # define CLARA_CPP11_OR_GREATER <nl> + <nl> + # if ! defined ( CLARA_INTERNAL_CONFIG_CPP11_NULLPTR ) <nl> + # define CLARA_INTERNAL_CONFIG_CPP11_NULLPTR <nl> + # endif <nl> + <nl> + # ifndef CLARA_INTERNAL_CONFIG_CPP11_NOEXCEPT <nl> + # define CLARA_INTERNAL_CONFIG_CPP11_NOEXCEPT <nl> + # endif <nl> + <nl> + # ifndef CLARA_INTERNAL_CONFIG_CPP11_GENERATED_METHODS <nl> + # define CLARA_INTERNAL_CONFIG_CPP11_GENERATED_METHODS <nl> + # endif <nl> + <nl> + # if ! defined ( CLARA_INTERNAL_CONFIG_CPP11_OVERRIDE ) <nl> + # define CLARA_INTERNAL_CONFIG_CPP11_OVERRIDE <nl> + # endif <nl> + # if ! defined ( CLARA_INTERNAL_CONFIG_CPP11_UNIQUE_PTR ) <nl> + # define CLARA_INTERNAL_CONFIG_CPP11_UNIQUE_PTR <nl> + # endif <nl> + <nl> + # endif / / __cplusplus > = 201103L <nl> + <nl> + / / Now set the actual defines based on the above + anything the user has configured <nl> + # if defined ( CLARA_INTERNAL_CONFIG_CPP11_NULLPTR ) & & ! defined ( CLARA_CONFIG_CPP11_NO_NULLPTR ) & & ! defined ( CLARA_CONFIG_CPP11_NULLPTR ) & & ! defined ( CLARA_CONFIG_NO_CPP11 ) <nl> + # define CLARA_CONFIG_CPP11_NULLPTR <nl> + # endif <nl> + # if defined ( CLARA_INTERNAL_CONFIG_CPP11_NOEXCEPT ) & & ! defined ( CLARA_CONFIG_CPP11_NO_NOEXCEPT ) & & ! defined ( CLARA_CONFIG_CPP11_NOEXCEPT ) & & ! defined ( CLARA_CONFIG_NO_CPP11 ) <nl> + # define CLARA_CONFIG_CPP11_NOEXCEPT <nl> + # endif <nl> + # if defined ( CLARA_INTERNAL_CONFIG_CPP11_GENERATED_METHODS ) & & ! defined ( CLARA_CONFIG_CPP11_NO_GENERATED_METHODS ) & & ! defined ( CLARA_CONFIG_CPP11_GENERATED_METHODS ) & & ! defined ( CLARA_CONFIG_NO_CPP11 ) <nl> + # define CLARA_CONFIG_CPP11_GENERATED_METHODS <nl> + # endif <nl> + # if defined ( CLARA_INTERNAL_CONFIG_CPP11_OVERRIDE ) & & ! defined ( CLARA_CONFIG_NO_OVERRIDE ) & & ! defined ( CLARA_CONFIG_CPP11_OVERRIDE ) & & ! defined ( CLARA_CONFIG_NO_CPP11 ) <nl> + # define CLARA_CONFIG_CPP11_OVERRIDE <nl> + # endif <nl> + # if defined ( CLARA_INTERNAL_CONFIG_CPP11_UNIQUE_PTR ) & & ! defined ( CLARA_CONFIG_NO_UNIQUE_PTR ) & & ! defined ( CLARA_CONFIG_CPP11_UNIQUE_PTR ) & & ! defined ( CLARA_CONFIG_NO_CPP11 ) <nl> + # define CLARA_CONFIG_CPP11_UNIQUE_PTR <nl> + # endif <nl> + <nl> + / / noexcept support : <nl> + # if defined ( CLARA_CONFIG_CPP11_NOEXCEPT ) & & ! defined ( CLARA_NOEXCEPT ) <nl> + # define CLARA_NOEXCEPT noexcept <nl> + # define CLARA_NOEXCEPT_IS ( x ) noexcept ( x ) <nl> + # else <nl> + # define CLARA_NOEXCEPT throw ( ) <nl> + # define CLARA_NOEXCEPT_IS ( x ) <nl> + # endif <nl> + <nl> + / / nullptr support <nl> + # ifdef CLARA_CONFIG_CPP11_NULLPTR <nl> + # define CLARA_NULL nullptr <nl> + # else <nl> + # define CLARA_NULL NULL <nl> + # endif <nl> + <nl> + / / override support <nl> + # ifdef CLARA_CONFIG_CPP11_OVERRIDE <nl> + # define CLARA_OVERRIDE override <nl> + # else <nl> + # define CLARA_OVERRIDE <nl> + # endif <nl> + <nl> + / / unique_ptr support <nl> + # ifdef CLARA_CONFIG_CPP11_UNIQUE_PTR <nl> + # define CLARA_AUTO_PTR ( T ) std : : unique_ptr < T > <nl> + # else <nl> + # define CLARA_AUTO_PTR ( T ) std : : auto_ptr < T > <nl> + # endif <nl> + <nl> + # endif / / TWOBLUECUBES_CLARA_COMPILERS_H_INCLUDED <nl> + <nl> + / / mmmmmmmmm - - end of # include from clara_compilers . h mmmmmmmmm - - <nl> + / / . . . . . . . . . . . back in clara . h <nl> + <nl> # include < map > <nl> - # include < algorithm > <nl> # include < stdexcept > <nl> # include < memory > <nl> <nl> namespace Clara { <nl> const unsigned int consoleWidth = 80 ; <nl> # endif <nl> <nl> + / / Use this to try and stop compiler from warning about unreachable code <nl> + inline bool isTrue ( bool value ) { return value ; } <nl> + <nl> using namespace Tbc ; <nl> <nl> inline bool startsWith ( std : : string const & str , std : : string const & prefix ) { <nl> namespace Clara { <nl> } <nl> template < typename T > <nl> inline void convertInto ( bool , T & ) { <nl> - throw std : : runtime_error ( " Invalid conversion " ) ; <nl> + if ( isTrue ( true ) ) <nl> + throw std : : runtime_error ( " Invalid conversion " ) ; <nl> } <nl> <nl> template < typename ConfigT > <nl> struct IArgFunction { <nl> virtual ~ IArgFunction ( ) { } <nl> - # ifdef CATCH_CONFIG_CPP11_GENERATED_METHODS <nl> + # ifdef CLARA_CONFIG_CPP11_GENERATED_METHODS <nl> IArgFunction ( ) = default ; <nl> IArgFunction ( IArgFunction const & ) = default ; <nl> - # endif <nl> + # endif <nl> virtual void set ( ConfigT & config , std : : string const & value ) const = 0 ; <nl> virtual void setFlag ( ConfigT & config ) const = 0 ; <nl> virtual bool takesArg ( ) const = 0 ; <nl> namespace Clara { <nl> template < typename ConfigT > <nl> class BoundArgFunction { <nl> public : <nl> - BoundArgFunction ( ) : functionObj ( CATCH_NULL ) { } <nl> + BoundArgFunction ( ) : functionObj ( CLARA_NULL ) { } <nl> BoundArgFunction ( IArgFunction < ConfigT > * _functionObj ) : functionObj ( _functionObj ) { } <nl> - BoundArgFunction ( BoundArgFunction const & other ) : functionObj ( other . functionObj ? other . functionObj - > clone ( ) : CATCH_NULL ) { } <nl> + BoundArgFunction ( BoundArgFunction const & other ) : functionObj ( other . functionObj ? other . functionObj - > clone ( ) : CLARA_NULL ) { } <nl> BoundArgFunction & operator = ( BoundArgFunction const & other ) { <nl> - IArgFunction < ConfigT > * newFunctionObj = other . functionObj ? other . functionObj - > clone ( ) : CATCH_NULL ; <nl> + IArgFunction < ConfigT > * newFunctionObj = other . functionObj ? other . functionObj - > clone ( ) : CLARA_NULL ; <nl> delete functionObj ; <nl> functionObj = newFunctionObj ; <nl> return * this ; <nl> namespace Clara { <nl> bool takesArg ( ) const { return functionObj - > takesArg ( ) ; } <nl> <nl> bool isSet ( ) const { <nl> - return functionObj ! = CATCH_NULL ; <nl> + return functionObj ! = CLARA_NULL ; <nl> } <nl> private : <nl> IArgFunction < ConfigT > * functionObj ; <nl> namespace Clara { <nl> std : : string data ; <nl> } ; <nl> <nl> - void parseIntoTokens ( int argc , char const * const * argv , std : : vector < Parser : : Token > & tokens ) const { <nl> + void parseIntoTokens ( int argc , char const * const argv [ ] , std : : vector < Parser : : Token > & tokens ) const { <nl> const std : : string doubleDash = " - - " ; <nl> for ( int i = 1 ; i < argc & & argv [ i ] ! = doubleDash ; + + i ) <nl> parseIntoTokens ( argv [ i ] , tokens ) ; <nl> namespace Clara { <nl> } <nl> } ; <nl> <nl> - typedef CATCH_AUTO_PTR ( Arg ) ArgAutoPtr ; <nl> + typedef CLARA_AUTO_PTR ( Arg ) ArgAutoPtr ; <nl> <nl> friend void addOptName ( Arg & arg , std : : string const & optName ) <nl> { <nl> namespace Clara { <nl> m_arg - > description = description ; <nl> return * this ; <nl> } <nl> - ArgBuilder & detail ( std : : string const & _detail ) { <nl> - m_arg - > detail = _detail ; <nl> + ArgBuilder & detail ( std : : string const & detail ) { <nl> + m_arg - > detail = detail ; <nl> return * this ; <nl> } <nl> <nl> namespace Clara { <nl> maxWidth = ( std : : max ) ( maxWidth , it - > commands ( ) . size ( ) ) ; <nl> <nl> for ( it = itBegin ; it ! = itEnd ; + + it ) { <nl> - Detail : : Text usageText ( it - > commands ( ) , Detail : : TextAttributes ( ) <nl> + Detail : : Text usage ( it - > commands ( ) , Detail : : TextAttributes ( ) <nl> . setWidth ( maxWidth + indent ) <nl> . setIndent ( indent ) ) ; <nl> Detail : : Text desc ( it - > description , Detail : : TextAttributes ( ) <nl> . setWidth ( width - maxWidth - 3 ) ) ; <nl> <nl> - for ( std : : size_t i = 0 ; i < ( std : : max ) ( usageText . size ( ) , desc . size ( ) ) ; + + i ) { <nl> - std : : string usageCol = i < usageText . size ( ) ? usageText [ i ] : " " ; <nl> + for ( std : : size_t i = 0 ; i < ( std : : max ) ( usage . size ( ) , desc . size ( ) ) ; + + i ) { <nl> + std : : string usageCol = i < usage . size ( ) ? usage [ i ] : " " ; <nl> os < < usageCol ; <nl> <nl> if ( i < desc . size ( ) & & ! desc [ i ] . empty ( ) ) <nl> namespace Clara { <nl> return oss . str ( ) ; <nl> } <nl> <nl> - ConfigT parse ( int argc , char const * const * argv ) const { <nl> + ConfigT parse ( int argc , char const * const argv [ ] ) const { <nl> ConfigT config ; <nl> parseInto ( argc , argv , config ) ; <nl> return config ; <nl> } <nl> <nl> - std : : vector < Parser : : Token > parseInto ( int argc , char const * const * argv , ConfigT & config ) const { <nl> + std : : vector < Parser : : Token > parseInto ( int argc , char const * argv [ ] , ConfigT & config ) const { <nl> std : : string processName = argv [ 0 ] ; <nl> std : : size_t lastSlash = processName . find_last_of ( " / \ \ " ) ; <nl> if ( lastSlash ! = std : : string : : npos ) <nl> namespace Catch { <nl> Catch : : cout ( ) < < " For more detail usage please see the project docs \ n " < < std : : endl ; <nl> } <nl> <nl> - int applyCommandLine ( int argc , char const * const argv [ ] , OnUnusedOptions : : DoWhat unusedOptionBehaviour = OnUnusedOptions : : Fail ) { <nl> + int applyCommandLine ( int argc , char const * argv [ ] , OnUnusedOptions : : DoWhat unusedOptionBehaviour = OnUnusedOptions : : Fail ) { <nl> try { <nl> m_cli . setThrowOnUnrecognisedTokens ( unusedOptionBehaviour = = OnUnusedOptions : : Fail ) ; <nl> m_unusedTokens = m_cli . parseInto ( argc , argv , m_configData ) ; <nl> namespace Catch { <nl> m_config . reset ( ) ; <nl> } <nl> <nl> - int run ( int argc , char const * const argv [ ] ) { <nl> + int run ( int argc , char const * argv [ ] ) { <nl> <nl> int returnCode = applyCommandLine ( argc , argv ) ; <nl> if ( returnCode = = 0 ) <nl> returnCode = run ( ) ; <nl> return returnCode ; <nl> } <nl> + int run ( int argc , char * argv [ ] ) { <nl> + return run ( argc , const_cast < char const * * > ( argv ) ) ; <nl> + } <nl> <nl> int run ( ) { <nl> if ( m_configData . showHelp ) <nl> namespace Catch { <nl> return os ; <nl> } <nl> <nl> - Version libraryVersion ( 1 , 3 , 1 , " " , 0 ) ; <nl> + Version libraryVersion ( 1 , 3 , 4 , " " , 0 ) ; <nl> <nl> } <nl> <nl> int main ( int argc , char * const argv [ ] ) { <nl> # define CATCH_TEST_CASE ( . . . ) INTERNAL_CATCH_TESTCASE ( __VA_ARGS__ ) <nl> # define CATCH_TEST_CASE_METHOD ( className , . . . ) INTERNAL_CATCH_TEST_CASE_METHOD ( className , __VA_ARGS__ ) <nl> # define CATCH_METHOD_AS_TEST_CASE ( method , . . . ) INTERNAL_CATCH_METHOD_AS_TEST_CASE ( method , __VA_ARGS__ ) <nl> - # define CATCH_REGISTER_TEST_CASE ( . . . ) INTERNAL_CATCH_REGISTER_TESTCASE ( __VA_ARGS__ ) <nl> + # define CATCH_REGISTER_TEST_CASE ( Function , . . . ) INTERNAL_CATCH_REGISTER_TESTCASE ( Function , __VA_ARGS__ ) <nl> # define CATCH_SECTION ( . . . ) INTERNAL_CATCH_SECTION ( __VA_ARGS__ ) <nl> # define CATCH_FAIL ( . . . ) INTERNAL_CATCH_MSG ( Catch : : ResultWas : : ExplicitFailure , Catch : : ResultDisposition : : Normal , " CATCH_FAIL " , __VA_ARGS__ ) <nl> # define CATCH_SUCCEED ( . . . ) INTERNAL_CATCH_MSG ( Catch : : ResultWas : : Ok , Catch : : ResultDisposition : : ContinueOnFailure , " CATCH_SUCCEED " , __VA_ARGS__ ) <nl> int main ( int argc , char * const argv [ ] ) { <nl> # define TEST_CASE ( . . . ) INTERNAL_CATCH_TESTCASE ( __VA_ARGS__ ) <nl> # define TEST_CASE_METHOD ( className , . . . ) INTERNAL_CATCH_TEST_CASE_METHOD ( className , __VA_ARGS__ ) <nl> # define METHOD_AS_TEST_CASE ( method , . . . ) INTERNAL_CATCH_METHOD_AS_TEST_CASE ( method , __VA_ARGS__ ) <nl> - # define REGISTER_TEST_CASE ( . . . ) INTERNAL_CATCH_REGISTER_TESTCASE ( __VA_ARGS__ ) <nl> + # define REGISTER_TEST_CASE ( Function , . . . ) INTERNAL_CATCH_REGISTER_TESTCASE ( Function , __VA_ARGS__ ) <nl> # define SECTION ( . . . ) INTERNAL_CATCH_SECTION ( __VA_ARGS__ ) <nl> # define FAIL ( . . . ) INTERNAL_CATCH_MSG ( Catch : : ResultWas : : ExplicitFailure , Catch : : ResultDisposition : : Normal , " FAIL " , __VA_ARGS__ ) <nl> # define SUCCEED ( . . . ) INTERNAL_CATCH_MSG ( Catch : : ResultWas : : Ok , Catch : : ResultDisposition : : ContinueOnFailure , " SUCCEED " , __VA_ARGS__ ) <nl> int main ( int argc , char * const argv [ ] ) { <nl> # define TEST_CASE ( name , description ) INTERNAL_CATCH_TESTCASE ( name , description ) <nl> # define TEST_CASE_METHOD ( className , name , description ) INTERNAL_CATCH_TEST_CASE_METHOD ( className , name , description ) <nl> # define METHOD_AS_TEST_CASE ( method , name , description ) INTERNAL_CATCH_METHOD_AS_TEST_CASE ( method , name , description ) <nl> - # define REGISTER_TEST_CASE ( . . . ) INTERNAL_CATCH_REGISTER_TESTCASE ( __VA_ARGS__ ) <nl> + # define REGISTER_TEST_CASE ( method , name , description ) INTERNAL_CATCH_REGISTER_TESTCASE ( method , name , description ) <nl> # define SECTION ( name , description ) INTERNAL_CATCH_SECTION ( name , description ) <nl> # define FAIL ( msg ) INTERNAL_CATCH_MSG ( Catch : : ResultWas : : ExplicitFailure , Catch : : ResultDisposition : : Normal , " FAIL " , msg ) <nl> # define SUCCEED ( msg ) INTERNAL_CATCH_MSG ( Catch : : ResultWas : : Ok , Catch : : ResultDisposition : : ContinueOnFailure , " SUCCEED " , msg ) <nl> new file mode 100644 <nl> index 000000000 . . 92e20024c <nl> mmm / dev / null <nl> ppp b / test / fuzz . cpp <nl> <nl> + / * <nl> + __ _____ _____ _____ <nl> + __ | | __ | | | | JSON for Modern C + + ( fuzz test support ) <nl> + | | | __ | | | | | | version 2 . 0 . 0 <nl> + | _____ | _____ | _____ | _ | ___ | https : / / github . com / nlohmann / json <nl> + <nl> + Run " make fuzz_testing " and follow the instructions . <nl> + <nl> + Licensed under the MIT License < http : / / opensource . org / licenses / MIT > . <nl> + * / <nl> + <nl> + # include < json . hpp > <nl> + <nl> + using json = nlohmann : : json ; <nl> + <nl> + int main ( ) <nl> + { <nl> + # ifdef __AFL_HAVE_MANUAL_CONTROL <nl> + while ( __AFL_LOOP ( 1000 ) ) <nl> + { <nl> + # endif <nl> + try <nl> + { <nl> + json j ( std : : cin ) ; <nl> + std : : cout < < j < < std : : endl ; <nl> + } <nl> + catch ( std : : invalid_argument & e ) <nl> + { <nl> + std : : cout < < " Invalid argument in parsing " < < e . what ( ) < < ' \ n ' ; <nl> + } <nl> + # ifdef __AFL_HAVE_MANUAL_CONTROL <nl> + } <nl> + # endif <nl> + } <nl>
update from master
nlohmann/json
f160f33fb5bdf747fe10c5c1de687003b6b9c998
2016-02-14T20:44:00Z
mmm a / data / gui . xml <nl> ppp b / data / gui . xml <nl> <nl> < ! - - When you scale the selection , pressing this <nl> keyboard shortcut you maintain aspect ratio - - > <nl> < key action = " MaintainAspectRatio " shortcut = " Shift " / > <nl> + <nl> + < ! - - Modifiers for selection tool - - > <nl> + < key action = " AddSelection " shortcut = " Shift " / > <nl> + < key action = " SubtractSelection " shortcut = " Alt " / > <nl> < / spriteeditor > <nl> <nl> < / keyboard > <nl> mmm a / src / app / modules / gui . cpp <nl> ppp b / src / app / modules / gui . cpp <nl> <nl> # define SPRITEDITOR_ACTION_ANGLESNAP " AngleSnap " <nl> # define SPRITEDITOR_ACTION_MAINTAINASPECTRATIO " MaintainAspectRatio " <nl> # define SPRITEDITOR_ACTION_LOCKAXIS " LockAxis " <nl> + # define SPRITEDITOR_ACTION_ADDSEL " AddSelection " <nl> + # define SPRITEDITOR_ACTION_SUBSEL " SubtractSelection " <nl> <nl> namespace app { <nl> <nl> Accelerator * get_accel_to_lock_axis ( ) <nl> return NULL ; <nl> } <nl> <nl> + Accelerator * get_accel_to_add_selection ( ) <nl> + { <nl> + Shortcut * shortcut = get_keyboard_shortcut_for_spriteeditor ( SPRITEDITOR_ACTION_ADDSEL ) ; <nl> + if ( shortcut ) <nl> + return shortcut - > accel ; <nl> + else <nl> + return NULL ; <nl> + } <nl> + <nl> + Accelerator * get_accel_to_subtract_selection ( ) <nl> + { <nl> + Shortcut * shortcut = get_keyboard_shortcut_for_spriteeditor ( SPRITEDITOR_ACTION_SUBSEL ) ; <nl> + if ( shortcut ) <nl> + return shortcut - > accel ; <nl> + else <nl> + return NULL ; <nl> + } <nl> + <nl> tools : : Tool * get_selected_quicktool ( tools : : Tool * currentTool ) <nl> { <nl> if ( currentTool & & currentTool - > getInk ( 0 ) - > isSelection ( ) ) { <nl> mmm a / src / app / modules / gui . h <nl> ppp b / src / app / modules / gui . h <nl> namespace app { <nl> ui : : Accelerator * get_accel_to_angle_snap ( ) ; <nl> ui : : Accelerator * get_accel_to_maintain_aspect_ratio ( ) ; <nl> ui : : Accelerator * get_accel_to_lock_axis ( ) ; <nl> + ui : : Accelerator * get_accel_to_add_selection ( ) ; <nl> + ui : : Accelerator * get_accel_to_subtract_selection ( ) ; <nl> <nl> tools : : Tool * get_selected_quicktool ( tools : : Tool * currentTool ) ; <nl> <nl> mmm a / src / app / ui / context_bar . cpp <nl> ppp b / src / app / ui / context_bar . cpp <nl> class ContextBar : : SelectionModeField : public ButtonSet <nl> <nl> void setupTooltips ( TooltipManager * tooltipManager ) { <nl> tooltipManager - > addTooltipFor ( getButtonAt ( 0 ) , " Replace selection " , JI_BOTTOM ) ; <nl> - tooltipManager - > addTooltipFor ( getButtonAt ( 1 ) , " Add to selection " , JI_BOTTOM ) ; <nl> - tooltipManager - > addTooltipFor ( getButtonAt ( 2 ) , " Subtract from selection " , JI_BOTTOM ) ; <nl> + tooltipManager - > addTooltipFor ( getButtonAt ( 1 ) , " Add to selection ( Shift key ) " , JI_BOTTOM ) ; <nl> + tooltipManager - > addTooltipFor ( getButtonAt ( 2 ) , " Subtract from selection ( Alt key ) " , JI_BOTTOM ) ; <nl> + } <nl> + <nl> + void setSelectionMode ( SelectionMode mode ) { <nl> + setSelectedItem ( ( int ) mode ) ; <nl> + invalidate ( ) ; <nl> } <nl> <nl> protected : <nl> void ContextBar : : updateForMovingPixels ( ) <nl> layout ( ) ; <nl> } <nl> <nl> + void ContextBar : : updateForSelectionMode ( SelectionMode mode ) <nl> + { <nl> + if ( ! m_selectionMode - > isVisible ( ) ) <nl> + return ; <nl> + <nl> + m_selectionMode - > setSelectionMode ( mode ) ; <nl> + } <nl> + <nl> } / / namespace app <nl> mmm a / src / app / ui / context_bar . h <nl> ppp b / src / app / ui / context_bar . h <nl> namespace app { <nl> <nl> void updateFromTool ( tools : : Tool * tool ) ; <nl> void updateForMovingPixels ( ) ; <nl> + void updateForSelectionMode ( SelectionMode mode ) ; <nl> <nl> protected : <nl> bool onProcessMessage ( ui : : Message * msg ) override ; <nl> mmm a / src / app / ui / document_view . cpp <nl> ppp b / src / app / ui / document_view . cpp <nl> class AppEditor : public Editor , <nl> else <nl> return false ; <nl> } <nl> + <nl> + bool isAddSelectionPressed ( ) override { <nl> + Accelerator * accel = get_accel_to_add_selection ( ) ; <nl> + if ( accel ) <nl> + return accel - > checkFromAllegroKeyArray ( ) ; <nl> + else <nl> + return false ; <nl> + } <nl> + <nl> + bool isSubtractSelectionPressed ( ) override { <nl> + Accelerator * accel = get_accel_to_subtract_selection ( ) ; <nl> + if ( accel ) <nl> + return accel - > checkFromAllegroKeyArray ( ) ; <nl> + else <nl> + return false ; <nl> + } <nl> + <nl> } ; <nl> <nl> DocumentView : : DocumentView ( Document * document , Type type ) <nl> mmm a / src / app / ui / editor / editor . cpp <nl> ppp b / src / app / ui / editor / editor . cpp <nl> Editor : : Editor ( Document * document , EditorFlags flags ) <nl> , m_frame ( FrameNumber ( 0 ) ) <nl> , m_zoom ( 0 ) <nl> , m_mask_timer ( 100 , this ) <nl> + , m_selectionMode ( kDefaultSelectionMode ) <nl> , m_customizationDelegate ( NULL ) <nl> , m_docView ( NULL ) <nl> , m_flags ( flags ) <nl> void Editor : : updateStatusBar ( ) <nl> m_state - > onUpdateStatusBar ( this ) ; <nl> } <nl> <nl> - void Editor : : editor_update_quicktool ( ) <nl> + void Editor : : updateQuicktool ( ) <nl> { <nl> if ( m_customizationDelegate ) { <nl> UIContext * context = UIContext : : instance ( ) ; <nl> tools : : Tool * current_tool = context - > settings ( ) - > getCurrentTool ( ) ; <nl> - tools : : Tool * old_quicktool = m_quicktool ; <nl> <nl> + / / Don ' t change quicktools if we are in a selection tool and using <nl> + / / the selection modifiers . <nl> + if ( current_tool - > getInk ( 0 ) - > isSelection ( ) ) { <nl> + if ( m_customizationDelegate - > isAddSelectionPressed ( ) | | <nl> + m_customizationDelegate - > isSubtractSelectionPressed ( ) ) <nl> + return ; <nl> + } <nl> + <nl> + tools : : Tool * old_quicktool = m_quicktool ; <nl> m_quicktool = m_customizationDelegate - > getQuickTool ( current_tool ) ; <nl> <nl> / / If the tool has changed , we must to update the status bar because <nl> void Editor : : editor_update_quicktool ( ) <nl> } <nl> } <nl> <nl> + void Editor : : updateSelectionMode ( ) <nl> + { <nl> + SelectionMode mode = UIContext : : instance ( ) - > settings ( ) - > selection ( ) - > getSelectionMode ( ) ; <nl> + <nl> + if ( m_customizationDelegate & & m_customizationDelegate - > isAddSelectionPressed ( ) ) <nl> + mode = kAddSelectionMode ; <nl> + else if ( m_customizationDelegate & & m_customizationDelegate - > isSubtractSelectionPressed ( ) ) <nl> + mode = kSubtractSelectionMode ; <nl> + else if ( m_secondaryButton ) <nl> + mode = kSubtractSelectionMode ; <nl> + <nl> + if ( mode ! = m_selectionMode ) { <nl> + m_selectionMode = mode ; <nl> + <nl> + App : : instance ( ) - > getMainWindow ( ) - > getContextBar ( ) <nl> + - > updateForSelectionMode ( mode ) ; <nl> + } <nl> + } <nl> + <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> / / Message handler for the editor <nl> <nl> bool Editor : : onProcessMessage ( Message * msg ) <nl> break ; <nl> <nl> case kMouseEnterMessage : <nl> - editor_update_quicktool ( ) ; <nl> + updateQuicktool ( ) ; <nl> + updateSelectionMode ( ) ; <nl> break ; <nl> <nl> case kMouseLeaveMessage : <nl> bool Editor : : onProcessMessage ( Message * msg ) <nl> if ( ! m_secondaryButton & & mouseMsg - > right ( ) ) { <nl> m_secondaryButton = mouseMsg - > right ( ) ; <nl> <nl> - editor_update_quicktool ( ) ; <nl> + updateQuicktool ( ) ; <nl> + updateSelectionMode ( ) ; <nl> editor_setcursor ( ) ; <nl> } <nl> <nl> bool Editor : : onProcessMessage ( Message * msg ) <nl> if ( ! hasCapture ( ) & & m_secondaryButton ) { <nl> m_secondaryButton = false ; <nl> <nl> - editor_update_quicktool ( ) ; <nl> + updateQuicktool ( ) ; <nl> + updateSelectionMode ( ) ; <nl> editor_setcursor ( ) ; <nl> } <nl> <nl> bool Editor : : onProcessMessage ( Message * msg ) <nl> bool used = m_state - > onKeyDown ( this , static_cast < KeyMessage * > ( msg ) ) ; <nl> <nl> if ( hasMouse ( ) ) { <nl> - editor_update_quicktool ( ) ; <nl> + updateQuicktool ( ) ; <nl> + updateSelectionMode ( ) ; <nl> editor_setcursor ( ) ; <nl> } <nl> <nl> bool Editor : : onProcessMessage ( Message * msg ) <nl> bool used = m_state - > onKeyUp ( this , static_cast < KeyMessage * > ( msg ) ) ; <nl> <nl> if ( hasMouse ( ) ) { <nl> - editor_update_quicktool ( ) ; <nl> + updateQuicktool ( ) ; <nl> + updateSelectionMode ( ) ; <nl> editor_setcursor ( ) ; <nl> } <nl> <nl> bool Editor : : isInsideSelection ( ) <nl> int x , y ; <nl> screenToEditor ( jmouse_x ( 0 ) , jmouse_y ( 0 ) , & x , & y ) ; <nl> return <nl> - ( UIContext : : instance ( ) - > settings ( ) - > selection ( ) - > getSelectionMode ( ) ! = kSubtractSelectionMode ) & & <nl> + ( m_selectionMode ! = kSubtractSelectionMode ) & & <nl> m_document ! = NULL & & <nl> m_document - > isMaskVisible ( ) & & <nl> m_document - > mask ( ) - > containsPoint ( x , y ) ; <nl> mmm a / src / app / ui / editor / editor . h <nl> ppp b / src / app / ui / editor / editor . h <nl> <nl> <nl> # include " app / color . h " <nl> # include " app / document . h " <nl> + # include " app / settings / selection_mode . h " <nl> # include " app / settings / settings_observers . h " <nl> # include " app / ui / editor / editor_observers . h " <nl> # include " app / ui / editor / editor_state . h " <nl> namespace app { <nl> tools : : Tool * getCurrentEditorTool ( ) ; <nl> tools : : Ink * getCurrentEditorInk ( ) ; <nl> <nl> + SelectionMode getSelectionMode ( ) const { return m_selectionMode ; } <nl> + <nl> bool isSecondaryButton ( ) const { return m_secondaryButton ; } <nl> <nl> / / Returns true if we are able to draw in the current doc / sprite / layer / cel . <nl> namespace app { <nl> <nl> private : <nl> void setStateInternal ( const EditorStatePtr & newState ) ; <nl> - void editor_update_quicktool ( ) ; <nl> + void updateQuicktool ( ) ; <nl> + void updateSelectionMode ( ) ; <nl> void drawBrushPreview ( int x , int y , bool refresh = true ) ; <nl> void moveBrushPreview ( int x , int y , bool refresh = true ) ; <nl> void clearBrushPreview ( bool refresh = true ) ; <nl> namespace app { <nl> / / the user is not pressing any keyboard key ) . <nl> tools : : Tool * m_quicktool ; <nl> <nl> + SelectionMode m_selectionMode ; <nl> + <nl> / / Offset for the sprite <nl> int m_offset_x ; <nl> int m_offset_y ; <nl> mmm a / src / app / ui / editor / editor_customization_delegate . h <nl> ppp b / src / app / ui / editor / editor_customization_delegate . h <nl> namespace app { <nl> / / Returns true if the user wants to lock the X or Y axis when he is <nl> / / dragging the selection . <nl> virtual bool isLockAxisKeyPressed ( ) = 0 ; <nl> + <nl> + virtual bool isAddSelectionPressed ( ) = 0 ; <nl> + <nl> + virtual bool isSubtractSelectionPressed ( ) = 0 ; <nl> } ; <nl> <nl> } / / namespace app <nl> mmm a / src / app / ui / editor / tool_loop_impl . cpp <nl> ppp b / src / app / ui / editor / tool_loop_impl . cpp <nl> class ToolLoopImpl : public tools : : ToolLoop , <nl> tools : : Ink * m_ink ; <nl> int m_primary_color ; <nl> int m_secondary_color ; <nl> - SelectionMode m_selectionMode ; <nl> UndoTransaction m_undoTransaction ; <nl> ExpandCelCanvas m_expandCelCanvas ; <nl> gfx : : Region m_dirtyArea ; <nl> class ToolLoopImpl : public tools : : ToolLoop , <nl> , m_ink ( ink ) <nl> , m_primary_color ( color_utils : : color_for_layer ( primary_color , m_layer ) ) <nl> , m_secondary_color ( color_utils : : color_for_layer ( secondary_color , m_layer ) ) <nl> - , m_selectionMode ( m_settings - > selection ( ) - > getSelectionMode ( ) ) <nl> , m_undoTransaction ( m_context , <nl> m_tool - > getText ( ) . c_str ( ) , <nl> ( ( getInk ( ) - > isSelection ( ) | | <nl> class ToolLoopImpl : public tools : : ToolLoop , <nl> break ; <nl> } <nl> <nl> - / / Right - click subtract selection always . <nl> - if ( m_button = = 1 ) <nl> - m_selectionMode = kSubtractSelectionMode ; <nl> - <nl> m_previewFilled = m_toolSettings - > getPreviewFilled ( ) ; <nl> <nl> m_sprayWidth = m_toolSettings - > getSprayWidth ( ) ; <nl> class ToolLoopImpl : public tools : : ToolLoop , <nl> / / Selection ink <nl> if ( getInk ( ) - > isSelection ( ) & & <nl> ( ! m_document - > isMaskVisible ( ) | | <nl> - m_selectionMode = = kDefaultSelectionMode ) ) { <nl> + getSelectionMode ( ) = = kDefaultSelectionMode ) ) { <nl> Mask emptyMask ; <nl> m_document - > setMask ( & emptyMask ) ; <nl> } <nl> class ToolLoopImpl : public tools : : ToolLoop , <nl> int getOpacity ( ) override { return m_opacity ; } <nl> int getTolerance ( ) override { return m_tolerance ; } <nl> bool getContiguous ( ) override { return m_contiguous ; } <nl> - SelectionMode getSelectionMode ( ) override { return m_selectionMode ; } <nl> + SelectionMode getSelectionMode ( ) override { return m_editor - > getSelectionMode ( ) ; } <nl> ISettings * settings ( ) override { return m_settings ; } <nl> IDocumentSettings * getDocumentSettings ( ) override { return m_docSettings ; } <nl> bool getFilled ( ) override { return m_filled ; } <nl>
Add Shift / Alt modifiers to selection tools to change Union / Subtract modes ( fix )
aseprite/aseprite
522e9a03377f33d382dd70e1bd1a66cd18eab5b4
2014-08-24T22:19:38Z
mmm a / README . md <nl> ppp b / README . md <nl> For previous versions , please read : <nl> <nl> # # V3 changes <nl> <nl> + * v3 . 0 , 2020 - 01 - 28 , Use multiple revisions . 3 . 0 . 111 <nl> * v3 . 0 , 2020 - 01 - 28 , Fix [ # 1230 ] [ bug # 1230 ] , racing condition in source fetch or create . 3 . 0 . 110 <nl> * v3 . 0 , 2020 - 01 - 27 , Fix [ # 1303 ] [ bug # 1303 ] , do not dispatch previous meta when not publishing . 3 . 0 . 109 <nl> * v3 . 0 , 2020 - 01 - 26 , Allow use libst . so for ST is MPL license . <nl> mmm a / trunk / src / core / srs_core . hpp <nl> ppp b / trunk / src / core / srs_core . hpp <nl> <nl> / / The version config . <nl> # define VERSION_MAJOR 3 <nl> # define VERSION_MINOR 0 <nl> - # define SRS3_VERSION_REVISION 110 <nl> + # define SRS3_VERSION_REVISION 111 <nl> # define VERSION_REVISION SRS3_VERSION_REVISION <nl> <nl> / / The macros generated by configure script . <nl>
Use multiple revisions . 3 . 0 . 111
ossrs/srs
afc0faf7387418fdd9a40aef44e28d9347951cb5
2020-01-28T13:42:48Z
mmm a / hphp / hack / src / hh_single_decl . ml <nl> ppp b / hphp / hack / src / hh_single_decl . ml <nl> <nl> open Hh_prelude <nl> open Direct_decl_parser <nl> <nl> - type verbosity = <nl> - | Standard <nl> - | Verbose <nl> - | Silent <nl> - <nl> let auto_namespace_map = [ ] <nl> <nl> let popt = <nl> let init root : Provider_context . t = <nl> <nl> ctx <nl> <nl> - let time verbosity msg f = <nl> - let before = Unix . gettimeofday ( ) in <nl> - let ret = f ( ) in <nl> - let after = Unix . gettimeofday ( ) in <nl> - ( match verbosity with <nl> - | Verbose - > Printf . printf " % s : % f ms \ n " msg ( ( after - . before ) * . 1000 . ) <nl> - | _ - > ( ) ) ; <nl> - ret <nl> - <nl> - let colon = Str . regexp " : " <nl> - <nl> - let dash = Str . regexp " - " <nl> - <nl> - let mangle_xhp x = <nl> - x <nl> - | > Str . replace_first colon " xhp_ " <nl> - | > Str . global_replace colon " __ " <nl> - | > Str . global_replace dash " _ " <nl> - <nl> - type decls = { <nl> - classes : Shallow_decl_defs . shallow_class SMap . t ; <nl> - funs : Typing_defs . fun_elt SMap . t ; <nl> - typedefs : Typing_defs . typedef_type SMap . t ; <nl> - consts : Typing_defs . const_decl SMap . t ; <nl> - records : Typing_defs . record_def_type SMap . t ; <nl> - } <nl> - [ @ @ deriving show { with_path = false } ] <nl> - <nl> - let empty_decls = <nl> - { <nl> - classes = SMap . empty ; <nl> - funs = SMap . empty ; <nl> - typedefs = SMap . empty ; <nl> - consts = SMap . empty ; <nl> - records = SMap . empty ; <nl> - } <nl> - <nl> - let parse_decls fn text auto_namespace_map = <nl> - let decls = parse_decls_ffi fn text auto_namespace_map in <nl> - List . fold decls ~ init : empty_decls ~ f : ( fun decls ( name , decl ) - > <nl> - let open Shallow_decl_defs in <nl> - match decl with <nl> - | Class x - > { decls with classes = SMap . add name x decls . classes } <nl> - | Fun x - > { decls with funs = SMap . add name x decls . funs } <nl> - | Typedef x - > { decls with typedefs = SMap . add name x decls . typedefs } <nl> - | Record x - > { decls with records = SMap . add name x decls . records } <nl> - | Const x - > { decls with consts = SMap . add name x decls . consts } ) <nl> + let rec shallow_declare_ast ctx decls prog = <nl> + List . fold prog ~ init : decls ~ f : ( fun decls def - > <nl> + let open Aast in <nl> + match def with <nl> + | Namespace ( _ , prog ) - > shallow_declare_ast ctx decls prog <nl> + | NamespaceUse _ - > decls <nl> + | SetNamespaceEnv _ - > decls <nl> + | FileAttributes _ - > decls <nl> + | Fun f - > <nl> + let ( name , decl ) = <nl> + Decl_nast . fun_naming_and_decl ~ write_shmem : false ctx f <nl> + in <nl> + ( name , Shallow_decl_defs . Fun decl ) : : decls <nl> + | Class c - > <nl> + let decl = Shallow_classes_provider . decl ~ use_cache : false ctx c in <nl> + let ( _ , name ) = decl . Shallow_decl_defs . sc_name in <nl> + ( name , Shallow_decl_defs . Class decl ) : : decls <nl> + | RecordDef rd - > <nl> + let ( name , decl ) = <nl> + Decl_nast . record_def_naming_and_decl ~ write_shmem : false ctx rd <nl> + in <nl> + ( name , Shallow_decl_defs . Record decl ) : : decls <nl> + | Typedef typedef - > <nl> + let ( name , decl ) = <nl> + Decl_nast . typedef_naming_and_decl ~ write_shmem : false ctx typedef <nl> + in <nl> + ( name , Shallow_decl_defs . Typedef decl ) : : decls <nl> + | Stmt _ - > decls <nl> + | Constant cst - > <nl> + let ( name , ty ) = <nl> + Decl_nast . const_naming_and_decl ~ write_shmem : false ctx cst <nl> + in <nl> + let decl = Typing_defs . { cd_pos = fst cst . cst_name ; cd_type = ty } in <nl> + ( name , Shallow_decl_defs . Const decl ) : : decls ) <nl> <nl> - let compare_decl ctx verbosity fn = <nl> + let compare_decls ctx fn = <nl> let fn = Path . to_string fn in <nl> let text = RealDisk . cat fn in <nl> let fn = Relative_path . ( create Root fn ) in <nl> - let decls = <nl> - time verbosity " Parsed decls " ( fun ( ) - > <nl> - parse_decls fn text auto_namespace_map ) <nl> - in <nl> - let facts = <nl> - Option . value_exn <nl> - ~ message : " Could not parse facts from file " <nl> - ( Facts_parser . from_text <nl> - ~ php5_compat_mode : false <nl> - ~ hhvm_compat_mode : false <nl> - ~ disable_nontoplevel_declarations : false <nl> - ~ disable_legacy_soft_typehints : false <nl> - ~ allow_new_attribute_syntax : true <nl> - ~ disable_legacy_attribute_syntax : false <nl> - ~ enable_xhp_class_modifier : false <nl> - ~ disable_xhp_element_mangling : false <nl> - ~ filename : fn <nl> - ~ text ) <nl> - in <nl> - let passes_symbol_check ( ) = <nl> - let compare name facts_symbols decl_symbols = <nl> - let facts_symbols = SSet . of_list ( List . map facts_symbols ( ( ^ ) " \ \ " ) ) in <nl> - let decl_symbols = SSet . of_list decl_symbols in <nl> - let facts_only = SSet . diff facts_symbols decl_symbols in <nl> - let decl_only = SSet . diff decl_symbols facts_symbols in <nl> - if ( not @ @ SSet . is_empty facts_only ) | | ( not @ @ SSet . is_empty decl_only ) <nl> - then ( <nl> - if not @ @ SSet . is_empty facts_only then <nl> - Printf . eprintf <nl> - " The following % s were found in the facts parse but not the decl parse : % s \ n " <nl> - name <nl> - ( SSet . show facts_only ) ; <nl> - if not @ @ SSet . is_empty decl_only then <nl> - Printf . eprintf <nl> - " The following % s were found in the decl parse but not the facts parse : % s \ n " <nl> - name <nl> - ( SSet . show decl_only ) ; <nl> - prerr_endline " " ; <nl> - false <nl> - ) else <nl> - true <nl> - in <nl> - [ <nl> - compare " typedef ( s ) " facts . Facts . type_aliases ( SMap . keys decls . typedefs ) ; <nl> - compare " constant ( s ) " facts . Facts . constants ( SMap . keys decls . consts ) ; <nl> - compare " function ( s ) " facts . Facts . functions ( SMap . keys decls . funs ) ; <nl> - compare <nl> - " class ( es ) " <nl> - ( Facts . InvSMap . keys facts . Facts . types ) <nl> - ( List . map ( SMap . keys decls . classes ) ~ f : mangle_xhp <nl> - @ SMap . keys decls . typedefs ) ; <nl> - ] <nl> - | > List . reduce_exn ~ f : ( & & ) <nl> - in <nl> - let passes_decl_check ( ) = <nl> - let ( ) = <nl> - time verbosity " Calculated legacy decls " ( fun ( ) - > <nl> - ( * Put the file contents in the disk heap so both the decl parsing and <nl> - * legacy decl branches can avoid having to wait for file I / O . * ) <nl> - File_provider . provide_file fn ( File_provider . Disk text ) ; <nl> - Decl . make_env ~ sh : SharedMem . Uses ctx fn ) <nl> - in <nl> - let compare name get_decl eq_decl show_decl parsed_decls = <nl> - let different_decls = <nl> - SMap . fold <nl> - ( fun key parsed_decl acc - > <nl> - let legacy_decl = get_decl ctx fn key in <nl> - let legacy_decl_str = show_decl legacy_decl in <nl> - let parsed_decl_str = show_decl parsed_decl in <nl> - if not @ @ eq_decl legacy_decl parsed_decl then <nl> - ( key , legacy_decl_str , parsed_decl_str ) : : acc <nl> - else <nl> - acc ) <nl> - parsed_decls <nl> - [ ] <nl> - in <nl> - match different_decls with <nl> - | [ ] - > true <nl> - | different_decls - > <nl> - Printf . eprintf <nl> - " The following % s differed between the legacy and parsed versions : \ n " <nl> - name ; <nl> - List . iter different_decls ~ f : ( fun ( key , legacy_decl , parsed_decl ) - > <nl> - Tempfile . with_real_tempdir ( fun dir - > <nl> - let temp_dir = Path . to_string dir in <nl> - let temp_file ( ) = <nl> - Caml . Filename . temp_file <nl> - ~ temp_dir <nl> - ( Printf . sprintf " % s_ % s " name key ) <nl> - " . txt " <nl> - in <nl> - let expected = temp_file ( ) in <nl> - let actual = temp_file ( ) in <nl> - Disk . write_file ~ file : expected ~ contents : legacy_decl ; <nl> - Disk . write_file ~ file : actual ~ contents : parsed_decl ; <nl> - Printf . eprintf " \ n \ n [ % s ] \ n " key ; <nl> - Out_channel . flush stderr ; <nl> - Ppxlib_print_diff . print <nl> - ~ diff_command : " diff - U9999 - - label legacy - - label parsed " <nl> - ~ file1 : expected <nl> - ~ file2 : actual <nl> - ( ) ) ) ; <nl> - false <nl> - in <nl> - [ <nl> - compare <nl> - " typedef ( s ) " <nl> - ( Decl . declare_typedef_in_file ~ write_shmem : true ) <nl> - Typing_defs . equal_typedef_type <nl> - Typing_defs . show_typedef_type <nl> - decls . typedefs ; <nl> - compare <nl> - " constant ( s ) " <nl> - ( fun ctx a b - > Decl . declare_const_in_file ~ write_shmem : true ctx a b ) <nl> - Typing_defs . equal_decl_ty <nl> - Typing_defs . show_decl_ty <nl> - ( SMap . map ( fun cd - > cd . Typing_defs . cd_type ) decls . consts ) ; <nl> - compare <nl> - " function ( s ) " <nl> - ( Decl . declare_fun_in_file ~ write_shmem : true ) <nl> - Typing_defs . equal_fun_elt <nl> - Typing_defs . show_fun_elt <nl> - decls . funs ; <nl> - compare <nl> - " class ( es ) " <nl> - ( fun ctx fn name - > <nl> - let class_ = Ast_provider . find_class_in_file ctx fn name in <nl> - let class_ = Option . value_exn class_ in <nl> - let class_ = <nl> - Shallow_classes_provider . decl ctx ~ use_cache : true class_ <nl> - in <nl> - class_ ) <nl> - Shallow_decl_defs . equal_shallow_class <nl> - Shallow_decl_defs . show_shallow_class <nl> - decls . classes ; <nl> - ] <nl> - | > List . reduce_exn ~ f : ( & & ) <nl> - in <nl> - let matched = passes_symbol_check ( ) & & passes_decl_check ( ) in <nl> - if matched then ( <nl> - print_endline " Parsed decls : \ n " ; <nl> - print_endline ( show_decls decls ) ; <nl> - print_endline " \ nThey matched ! " <nl> - ) ; <nl> + let ast = Ast_provider . get_ast ctx fn in <nl> + let legacy_decls = shallow_declare_ast ctx [ ] ast in <nl> + let legacy_decls_str = show_decls ( List . rev legacy_decls ) ^ " \ n " in <nl> + let decls = parse_decls_ffi fn text auto_namespace_map in <nl> + let decls_str = show_decls ( List . rev decls ) ^ " \ n " in <nl> + let matched = String . equal decls_str legacy_decls_str in <nl> + if matched then <nl> + Printf . printf " % s \ nThey matched ! \ n " decls_str <nl> + else <nl> + Tempfile . with_real_tempdir ( fun dir - > <nl> + let temp_dir = Path . to_string dir in <nl> + let expected = <nl> + Caml . Filename . temp_file ~ temp_dir " expected_decls " " . txt " <nl> + in <nl> + let actual = Caml . Filename . temp_file ~ temp_dir " actual_decls " " . txt " in <nl> + Disk . write_file ~ file : expected ~ contents : legacy_decls_str ; <nl> + Disk . write_file ~ file : actual ~ contents : decls_str ; <nl> + Ppxlib_print_diff . print <nl> + ~ diff_command : " diff - U9999 - - label legacy - - label ' direct decl ' " <nl> + ~ file1 : expected <nl> + ~ file2 : actual <nl> + ( ) ) ; <nl> matched <nl> <nl> type modes = CompareDirectDeclParser <nl> let ( ) = <nl> | None - > file : = Some f <nl> | Some _ - > usage_and_exit ( ) <nl> in <nl> - let verbosity = ref Standard in <nl> let skip_if_errors = ref false in <nl> + let expect_extension = ref " . exp " in <nl> + let set_expect_extension s = expect_extension : = s in <nl> Arg . parse <nl> [ <nl> ( " - - compare - direct - decl - parser " , <nl> Arg . Unit ( set_mode CompareDirectDeclParser ) , <nl> " ( mode ) Runs the direct decl parser against the FFP - > naming - > decl pipeline and compares their output " <nl> ) ; <nl> - ( " - - verbosity " , <nl> - Arg . Symbol <nl> - ( [ " silent " ; " standard " ; " verbose " ] , <nl> - fun v - > <nl> - verbosity : = <nl> - match v with <nl> - | " silent " - > Silent <nl> - | " standard " - > Standard <nl> - | " verbose " - > Verbose <nl> - | _ - > <nl> - failwith <nl> - @ @ Printf . sprintf " Did not understand verbosity level % s " v ) , <nl> - " Set the verbosity level . Silent will hide the \ " no differences \ " message on a successful " <nl> - ^ " run , and verbose will print debugging information to the console " ) ; <nl> ( " - - skip - if - errors " , <nl> Arg . Set skip_if_errors , <nl> " Skip comparison if the corresponding . exp file has errors " ) ; <nl> + ( " - - expect - extension " , <nl> + Arg . String set_expect_extension , <nl> + " The extension with which the output of the legacy pipeline should be written " <nl> + ) ; <nl> ] <nl> set_file <nl> usage ; <nl> let ( ) = <nl> let file = Path . make file in <nl> let ctx = init ( Path . dirname file ) in <nl> Provider_utils . respect_but_quarantine_unsaved_changes ~ ctx ~ f : ( fun ( ) - > <nl> - if not @ @ compare_decl ctx ! verbosity file then exit 1 ) <nl> + if not @ @ compare_decls ctx file then exit 1 ) <nl> end <nl> mmm a / hphp / hack / test / decl / abstract_method . php . exp <nl> ppp b / hphp / hack / test / decl / abstract_method . php . exp <nl> <nl> - Parsed decls : <nl> - <nl> - { classes = <nl> - { " \ \ C " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cabstract ; <nl> - sc_name = ( [ 3 : 16 - 17 ] , " \ \ C " ) ; sc_tparams = [ ] ; <nl> - sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> - sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> - sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; <nl> - sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; sc_constructor = None ; <nl> - sc_static_methods = [ ] ; <nl> - sc_methods = <nl> - [ { Shallow_decl_defs . sm_abstract = true ; sm_final = false ; <nl> - sm_memoizelsb = false ; sm_name = ( [ 4 : 28 - 29 ] , " f " ) ; <nl> - sm_override = false ; sm_dynamicallycallable = false ; <nl> - sm_reactivity = None ; <nl> - sm_type = <nl> - ( Rwitness ( root | abstract_method . php line 4 , characters 28 - 28 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | abstract_method . php line 4 , characters 28 - 28 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | abstract_method . php line 4 , characters 33 - 36 ) , <nl> - ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } <nl> - } ) ) ; <nl> - sm_visibility = Public ; sm_deprecated = None } <nl> - ] ; <nl> - sc_user_attributes = [ ] ; sc_enum_type = None } } ; <nl> - funs = { } ; typedefs = { } ; consts = { } ; records = { } } <nl> + [ ( " \ \ C " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cabstract ; <nl> + sc_name = ( [ 3 : 16 - 17 ] , " \ \ C " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> + sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> + sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; <nl> + sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> + sc_constructor = None ; sc_static_methods = [ ] ; <nl> + sc_methods = <nl> + [ { Shallow_decl_defs . sm_abstract = true ; sm_final = false ; <nl> + sm_memoizelsb = false ; sm_name = ( [ 4 : 28 - 29 ] , " f " ) ; <nl> + sm_override = false ; sm_dynamicallycallable = false ; <nl> + sm_reactivity = None ; <nl> + sm_type = <nl> + ( Rwitness ( root | abstract_method . php line 4 , characters 28 - 28 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | abstract_method . php line 4 , characters 28 - 28 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | abstract_method . php line 4 , characters 33 - 36 ) , <nl> + ( Tprim Tvoid ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } <nl> + } ) ) ; <nl> + sm_visibility = Public ; sm_deprecated = None } <nl> + ] ; <nl> + sc_user_attributes = [ ] ; sc_enum_type = None } ) ) <nl> + ] <nl> <nl> They matched ! <nl> mmm a / hphp / hack / test / decl / accept_disposable . php . exp <nl> ppp b / hphp / hack / test / decl / accept_disposable . php . exp <nl> <nl> - Parsed decls : <nl> - <nl> - { classes = <nl> - { " \ \ Handle " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> - sc_name = ( [ 4 : 7 - 13 ] , " \ \ Handle " ) ; sc_tparams = [ ] ; <nl> - sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> - sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> - sc_implements = <nl> - [ ( Rhint ( root | accept_disposable . php line 4 , characters 25 - 35 ) , <nl> - ( Tapply ( ( [ 4 : 25 - 36 ] , " \ \ IDisposable " ) , [ ] ) ) ) ] ; <nl> - sc_consts = [ ] ; sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; sc_props = [ ] ; <nl> - sc_sprops = [ ] ; sc_constructor = None ; sc_static_methods = [ ] ; <nl> - sc_methods = <nl> - [ { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> - sm_memoizelsb = false ; sm_name = ( [ 5 : 19 - 28 ] , " __dispose " ) ; <nl> - sm_override = false ; sm_dynamicallycallable = false ; <nl> - sm_reactivity = None ; <nl> - sm_type = <nl> - ( Rwitness ( root | accept_disposable . php line 5 , characters 19 - 27 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | accept_disposable . php line 5 , characters 19 - 27 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | accept_disposable . php line 5 , characters 32 - 35 ) , <nl> - ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } <nl> - } ) ) ; <nl> - sm_visibility = Public ; sm_deprecated = None } ; <nl> - { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> - sm_memoizelsb = false ; sm_name = ( [ 6 : 19 - 22 ] , " foo " ) ; <nl> + [ ( " \ \ Handle " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> + sc_name = ( [ 4 : 7 - 13 ] , " \ \ Handle " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> + sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> + sc_implements = <nl> + [ ( Rhint ( root | accept_disposable . php line 4 , characters 25 - 35 ) , <nl> + ( Tapply ( ( [ 4 : 25 - 36 ] , " \ \ IDisposable " ) , [ ] ) ) ) ] ; <nl> + sc_consts = [ ] ; sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; sc_props = [ ] ; <nl> + sc_sprops = [ ] ; sc_constructor = None ; sc_static_methods = [ ] ; <nl> + sc_methods = <nl> + [ { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> + sm_memoizelsb = false ; sm_name = ( [ 5 : 19 - 28 ] , " __dispose " ) ; <nl> sm_override = false ; sm_dynamicallycallable = false ; <nl> sm_reactivity = None ; <nl> sm_type = <nl> - ( Rwitness ( root | accept_disposable . php line 6 , characters 19 - 21 ) , <nl> + ( Rwitness ( root | accept_disposable . php line 5 , characters 19 - 27 ) , <nl> ( Tfun <nl> { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> ft_implicit_params = <nl> { capability = <nl> - ( Rhint ( root | accept_disposable . php line 6 , characters 19 - 21 ) , <nl> + ( Rhint ( root | accept_disposable . php line 5 , characters 19 - 27 ) , <nl> ( Tunion [ ] ) ) <nl> } ; <nl> ft_ret = <nl> { et_enforced = false ; <nl> et_type = <nl> - ( Rhint ( root | accept_disposable . php line 6 , characters 26 - 29 ) , <nl> + ( Rhint ( root | accept_disposable . php line 5 , characters 32 - 35 ) , <nl> ( Tprim Tvoid ) ) <nl> } ; <nl> ft_flags = <nl> Parsed decls : <nl> ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } <nl> } ) ) ; <nl> - sm_visibility = Public ; sm_deprecated = None } <nl> - ] ; <nl> - sc_user_attributes = [ ] ; sc_enum_type = None } } ; <nl> - funs = <nl> - { " \ \ f " - > <nl> - { Typing_defs . fe_deprecated = None ; <nl> - fe_type = <nl> - ( Rwitness ( root | accept_disposable . php line 9 , characters 10 - 10 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; <nl> - ft_params = <nl> - [ { fp_pos = [ 9 : 42 - 44 ] ; fp_name = ( Some " $ h " ) ; <nl> - fp_type = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | accept_disposable . php line 9 , characters 35 - 40 ) , <nl> - ( Tapply ( ( [ 9 : 35 - 41 ] , " \ \ Handle " ) , [ ] ) ) ) <nl> - } ; <nl> - fp_flags = <nl> - ( make_fp_flags ~ mutability : None ~ accept_disposable : true <nl> - ~ has_default : false ~ mode : Typing_defs_core . FPnormal <nl> - ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> - } <nl> - ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | accept_disposable . php line 9 , characters 10 - 10 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | accept_disposable . php line 9 , characters 47 - 50 ) , <nl> - ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - fe_pos = [ 9 : 10 - 11 ] ; fe_php_std_lib = false } } ; <nl> - typedefs = { } ; consts = { } ; records = { } } <nl> + sm_visibility = Public ; sm_deprecated = None } ; <nl> + { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> + sm_memoizelsb = false ; sm_name = ( [ 6 : 19 - 22 ] , " foo " ) ; <nl> + sm_override = false ; sm_dynamicallycallable = false ; <nl> + sm_reactivity = None ; <nl> + sm_type = <nl> + ( Rwitness ( root | accept_disposable . php line 6 , characters 19 - 21 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | accept_disposable . php line 6 , characters 19 - 21 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | accept_disposable . php line 6 , characters 26 - 29 ) , <nl> + ( Tprim Tvoid ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; <nl> + ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + sm_visibility = Public ; sm_deprecated = None } <nl> + ] ; <nl> + sc_user_attributes = [ ] ; sc_enum_type = None } ) ) ; <nl> + ( " \ \ f " , <nl> + ( Shallow_decl_defs . Fun <nl> + { Typing_defs . fe_deprecated = None ; <nl> + fe_type = <nl> + ( Rwitness ( root | accept_disposable . php line 9 , characters 10 - 10 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; <nl> + ft_params = <nl> + [ { fp_pos = [ 9 : 42 - 44 ] ; fp_name = ( Some " $ h " ) ; <nl> + fp_type = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | accept_disposable . php line 9 , characters 35 - 40 ) , <nl> + ( Tapply ( ( [ 9 : 35 - 41 ] , " \ \ Handle " ) , [ ] ) ) ) <nl> + } ; <nl> + fp_flags = <nl> + ( make_fp_flags ~ mutability : None ~ accept_disposable : true <nl> + ~ has_default : false ~ mode : Typing_defs_core . FPnormal <nl> + ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> + } <nl> + ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | accept_disposable . php line 9 , characters 10 - 10 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | accept_disposable . php line 9 , characters 47 - 50 ) , <nl> + ( Tprim Tvoid ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + fe_pos = [ 9 : 10 - 11 ] ; fe_php_std_lib = false } ) ) <nl> + ] <nl> <nl> They matched ! <nl> mmm a / hphp / hack / test / decl / array_typehints . php . exp <nl> ppp b / hphp / hack / test / decl / array_typehints . php . exp <nl> <nl> - Parsed decls : <nl> - <nl> - { classes = { } ; <nl> - funs = <nl> - { " \ \ a2 " - > <nl> - { Typing_defs . fe_deprecated = None ; <nl> - fe_type = <nl> - ( Rwitness ( root | array_typehints . php line 3 , characters 10 - 11 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | array_typehints . php line 3 , characters 10 - 11 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | array_typehints . php line 3 , characters 16 - 34 ) , <nl> - ( Tdarray ( <nl> - ( Rhint ( root | array_typehints . php line 3 , characters 23 - 25 ) , <nl> - ( Tprim Tint ) ) , <nl> - ( Rhint ( root | array_typehints . php line 3 , characters 28 - 33 ) , <nl> - ( Tprim Tstring ) ) <nl> - ) ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - fe_pos = [ 3 : 10 - 12 ] ; fe_php_std_lib = false } ; <nl> - " \ \ d0 " - > <nl> - { Typing_defs . fe_deprecated = None ; <nl> - fe_type = <nl> - ( Rwitness ( root | array_typehints . php line 15 , characters 10 - 11 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | array_typehints . php line 15 , characters 10 - 11 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | array_typehints . php line 15 , characters 16 - 21 ) , <nl> - ( Tdarray ( ( Rnone ( | line 0 , characters 0 - 0 ) , Tany ) , <nl> - ( Rnone ( | line 0 , characters 0 - 0 ) , Tany ) ) ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - fe_pos = [ 15 : 10 - 12 ] ; fe_php_std_lib = false } ; <nl> - " \ \ d2 " - > <nl> - { Typing_defs . fe_deprecated = None ; <nl> - fe_type = <nl> - ( Rwitness ( root | array_typehints . php line 19 , characters 10 - 11 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | array_typehints . php line 19 , characters 10 - 11 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | array_typehints . php line 19 , characters 16 - 34 ) , <nl> - ( Tdarray ( <nl> - ( Rhint ( root | array_typehints . php line 19 , characters 23 - 25 ) , <nl> - ( Tprim Tint ) ) , <nl> - ( Rhint ( root | array_typehints . php line 19 , characters 28 - 33 ) , <nl> - ( Tprim Tstring ) ) <nl> - ) ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - fe_pos = [ 19 : 10 - 12 ] ; fe_php_std_lib = false } ; <nl> - " \ \ v0 " - > <nl> - { Typing_defs . fe_deprecated = None ; <nl> - fe_type = <nl> - ( Rwitness ( root | array_typehints . php line 7 , characters 10 - 11 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | array_typehints . php line 7 , characters 10 - 11 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | array_typehints . php line 7 , characters 16 - 21 ) , <nl> - ( Tvarray ( Rnone ( | line 0 , characters 0 - 0 ) , Tany ) ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - fe_pos = [ 7 : 10 - 12 ] ; fe_php_std_lib = false } ; <nl> - " \ \ v1 " - > <nl> - { Typing_defs . fe_deprecated = None ; <nl> - fe_type = <nl> - ( Rwitness ( root | array_typehints . php line 11 , characters 10 - 11 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | array_typehints . php line 11 , characters 10 - 11 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | array_typehints . php line 11 , characters 16 - 26 ) , <nl> - ( Tvarray <nl> - ( Rhint ( root | array_typehints . php line 11 , characters 23 - 25 ) , <nl> - ( Tprim Tint ) ) ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - fe_pos = [ 11 : 10 - 12 ] ; fe_php_std_lib = false } ; <nl> - " \ \ vd0 " - > <nl> - { Typing_defs . fe_deprecated = None ; <nl> - fe_type = <nl> - ( Rwitness ( root | array_typehints . php line 23 , characters 10 - 12 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | array_typehints . php line 23 , characters 10 - 12 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | array_typehints . php line 23 , characters 17 - 32 ) , <nl> - ( Tvarray_or_darray <nl> - ( Rnone ( | line 0 , characters 0 - 0 ) , ( Tprim Tarraykey ) ) , <nl> - ( Rnone ( | line 0 , characters 0 - 0 ) , Tany ) ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - fe_pos = [ 23 : 10 - 13 ] ; fe_php_std_lib = false } ; <nl> - " \ \ vd1 " - > <nl> - { Typing_defs . fe_deprecated = None ; <nl> - fe_type = <nl> - ( Rwitness ( root | array_typehints . php line 27 , characters 10 - 12 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | array_typehints . php line 27 , characters 10 - 12 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | array_typehints . php line 27 , characters 17 - 37 ) , <nl> - ( Tvarray_or_darray <nl> - ( Rnone ( | line 0 , characters 0 - 0 ) , ( Tprim Tarraykey ) ) , <nl> - ( Rhint ( root | array_typehints . php line 27 , characters 34 - 36 ) , <nl> - ( Tprim Tint ) ) ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - fe_pos = [ 27 : 10 - 13 ] ; fe_php_std_lib = false } ; <nl> - " \ \ vd2 " - > <nl> - { Typing_defs . fe_deprecated = None ; <nl> - fe_type = <nl> - ( Rwitness ( root | array_typehints . php line 31 , characters 10 - 12 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | array_typehints . php line 31 , characters 10 - 12 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | array_typehints . php line 31 , characters 17 - 45 ) , <nl> - ( Tvarray_or_darray <nl> - ( Rhint ( root | array_typehints . php line 31 , characters 34 - 36 ) , <nl> - ( Tprim Tint ) ) , <nl> - ( Rhint ( root | array_typehints . php line 31 , characters 39 - 44 ) , <nl> - ( Tprim Tstring ) ) ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - fe_pos = [ 31 : 10 - 13 ] ; fe_php_std_lib = false } ; <nl> - " \ \ vd3 " - > <nl> - { Typing_defs . fe_deprecated = None ; <nl> - fe_type = <nl> - ( Rwitness ( root | array_typehints . php line 35 , characters 10 - 12 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | array_typehints . php line 35 , characters 10 - 12 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | array_typehints . php line 35 , characters 17 - 51 ) , <nl> - Tany ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - fe_pos = [ 35 : 10 - 13 ] ; fe_php_std_lib = false } } ; <nl> - typedefs = { } ; consts = { } ; records = { } } <nl> - <nl> - They matched ! <nl> + mmm legacy <nl> ppp + direct decl <nl> + <nl> + [ ( " \ \ a2 " , <nl> + ( Shallow_decl_defs . Fun <nl> + { Typing_defs . fe_deprecated = None ; <nl> + fe_type = <nl> + ( Rwitness ( root | array_typehints . php line 3 , characters 10 - 11 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | array_typehints . php line 3 , characters 10 - 11 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | array_typehints . php line 3 , characters 16 - 34 ) , <nl> + ( Tdarray ( <nl> + ( Rhint ( root | array_typehints . php line 3 , characters 23 - 25 ) , <nl> + ( Tprim Tint ) ) , <nl> + ( Rhint ( root | array_typehints . php line 3 , characters 28 - 33 ) , <nl> + ( Tprim Tstring ) ) <nl> + ) ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + fe_pos = [ 3 : 10 - 12 ] ; fe_php_std_lib = false } ) ) ; <nl> + ( " \ \ v0 " , <nl> + ( Shallow_decl_defs . Fun <nl> + { Typing_defs . fe_deprecated = None ; <nl> + fe_type = <nl> + ( Rwitness ( root | array_typehints . php line 7 , characters 10 - 11 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | array_typehints . php line 7 , characters 10 - 11 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | array_typehints . php line 7 , characters 16 - 21 ) , <nl> + - ( Tvarray <nl> + - ( Rhint ( root | array_typehints . php line 7 , characters 16 - 21 ) , <nl> + - Tany ) ) ) <nl> + + ( Tvarray ( Rnone ( | line 0 , characters 0 - 0 ) , Tany ) ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + fe_pos = [ 7 : 10 - 12 ] ; fe_php_std_lib = false } ) ) ; <nl> + ( " \ \ v1 " , <nl> + ( Shallow_decl_defs . Fun <nl> + { Typing_defs . fe_deprecated = None ; <nl> + fe_type = <nl> + ( Rwitness ( root | array_typehints . php line 11 , characters 10 - 11 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | array_typehints . php line 11 , characters 10 - 11 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | array_typehints . php line 11 , characters 16 - 26 ) , <nl> + ( Tvarray <nl> + ( Rhint ( root | array_typehints . php line 11 , characters 23 - 25 ) , <nl> + ( Tprim Tint ) ) ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + fe_pos = [ 11 : 10 - 12 ] ; fe_php_std_lib = false } ) ) ; <nl> + ( " \ \ d0 " , <nl> + ( Shallow_decl_defs . Fun <nl> + { Typing_defs . fe_deprecated = None ; <nl> + fe_type = <nl> + ( Rwitness ( root | array_typehints . php line 15 , characters 10 - 11 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | array_typehints . php line 15 , characters 10 - 11 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | array_typehints . php line 15 , characters 16 - 21 ) , <nl> + - ( Tdarray ( <nl> + - ( Rhint ( root | array_typehints . php line 15 , characters 16 - 21 ) , <nl> + - Tany ) , <nl> + - ( Rhint ( root | array_typehints . php line 15 , characters 16 - 21 ) , <nl> + - Tany ) <nl> + - ) ) ) <nl> + + ( Tdarray ( ( Rnone ( | line 0 , characters 0 - 0 ) , Tany ) , <nl> + + ( Rnone ( | line 0 , characters 0 - 0 ) , Tany ) ) ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + fe_pos = [ 15 : 10 - 12 ] ; fe_php_std_lib = false } ) ) ; <nl> + ( " \ \ d2 " , <nl> + ( Shallow_decl_defs . Fun <nl> + { Typing_defs . fe_deprecated = None ; <nl> + fe_type = <nl> + ( Rwitness ( root | array_typehints . php line 19 , characters 10 - 11 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | array_typehints . php line 19 , characters 10 - 11 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | array_typehints . php line 19 , characters 16 - 34 ) , <nl> + ( Tdarray ( <nl> + ( Rhint ( root | array_typehints . php line 19 , characters 23 - 25 ) , <nl> + ( Tprim Tint ) ) , <nl> + ( Rhint ( root | array_typehints . php line 19 , characters 28 - 33 ) , <nl> + ( Tprim Tstring ) ) <nl> + ) ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + fe_pos = [ 19 : 10 - 12 ] ; fe_php_std_lib = false } ) ) ; <nl> + ( " \ \ vd0 " , <nl> + ( Shallow_decl_defs . Fun <nl> + { Typing_defs . fe_deprecated = None ; <nl> + fe_type = <nl> + ( Rwitness ( root | array_typehints . php line 23 , characters 10 - 12 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | array_typehints . php line 23 , characters 10 - 12 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | array_typehints . php line 23 , characters 17 - 32 ) , <nl> + ( Tvarray_or_darray <nl> + - ( Rvarray_or_darray_key ( root | array_typehints . php line 23 , characters 17 - 32 ) , <nl> + - ( Tprim Tarraykey ) ) , <nl> + - ( Rhint ( root | array_typehints . php line 23 , characters 17 - 32 ) , <nl> + - Tany ) ) ) <nl> + + ( Rnone ( | line 0 , characters 0 - 0 ) , ( Tprim Tarraykey ) ) , <nl> + + ( Rnone ( | line 0 , characters 0 - 0 ) , Tany ) ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + fe_pos = [ 23 : 10 - 13 ] ; fe_php_std_lib = false } ) ) ; <nl> + ( " \ \ vd1 " , <nl> + ( Shallow_decl_defs . Fun <nl> + { Typing_defs . fe_deprecated = None ; <nl> + fe_type = <nl> + ( Rwitness ( root | array_typehints . php line 27 , characters 10 - 12 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | array_typehints . php line 27 , characters 10 - 12 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | array_typehints . php line 27 , characters 17 - 37 ) , <nl> + ( Tvarray_or_darray <nl> + - ( Rvarray_or_darray_key ( root | array_typehints . php line 27 , characters 17 - 37 ) , <nl> + - ( Tprim Tarraykey ) ) , <nl> + + ( Rnone ( | line 0 , characters 0 - 0 ) , ( Tprim Tarraykey ) ) , <nl> + ( Rhint ( root | array_typehints . php line 27 , characters 34 - 36 ) , <nl> + ( Tprim Tint ) ) ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + fe_pos = [ 27 : 10 - 13 ] ; fe_php_std_lib = false } ) ) ; <nl> + ( " \ \ vd2 " , <nl> + ( Shallow_decl_defs . Fun <nl> + { Typing_defs . fe_deprecated = None ; <nl> + fe_type = <nl> + ( Rwitness ( root | array_typehints . php line 31 , characters 10 - 12 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | array_typehints . php line 31 , characters 10 - 12 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | array_typehints . php line 31 , characters 17 - 45 ) , <nl> + ( Tvarray_or_darray <nl> + ( Rhint ( root | array_typehints . php line 31 , characters 34 - 36 ) , <nl> + ( Tprim Tint ) ) , <nl> + ( Rhint ( root | array_typehints . php line 31 , characters 39 - 44 ) , <nl> + ( Tprim Tstring ) ) ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + fe_pos = [ 31 : 10 - 13 ] ; fe_php_std_lib = false } ) ) ; <nl> + ( " \ \ vd3 " , <nl> + ( Shallow_decl_defs . Fun <nl> + { Typing_defs . fe_deprecated = None ; <nl> + fe_type = <nl> + ( Rwitness ( root | array_typehints . php line 35 , characters 10 - 12 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | array_typehints . php line 35 , characters 10 - 12 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | array_typehints . php line 35 , characters 17 - 51 ) , <nl> + Tany ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + fe_pos = [ 35 : 10 - 13 ] ; fe_php_std_lib = false } ) ) <nl> + ] <nl> mmm a / hphp / hack / test / decl / async_and_generator_functions . php . exp <nl> ppp b / hphp / hack / test / decl / async_and_generator_functions . php . exp <nl> <nl> - Parsed decls : <nl> - <nl> - { classes = { } ; <nl> - funs = <nl> - { " \ \ async_function " - > <nl> - { Typing_defs . fe_deprecated = None ; <nl> - fe_type = <nl> - ( Rwitness ( root | async_and_generator_functions . php line 5 , characters 16 - 29 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | async_and_generator_functions . php line 5 , characters 16 - 29 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | async_and_generator_functions . php line 5 , characters 34 - 50 ) , <nl> - ( Tapply ( ( [ 5 : 34 - 43 ] , " \ \ HH \ \ Awaitable " ) , <nl> - [ ( Rhint ( root | async_and_generator_functions . php line 5 , characters 44 - 49 ) , <nl> - ( Tprim Tstring ) ) ] <nl> - ) ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FAsync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - fe_pos = [ 5 : 16 - 30 ] ; fe_php_std_lib = false } ; <nl> - " \ \ async_generator " - > <nl> - { Typing_defs . fe_deprecated = None ; <nl> - fe_type = <nl> - ( Rwitness ( root | async_and_generator_functions . php line 18 , characters 16 - 30 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | async_and_generator_functions . php line 18 , characters 16 - 30 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | async_and_generator_functions . php line 18 , characters 35 - 67 ) , <nl> - ( Tapply ( ( [ 18 : 35 - 49 ] , " \ \ HH \ \ AsyncGenerator " ) , <nl> - [ ( Rhint ( root | async_and_generator_functions . php line 18 , characters 50 - 52 ) , <nl> - ( Tprim Tint ) ) ; <nl> - ( Rhint ( root | async_and_generator_functions . php line 18 , characters 55 - 60 ) , <nl> - ( Tprim Tstring ) ) ; <nl> - ( Rhint ( root | async_and_generator_functions . php line 18 , characters 63 - 66 ) , <nl> - ( Tprim Tvoid ) ) <nl> - ] <nl> - ) ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FAsyncGenerator None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - fe_pos = [ 18 : 16 - 31 ] ; fe_php_std_lib = false } ; <nl> - " \ \ generator_function " - > <nl> - { Typing_defs . fe_deprecated = None ; <nl> - fe_type = <nl> - ( Rwitness ( root | async_and_generator_functions . php line 10 , characters 10 - 27 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | async_and_generator_functions . php line 10 , characters 10 - 27 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | async_and_generator_functions . php line 10 , characters 32 - 59 ) , <nl> - ( Tapply ( ( [ 10 : 32 - 41 ] , " \ \ Generator " ) , <nl> - [ ( Rhint ( root | async_and_generator_functions . php line 10 , characters 42 - 47 ) , <nl> - ( Tprim Tstring ) ) ; <nl> - ( Rhint ( root | async_and_generator_functions . php line 10 , characters 50 - 52 ) , <nl> - ( Tprim Tint ) ) ; <nl> - ( Rhint ( root | async_and_generator_functions . php line 10 , characters 55 - 58 ) , <nl> - ( Tprim Tvoid ) ) <nl> - ] <nl> - ) ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FGenerator None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - fe_pos = [ 10 : 10 - 28 ] ; fe_php_std_lib = false } ; <nl> - " \ \ generator_function_implicit_key " - > <nl> - { Typing_defs . fe_deprecated = None ; <nl> - fe_type = <nl> - ( Rwitness ( root | async_and_generator_functions . php line 14 , characters 10 - 40 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | async_and_generator_functions . php line 14 , characters 10 - 40 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | async_and_generator_functions . php line 14 , characters 45 - 72 ) , <nl> - ( Tapply ( ( [ 14 : 45 - 54 ] , " \ \ Generator " ) , <nl> - [ ( Rhint ( root | async_and_generator_functions . php line 14 , characters 55 - 57 ) , <nl> - ( Tprim Tint ) ) ; <nl> - ( Rhint ( root | async_and_generator_functions . php line 14 , characters 60 - 65 ) , <nl> - ( Tprim Tstring ) ) ; <nl> - ( Rhint ( root | async_and_generator_functions . php line 14 , characters 68 - 71 ) , <nl> - ( Tprim Tvoid ) ) <nl> - ] <nl> - ) ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FGenerator None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - fe_pos = [ 14 : 10 - 41 ] ; fe_php_std_lib = false } ; <nl> - " \ \ sync_function " - > <nl> - { Typing_defs . fe_deprecated = None ; <nl> - fe_type = <nl> - ( Rwitness ( root | async_and_generator_functions . php line 3 , characters 10 - 22 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | async_and_generator_functions . php line 3 , characters 10 - 22 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | async_and_generator_functions . php line 3 , characters 27 - 30 ) , <nl> - ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - fe_pos = [ 3 : 10 - 23 ] ; fe_php_std_lib = false } } ; <nl> - typedefs = { } ; consts = { } ; records = { } } <nl> + [ ( " \ \ sync_function " , <nl> + ( Shallow_decl_defs . Fun <nl> + { Typing_defs . fe_deprecated = None ; <nl> + fe_type = <nl> + ( Rwitness ( root | async_and_generator_functions . php line 3 , characters 10 - 22 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | async_and_generator_functions . php line 3 , characters 10 - 22 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | async_and_generator_functions . php line 3 , characters 27 - 30 ) , <nl> + ( Tprim Tvoid ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + fe_pos = [ 3 : 10 - 23 ] ; fe_php_std_lib = false } ) ) ; <nl> + ( " \ \ async_function " , <nl> + ( Shallow_decl_defs . Fun <nl> + { Typing_defs . fe_deprecated = None ; <nl> + fe_type = <nl> + ( Rwitness ( root | async_and_generator_functions . php line 5 , characters 16 - 29 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | async_and_generator_functions . php line 5 , characters 16 - 29 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | async_and_generator_functions . php line 5 , characters 34 - 50 ) , <nl> + ( Tapply ( ( [ 5 : 34 - 43 ] , " \ \ HH \ \ Awaitable " ) , <nl> + [ ( Rhint ( root | async_and_generator_functions . php line 5 , characters 44 - 49 ) , <nl> + ( Tprim Tstring ) ) ] <nl> + ) ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FAsync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + fe_pos = [ 5 : 16 - 30 ] ; fe_php_std_lib = false } ) ) ; <nl> + ( " \ \ generator_function " , <nl> + ( Shallow_decl_defs . Fun <nl> + { Typing_defs . fe_deprecated = None ; <nl> + fe_type = <nl> + ( Rwitness ( root | async_and_generator_functions . php line 10 , characters 10 - 27 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | async_and_generator_functions . php line 10 , characters 10 - 27 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | async_and_generator_functions . php line 10 , characters 32 - 59 ) , <nl> + ( Tapply ( ( [ 10 : 32 - 41 ] , " \ \ Generator " ) , <nl> + [ ( Rhint ( root | async_and_generator_functions . php line 10 , characters 42 - 47 ) , <nl> + ( Tprim Tstring ) ) ; <nl> + ( Rhint ( root | async_and_generator_functions . php line 10 , characters 50 - 52 ) , <nl> + ( Tprim Tint ) ) ; <nl> + ( Rhint ( root | async_and_generator_functions . php line 10 , characters 55 - 58 ) , <nl> + ( Tprim Tvoid ) ) <nl> + ] <nl> + ) ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FGenerator None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + fe_pos = [ 10 : 10 - 28 ] ; fe_php_std_lib = false } ) ) ; <nl> + ( " \ \ generator_function_implicit_key " , <nl> + ( Shallow_decl_defs . Fun <nl> + { Typing_defs . fe_deprecated = None ; <nl> + fe_type = <nl> + ( Rwitness ( root | async_and_generator_functions . php line 14 , characters 10 - 40 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | async_and_generator_functions . php line 14 , characters 10 - 40 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | async_and_generator_functions . php line 14 , characters 45 - 72 ) , <nl> + ( Tapply ( ( [ 14 : 45 - 54 ] , " \ \ Generator " ) , <nl> + [ ( Rhint ( root | async_and_generator_functions . php line 14 , characters 55 - 57 ) , <nl> + ( Tprim Tint ) ) ; <nl> + ( Rhint ( root | async_and_generator_functions . php line 14 , characters 60 - 65 ) , <nl> + ( Tprim Tstring ) ) ; <nl> + ( Rhint ( root | async_and_generator_functions . php line 14 , characters 68 - 71 ) , <nl> + ( Tprim Tvoid ) ) <nl> + ] <nl> + ) ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FGenerator None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + fe_pos = [ 14 : 10 - 41 ] ; fe_php_std_lib = false } ) ) ; <nl> + ( " \ \ async_generator " , <nl> + ( Shallow_decl_defs . Fun <nl> + { Typing_defs . fe_deprecated = None ; <nl> + fe_type = <nl> + ( Rwitness ( root | async_and_generator_functions . php line 18 , characters 16 - 30 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | async_and_generator_functions . php line 18 , characters 16 - 30 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | async_and_generator_functions . php line 18 , characters 35 - 67 ) , <nl> + ( Tapply ( ( [ 18 : 35 - 49 ] , " \ \ HH \ \ AsyncGenerator " ) , <nl> + [ ( Rhint ( root | async_and_generator_functions . php line 18 , characters 50 - 52 ) , <nl> + ( Tprim Tint ) ) ; <nl> + ( Rhint ( root | async_and_generator_functions . php line 18 , characters 55 - 60 ) , <nl> + ( Tprim Tstring ) ) ; <nl> + ( Rhint ( root | async_and_generator_functions . php line 18 , characters 63 - 66 ) , <nl> + ( Tprim Tvoid ) ) <nl> + ] <nl> + ) ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FAsyncGenerator None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + fe_pos = [ 18 : 16 - 31 ] ; fe_php_std_lib = false } ) ) <nl> + ] <nl> <nl> They matched ! <nl> mmm a / hphp / hack / test / decl / at_most_rx_as_func . php . exp <nl> ppp b / hphp / hack / test / decl / at_most_rx_as_func . php . exp <nl> <nl> - Parsed decls : <nl> - <nl> - { classes = { } ; <nl> - funs = <nl> - { " \ \ f " - > <nl> - { Typing_defs . fe_deprecated = None ; <nl> - fe_type = <nl> - ( Rwitness ( root | at_most_rx_as_func . php line 4 , characters 10 - 10 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; <nl> - ft_tparams = <nl> - [ { Typing_defs_core . tp_variance = Invariant ; <nl> - tp_name = ( [ 4 : 12 - 13 ] , " T " ) ; tp_tparams = [ ] ; <nl> - tp_constraints = [ ] ; tp_reified = Erased ; <nl> - tp_user_attributes = [ ] } <nl> - ] ; <nl> - ft_where_constraints = [ ] ; <nl> - ft_params = <nl> - [ { fp_pos = [ 5 : 44 - 46 ] ; fp_name = ( Some " $ g " ) ; <nl> + [ ( " \ \ f " , <nl> + ( Shallow_decl_defs . Fun <nl> + { Typing_defs . fe_deprecated = None ; <nl> + fe_type = <nl> + ( Rwitness ( root | at_most_rx_as_func . php line 4 , characters 10 - 10 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; <nl> + ft_tparams = <nl> + [ { Typing_defs_core . tp_variance = Invariant ; <nl> + tp_name = ( [ 4 : 12 - 13 ] , " T " ) ; tp_tparams = [ ] ; <nl> + tp_constraints = [ ] ; tp_reified = Erased ; <nl> + tp_user_attributes = [ ] } <nl> + ] ; <nl> + ft_where_constraints = [ ] ; <nl> + ft_params = <nl> + [ { fp_pos = [ 5 : 44 - 46 ] ; fp_name = ( Some " $ g " ) ; <nl> + fp_type = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | at_most_rx_as_func . php line 5 , characters 24 - 42 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; <nl> + ft_params = <nl> + [ { fp_pos = [ 5 : 34 - 35 ] ; fp_name = None ; <nl> + fp_type = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | at_most_rx_as_func . php line 5 , characters 34 - 34 ) , <nl> + ( Tgeneric ( " T " , [ ] ) ) ) <nl> + } ; <nl> + fp_flags = <nl> + ( make_fp_flags ~ mutability : None <nl> + ~ accept_disposable : false ~ has_default : false <nl> + ~ mode : Typing_defs_core . FPnormal <nl> + ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> + } <nl> + ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | at_most_rx_as_func . php line 5 , characters 24 - 42 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | at_most_rx_as_func . php line 5 , characters 38 - 41 ) , <nl> + ( Tprim Tbool ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = RxVar { } ; <nl> + ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) <nl> + } ; <nl> + fp_flags = <nl> + ( make_fp_flags ~ mutability : None ~ accept_disposable : false <nl> + ~ has_default : false ~ mode : Typing_defs_core . FPnormal <nl> + ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> + } ; <nl> + { fp_pos = [ 6 : 5 - 7 ] ; fp_name = ( Some " $ x " ) ; <nl> fp_type = <nl> { et_enforced = false ; <nl> et_type = <nl> - ( Rhint ( root | at_most_rx_as_func . php line 5 , characters 24 - 42 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; <nl> - ft_params = <nl> - [ { fp_pos = [ 5 : 34 - 35 ] ; fp_name = None ; <nl> - fp_type = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | at_most_rx_as_func . php line 5 , characters 34 - 34 ) , <nl> - ( Tgeneric ( " T " , [ ] ) ) ) <nl> - } ; <nl> - fp_flags = <nl> - ( make_fp_flags ~ mutability : None <nl> - ~ accept_disposable : false ~ has_default : false <nl> - ~ mode : Typing_defs_core . FPnormal <nl> - ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> - } <nl> - ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | at_most_rx_as_func . php line 5 , characters 24 - 42 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | at_most_rx_as_func . php line 5 , characters 38 - 41 ) , <nl> - ( Tprim Tbool ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = RxVar { } ; <nl> - ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) <nl> - } ; <nl> - fp_flags = <nl> - ( make_fp_flags ~ mutability : None ~ accept_disposable : false <nl> - ~ has_default : false ~ mode : Typing_defs_core . FPnormal <nl> - ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> + ( Rhint ( root | at_most_rx_as_func . php line 6 , characters 3 - 3 ) , <nl> + ( Tgeneric ( " T " , [ ] ) ) ) <nl> } ; <nl> - { fp_pos = [ 6 : 5 - 7 ] ; fp_name = ( Some " $ x " ) ; <nl> - fp_type = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | at_most_rx_as_func . php line 6 , characters 3 - 3 ) , <nl> - ( Tgeneric ( " T " , [ ] ) ) ) <nl> - } ; <nl> - fp_flags = <nl> - ( make_fp_flags ~ mutability : None ~ accept_disposable : false <nl> - ~ has_default : false ~ mode : Typing_defs_core . FPnormal <nl> - ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> - } ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | at_most_rx_as_func . php line 4 , characters 10 - 10 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | at_most_rx_as_func . php line 7 , characters 4 - 7 ) , <nl> - ( Tprim Tbool ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Reactive { } ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - fe_pos = [ 4 : 10 - 11 ] ; <nl> - fe_php_std_lib = false <nl> - } } ; typedefs = { } ; consts = { } ; records = { } <nl> - } <nl> + fp_flags = <nl> + ( make_fp_flags ~ mutability : None ~ accept_disposable : false <nl> + ~ has_default : false ~ mode : Typing_defs_core . FPnormal <nl> + ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> + } ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | at_most_rx_as_func . php line 4 , characters 10 - 10 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | at_most_rx_as_func . php line 7 , characters 4 - 7 ) , <nl> + ( Tprim Tbool ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Reactive { } ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + fe_pos = [ 4 : 10 - 11 ] ; fe_php_std_lib = false } ) ) <nl> + ] <nl> <nl> They matched ! <nl> mmm a / hphp / hack / test / decl / at_most_rx_as_func_with_optional_func . php . exp <nl> ppp b / hphp / hack / test / decl / at_most_rx_as_func_with_optional_func . php . exp <nl> <nl> - Parsed decls : <nl> - <nl> - { classes = { } ; <nl> - funs = <nl> - { " \ \ f " - > <nl> - { Typing_defs . fe_deprecated = None ; <nl> - fe_type = <nl> - ( Rwitness ( root | at_most_rx_as_func_with_optional_func . php line 4 , characters 10 - 10 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; <nl> - ft_tparams = <nl> - [ { Typing_defs_core . tp_variance = Invariant ; <nl> - tp_name = ( [ 4 : 12 - 13 ] , " T " ) ; tp_tparams = [ ] ; <nl> - tp_constraints = [ ] ; tp_reified = Erased ; <nl> - tp_user_attributes = [ ] } <nl> - ] ; <nl> - ft_where_constraints = [ ] ; <nl> - ft_params = <nl> - [ { fp_pos = [ 6 : 24 - 34 ] ; fp_name = ( Some " $ predicate " ) ; <nl> - fp_type = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | at_most_rx_as_func_with_optional_func . php line 6 , characters 3 - 22 ) , <nl> - ( Toption <nl> - ( Rhint ( root | at_most_rx_as_func_with_optional_func . php line 6 , characters 4 - 22 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; <nl> - ft_params = <nl> - [ { fp_pos = [ 6 : 14 - 15 ] ; fp_name = None ; <nl> - fp_type = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | at_most_rx_as_func_with_optional_func . php line 6 , characters 14 - 14 ) , <nl> - ( Tgeneric ( " T " , [ ] ) ) ) <nl> - } ; <nl> - fp_flags = <nl> - ( make_fp_flags ~ mutability : None <nl> - ~ accept_disposable : false ~ has_default : false <nl> - ~ mode : Typing_defs_core . FPnormal <nl> - ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> - } <nl> - ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | at_most_rx_as_func_with_optional_func . php line 6 , characters 4 - 22 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | at_most_rx_as_func_with_optional_func . php line 6 , characters 18 - 21 ) , <nl> - ( Tprim Tbool ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = RxVar { } ; <nl> - ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ) ) <nl> - } ; <nl> - fp_flags = <nl> - ( make_fp_flags ~ mutability : None ~ accept_disposable : false <nl> - ~ has_default : true ~ mode : Typing_defs_core . FPnormal <nl> - ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> - } <nl> - ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | at_most_rx_as_func_with_optional_func . php line 4 , characters 10 - 10 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | at_most_rx_as_func_with_optional_func . php line 7 , characters 4 - 7 ) , <nl> - ( Tprim Tbool ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Reactive { } ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - fe_pos = [ 4 : 10 - 11 ] ; fe_php_std_lib = false } } ; typedefs = { } ; <nl> - consts = { } ; records = { } <nl> - } <nl> + [ ( " \ \ f " , <nl> + ( Shallow_decl_defs . Fun <nl> + { Typing_defs . fe_deprecated = None ; <nl> + fe_type = <nl> + ( Rwitness ( root | at_most_rx_as_func_with_optional_func . php line 4 , characters 10 - 10 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; <nl> + ft_tparams = <nl> + [ { Typing_defs_core . tp_variance = Invariant ; <nl> + tp_name = ( [ 4 : 12 - 13 ] , " T " ) ; tp_tparams = [ ] ; <nl> + tp_constraints = [ ] ; tp_reified = Erased ; <nl> + tp_user_attributes = [ ] } <nl> + ] ; <nl> + ft_where_constraints = [ ] ; <nl> + ft_params = <nl> + [ { fp_pos = [ 6 : 24 - 34 ] ; fp_name = ( Some " $ predicate " ) ; <nl> + fp_type = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | at_most_rx_as_func_with_optional_func . php line 6 , characters 3 - 22 ) , <nl> + ( Toption <nl> + ( Rhint ( root | at_most_rx_as_func_with_optional_func . php line 6 , characters 4 - 22 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; <nl> + ft_params = <nl> + [ { fp_pos = [ 6 : 14 - 15 ] ; fp_name = None ; <nl> + fp_type = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | at_most_rx_as_func_with_optional_func . php line 6 , characters 14 - 14 ) , <nl> + ( Tgeneric ( " T " , [ ] ) ) ) <nl> + } ; <nl> + fp_flags = <nl> + ( make_fp_flags ~ mutability : None <nl> + ~ accept_disposable : false ~ has_default : false <nl> + ~ mode : Typing_defs_core . FPnormal <nl> + ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> + } <nl> + ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | at_most_rx_as_func_with_optional_func . php line 6 , characters 4 - 22 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | at_most_rx_as_func_with_optional_func . php line 6 , characters 18 - 21 ) , <nl> + ( Tprim Tbool ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = RxVar { } ; <nl> + ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ) ) <nl> + } ; <nl> + fp_flags = <nl> + ( make_fp_flags ~ mutability : None ~ accept_disposable : false <nl> + ~ has_default : true ~ mode : Typing_defs_core . FPnormal <nl> + ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> + } <nl> + ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | at_most_rx_as_func_with_optional_func . php line 4 , characters 10 - 10 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | at_most_rx_as_func_with_optional_func . php line 7 , characters 4 - 7 ) , <nl> + ( Tprim Tbool ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Reactive { } ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + fe_pos = [ 4 : 10 - 11 ] ; fe_php_std_lib = false } ) ) <nl> + ] <nl> <nl> They matched ! <nl> mmm a / hphp / hack / test / decl / autoimport_in_namespace . php . exp <nl> ppp b / hphp / hack / test / decl / autoimport_in_namespace . php . exp <nl> <nl> - Parsed decls : <nl> - <nl> - { classes = { } ; funs = { } ; <nl> - typedefs = <nl> - { " \ \ A " - > <nl> - { Typing_defs . td_pos = [ 4 : 8 - 9 ] ; td_vis = Transparent ; td_tparams = [ ] ; <nl> - td_constraint = None ; <nl> - td_type = <nl> - ( Rhint ( root | autoimport_in_namespace . php line 4 , characters 12 - 27 ) , <nl> - ( Tapply ( ( [ 4 : 12 - 23 ] , " \ \ HH \ \ Traversable " ) , <nl> - [ ( Rhint ( root | autoimport_in_namespace . php line 4 , characters 24 - 26 ) , <nl> - ( Tprim Tint ) ) ] <nl> - ) ) ) <nl> - } ; <nl> - " \ \ B " - > <nl> - { Typing_defs . td_pos = [ 5 : 8 - 9 ] ; td_vis = Transparent ; td_tparams = [ ] ; <nl> - td_constraint = None ; <nl> - td_type = <nl> - ( Rhint ( root | autoimport_in_namespace . php line 5 , characters 12 - 28 ) , <nl> - ( Tapply ( ( [ 5 : 12 - 24 ] , " \ \ Traversable " ) , <nl> - [ ( Rhint ( root | autoimport_in_namespace . php line 5 , characters 25 - 27 ) , <nl> - ( Tprim Tint ) ) ] <nl> - ) ) ) <nl> - } ; <nl> - " \ \ NS \ \ A " - > <nl> - { Typing_defs . td_pos = [ 8 : 10 - 11 ] ; td_vis = Transparent ; td_tparams = [ ] ; <nl> - td_constraint = None ; <nl> - td_type = <nl> - ( Rhint ( root | autoimport_in_namespace . php line 8 , characters 14 - 29 ) , <nl> - ( Tapply ( ( [ 8 : 14 - 25 ] , " \ \ HH \ \ Traversable " ) , <nl> - [ ( Rhint ( root | autoimport_in_namespace . php line 8 , characters 26 - 28 ) , <nl> - ( Tprim Tint ) ) ] <nl> - ) ) ) <nl> - } ; <nl> - " \ \ NS \ \ B " - > <nl> - { Typing_defs . td_pos = [ 9 : 10 - 11 ] ; td_vis = Transparent ; td_tparams = [ ] ; <nl> - td_constraint = None ; <nl> - td_type = <nl> - ( Rhint ( root | autoimport_in_namespace . php line 9 , characters 14 - 30 ) , <nl> - ( Tapply ( ( [ 9 : 14 - 26 ] , " \ \ Traversable " ) , <nl> - [ ( Rhint ( root | autoimport_in_namespace . php line 9 , characters 27 - 29 ) , <nl> - ( Tprim Tint ) ) ] <nl> - ) ) ) <nl> - } } ; <nl> - consts = { } ; records = { } } <nl> + [ ( " \ \ A " , <nl> + ( Shallow_decl_defs . Typedef <nl> + { Typing_defs . td_pos = [ 4 : 8 - 9 ] ; td_vis = Transparent ; td_tparams = [ ] ; <nl> + td_constraint = None ; <nl> + td_type = <nl> + ( Rhint ( root | autoimport_in_namespace . php line 4 , characters 12 - 27 ) , <nl> + ( Tapply ( ( [ 4 : 12 - 23 ] , " \ \ HH \ \ Traversable " ) , <nl> + [ ( Rhint ( root | autoimport_in_namespace . php line 4 , characters 24 - 26 ) , <nl> + ( Tprim Tint ) ) ] <nl> + ) ) ) <nl> + } ) ) ; <nl> + ( " \ \ B " , <nl> + ( Shallow_decl_defs . Typedef <nl> + { Typing_defs . td_pos = [ 5 : 8 - 9 ] ; td_vis = Transparent ; td_tparams = [ ] ; <nl> + td_constraint = None ; <nl> + td_type = <nl> + ( Rhint ( root | autoimport_in_namespace . php line 5 , characters 12 - 28 ) , <nl> + ( Tapply ( ( [ 5 : 12 - 24 ] , " \ \ Traversable " ) , <nl> + [ ( Rhint ( root | autoimport_in_namespace . php line 5 , characters 25 - 27 ) , <nl> + ( Tprim Tint ) ) ] <nl> + ) ) ) <nl> + } ) ) ; <nl> + ( " \ \ NS \ \ A " , <nl> + ( Shallow_decl_defs . Typedef <nl> + { Typing_defs . td_pos = [ 8 : 10 - 11 ] ; td_vis = Transparent ; <nl> + td_tparams = [ ] ; td_constraint = None ; <nl> + td_type = <nl> + ( Rhint ( root | autoimport_in_namespace . php line 8 , characters 14 - 29 ) , <nl> + ( Tapply ( ( [ 8 : 14 - 25 ] , " \ \ HH \ \ Traversable " ) , <nl> + [ ( Rhint ( root | autoimport_in_namespace . php line 8 , characters 26 - 28 ) , <nl> + ( Tprim Tint ) ) ] <nl> + ) ) ) <nl> + } ) ) ; <nl> + ( " \ \ NS \ \ B " , <nl> + ( Shallow_decl_defs . Typedef <nl> + { Typing_defs . td_pos = [ 9 : 10 - 11 ] ; td_vis = Transparent ; <nl> + td_tparams = [ ] ; td_constraint = None ; <nl> + td_type = <nl> + ( Rhint ( root | autoimport_in_namespace . php line 9 , characters 14 - 30 ) , <nl> + ( Tapply ( ( [ 9 : 14 - 26 ] , " \ \ Traversable " ) , <nl> + [ ( Rhint ( root | autoimport_in_namespace . php line 9 , characters 27 - 29 ) , <nl> + ( Tprim Tint ) ) ] <nl> + ) ) ) <nl> + } ) ) <nl> + ] <nl> <nl> They matched ! <nl> mmm a / hphp / hack / test / decl / autoimport_namespaces . php . exp <nl> ppp b / hphp / hack / test / decl / autoimport_namespaces . php . exp <nl> <nl> - Parsed decls : <nl> - <nl> - { classes = { } ; funs = { } ; <nl> - typedefs = <nl> - { " \ \ BackslashRxException " - > <nl> - { Typing_defs . td_pos = [ 5 : 6 - 26 ] ; td_vis = Transparent ; td_tparams = [ ] ; <nl> - td_constraint = None ; <nl> - td_type = <nl> - ( Rhint ( root | autoimport_namespaces . php line 5 , characters 29 - 41 ) , <nl> - ( Tapply ( ( [ 5 : 29 - 42 ] , " \ \ Rx \ \ Exception " ) , [ ] ) ) ) <nl> - } ; <nl> - " \ \ MyRx " - > <nl> - { Typing_defs . td_pos = [ 9 : 6 - 10 ] ; td_vis = Transparent ; td_tparams = [ ] ; <nl> - td_constraint = None ; <nl> - td_type = <nl> - ( Rhint ( root | autoimport_namespaces . php line 9 , characters 13 - 14 ) , <nl> - ( Tapply ( ( [ 9 : 13 - 15 ] , " \ \ Rx " ) , [ ] ) ) ) <nl> - } ; <nl> - " \ \ RxException " - > <nl> - { Typing_defs . td_pos = [ 3 : 6 - 17 ] ; td_vis = Transparent ; td_tparams = [ ] ; <nl> - td_constraint = None ; <nl> - td_type = <nl> - ( Rhint ( root | autoimport_namespaces . php line 3 , characters 20 - 31 ) , <nl> - ( Tapply ( ( [ 3 : 20 - 32 ] , " \ \ HH \ \ Rx \ \ Exception " ) , [ ] ) ) ) <nl> - } ; <nl> - " \ \ RxRxException " - > <nl> - { Typing_defs . td_pos = [ 7 : 6 - 19 ] ; td_vis = Transparent ; td_tparams = [ ] ; <nl> - td_constraint = None ; <nl> - td_type = <nl> - ( Rhint ( root | autoimport_namespaces . php line 7 , characters 22 - 35 ) , <nl> - ( Tapply ( ( [ 7 : 22 - 36 ] , " \ \ RxRx \ \ Exception " ) , [ ] ) ) ) <nl> - } } ; <nl> - consts = { } ; records = { } } <nl> + [ ( " \ \ RxException " , <nl> + ( Shallow_decl_defs . Typedef <nl> + { Typing_defs . td_pos = [ 3 : 6 - 17 ] ; td_vis = Transparent ; td_tparams = [ ] ; <nl> + td_constraint = None ; <nl> + td_type = <nl> + ( Rhint ( root | autoimport_namespaces . php line 3 , characters 20 - 31 ) , <nl> + ( Tapply ( ( [ 3 : 20 - 32 ] , " \ \ HH \ \ Rx \ \ Exception " ) , [ ] ) ) ) <nl> + } ) ) ; <nl> + ( " \ \ BackslashRxException " , <nl> + ( Shallow_decl_defs . Typedef <nl> + { Typing_defs . td_pos = [ 5 : 6 - 26 ] ; td_vis = Transparent ; td_tparams = [ ] ; <nl> + td_constraint = None ; <nl> + td_type = <nl> + ( Rhint ( root | autoimport_namespaces . php line 5 , characters 29 - 41 ) , <nl> + ( Tapply ( ( [ 5 : 29 - 42 ] , " \ \ Rx \ \ Exception " ) , [ ] ) ) ) <nl> + } ) ) ; <nl> + ( " \ \ RxRxException " , <nl> + ( Shallow_decl_defs . Typedef <nl> + { Typing_defs . td_pos = [ 7 : 6 - 19 ] ; td_vis = Transparent ; td_tparams = [ ] ; <nl> + td_constraint = None ; <nl> + td_type = <nl> + ( Rhint ( root | autoimport_namespaces . php line 7 , characters 22 - 35 ) , <nl> + ( Tapply ( ( [ 7 : 22 - 36 ] , " \ \ RxRx \ \ Exception " ) , [ ] ) ) ) <nl> + } ) ) ; <nl> + ( " \ \ MyRx " , <nl> + ( Shallow_decl_defs . Typedef <nl> + { Typing_defs . td_pos = [ 9 : 6 - 10 ] ; td_vis = Transparent ; td_tparams = [ ] ; <nl> + td_constraint = None ; <nl> + td_type = <nl> + ( Rhint ( root | autoimport_namespaces . php line 9 , characters 13 - 14 ) , <nl> + ( Tapply ( ( [ 9 : 13 - 15 ] , " \ \ Rx " ) , [ ] ) ) ) <nl> + } ) ) <nl> + ] <nl> <nl> They matched ! <nl> mmm a / hphp / hack / test / decl / cipp . php . exp <nl> ppp b / hphp / hack / test / decl / cipp . php . exp <nl> <nl> - Parsed decls : <nl> - <nl> - { classes = <nl> - { " \ \ C " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> - sc_name = ( [ 3 : 7 - 8 ] , " \ \ C " ) ; sc_tparams = [ ] ; sc_where_constraints = [ ] ; <nl> - sc_extends = [ ] ; sc_uses = [ ] ; sc_xhp_attr_uses = [ ] ; <nl> - sc_req_extends = [ ] ; sc_req_implements = [ ] ; sc_implements = [ ] ; <nl> - sc_consts = [ ] ; sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; sc_props = [ ] ; <nl> - sc_sprops = [ ] ; sc_constructor = None ; sc_static_methods = [ ] ; <nl> - sc_methods = <nl> - [ { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> - sm_memoizelsb = false ; sm_name = ( [ 5 : 19 - 30 ] , " cipp_method " ) ; <nl> - sm_override = false ; sm_dynamicallycallable = false ; <nl> - sm_reactivity = None ; <nl> - sm_type = <nl> - ( Rwitness ( root | cipp . php line 5 , characters 19 - 29 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | cipp . php line 5 , characters 19 - 29 ) , ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | cipp . php line 5 , characters 34 - 37 ) , <nl> - ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Cipp { \ C } ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - sm_visibility = Public ; sm_deprecated = None } ; <nl> - { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> - sm_memoizelsb = false ; sm_name = ( [ 8 : 19 - 37 ] , " cipp_global_method " ) ; <nl> - sm_override = false ; sm_dynamicallycallable = false ; <nl> - sm_reactivity = None ; <nl> - sm_type = <nl> - ( Rwitness ( root | cipp . php line 8 , characters 19 - 36 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | cipp . php line 8 , characters 19 - 36 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | cipp . php line 8 , characters 41 - 44 ) , <nl> - ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = CippGlobal ; ft_ifc_decl = FDPolicied { # PUBLIC } <nl> - } ) ) ; <nl> - sm_visibility = Public ; sm_deprecated = None } ; <nl> - { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> - sm_memoizelsb = false ; sm_name = ( [ 11 : 19 - 36 ] , " cipp_local_method " ) ; <nl> + [ ( " \ \ C " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> + sc_name = ( [ 3 : 7 - 8 ] , " \ \ C " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> + sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> + sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; <nl> + sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> + sc_constructor = None ; sc_static_methods = [ ] ; <nl> + sc_methods = <nl> + [ { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> + sm_memoizelsb = false ; sm_name = ( [ 5 : 19 - 30 ] , " cipp_method " ) ; <nl> sm_override = false ; sm_dynamicallycallable = false ; <nl> sm_reactivity = None ; <nl> sm_type = <nl> - ( Rwitness ( root | cipp . php line 11 , characters 19 - 35 ) , <nl> + ( Rwitness ( root | cipp . php line 5 , characters 19 - 29 ) , <nl> ( Tfun <nl> { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> ft_implicit_params = <nl> { capability = <nl> - ( Rhint ( root | cipp . php line 11 , characters 19 - 35 ) , <nl> + ( Rhint ( root | cipp . php line 5 , characters 19 - 29 ) , <nl> ( Tunion [ ] ) ) <nl> } ; <nl> ft_ret = <nl> { et_enforced = false ; <nl> et_type = <nl> - ( Rhint ( root | cipp . php line 11 , characters 40 - 43 ) , <nl> + ( Rhint ( root | cipp . php line 5 , characters 34 - 37 ) , <nl> ( Tprim Tvoid ) ) <nl> } ; <nl> ft_flags = <nl> ( make_ft_flags FSync None ~ return_disposable : false <nl> ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = CippLocal { a } ; <nl> - ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + ft_reactive = Cipp { \ C } ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> sm_visibility = Public ; sm_deprecated = None } ; <nl> - { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> - sm_memoizelsb = false ; sm_name = ( [ 14 : 19 - 33 ] , " cipp_rx_method " ) ; <nl> - sm_override = false ; sm_dynamicallycallable = false ; <nl> - sm_reactivity = None ; <nl> - sm_type = <nl> - ( Rwitness ( root | cipp . php line 14 , characters 19 - 32 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | cipp . php line 14 , characters 19 - 32 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | cipp . php line 14 , characters 37 - 40 ) , <nl> - ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = CippRx ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - sm_visibility = Public ; sm_deprecated = None } <nl> - ] ; <nl> - sc_user_attributes = [ ] ; sc_enum_type = None } } ; <nl> - funs = <nl> - { " \ \ cipp_function " - > <nl> - { Typing_defs . fe_deprecated = None ; <nl> - fe_type = <nl> - ( Rwitness ( root | cipp . php line 18 , characters 10 - 22 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | cipp . php line 18 , characters 10 - 22 ) , ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | cipp . php line 18 , characters 27 - 30 ) , ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Cipp { b } ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - fe_pos = [ 18 : 10 - 23 ] ; fe_php_std_lib = false } ; <nl> - " \ \ cipp_global_function " - > <nl> - { Typing_defs . fe_deprecated = None ; <nl> - fe_type = <nl> - ( Rwitness ( root | cipp . php line 21 , characters 10 - 29 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | cipp . php line 21 , characters 10 - 29 ) , ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | cipp . php line 21 , characters 34 - 37 ) , ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = CippGlobal ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - fe_pos = [ 21 : 10 - 30 ] ; fe_php_std_lib = false } ; <nl> - " \ \ cipp_local_function " - > <nl> - { Typing_defs . fe_deprecated = None ; <nl> - fe_type = <nl> - ( Rwitness ( root | cipp . php line 24 , characters 10 - 28 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | cipp . php line 24 , characters 10 - 28 ) , ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | cipp . php line 24 , characters 33 - 36 ) , ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = CippLocal { \ C } ; ft_ifc_decl = FDPolicied { # PUBLIC } <nl> - } ) ) ; <nl> - fe_pos = [ 24 : 10 - 29 ] ; fe_php_std_lib = false } ; <nl> - " \ \ cipp_rx_function " - > <nl> - { Typing_defs . fe_deprecated = None ; <nl> - fe_type = <nl> - ( Rwitness ( root | cipp . php line 27 , characters 10 - 25 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | cipp . php line 27 , characters 10 - 25 ) , ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | cipp . php line 27 , characters 30 - 33 ) , ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = CippRx ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - fe_pos = [ 27 : 10 - 26 ] ; fe_php_std_lib = false } } ; <nl> - typedefs = { } ; consts = { } ; records = { } } <nl> + { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> + sm_memoizelsb = false ; <nl> + sm_name = ( [ 8 : 19 - 37 ] , " cipp_global_method " ) ; sm_override = false ; <nl> + sm_dynamicallycallable = false ; sm_reactivity = None ; <nl> + sm_type = <nl> + ( Rwitness ( root | cipp . php line 8 , characters 19 - 36 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | cipp . php line 8 , characters 19 - 36 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | cipp . php line 8 , characters 41 - 44 ) , <nl> + ( Tprim Tvoid ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = CippGlobal ; ft_ifc_decl = FDPolicied { # PUBLIC } <nl> + } ) ) ; <nl> + sm_visibility = Public ; sm_deprecated = None } ; <nl> + { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> + sm_memoizelsb = false ; <nl> + sm_name = ( [ 11 : 19 - 36 ] , " cipp_local_method " ) ; sm_override = false ; <nl> + sm_dynamicallycallable = false ; sm_reactivity = None ; <nl> + sm_type = <nl> + ( Rwitness ( root | cipp . php line 11 , characters 19 - 35 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | cipp . php line 11 , characters 19 - 35 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | cipp . php line 11 , characters 40 - 43 ) , <nl> + ( Tprim Tvoid ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = CippLocal { a } ; <nl> + ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + sm_visibility = Public ; sm_deprecated = None } ; <nl> + { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> + sm_memoizelsb = false ; sm_name = ( [ 14 : 19 - 33 ] , " cipp_rx_method " ) ; <nl> + sm_override = false ; sm_dynamicallycallable = false ; <nl> + sm_reactivity = None ; <nl> + sm_type = <nl> + ( Rwitness ( root | cipp . php line 14 , characters 19 - 32 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | cipp . php line 14 , characters 19 - 32 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | cipp . php line 14 , characters 37 - 40 ) , <nl> + ( Tprim Tvoid ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = CippRx ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + sm_visibility = Public ; sm_deprecated = None } <nl> + ] ; <nl> + sc_user_attributes = [ ] ; sc_enum_type = None } ) ) ; <nl> + ( " \ \ cipp_function " , <nl> + ( Shallow_decl_defs . Fun <nl> + { Typing_defs . fe_deprecated = None ; <nl> + fe_type = <nl> + ( Rwitness ( root | cipp . php line 18 , characters 10 - 22 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | cipp . php line 18 , characters 10 - 22 ) , ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | cipp . php line 18 , characters 27 - 30 ) , <nl> + ( Tprim Tvoid ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Cipp { b } ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + fe_pos = [ 18 : 10 - 23 ] ; fe_php_std_lib = false } ) ) ; <nl> + ( " \ \ cipp_global_function " , <nl> + ( Shallow_decl_defs . Fun <nl> + { Typing_defs . fe_deprecated = None ; <nl> + fe_type = <nl> + ( Rwitness ( root | cipp . php line 21 , characters 10 - 29 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | cipp . php line 21 , characters 10 - 29 ) , ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | cipp . php line 21 , characters 34 - 37 ) , <nl> + ( Tprim Tvoid ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = CippGlobal ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + fe_pos = [ 21 : 10 - 30 ] ; fe_php_std_lib = false } ) ) ; <nl> + ( " \ \ cipp_local_function " , <nl> + ( Shallow_decl_defs . Fun <nl> + { Typing_defs . fe_deprecated = None ; <nl> + fe_type = <nl> + ( Rwitness ( root | cipp . php line 24 , characters 10 - 28 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | cipp . php line 24 , characters 10 - 28 ) , ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | cipp . php line 24 , characters 33 - 36 ) , <nl> + ( Tprim Tvoid ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = CippLocal { \ C } ; <nl> + ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + fe_pos = [ 24 : 10 - 29 ] ; fe_php_std_lib = false } ) ) ; <nl> + ( " \ \ cipp_rx_function " , <nl> + ( Shallow_decl_defs . Fun <nl> + { Typing_defs . fe_deprecated = None ; <nl> + fe_type = <nl> + ( Rwitness ( root | cipp . php line 27 , characters 10 - 25 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | cipp . php line 27 , characters 10 - 25 ) , ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | cipp . php line 27 , characters 30 - 33 ) , <nl> + ( Tprim Tvoid ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = CippRx ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + fe_pos = [ 27 : 10 - 26 ] ; fe_php_std_lib = false } ) ) <nl> + ] <nl> <nl> They matched ! <nl> mmm a / hphp / hack / test / decl / class_const_declarator_list . php . exp <nl> ppp b / hphp / hack / test / decl / class_const_declarator_list . php . exp <nl> <nl> - Parsed decls : <nl> - <nl> - { classes = <nl> - { " \ \ C " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> - sc_name = ( [ 3 : 7 - 8 ] , " \ \ C " ) ; sc_tparams = [ ] ; sc_where_constraints = [ ] ; <nl> - sc_extends = [ ] ; sc_uses = [ ] ; sc_xhp_attr_uses = [ ] ; <nl> - sc_req_extends = [ ] ; sc_req_implements = [ ] ; sc_implements = [ ] ; <nl> - sc_consts = <nl> - [ { Shallow_decl_defs . scc_abstract = false ; scc_name = ( [ 5 : 5 - 8 ] , " FOO " ) ; <nl> - scc_type = <nl> - ( Rhint ( root | class_const_declarator_list . php line 4 , characters 9 - 11 ) , <nl> - ( Tprim Tint ) ) <nl> - } ; <nl> - { Shallow_decl_defs . scc_abstract = false ; <nl> - scc_name = ( [ 6 : 5 - 8 ] , " BAR " ) ; <nl> + [ ( " \ \ C " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> + sc_name = ( [ 3 : 7 - 8 ] , " \ \ C " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> + sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> + sc_implements = [ ] ; <nl> + sc_consts = <nl> + [ { Shallow_decl_defs . scc_abstract = false ; <nl> + scc_name = ( [ 5 : 5 - 8 ] , " FOO " ) ; <nl> scc_type = <nl> ( Rhint ( root | class_const_declarator_list . php line 4 , characters 9 - 11 ) , <nl> ( Tprim Tint ) ) <nl> - } <nl> - ] ; <nl> - sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> - sc_constructor = None ; sc_static_methods = [ ] ; sc_methods = [ ] ; <nl> - sc_user_attributes = [ ] ; sc_enum_type = None } } ; <nl> - funs = { } ; typedefs = { } ; consts = { } ; records = { } } <nl> + } ; <nl> + { Shallow_decl_defs . scc_abstract = false ; <nl> + scc_name = ( [ 6 : 5 - 8 ] , " BAR " ) ; <nl> + scc_type = <nl> + ( Rhint ( root | class_const_declarator_list . php line 4 , characters 9 - 11 ) , <nl> + ( Tprim Tint ) ) <nl> + } <nl> + ] ; <nl> + sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> + sc_constructor = None ; sc_static_methods = [ ] ; sc_methods = [ ] ; <nl> + sc_user_attributes = [ ] ; sc_enum_type = None } ) ) <nl> + ] <nl> <nl> They matched ! <nl> mmm a / hphp / hack / test / decl / class_const_int_literals . php . exp <nl> ppp b / hphp / hack / test / decl / class_const_int_literals . php . exp <nl> <nl> - Parsed decls : <nl> - <nl> - { classes = <nl> - { " \ \ C " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> - sc_name = ( [ 3 : 7 - 8 ] , " \ \ C " ) ; sc_tparams = [ ] ; sc_where_constraints = [ ] ; <nl> - sc_extends = [ ] ; sc_uses = [ ] ; sc_xhp_attr_uses = [ ] ; <nl> - sc_req_extends = [ ] ; sc_req_implements = [ ] ; sc_implements = [ ] ; <nl> - sc_consts = <nl> - [ { Shallow_decl_defs . scc_abstract = false ; <nl> - scc_name = ( [ 4 : 13 - 27 ] , " MY_DECIMAL_INT " ) ; <nl> - scc_type = <nl> - ( Rhint ( root | class_const_int_literals . php line 4 , characters 9 - 11 ) , <nl> - ( Tprim Tint ) ) <nl> - } ; <nl> - { Shallow_decl_defs . scc_abstract = false ; <nl> - scc_name = ( [ 5 : 13 - 25 ] , " MY_OCTAL_INT " ) ; <nl> - scc_type = <nl> - ( Rhint ( root | class_const_int_literals . php line 5 , characters 9 - 11 ) , <nl> - ( Tprim Tint ) ) <nl> - } ; <nl> - { Shallow_decl_defs . scc_abstract = false ; <nl> - scc_name = ( [ 6 : 13 - 23 ] , " MY_HEX_INT " ) ; <nl> + [ ( " \ \ C " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> + sc_name = ( [ 3 : 7 - 8 ] , " \ \ C " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> + sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> + sc_implements = [ ] ; <nl> + sc_consts = <nl> + [ { Shallow_decl_defs . scc_abstract = false ; <nl> + scc_name = ( [ 4 : 13 - 27 ] , " MY_DECIMAL_INT " ) ; <nl> scc_type = <nl> - ( Rhint ( root | class_const_int_literals . php line 6 , characters 9 - 11 ) , <nl> + ( Rhint ( root | class_const_int_literals . php line 4 , characters 9 - 11 ) , <nl> ( Tprim Tint ) ) <nl> } ; <nl> - { Shallow_decl_defs . scc_abstract = false ; <nl> - scc_name = ( [ 7 : 13 - 26 ] , " MY_BINARY_INT " ) ; <nl> - scc_type = <nl> - ( Rhint ( root | class_const_int_literals . php line 7 , characters 9 - 11 ) , <nl> - ( Tprim Tint ) ) <nl> - } <nl> - ] ; <nl> - sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> - sc_constructor = None ; sc_static_methods = [ ] ; sc_methods = [ ] ; <nl> - sc_user_attributes = [ ] ; sc_enum_type = None } } ; <nl> - funs = { } ; typedefs = { } ; consts = { } ; records = { } } <nl> + { Shallow_decl_defs . scc_abstract = false ; <nl> + scc_name = ( [ 5 : 13 - 25 ] , " MY_OCTAL_INT " ) ; <nl> + scc_type = <nl> + ( Rhint ( root | class_const_int_literals . php line 5 , characters 9 - 11 ) , <nl> + ( Tprim Tint ) ) <nl> + } ; <nl> + { Shallow_decl_defs . scc_abstract = false ; <nl> + scc_name = ( [ 6 : 13 - 23 ] , " MY_HEX_INT " ) ; <nl> + scc_type = <nl> + ( Rhint ( root | class_const_int_literals . php line 6 , characters 9 - 11 ) , <nl> + ( Tprim Tint ) ) <nl> + } ; <nl> + { Shallow_decl_defs . scc_abstract = false ; <nl> + scc_name = ( [ 7 : 13 - 26 ] , " MY_BINARY_INT " ) ; <nl> + scc_type = <nl> + ( Rhint ( root | class_const_int_literals . php line 7 , characters 9 - 11 ) , <nl> + ( Tprim Tint ) ) <nl> + } <nl> + ] ; <nl> + sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> + sc_constructor = None ; sc_static_methods = [ ] ; sc_methods = [ ] ; <nl> + sc_user_attributes = [ ] ; sc_enum_type = None } ) ) <nl> + ] <nl> <nl> They matched ! <nl> mmm a / hphp / hack / test / decl / class_const_referencing_global_const . php . exp <nl> ppp b / hphp / hack / test / decl / class_const_referencing_global_const . php . exp <nl> <nl> - Parsed decls : <nl> - <nl> - { classes = <nl> - { " \ \ Integer " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> - sc_name = ( [ 4 : 9 - 16 ] , " \ \ Integer " ) ; sc_tparams = [ ] ; <nl> - sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> - sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> - sc_implements = [ ] ; <nl> - sc_consts = <nl> - [ { Shallow_decl_defs . scc_abstract = false ; <nl> - scc_name = ( [ 5 : 15 - 20 ] , " MAX32 " ) ; <nl> - scc_type = <nl> - ( Rhint ( root | class_const_referencing_global_const . php line 5 , characters 11 - 13 ) , <nl> - ( Tprim Tint ) ) <nl> - } ; <nl> - { Shallow_decl_defs . scc_abstract = false ; <nl> - scc_name = ( [ 6 : 15 - 20 ] , " MAX64 " ) ; <nl> - scc_type = <nl> - ( Rhint ( root | class_const_referencing_global_const . php line 6 , characters 11 - 13 ) , <nl> - ( Tprim Tint ) ) <nl> - } <nl> - ] ; <nl> - sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> - sc_constructor = None ; sc_static_methods = [ ] ; sc_methods = [ ] ; <nl> - sc_user_attributes = [ ] ; sc_enum_type = None } ; <nl> - " \ \ NS \ \ Integer " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> - sc_name = ( [ 10 : 11 - 18 ] , " \ \ NS \ \ Integer " ) ; sc_tparams = [ ] ; <nl> - sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> - sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> - sc_implements = [ ] ; <nl> - sc_consts = <nl> - [ { Shallow_decl_defs . scc_abstract = false ; <nl> - scc_name = ( [ 11 : 17 - 22 ] , " MAX32 " ) ; <nl> - scc_type = <nl> - ( Rhint ( root | class_const_referencing_global_const . php line 11 , characters 13 - 15 ) , <nl> - ( Tprim Tint ) ) <nl> - } ; <nl> - { Shallow_decl_defs . scc_abstract = false ; <nl> - scc_name = ( [ 12 : 17 - 22 ] , " MAX64 " ) ; <nl> + [ ( " \ \ Integer " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> + sc_name = ( [ 4 : 9 - 16 ] , " \ \ Integer " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> + sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> + sc_implements = [ ] ; <nl> + sc_consts = <nl> + [ { Shallow_decl_defs . scc_abstract = false ; <nl> + scc_name = ( [ 5 : 15 - 20 ] , " MAX32 " ) ; <nl> scc_type = <nl> - ( Rhint ( root | class_const_referencing_global_const . php line 12 , characters 13 - 15 ) , <nl> + ( Rhint ( root | class_const_referencing_global_const . php line 5 , characters 11 - 13 ) , <nl> ( Tprim Tint ) ) <nl> - } <nl> - ] ; <nl> - sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> - sc_constructor = None ; sc_static_methods = [ ] ; sc_methods = [ ] ; <nl> - sc_user_attributes = [ ] ; sc_enum_type = None } } ; <nl> - funs = { } ; typedefs = { } ; consts = { } ; records = { } } <nl> + } ; <nl> + { Shallow_decl_defs . scc_abstract = false ; <nl> + scc_name = ( [ 6 : 15 - 20 ] , " MAX64 " ) ; <nl> + scc_type = <nl> + ( Rhint ( root | class_const_referencing_global_const . php line 6 , characters 11 - 13 ) , <nl> + ( Tprim Tint ) ) <nl> + } <nl> + ] ; <nl> + sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> + sc_constructor = None ; sc_static_methods = [ ] ; sc_methods = [ ] ; <nl> + sc_user_attributes = [ ] ; sc_enum_type = None } ) ) ; <nl> + ( " \ \ NS \ \ Integer " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> + sc_name = ( [ 10 : 11 - 18 ] , " \ \ NS \ \ Integer " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> + sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> + sc_implements = [ ] ; <nl> + sc_consts = <nl> + [ { Shallow_decl_defs . scc_abstract = false ; <nl> + scc_name = ( [ 11 : 17 - 22 ] , " MAX32 " ) ; <nl> + scc_type = <nl> + ( Rhint ( root | class_const_referencing_global_const . php line 11 , characters 13 - 15 ) , <nl> + ( Tprim Tint ) ) <nl> + } ; <nl> + { Shallow_decl_defs . scc_abstract = false ; <nl> + scc_name = ( [ 12 : 17 - 22 ] , " MAX64 " ) ; <nl> + scc_type = <nl> + ( Rhint ( root | class_const_referencing_global_const . php line 12 , characters 13 - 15 ) , <nl> + ( Tprim Tint ) ) <nl> + } <nl> + ] ; <nl> + sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> + sc_constructor = None ; sc_static_methods = [ ] ; sc_methods = [ ] ; <nl> + sc_user_attributes = [ ] ; sc_enum_type = None } ) ) <nl> + ] <nl> <nl> They matched ! <nl> mmm a / hphp / hack / test / decl / class_const_with_parens . php . exp <nl> ppp b / hphp / hack / test / decl / class_const_with_parens . php . exp <nl> <nl> - Parsed decls : <nl> - <nl> - { classes = <nl> - { " \ \ C " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> - sc_name = ( [ 3 : 7 - 8 ] , " \ \ C " ) ; sc_tparams = [ ] ; sc_where_constraints = [ ] ; <nl> - sc_extends = [ ] ; sc_uses = [ ] ; sc_xhp_attr_uses = [ ] ; <nl> - sc_req_extends = [ ] ; sc_req_implements = [ ] ; sc_implements = [ ] ; <nl> - sc_consts = <nl> - [ { Shallow_decl_defs . scc_abstract = false ; scc_name = ( [ 4 : 13 - 14 ] , " X " ) ; <nl> - scc_type = <nl> - ( Rhint ( root | class_const_with_parens . php line 4 , characters 9 - 11 ) , <nl> - ( Tprim Tint ) ) <nl> - } ; <nl> - { Shallow_decl_defs . scc_abstract = false ; <nl> - scc_name = ( [ 5 : 13 - 14 ] , " Y " ) ; <nl> + [ ( " \ \ C " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> + sc_name = ( [ 3 : 7 - 8 ] , " \ \ C " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> + sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> + sc_implements = [ ] ; <nl> + sc_consts = <nl> + [ { Shallow_decl_defs . scc_abstract = false ; <nl> + scc_name = ( [ 4 : 13 - 14 ] , " X " ) ; <nl> scc_type = <nl> - ( Rhint ( root | class_const_with_parens . php line 5 , characters 9 - 11 ) , <nl> + ( Rhint ( root | class_const_with_parens . php line 4 , characters 9 - 11 ) , <nl> ( Tprim Tint ) ) <nl> - } <nl> - ] ; <nl> - sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> - sc_constructor = None ; sc_static_methods = [ ] ; sc_methods = [ ] ; <nl> - sc_user_attributes = [ ] ; sc_enum_type = None } } ; <nl> - funs = { } ; typedefs = { } ; consts = { } ; records = { } } <nl> + } ; <nl> + { Shallow_decl_defs . scc_abstract = false ; <nl> + scc_name = ( [ 5 : 13 - 14 ] , " Y " ) ; <nl> + scc_type = <nl> + ( Rhint ( root | class_const_with_parens . php line 5 , characters 9 - 11 ) , <nl> + ( Tprim Tint ) ) <nl> + } <nl> + ] ; <nl> + sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> + sc_constructor = None ; sc_static_methods = [ ] ; sc_methods = [ ] ; <nl> + sc_user_attributes = [ ] ; sc_enum_type = None } ) ) <nl> + ] <nl> <nl> They matched ! <nl> mmm a / hphp / hack / test / decl / class_in_namespace . php . exp <nl> ppp b / hphp / hack / test / decl / class_in_namespace . php . exp <nl> <nl> - Parsed decls : <nl> - <nl> - { classes = <nl> - { " \ \ Foo \ \ C " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> - sc_name = ( [ 4 : 9 - 10 ] , " \ \ Foo \ \ C " ) ; sc_tparams = [ ] ; <nl> - sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> - sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> - sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; <nl> - sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; sc_constructor = None ; <nl> - sc_static_methods = [ ] ; <nl> - sc_methods = <nl> - [ { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> - sm_memoizelsb = false ; sm_name = ( [ 5 : 21 - 22 ] , " f " ) ; <nl> - sm_override = false ; sm_dynamicallycallable = false ; <nl> - sm_reactivity = None ; <nl> - sm_type = <nl> - ( Rwitness ( root | class_in_namespace . php line 5 , characters 21 - 21 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | class_in_namespace . php line 5 , characters 21 - 21 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | class_in_namespace . php line 5 , characters 26 - 29 ) , <nl> - ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } <nl> - } ) ) ; <nl> - sm_visibility = Public ; sm_deprecated = None } <nl> - ] ; <nl> - sc_user_attributes = [ ] ; sc_enum_type = None } } ; <nl> - funs = { } ; typedefs = { } ; consts = { } ; records = { } } <nl> + [ ( " \ \ Foo \ \ C " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> + sc_name = ( [ 4 : 9 - 10 ] , " \ \ Foo \ \ C " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> + sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> + sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; <nl> + sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> + sc_constructor = None ; sc_static_methods = [ ] ; <nl> + sc_methods = <nl> + [ { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> + sm_memoizelsb = false ; sm_name = ( [ 5 : 21 - 22 ] , " f " ) ; <nl> + sm_override = false ; sm_dynamicallycallable = false ; <nl> + sm_reactivity = None ; <nl> + sm_type = <nl> + ( Rwitness ( root | class_in_namespace . php line 5 , characters 21 - 21 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | class_in_namespace . php line 5 , characters 21 - 21 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | class_in_namespace . php line 5 , characters 26 - 29 ) , <nl> + ( Tprim Tvoid ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } <nl> + } ) ) ; <nl> + sm_visibility = Public ; sm_deprecated = None } <nl> + ] ; <nl> + sc_user_attributes = [ ] ; sc_enum_type = None } ) ) <nl> + ] <nl> <nl> They matched ! <nl> mmm a / hphp / hack / test / decl / class_level_where . php . exp <nl> ppp b / hphp / hack / test / decl / class_level_where . php . exp <nl> <nl> - Parsed decls : <nl> - <nl> - { classes = <nl> - { " \ \ C " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> - sc_name = ( [ 14 : 7 - 8 ] , " \ \ C " ) ; sc_tparams = [ ] ; <nl> - sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> - sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> - sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; <nl> - sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; sc_constructor = None ; <nl> - sc_static_methods = [ ] ; sc_methods = [ ] ; sc_user_attributes = [ ] ; <nl> - sc_enum_type = None } ; <nl> - " \ \ I " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cinterface ; <nl> - sc_name = ( [ 16 : 11 - 12 ] , " \ \ I " ) ; sc_tparams = [ ] ; <nl> - sc_where_constraints = <nl> - [ ( ( Rhint ( root | class_level_where . php line 16 , characters 19 - 22 ) , Tthis ) , <nl> - Constraint_as , <nl> - ( Rhint ( root | class_level_where . php line 16 , characters 27 - 27 ) , <nl> - ( Tapply ( ( [ 16 : 27 - 28 ] , " \ \ C " ) , [ ] ) ) ) ) <nl> - ] ; <nl> - sc_extends = [ ] ; sc_uses = [ ] ; sc_xhp_attr_uses = [ ] ; <nl> - sc_req_extends = [ ] ; sc_req_implements = [ ] ; sc_implements = [ ] ; <nl> - sc_consts = [ ] ; sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; sc_props = [ ] ; <nl> - sc_sprops = [ ] ; sc_constructor = None ; sc_static_methods = [ ] ; <nl> - sc_methods = [ ] ; sc_user_attributes = [ ] ; sc_enum_type = None } ; <nl> - " \ \ J " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cinterface ; <nl> - sc_name = ( [ 20 : 11 - 12 ] , " \ \ J " ) ; sc_tparams = [ ] ; <nl> - sc_where_constraints = <nl> - [ ( ( Rhint ( root | class_level_where . php line 20 , characters 19 - 19 ) , <nl> - ( Tapply ( ( [ 20 : 19 - 20 ] , " \ \ C " ) , [ ] ) ) ) , <nl> - Constraint_super , <nl> - ( Rhint ( root | class_level_where . php line 20 , characters 27 - 30 ) , Tthis ) ) <nl> - ] ; <nl> - sc_extends = [ ] ; sc_uses = [ ] ; sc_xhp_attr_uses = [ ] ; <nl> - sc_req_extends = [ ] ; sc_req_implements = [ ] ; sc_implements = [ ] ; <nl> - sc_consts = [ ] ; sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; sc_props = [ ] ; <nl> - sc_sprops = [ ] ; sc_constructor = None ; sc_static_methods = [ ] ; <nl> - sc_methods = [ ] ; sc_user_attributes = [ ] ; sc_enum_type = None } ; <nl> - " \ \ PartialC " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Ctrait ; <nl> - sc_name = ( [ 18 : 7 - 15 ] , " \ \ PartialC " ) ; sc_tparams = [ ] ; <nl> - sc_where_constraints = <nl> - [ ( ( Rhint ( root | class_level_where . php line 18 , characters 35 - 38 ) , Tthis ) , <nl> - Constraint_eq , <nl> - ( Rhint ( root | class_level_where . php line 18 , characters 42 - 42 ) , <nl> - ( Tapply ( ( [ 18 : 42 - 43 ] , " \ \ C " ) , [ ] ) ) ) ) <nl> - ] ; <nl> - sc_extends = [ ] ; sc_uses = [ ] ; sc_xhp_attr_uses = [ ] ; <nl> - sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> - sc_implements = <nl> - [ ( Rhint ( root | class_level_where . php line 18 , characters 27 - 27 ) , <nl> - ( Tapply ( ( [ 18 : 27 - 28 ] , " \ \ I " ) , [ ] ) ) ) ] ; <nl> - sc_consts = [ ] ; sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; sc_props = [ ] ; <nl> - sc_sprops = [ ] ; sc_constructor = None ; sc_static_methods = [ ] ; <nl> - sc_methods = [ ] ; sc_user_attributes = [ ] ; sc_enum_type = None } } ; <nl> - funs = { } ; typedefs = { } ; consts = { } ; records = { } } <nl> + [ ( " \ \ C " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> + sc_name = ( [ 14 : 7 - 8 ] , " \ \ C " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> + sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> + sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; <nl> + sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> + sc_constructor = None ; sc_static_methods = [ ] ; sc_methods = [ ] ; <nl> + sc_user_attributes = [ ] ; sc_enum_type = None } ) ) ; <nl> + ( " \ \ I " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cinterface ; <nl> + sc_name = ( [ 16 : 11 - 12 ] , " \ \ I " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = <nl> + [ ( ( Rhint ( root | class_level_where . php line 16 , characters 19 - 22 ) , <nl> + Tthis ) , <nl> + Constraint_as , <nl> + ( Rhint ( root | class_level_where . php line 16 , characters 27 - 27 ) , <nl> + ( Tapply ( ( [ 16 : 27 - 28 ] , " \ \ C " ) , [ ] ) ) ) ) <nl> + ] ; <nl> + sc_extends = [ ] ; sc_uses = [ ] ; sc_xhp_attr_uses = [ ] ; <nl> + sc_req_extends = [ ] ; sc_req_implements = [ ] ; sc_implements = [ ] ; <nl> + sc_consts = [ ] ; sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; sc_props = [ ] ; <nl> + sc_sprops = [ ] ; sc_constructor = None ; sc_static_methods = [ ] ; <nl> + sc_methods = [ ] ; sc_user_attributes = [ ] ; sc_enum_type = None } ) ) ; <nl> + ( " \ \ PartialC " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Ctrait ; <nl> + sc_name = ( [ 18 : 7 - 15 ] , " \ \ PartialC " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = <nl> + [ ( ( Rhint ( root | class_level_where . php line 18 , characters 35 - 38 ) , <nl> + Tthis ) , <nl> + Constraint_eq , <nl> + ( Rhint ( root | class_level_where . php line 18 , characters 42 - 42 ) , <nl> + ( Tapply ( ( [ 18 : 42 - 43 ] , " \ \ C " ) , [ ] ) ) ) ) <nl> + ] ; <nl> + sc_extends = [ ] ; sc_uses = [ ] ; sc_xhp_attr_uses = [ ] ; <nl> + sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> + sc_implements = <nl> + [ ( Rhint ( root | class_level_where . php line 18 , characters 27 - 27 ) , <nl> + ( Tapply ( ( [ 18 : 27 - 28 ] , " \ \ I " ) , [ ] ) ) ) ] ; <nl> + sc_consts = [ ] ; sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; sc_props = [ ] ; <nl> + sc_sprops = [ ] ; sc_constructor = None ; sc_static_methods = [ ] ; <nl> + sc_methods = [ ] ; sc_user_attributes = [ ] ; sc_enum_type = None } ) ) ; <nl> + ( " \ \ J " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cinterface ; <nl> + sc_name = ( [ 20 : 11 - 12 ] , " \ \ J " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = <nl> + [ ( ( Rhint ( root | class_level_where . php line 20 , characters 19 - 19 ) , <nl> + ( Tapply ( ( [ 20 : 19 - 20 ] , " \ \ C " ) , [ ] ) ) ) , <nl> + Constraint_super , <nl> + ( Rhint ( root | class_level_where . php line 20 , characters 27 - 30 ) , <nl> + Tthis ) ) <nl> + ] ; <nl> + sc_extends = [ ] ; sc_uses = [ ] ; sc_xhp_attr_uses = [ ] ; <nl> + sc_req_extends = [ ] ; sc_req_implements = [ ] ; sc_implements = [ ] ; <nl> + sc_consts = [ ] ; sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; sc_props = [ ] ; <nl> + sc_sprops = [ ] ; sc_constructor = None ; sc_static_methods = [ ] ; <nl> + sc_methods = [ ] ; sc_user_attributes = [ ] ; sc_enum_type = None } ) ) <nl> + ] <nl> <nl> They matched ! <nl> mmm a / hphp / hack / test / decl / classes . php . exp <nl> ppp b / hphp / hack / test / decl / classes . php . exp <nl> <nl> - Parsed decls : <nl> - <nl> - { classes = <nl> - { " \ \ MyAbstractClass " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cabstract ; <nl> - sc_name = ( [ 45 : 16 - 31 ] , " \ \ MyAbstractClass " ) ; sc_tparams = [ ] ; <nl> - sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> - sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> - sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; <nl> - sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; sc_constructor = None ; <nl> - sc_static_methods = [ ] ; sc_methods = [ ] ; sc_user_attributes = [ ] ; <nl> - sc_enum_type = None } ; <nl> - " \ \ MyClass " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> - sc_name = ( [ 3 : 7 - 14 ] , " \ \ MyClass " ) ; sc_tparams = [ ] ; <nl> - sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> - sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> - sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; <nl> - sc_pu_enums = [ ] ; <nl> - sc_props = <nl> - [ { Shallow_decl_defs . sp_const = false ; sp_xhp_attr = None ; <nl> - sp_lateinit = false ; sp_lsb = false ; <nl> - sp_name = ( [ 5 : 17 - 34 ] , " instanceProperty " ) ; sp_needs_init = true ; <nl> - sp_type = <nl> - ( Some ( Rhint ( root | classes . php line 5 , characters 10 - 15 ) , <nl> - ( Tprim Tstring ) ) ) ; <nl> - sp_abstract = false ; sp_visibility = Public } ; <nl> - { Shallow_decl_defs . sp_const = false ; sp_xhp_attr = None ; <nl> + [ ( " \ \ MyClass " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> + sc_name = ( [ 3 : 7 - 14 ] , " \ \ MyClass " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> + sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> + sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; <nl> + sc_pu_enums = [ ] ; <nl> + sc_props = <nl> + [ { Shallow_decl_defs . sp_const = false ; sp_xhp_attr = None ; <nl> sp_lateinit = false ; sp_lsb = false ; <nl> - sp_name = ( [ 6 : 17 - 35 ] , " protectedProperty " ) ; sp_needs_init = true ; <nl> + sp_name = ( [ 5 : 17 - 34 ] , " instanceProperty " ) ; sp_needs_init = true ; <nl> sp_type = <nl> - ( Some ( Rhint ( root | classes . php line 6 , characters 13 - 15 ) , <nl> - ( Tprim Tint ) ) ) ; <nl> - sp_abstract = false ; sp_visibility = Protected } ; <nl> - { Shallow_decl_defs . sp_const = false ; sp_xhp_attr = None ; <nl> - sp_lateinit = true ; sp_lsb = false ; sp_name = ( [ 7 : 34 - 36 ] , " p " ) ; <nl> - sp_needs_init = true ; <nl> + ( Some ( Rhint ( root | classes . php line 5 , characters 10 - 15 ) , <nl> + ( Tprim Tstring ) ) ) ; <nl> + sp_abstract = false ; sp_visibility = Public } ; <nl> + { Shallow_decl_defs . sp_const = false ; sp_xhp_attr = None ; <nl> + sp_lateinit = false ; sp_lsb = false ; <nl> + sp_name = ( [ 6 : 17 - 35 ] , " protectedProperty " ) ; sp_needs_init = true ; <nl> + sp_type = <nl> + ( Some ( Rhint ( root | classes . php line 6 , characters 13 - 15 ) , <nl> + ( Tprim Tint ) ) ) ; <nl> + sp_abstract = false ; sp_visibility = Protected } ; <nl> + { Shallow_decl_defs . sp_const = false ; sp_xhp_attr = None ; <nl> + sp_lateinit = true ; sp_lsb = false ; sp_name = ( [ 7 : 34 - 36 ] , " p " ) ; <nl> + sp_needs_init = true ; <nl> + sp_type = <nl> + ( Some ( Rhint ( root | classes . php line 7 , characters 25 - 32 ) , <nl> + ( Tprim Tarraykey ) ) ) ; <nl> + sp_abstract = false ; sp_visibility = Public } <nl> + ] ; <nl> + sc_sprops = <nl> + [ { Shallow_decl_defs . sp_const = false ; sp_xhp_attr = None ; <nl> + sp_lateinit = false ; sp_lsb = false ; <nl> + sp_name = ( [ 4 : 25 - 40 ] , " $ staticProperty " ) ; sp_needs_init = true ; <nl> sp_type = <nl> - ( Some ( Rhint ( root | classes . php line 7 , characters 25 - 32 ) , <nl> - ( Tprim Tarraykey ) ) ) ; <nl> - sp_abstract = false ; sp_visibility = Public } <nl> - ] ; <nl> - sc_sprops = <nl> - [ { Shallow_decl_defs . sp_const = false ; sp_xhp_attr = None ; <nl> - sp_lateinit = false ; sp_lsb = false ; <nl> - sp_name = ( [ 4 : 25 - 40 ] , " $ staticProperty " ) ; sp_needs_init = true ; <nl> - sp_type = <nl> - ( Some ( Rhint ( root | classes . php line 4 , characters 18 - 23 ) , <nl> - ( Tprim Tstring ) ) ) ; <nl> - sp_abstract = false ; sp_visibility = Private } <nl> - ] ; <nl> - sc_constructor = <nl> - ( Some { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> - sm_memoizelsb = false ; sm_name = ( [ 9 : 19 - 30 ] , " __construct " ) ; <nl> - sm_override = false ; sm_dynamicallycallable = false ; <nl> - sm_reactivity = None ; <nl> - sm_type = <nl> - ( Rwitness ( root | classes . php line 9 , characters 19 - 29 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | classes . php line 9 , characters 19 - 29 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rwitness ( root | classes . php line 9 , characters 19 - 29 ) , <nl> - ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; <nl> - ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - sm_visibility = Public ; sm_deprecated = None } ) ; <nl> - sc_static_methods = [ ] ; <nl> - sc_methods = <nl> - [ { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> - sm_memoizelsb = false ; sm_name = ( [ 11 : 20 - 33 ] , " privateMethod " ) ; <nl> - sm_override = false ; sm_dynamicallycallable = false ; <nl> - sm_reactivity = None ; <nl> - sm_type = <nl> - ( Rwitness ( root | classes . php line 11 , characters 20 - 32 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | classes . php line 11 , characters 20 - 32 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | classes . php line 11 , characters 37 - 40 ) , <nl> - ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } <nl> - } ) ) ; <nl> - sm_visibility = Private ; sm_deprecated = None } ; <nl> - { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> - sm_memoizelsb = false ; sm_name = ( [ 12 : 19 - 31 ] , " publicMethod " ) ; <nl> - sm_override = false ; sm_dynamicallycallable = false ; <nl> - sm_reactivity = None ; <nl> - sm_type = <nl> - ( Rwitness ( root | classes . php line 12 , characters 19 - 30 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | classes . php line 12 , characters 19 - 30 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | classes . php line 12 , characters 35 - 38 ) , <nl> - ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } <nl> - } ) ) ; <nl> - sm_visibility = Public ; sm_deprecated = None } ; <nl> - { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> - sm_memoizelsb = false ; sm_name = ( [ 13 : 22 - 37 ] , " protectedMethod " ) ; <nl> + ( Some ( Rhint ( root | classes . php line 4 , characters 18 - 23 ) , <nl> + ( Tprim Tstring ) ) ) ; <nl> + sp_abstract = false ; sp_visibility = Private } <nl> + ] ; <nl> + sc_constructor = <nl> + ( Some { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> + sm_memoizelsb = false ; sm_name = ( [ 9 : 19 - 30 ] , " __construct " ) ; <nl> + sm_override = false ; sm_dynamicallycallable = false ; <nl> + sm_reactivity = None ; <nl> + sm_type = <nl> + ( Rwitness ( root | classes . php line 9 , characters 19 - 29 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | classes . php line 9 , characters 19 - 29 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rwitness ( root | classes . php line 9 , characters 19 - 29 ) , <nl> + ( Tprim Tvoid ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; <nl> + ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + sm_visibility = Public ; sm_deprecated = None } ) ; <nl> + sc_static_methods = [ ] ; <nl> + sc_methods = <nl> + [ { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> + sm_memoizelsb = false ; sm_name = ( [ 11 : 20 - 33 ] , " privateMethod " ) ; <nl> sm_override = false ; sm_dynamicallycallable = false ; <nl> sm_reactivity = None ; <nl> sm_type = <nl> - ( Rwitness ( root | classes . php line 13 , characters 22 - 36 ) , <nl> + ( Rwitness ( root | classes . php line 11 , characters 20 - 32 ) , <nl> ( Tfun <nl> { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> ft_implicit_params = <nl> { capability = <nl> - ( Rhint ( root | classes . php line 13 , characters 22 - 36 ) , <nl> + ( Rhint ( root | classes . php line 11 , characters 20 - 32 ) , <nl> ( Tunion [ ] ) ) <nl> } ; <nl> ft_ret = <nl> { et_enforced = false ; <nl> et_type = <nl> - ( Rhint ( root | classes . php line 13 , characters 41 - 44 ) , <nl> + ( Rhint ( root | classes . php line 11 , characters 37 - 40 ) , <nl> ( Tprim Tvoid ) ) <nl> } ; <nl> ft_flags = <nl> Parsed decls : <nl> ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } <nl> } ) ) ; <nl> - sm_visibility = Protected ; sm_deprecated = None } ; <nl> - { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> - sm_memoizelsb = false ; sm_name = ( [ 14 : 25 - 40 ] , " async_generator " ) ; <nl> - sm_override = false ; sm_dynamicallycallable = false ; <nl> - sm_reactivity = None ; <nl> - sm_type = <nl> - ( Rwitness ( root | classes . php line 14 , characters 25 - 39 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; <nl> - ft_params = <nl> - [ { fp_pos = [ 15 : 12 - 17 ] ; fp_name = ( Some " $ arg1 " ) ; <nl> - fp_type = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | classes . php line 15 , characters 5 - 10 ) , <nl> - ( Tprim Tstring ) ) <nl> - } ; <nl> - fp_flags = <nl> - ( make_fp_flags ~ mutability : None ~ accept_disposable : false <nl> - ~ has_default : false ~ mode : Typing_defs_core . FPnormal <nl> - ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> - } ; <nl> - { fp_pos = [ 16 : 9 - 14 ] ; fp_name = ( Some " $ arg2 " ) ; <nl> + sm_visibility = Private ; sm_deprecated = None } ; <nl> + { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> + sm_memoizelsb = false ; sm_name = ( [ 12 : 19 - 31 ] , " publicMethod " ) ; <nl> + sm_override = false ; sm_dynamicallycallable = false ; <nl> + sm_reactivity = None ; <nl> + sm_type = <nl> + ( Rwitness ( root | classes . php line 12 , characters 19 - 30 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | classes . php line 12 , characters 19 - 30 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | classes . php line 12 , characters 35 - 38 ) , <nl> + ( Tprim Tvoid ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; <nl> + ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + sm_visibility = Public ; sm_deprecated = None } ; <nl> + { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> + sm_memoizelsb = false ; sm_name = ( [ 13 : 22 - 37 ] , " protectedMethod " ) ; <nl> + sm_override = false ; sm_dynamicallycallable = false ; <nl> + sm_reactivity = None ; <nl> + sm_type = <nl> + ( Rwitness ( root | classes . php line 13 , characters 22 - 36 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | classes . php line 13 , characters 22 - 36 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | classes . php line 13 , characters 41 - 44 ) , <nl> + ( Tprim Tvoid ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; <nl> + ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + sm_visibility = Protected ; sm_deprecated = None } ; <nl> + { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> + sm_memoizelsb = false ; sm_name = ( [ 14 : 25 - 40 ] , " async_generator " ) ; <nl> + sm_override = false ; sm_dynamicallycallable = false ; <nl> + sm_reactivity = None ; <nl> + sm_type = <nl> + ( Rwitness ( root | classes . php line 14 , characters 25 - 39 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; <nl> + ft_params = <nl> + [ { fp_pos = [ 15 : 12 - 17 ] ; fp_name = ( Some " $ arg1 " ) ; <nl> fp_type = <nl> { et_enforced = false ; <nl> et_type = <nl> - ( Rhint ( root | classes . php line 16 , characters 5 - 7 ) , <nl> - ( Tprim Tint ) ) <nl> + ( Rhint ( root | classes . php line 15 , characters 5 - 10 ) , <nl> + ( Tprim Tstring ) ) <nl> } ; <nl> fp_flags = <nl> ( make_fp_flags ~ mutability : None ~ accept_disposable : false <nl> ~ has_default : false ~ mode : Typing_defs_core . FPnormal <nl> ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> - } <nl> - ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | classes . php line 14 , characters 25 - 39 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | classes . php line 17 , characters 6 - 41 ) , <nl> - ( Tapply ( ( [ 17 : 6 - 23 ] , " \ \ HH \ \ AsyncGenerator " ) , <nl> - [ ( Rhint ( root | classes . php line 17 , characters 24 - 26 ) , <nl> - ( Tprim Tint ) ) ; <nl> - ( Rhint ( root | classes . php line 17 , characters 29 - 34 ) , <nl> - ( Tprim Tstring ) ) ; <nl> - ( Rhint ( root | classes . php line 17 , characters 37 - 40 ) , <nl> - ( Tprim Tvoid ) ) <nl> - ] <nl> - ) ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FAsyncGenerator None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } <nl> - } ) ) ; <nl> - sm_visibility = Public ; sm_deprecated = None } ; <nl> - { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> - sm_memoizelsb = false ; sm_name = ( [ 23 : 19 - 36 ] , " reactive_function " ) ; <nl> - sm_override = false ; sm_dynamicallycallable = false ; <nl> - sm_reactivity = ( Some ( Decl_defs . Method_reactive None ) ) ; <nl> - sm_type = <nl> - ( Rwitness ( root | classes . php line 23 , characters 19 - 35 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | classes . php line 23 , characters 19 - 35 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | classes . php line 23 , characters 40 - 43 ) , <nl> - ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Reactive { } ; ft_ifc_decl = FDPolicied { # PUBLIC } <nl> - } ) ) ; <nl> - sm_visibility = Public ; sm_deprecated = None } ; <nl> - { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> - sm_memoizelsb = false ; <nl> - sm_name = ( [ 26 : 19 - 44 ] , " shallow_reactive_function " ) ; <nl> - sm_override = false ; sm_dynamicallycallable = false ; <nl> - sm_reactivity = ( Some ( Decl_defs . Method_shallow None ) ) ; <nl> - sm_type = <nl> - ( Rwitness ( root | classes . php line 26 , characters 19 - 43 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | classes . php line 26 , characters 19 - 43 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | classes . php line 26 , characters 48 - 51 ) , <nl> - ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Shallow { } ; ft_ifc_decl = FDPolicied { # PUBLIC } <nl> - } ) ) ; <nl> - sm_visibility = Public ; sm_deprecated = None } ; <nl> - { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> - sm_memoizelsb = false ; <nl> - sm_name = ( [ 29 : 19 - 42 ] , " local_reactive_function " ) ; <nl> - sm_override = false ; sm_dynamicallycallable = false ; <nl> - sm_reactivity = ( Some ( Decl_defs . Method_local None ) ) ; <nl> - sm_type = <nl> - ( Rwitness ( root | classes . php line 29 , characters 19 - 41 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | classes . php line 29 , characters 19 - 41 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | classes . php line 29 , characters 46 - 49 ) , <nl> - ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Local { } ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - sm_visibility = Public ; sm_deprecated = None } ; <nl> - { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> - sm_memoizelsb = false ; <nl> - sm_name = ( [ 32 : 19 - 49 ] , " reactive_function_mutable_args " ) ; <nl> - sm_override = false ; sm_dynamicallycallable = false ; <nl> - sm_reactivity = ( Some ( Decl_defs . Method_reactive None ) ) ; <nl> - sm_type = <nl> - ( Rwitness ( root | classes . php line 32 , characters 19 - 48 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; <nl> - ft_params = <nl> - [ { fp_pos = [ 33 : 27 - 29 ] ; fp_name = ( Some " $ a " ) ; <nl> - fp_type = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | classes . php line 33 , characters 19 - 25 ) , <nl> - ( Tapply ( ( [ 33 : 19 - 26 ] , " \ \ MyClass " ) , [ ] ) ) ) <nl> } ; <nl> - fp_flags = <nl> - ( make_fp_flags <nl> - ~ mutability : ( Some Typing_defs_core . Param_borrowed_mutable ) <nl> - ~ accept_disposable : false ~ has_default : false <nl> - ~ mode : Typing_defs_core . FPnormal ~ ifc_external : false <nl> - ~ ifc_can_call : false ) ; <nl> - } ; <nl> - { fp_pos = [ 34 : 32 - 34 ] ; fp_name = ( Some " $ b " ) ; <nl> + { fp_pos = [ 16 : 9 - 14 ] ; fp_name = ( Some " $ arg2 " ) ; <nl> + fp_type = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | classes . php line 16 , characters 5 - 7 ) , <nl> + ( Tprim Tint ) ) <nl> + } ; <nl> + fp_flags = <nl> + ( make_fp_flags ~ mutability : None ~ accept_disposable : false <nl> + ~ has_default : false ~ mode : Typing_defs_core . FPnormal <nl> + ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> + } <nl> + ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | classes . php line 14 , characters 25 - 39 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | classes . php line 17 , characters 6 - 41 ) , <nl> + ( Tapply ( ( [ 17 : 6 - 23 ] , " \ \ HH \ \ AsyncGenerator " ) , <nl> + [ ( Rhint ( root | classes . php line 17 , characters 24 - 26 ) , <nl> + ( Tprim Tint ) ) ; <nl> + ( Rhint ( root | classes . php line 17 , characters 29 - 34 ) , <nl> + ( Tprim Tstring ) ) ; <nl> + ( Rhint ( root | classes . php line 17 , characters 37 - 40 ) , <nl> + ( Tprim Tvoid ) ) <nl> + ] <nl> + ) ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FAsyncGenerator None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; <nl> + ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + sm_visibility = Public ; sm_deprecated = None } ; <nl> + { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> + sm_memoizelsb = false ; <nl> + sm_name = ( [ 23 : 19 - 36 ] , " reactive_function " ) ; sm_override = false ; <nl> + sm_dynamicallycallable = false ; <nl> + sm_reactivity = ( Some ( Decl_defs . Method_reactive None ) ) ; <nl> + sm_type = <nl> + ( Rwitness ( root | classes . php line 23 , characters 19 - 35 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | classes . php line 23 , characters 19 - 35 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | classes . php line 23 , characters 40 - 43 ) , <nl> + ( Tprim Tvoid ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Reactive { } ; <nl> + ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + sm_visibility = Public ; sm_deprecated = None } ; <nl> + { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> + sm_memoizelsb = false ; <nl> + sm_name = ( [ 26 : 19 - 44 ] , " shallow_reactive_function " ) ; <nl> + sm_override = false ; sm_dynamicallycallable = false ; <nl> + sm_reactivity = ( Some ( Decl_defs . Method_shallow None ) ) ; <nl> + sm_type = <nl> + ( Rwitness ( root | classes . php line 26 , characters 19 - 43 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | classes . php line 26 , characters 19 - 43 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | classes . php line 26 , characters 48 - 51 ) , <nl> + ( Tprim Tvoid ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Shallow { } ; ft_ifc_decl = FDPolicied { # PUBLIC } <nl> + } ) ) ; <nl> + sm_visibility = Public ; sm_deprecated = None } ; <nl> + { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> + sm_memoizelsb = false ; <nl> + sm_name = ( [ 29 : 19 - 42 ] , " local_reactive_function " ) ; <nl> + sm_override = false ; sm_dynamicallycallable = false ; <nl> + sm_reactivity = ( Some ( Decl_defs . Method_local None ) ) ; <nl> + sm_type = <nl> + ( Rwitness ( root | classes . php line 29 , characters 19 - 41 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | classes . php line 29 , characters 19 - 41 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | classes . php line 29 , characters 46 - 49 ) , <nl> + ( Tprim Tvoid ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Local { } ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + sm_visibility = Public ; sm_deprecated = None } ; <nl> + { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> + sm_memoizelsb = false ; <nl> + sm_name = ( [ 32 : 19 - 49 ] , " reactive_function_mutable_args " ) ; <nl> + sm_override = false ; sm_dynamicallycallable = false ; <nl> + sm_reactivity = ( Some ( Decl_defs . Method_reactive None ) ) ; <nl> + sm_type = <nl> + ( Rwitness ( root | classes . php line 32 , characters 19 - 48 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; <nl> + ft_params = <nl> + [ { fp_pos = [ 33 : 27 - 29 ] ; fp_name = ( Some " $ a " ) ; <nl> fp_type = <nl> { et_enforced = false ; <nl> et_type = <nl> - ( Rhint ( root | classes . php line 34 , characters 24 - 30 ) , <nl> - ( Tapply ( ( [ 34 : 24 - 31 ] , " \ \ MyClass " ) , [ ] ) ) ) <nl> + ( Rhint ( root | classes . php line 33 , characters 19 - 25 ) , <nl> + ( Tapply ( ( [ 33 : 19 - 26 ] , " \ \ MyClass " ) , [ ] ) ) ) <nl> } ; <nl> fp_flags = <nl> ( make_fp_flags <nl> - ~ mutability : ( Some Typing_defs_core . Param_maybe_mutable ) <nl> + ~ mutability : ( Some Typing_defs_core . Param_borrowed_mutable ) <nl> ~ accept_disposable : false ~ has_default : false <nl> ~ mode : Typing_defs_core . FPnormal ~ ifc_external : false <nl> ~ ifc_can_call : false ) ; <nl> } ; <nl> - { fp_pos = [ 35 : 32 - 34 ] ; fp_name = ( Some " $ c " ) ; <nl> - fp_type = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | classes . php line 35 , characters 24 - 30 ) , <nl> - ( Tapply ( ( [ 35 : 24 - 31 ] , " \ \ MyClass " ) , [ ] ) ) ) <nl> + { fp_pos = [ 34 : 32 - 34 ] ; fp_name = ( Some " $ b " ) ; <nl> + fp_type = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | classes . php line 34 , characters 24 - 30 ) , <nl> + ( Tapply ( ( [ 34 : 24 - 31 ] , " \ \ MyClass " ) , [ ] ) ) ) <nl> + } ; <nl> + fp_flags = <nl> + ( make_fp_flags <nl> + ~ mutability : ( Some Typing_defs_core . Param_maybe_mutable ) <nl> + ~ accept_disposable : false ~ has_default : false <nl> + ~ mode : Typing_defs_core . FPnormal ~ ifc_external : false <nl> + ~ ifc_can_call : false ) ; <nl> } ; <nl> - fp_flags = <nl> - ( make_fp_flags <nl> - ~ mutability : ( Some Typing_defs_core . Param_owned_mutable ) <nl> - ~ accept_disposable : false ~ has_default : false <nl> - ~ mode : Typing_defs_core . FPnormal ~ ifc_external : false <nl> - ~ ifc_can_call : false ) ; <nl> - } <nl> - ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | classes . php line 32 , characters 19 - 48 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | classes . php line 36 , characters 6 - 9 ) , <nl> - ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Reactive { } ; ft_ifc_decl = FDPolicied { # PUBLIC } <nl> - } ) ) ; <nl> - sm_visibility = Public ; sm_deprecated = None } ; <nl> - { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> - sm_memoizelsb = false ; sm_name = ( [ 40 : 19 - 33 ] , " mutable_return " ) ; <nl> - sm_override = false ; sm_dynamicallycallable = false ; <nl> - sm_reactivity = ( Some ( Decl_defs . Method_reactive None ) ) ; <nl> - sm_type = <nl> - ( Rwitness ( root | classes . php line 40 , characters 19 - 32 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | classes . php line 40 , characters 19 - 32 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | classes . php line 40 , characters 37 - 43 ) , <nl> - ( Tapply ( ( [ 40 : 37 - 44 ] , " \ \ MyClass " ) , [ ] ) ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : true ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Reactive { } ; ft_ifc_decl = FDPolicied { # PUBLIC } <nl> - } ) ) ; <nl> - sm_visibility = Public ; sm_deprecated = None } <nl> - ] ; <nl> - sc_user_attributes = [ ] ; sc_enum_type = None } ; <nl> - " \ \ MyConstructorPropertiesClass " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> - sc_name = ( [ 49 : 7 - 35 ] , " \ \ MyConstructorPropertiesClass " ) ; <nl> - sc_tparams = [ ] ; sc_where_constraints = [ ] ; sc_extends = [ ] ; <nl> - sc_uses = [ ] ; sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; <nl> - sc_req_implements = [ ] ; sc_implements = [ ] ; sc_consts = [ ] ; <nl> - sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; <nl> - sc_props = <nl> - [ { Shallow_decl_defs . sp_const = false ; sp_xhp_attr = None ; <nl> - sp_lateinit = false ; sp_lsb = false ; <nl> - sp_name = ( [ 51 : 20 - 28 ] , " private " ) ; sp_needs_init = true ; <nl> - sp_type = <nl> - ( Some ( Rhint ( root | classes . php line 51 , characters 13 - 18 ) , <nl> - ( Tprim Tstring ) ) ) ; <nl> - sp_abstract = false ; sp_visibility = Private } ; <nl> - { Shallow_decl_defs . sp_const = false ; sp_xhp_attr = None ; <nl> - sp_lateinit = false ; sp_lsb = false ; <nl> - sp_name = ( [ 52 : 22 - 32 ] , " protected " ) ; sp_needs_init = true ; <nl> - sp_type = <nl> - ( Some ( Rhint ( root | classes . php line 52 , characters 15 - 20 ) , <nl> - ( Tprim Tstring ) ) ) ; <nl> - sp_abstract = false ; sp_visibility = Protected } ; <nl> - { Shallow_decl_defs . sp_const = false ; sp_xhp_attr = None ; <nl> - sp_lateinit = false ; sp_lsb = false ; <nl> - sp_name = ( [ 53 : 19 - 26 ] , " public " ) ; sp_needs_init = true ; <nl> - sp_type = <nl> - ( Some ( Rhint ( root | classes . php line 53 , characters 12 - 17 ) , <nl> - ( Tprim Tstring ) ) ) ; <nl> - sp_abstract = false ; sp_visibility = Public } ; <nl> - { Shallow_decl_defs . sp_const = false ; sp_xhp_attr = None ; <nl> - sp_lateinit = false ; sp_lsb = false ; <nl> - sp_name = ( [ 54 : 19 - 30 ] , " hasDefault " ) ; sp_needs_init = true ; <nl> - sp_type = <nl> - ( Some ( Rhint ( root | classes . php line 54 , characters 12 - 17 ) , <nl> - ( Tprim Tstring ) ) ) ; <nl> - sp_abstract = false ; sp_visibility = Public } <nl> - ] ; <nl> - sc_sprops = [ ] ; <nl> - sc_constructor = <nl> - ( Some { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> - sm_memoizelsb = false ; sm_name = ( [ 50 : 19 - 30 ] , " __construct " ) ; <nl> - sm_override = false ; sm_dynamicallycallable = false ; <nl> - sm_reactivity = None ; <nl> - sm_type = <nl> - ( Rwitness ( root | classes . php line 50 , characters 19 - 29 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; <nl> - ft_params = <nl> - [ { fp_pos = [ 51 : 20 - 28 ] ; fp_name = ( Some " $ private " ) ; <nl> - fp_type = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | classes . php line 51 , characters 13 - 18 ) , <nl> - ( Tprim Tstring ) ) <nl> - } ; <nl> - fp_flags = <nl> - ( make_fp_flags ~ mutability : None <nl> - ~ accept_disposable : false ~ has_default : false <nl> - ~ mode : Typing_defs_core . FPnormal ~ ifc_external : false <nl> - ~ ifc_can_call : false ) ; <nl> - } ; <nl> - { fp_pos = [ 52 : 22 - 32 ] ; fp_name = ( Some " $ protected " ) ; <nl> - fp_type = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | classes . php line 52 , characters 15 - 20 ) , <nl> - ( Tprim Tstring ) ) <nl> - } ; <nl> - fp_flags = <nl> - ( make_fp_flags ~ mutability : None <nl> - ~ accept_disposable : false ~ has_default : false <nl> - ~ mode : Typing_defs_core . FPnormal ~ ifc_external : false <nl> - ~ ifc_can_call : false ) ; <nl> - } ; <nl> - { fp_pos = [ 53 : 19 - 26 ] ; fp_name = ( Some " $ public " ) ; <nl> - fp_type = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | classes . php line 53 , characters 12 - 17 ) , <nl> - ( Tprim Tstring ) ) <nl> - } ; <nl> - fp_flags = <nl> - ( make_fp_flags ~ mutability : None <nl> - ~ accept_disposable : false ~ has_default : false <nl> - ~ mode : Typing_defs_core . FPnormal ~ ifc_external : false <nl> - ~ ifc_can_call : false ) ; <nl> - } ; <nl> - { fp_pos = [ 54 : 19 - 30 ] ; fp_name = ( Some " $ hasDefault " ) ; <nl> - fp_type = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | classes . php line 54 , characters 12 - 17 ) , <nl> - ( Tprim Tstring ) ) <nl> + { fp_pos = [ 35 : 32 - 34 ] ; fp_name = ( Some " $ c " ) ; <nl> + fp_type = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | classes . php line 35 , characters 24 - 30 ) , <nl> + ( Tapply ( ( [ 35 : 24 - 31 ] , " \ \ MyClass " ) , [ ] ) ) ) <nl> + } ; <nl> + fp_flags = <nl> + ( make_fp_flags <nl> + ~ mutability : ( Some Typing_defs_core . Param_owned_mutable ) <nl> + ~ accept_disposable : false ~ has_default : false <nl> + ~ mode : Typing_defs_core . FPnormal ~ ifc_external : false <nl> + ~ ifc_can_call : false ) ; <nl> + } <nl> + ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | classes . php line 32 , characters 19 - 48 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | classes . php line 36 , characters 6 - 9 ) , <nl> + ( Tprim Tvoid ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Reactive { } ; <nl> + ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + sm_visibility = Public ; sm_deprecated = None } ; <nl> + { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> + sm_memoizelsb = false ; sm_name = ( [ 40 : 19 - 33 ] , " mutable_return " ) ; <nl> + sm_override = false ; sm_dynamicallycallable = false ; <nl> + sm_reactivity = ( Some ( Decl_defs . Method_reactive None ) ) ; <nl> + sm_type = <nl> + ( Rwitness ( root | classes . php line 40 , characters 19 - 32 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | classes . php line 40 , characters 19 - 32 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | classes . php line 40 , characters 37 - 43 ) , <nl> + ( Tapply ( ( [ 40 : 37 - 44 ] , " \ \ MyClass " ) , [ ] ) ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : true ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Reactive { } ; <nl> + ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + sm_visibility = Public ; sm_deprecated = None } <nl> + ] ; <nl> + sc_user_attributes = [ ] ; sc_enum_type = None } ) ) ; <nl> + ( " \ \ MyAbstractClass " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cabstract ; <nl> + sc_name = ( [ 45 : 16 - 31 ] , " \ \ MyAbstractClass " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> + sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> + sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; <nl> + sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> + sc_constructor = None ; sc_static_methods = [ ] ; sc_methods = [ ] ; <nl> + sc_user_attributes = [ ] ; sc_enum_type = None } ) ) ; <nl> + ( " \ \ MyFinalClass " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = true ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> + sc_name = ( [ 46 : 13 - 25 ] , " \ \ MyFinalClass " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> + sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> + sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; <nl> + sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> + sc_constructor = None ; sc_static_methods = [ ] ; sc_methods = [ ] ; <nl> + sc_user_attributes = [ ] ; sc_enum_type = None } ) ) ; <nl> + ( " \ \ MyStaticClass " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = true ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cabstract ; <nl> + sc_name = ( [ 47 : 22 - 35 ] , " \ \ MyStaticClass " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> + sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> + sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; <nl> + sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> + sc_constructor = None ; sc_static_methods = [ ] ; sc_methods = [ ] ; <nl> + sc_user_attributes = [ ] ; sc_enum_type = None } ) ) ; <nl> + ( " \ \ MyConstructorPropertiesClass " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> + sc_name = ( [ 49 : 7 - 35 ] , " \ \ MyConstructorPropertiesClass " ) ; <nl> + sc_tparams = [ ] ; sc_where_constraints = [ ] ; sc_extends = [ ] ; <nl> + sc_uses = [ ] ; sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; <nl> + sc_req_implements = [ ] ; sc_implements = [ ] ; sc_consts = [ ] ; <nl> + sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; <nl> + sc_props = <nl> + [ { Shallow_decl_defs . sp_const = false ; sp_xhp_attr = None ; <nl> + sp_lateinit = false ; sp_lsb = false ; <nl> + sp_name = ( [ 51 : 20 - 28 ] , " private " ) ; sp_needs_init = true ; <nl> + sp_type = <nl> + ( Some ( Rhint ( root | classes . php line 51 , characters 13 - 18 ) , <nl> + ( Tprim Tstring ) ) ) ; <nl> + sp_abstract = false ; sp_visibility = Private } ; <nl> + { Shallow_decl_defs . sp_const = false ; sp_xhp_attr = None ; <nl> + sp_lateinit = false ; sp_lsb = false ; <nl> + sp_name = ( [ 52 : 22 - 32 ] , " protected " ) ; sp_needs_init = true ; <nl> + sp_type = <nl> + ( Some ( Rhint ( root | classes . php line 52 , characters 15 - 20 ) , <nl> + ( Tprim Tstring ) ) ) ; <nl> + sp_abstract = false ; sp_visibility = Protected } ; <nl> + { Shallow_decl_defs . sp_const = false ; sp_xhp_attr = None ; <nl> + sp_lateinit = false ; sp_lsb = false ; <nl> + sp_name = ( [ 53 : 19 - 26 ] , " public " ) ; sp_needs_init = true ; <nl> + sp_type = <nl> + ( Some ( Rhint ( root | classes . php line 53 , characters 12 - 17 ) , <nl> + ( Tprim Tstring ) ) ) ; <nl> + sp_abstract = false ; sp_visibility = Public } ; <nl> + { Shallow_decl_defs . sp_const = false ; sp_xhp_attr = None ; <nl> + sp_lateinit = false ; sp_lsb = false ; <nl> + sp_name = ( [ 54 : 19 - 30 ] , " hasDefault " ) ; sp_needs_init = true ; <nl> + sp_type = <nl> + ( Some ( Rhint ( root | classes . php line 54 , characters 12 - 17 ) , <nl> + ( Tprim Tstring ) ) ) ; <nl> + sp_abstract = false ; sp_visibility = Public } <nl> + ] ; <nl> + sc_sprops = [ ] ; <nl> + sc_constructor = <nl> + ( Some { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> + sm_memoizelsb = false ; sm_name = ( [ 50 : 19 - 30 ] , " __construct " ) ; <nl> + sm_override = false ; sm_dynamicallycallable = false ; <nl> + sm_reactivity = None ; <nl> + sm_type = <nl> + ( Rwitness ( root | classes . php line 50 , characters 19 - 29 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; <nl> + ft_params = <nl> + [ { fp_pos = [ 51 : 20 - 28 ] ; fp_name = ( Some " $ private " ) ; <nl> + fp_type = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | classes . php line 51 , characters 13 - 18 ) , <nl> + ( Tprim Tstring ) ) <nl> + } ; <nl> + fp_flags = <nl> + ( make_fp_flags ~ mutability : None <nl> + ~ accept_disposable : false ~ has_default : false <nl> + ~ mode : Typing_defs_core . FPnormal <nl> + ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> } ; <nl> - fp_flags = <nl> - ( make_fp_flags ~ mutability : None <nl> - ~ accept_disposable : false ~ has_default : true <nl> - ~ mode : Typing_defs_core . FPnormal ~ ifc_external : false <nl> - ~ ifc_can_call : false ) ; <nl> - } <nl> - ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | classes . php line 50 , characters 19 - 29 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rwitness ( root | classes . php line 50 , characters 19 - 29 ) , <nl> - ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; <nl> - ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - sm_visibility = Public ; sm_deprecated = None } ) ; <nl> - sc_static_methods = [ ] ; sc_methods = [ ] ; sc_user_attributes = [ ] ; <nl> - sc_enum_type = None } ; <nl> - " \ \ MyFinalClass " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = true ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> - sc_name = ( [ 46 : 13 - 25 ] , " \ \ MyFinalClass " ) ; sc_tparams = [ ] ; <nl> - sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> - sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> - sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; <nl> - sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; sc_constructor = None ; <nl> - sc_static_methods = [ ] ; sc_methods = [ ] ; sc_user_attributes = [ ] ; <nl> - sc_enum_type = None } ; <nl> - " \ \ MyStaticClass " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = true ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cabstract ; <nl> - sc_name = ( [ 47 : 22 - 35 ] , " \ \ MyStaticClass " ) ; sc_tparams = [ ] ; <nl> - sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> - sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> - sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; <nl> - sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; sc_constructor = None ; <nl> - sc_static_methods = [ ] ; sc_methods = [ ] ; sc_user_attributes = [ ] ; <nl> - sc_enum_type = None } } ; <nl> - funs = { } ; typedefs = { } ; consts = { } ; records = { } } <nl> + { fp_pos = [ 52 : 22 - 32 ] ; fp_name = ( Some " $ protected " ) ; <nl> + fp_type = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | classes . php line 52 , characters 15 - 20 ) , <nl> + ( Tprim Tstring ) ) <nl> + } ; <nl> + fp_flags = <nl> + ( make_fp_flags ~ mutability : None <nl> + ~ accept_disposable : false ~ has_default : false <nl> + ~ mode : Typing_defs_core . FPnormal <nl> + ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> + } ; <nl> + { fp_pos = [ 53 : 19 - 26 ] ; fp_name = ( Some " $ public " ) ; <nl> + fp_type = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | classes . php line 53 , characters 12 - 17 ) , <nl> + ( Tprim Tstring ) ) <nl> + } ; <nl> + fp_flags = <nl> + ( make_fp_flags ~ mutability : None <nl> + ~ accept_disposable : false ~ has_default : false <nl> + ~ mode : Typing_defs_core . FPnormal <nl> + ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> + } ; <nl> + { fp_pos = [ 54 : 19 - 30 ] ; <nl> + fp_name = ( Some " $ hasDefault " ) ; <nl> + fp_type = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | classes . php line 54 , characters 12 - 17 ) , <nl> + ( Tprim Tstring ) ) <nl> + } ; <nl> + fp_flags = <nl> + ( make_fp_flags ~ mutability : None <nl> + ~ accept_disposable : false ~ has_default : true <nl> + ~ mode : Typing_defs_core . FPnormal <nl> + ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> + } <nl> + ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | classes . php line 50 , characters 19 - 29 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rwitness ( root | classes . php line 50 , characters 19 - 29 ) , <nl> + ( Tprim Tvoid ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; <nl> + ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + sm_visibility = Public ; sm_deprecated = None } ) ; <nl> + sc_static_methods = [ ] ; sc_methods = [ ] ; sc_user_attributes = [ ] ; <nl> + sc_enum_type = None } ) ) <nl> + ] <nl> <nl> They matched ! <nl> mmm a / hphp / hack / test / decl / classes_consistent_construct . php . exp <nl> ppp b / hphp / hack / test / decl / classes_consistent_construct . php . exp <nl> <nl> - Parsed decls : <nl> - <nl> - { classes = <nl> - { " \ \ A " - > <nl> - { Shallow_decl_defs . sc_mode = Mpartial ; sc_final = false ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> - sc_name = ( [ 11 : 7 - 8 ] , " \ \ A " ) ; sc_tparams = [ ] ; <nl> - sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> - sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> - sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; <nl> - sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; sc_constructor = None ; <nl> - sc_static_methods = [ ] ; sc_methods = [ ] ; sc_user_attributes = [ ] ; <nl> - sc_enum_type = None } ; <nl> - " \ \ C1 " - > <nl> - { Shallow_decl_defs . sc_mode = Mpartial ; sc_final = false ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> - sc_name = ( [ 4 : 7 - 9 ] , " \ \ C1 " ) ; sc_tparams = [ ] ; <nl> - sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> - sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> - sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; <nl> - sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; sc_constructor = None ; <nl> - sc_static_methods = [ ] ; sc_methods = [ ] ; <nl> - sc_user_attributes = <nl> - [ { Typing_defs_core . ua_name = ( [ 3 : 3 - 24 ] , " __ConsistentConstruct " ) ; <nl> - ua_classname_params = [ ] } <nl> - ] ; <nl> - sc_enum_type = None } ; <nl> - " \ \ C2 " - > <nl> - { Shallow_decl_defs . sc_mode = Mpartial ; sc_final = false ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> - sc_name = ( [ 6 : 7 - 9 ] , " \ \ C2 " ) ; sc_tparams = [ ] ; <nl> - sc_where_constraints = [ ] ; <nl> - sc_extends = <nl> - [ ( Rhint ( root | classes_consistent_construct . php line 6 , characters 18 - 19 ) , <nl> - ( Tapply ( ( [ 6 : 18 - 20 ] , " \ \ C1 " ) , [ ] ) ) ) ] ; <nl> - sc_uses = [ ] ; sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; <nl> - sc_req_implements = [ ] ; sc_implements = [ ] ; sc_consts = [ ] ; <nl> - sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> - sc_constructor = <nl> - ( Some { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> - sm_memoizelsb = false ; sm_name = ( [ 8 : 19 - 30 ] , " __construct " ) ; <nl> - sm_override = false ; sm_dynamicallycallable = false ; <nl> - sm_reactivity = None ; <nl> - sm_type = <nl> - ( Rwitness ( root | classes_consistent_construct . php line 8 , characters 19 - 29 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; <nl> - ft_params = <nl> - [ { fp_pos = [ 8 : 33 - 35 ] ; fp_name = ( Some " $ a " ) ; <nl> - fp_type = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | classes_consistent_construct . php line 8 , characters 31 - 31 ) , <nl> - ( Tapply ( ( [ 8 : 31 - 32 ] , " \ \ A " ) , [ ] ) ) ) <nl> - } ; <nl> - fp_flags = <nl> - ( make_fp_flags ~ mutability : None <nl> - ~ accept_disposable : false ~ has_default : false <nl> - ~ mode : Typing_defs_core . FPnormal ~ ifc_external : false <nl> - ~ ifc_can_call : false ) ; <nl> - } <nl> - ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | classes_consistent_construct . php line 8 , characters 19 - 29 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rwitness ( root | classes_consistent_construct . php line 8 , characters 19 - 29 ) , <nl> - ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; <nl> - ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - sm_visibility = Public ; sm_deprecated = None } ) ; <nl> - sc_static_methods = [ ] ; sc_methods = [ ] ; sc_user_attributes = [ ] ; <nl> - sc_enum_type = None } } ; <nl> - funs = { } ; typedefs = { } ; consts = { } ; records = { } } <nl> + [ ( " \ \ C1 " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mpartial ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> + sc_name = ( [ 4 : 7 - 9 ] , " \ \ C1 " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> + sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> + sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; <nl> + sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> + sc_constructor = None ; sc_static_methods = [ ] ; sc_methods = [ ] ; <nl> + sc_user_attributes = <nl> + [ { Typing_defs_core . ua_name = ( [ 3 : 3 - 24 ] , " __ConsistentConstruct " ) ; <nl> + ua_classname_params = [ ] } <nl> + ] ; <nl> + sc_enum_type = None } ) ) ; <nl> + ( " \ \ C2 " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mpartial ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> + sc_name = ( [ 6 : 7 - 9 ] , " \ \ C2 " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = [ ] ; <nl> + sc_extends = <nl> + [ ( Rhint ( root | classes_consistent_construct . php line 6 , characters 18 - 19 ) , <nl> + ( Tapply ( ( [ 6 : 18 - 20 ] , " \ \ C1 " ) , [ ] ) ) ) ] ; <nl> + sc_uses = [ ] ; sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; <nl> + sc_req_implements = [ ] ; sc_implements = [ ] ; sc_consts = [ ] ; <nl> + sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> + sc_constructor = <nl> + ( Some { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> + sm_memoizelsb = false ; sm_name = ( [ 8 : 19 - 30 ] , " __construct " ) ; <nl> + sm_override = false ; sm_dynamicallycallable = false ; <nl> + sm_reactivity = None ; <nl> + sm_type = <nl> + ( Rwitness ( root | classes_consistent_construct . php line 8 , characters 19 - 29 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; <nl> + ft_params = <nl> + [ { fp_pos = [ 8 : 33 - 35 ] ; fp_name = ( Some " $ a " ) ; <nl> + fp_type = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | classes_consistent_construct . php line 8 , characters 31 - 31 ) , <nl> + ( Tapply ( ( [ 8 : 31 - 32 ] , " \ \ A " ) , [ ] ) ) ) <nl> + } ; <nl> + fp_flags = <nl> + ( make_fp_flags ~ mutability : None <nl> + ~ accept_disposable : false ~ has_default : false <nl> + ~ mode : Typing_defs_core . FPnormal <nl> + ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> + } <nl> + ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | classes_consistent_construct . php line 8 , characters 19 - 29 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rwitness ( root | classes_consistent_construct . php line 8 , characters 19 - 29 ) , <nl> + ( Tprim Tvoid ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; <nl> + ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + sm_visibility = Public ; sm_deprecated = None } ) ; <nl> + sc_static_methods = [ ] ; sc_methods = [ ] ; sc_user_attributes = [ ] ; <nl> + sc_enum_type = None } ) ) ; <nl> + ( " \ \ A " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mpartial ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> + sc_name = ( [ 11 : 7 - 8 ] , " \ \ A " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> + sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> + sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; <nl> + sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> + sc_constructor = None ; sc_static_methods = [ ] ; sc_methods = [ ] ; <nl> + sc_user_attributes = [ ] ; sc_enum_type = None } ) ) <nl> + ] <nl> <nl> They matched ! <nl> mmm a / hphp / hack / test / decl / classes_const_attribute . php . exp <nl> ppp b / hphp / hack / test / decl / classes_const_attribute . php . exp <nl> <nl> - Parsed decls : <nl> - <nl> - { classes = <nl> - { " \ \ A " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cabstract ; <nl> - sc_name = ( [ 4 : 16 - 17 ] , " \ \ A " ) ; sc_tparams = [ ] ; <nl> - sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> - sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> - sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; <nl> - sc_pu_enums = [ ] ; <nl> - sc_props = <nl> - [ { Shallow_decl_defs . sp_const = true ; sp_xhp_attr = None ; <nl> - sp_lateinit = false ; sp_lsb = false ; sp_name = ( [ 5 : 40 - 42 ] , " p " ) ; <nl> - sp_needs_init = true ; <nl> - sp_type = <nl> - ( Some ( Rhint ( root | classes_const_attribute . php line 5 , characters 31 - 38 ) , <nl> - ( Tprim Tarraykey ) ) ) ; <nl> - sp_abstract = true ; sp_visibility = Public } <nl> - ] ; <nl> - sc_sprops = [ ] ; sc_constructor = None ; sc_static_methods = [ ] ; <nl> - sc_methods = [ ] ; sc_user_attributes = [ ] ; sc_enum_type = None } ; <nl> - " \ \ B " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> - sc_name = ( [ 8 : 7 - 8 ] , " \ \ B " ) ; sc_tparams = [ ] ; sc_where_constraints = [ ] ; <nl> - sc_extends = <nl> - [ ( Rhint ( root | classes_const_attribute . php line 8 , characters 17 - 17 ) , <nl> - ( Tapply ( ( [ 8 : 17 - 18 ] , " \ \ A " ) , [ ] ) ) ) ] ; <nl> - sc_uses = [ ] ; sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; <nl> - sc_req_implements = [ ] ; sc_implements = [ ] ; sc_consts = [ ] ; <nl> - sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; <nl> - sc_props = <nl> - [ { Shallow_decl_defs . sp_const = true ; sp_xhp_attr = None ; <nl> - sp_lateinit = false ; sp_lsb = false ; sp_name = ( [ 9 : 26 - 28 ] , " p " ) ; <nl> - sp_needs_init = false ; <nl> - sp_type = <nl> - ( Some ( Rhint ( root | classes_const_attribute . php line 9 , characters 22 - 24 ) , <nl> - ( Tprim Tint ) ) ) ; <nl> - sp_abstract = false ; sp_visibility = Public } <nl> - ] ; <nl> - sc_sprops = [ ] ; sc_constructor = None ; sc_static_methods = [ ] ; <nl> - sc_methods = [ ] ; sc_user_attributes = [ ] ; sc_enum_type = None } } ; <nl> - funs = { } ; typedefs = { } ; consts = { } ; records = { } } <nl> + [ ( " \ \ A " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cabstract ; <nl> + sc_name = ( [ 4 : 16 - 17 ] , " \ \ A " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> + sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> + sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; <nl> + sc_pu_enums = [ ] ; <nl> + sc_props = <nl> + [ { Shallow_decl_defs . sp_const = true ; sp_xhp_attr = None ; <nl> + sp_lateinit = false ; sp_lsb = false ; sp_name = ( [ 5 : 40 - 42 ] , " p " ) ; <nl> + sp_needs_init = true ; <nl> + sp_type = <nl> + ( Some ( Rhint ( root | classes_const_attribute . php line 5 , characters 31 - 38 ) , <nl> + ( Tprim Tarraykey ) ) ) ; <nl> + sp_abstract = true ; sp_visibility = Public } <nl> + ] ; <nl> + sc_sprops = [ ] ; sc_constructor = None ; sc_static_methods = [ ] ; <nl> + sc_methods = [ ] ; sc_user_attributes = [ ] ; sc_enum_type = None } ) ) ; <nl> + ( " \ \ B " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> + sc_name = ( [ 8 : 7 - 8 ] , " \ \ B " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = [ ] ; <nl> + sc_extends = <nl> + [ ( Rhint ( root | classes_const_attribute . php line 8 , characters 17 - 17 ) , <nl> + ( Tapply ( ( [ 8 : 17 - 18 ] , " \ \ A " ) , [ ] ) ) ) ] ; <nl> + sc_uses = [ ] ; sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; <nl> + sc_req_implements = [ ] ; sc_implements = [ ] ; sc_consts = [ ] ; <nl> + sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; <nl> + sc_props = <nl> + [ { Shallow_decl_defs . sp_const = true ; sp_xhp_attr = None ; <nl> + sp_lateinit = false ; sp_lsb = false ; sp_name = ( [ 9 : 26 - 28 ] , " p " ) ; <nl> + sp_needs_init = false ; <nl> + sp_type = <nl> + ( Some ( Rhint ( root | classes_const_attribute . php line 9 , characters 22 - 24 ) , <nl> + ( Tprim Tint ) ) ) ; <nl> + sp_abstract = false ; sp_visibility = Public } <nl> + ] ; <nl> + sc_sprops = [ ] ; sc_constructor = None ; sc_static_methods = [ ] ; <nl> + sc_methods = [ ] ; sc_user_attributes = [ ] ; sc_enum_type = None } ) ) <nl> + ] <nl> <nl> They matched ! <nl> mmm a / hphp / hack / test / decl / classes_const_keyword . php . exp <nl> ppp b / hphp / hack / test / decl / classes_const_keyword . php . exp <nl> <nl> - Parsed decls : <nl> - <nl> - { classes = <nl> - { " \ \ AbstractConsts " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cabstract ; <nl> - sc_name = ( [ 12 : 16 - 30 ] , " \ \ AbstractConsts " ) ; sc_tparams = [ ] ; <nl> - sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> - sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> - sc_implements = [ ] ; <nl> - sc_consts = <nl> - [ { Shallow_decl_defs . scc_abstract = true ; <nl> - scc_name = ( [ 13 : 22 - 35 ] , " CABSTRACT_INT " ) ; <nl> - scc_type = <nl> - ( Rhint ( root | classes_const_keyword . php line 13 , characters 18 - 20 ) , <nl> - ( Tprim Tint ) ) <nl> - } <nl> - ] ; <nl> - sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> - sc_constructor = None ; sc_static_methods = [ ] ; sc_methods = [ ] ; <nl> - sc_user_attributes = [ ] ; sc_enum_type = None } ; <nl> - " \ \ ArrayConsts " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> - sc_name = ( [ 21 : 7 - 18 ] , " \ \ ArrayConsts " ) ; sc_tparams = [ ] ; <nl> - sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> - sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> - sc_implements = [ ] ; <nl> - sc_consts = <nl> - [ { Shallow_decl_defs . scc_abstract = false ; <nl> - scc_name = ( [ 22 : 29 - 36 ] , " CDARRAY " ) ; <nl> - scc_type = <nl> - ( Rhint ( root | classes_const_keyword . php line 22 , characters 9 - 27 ) , <nl> - ( Tdarray ( <nl> - ( Rhint ( root | classes_const_keyword . php line 22 , characters 16 - 21 ) , <nl> - ( Tprim Tstring ) ) , <nl> - ( Rhint ( root | classes_const_keyword . php line 22 , characters 24 - 26 ) , <nl> - ( Tprim Tint ) ) <nl> - ) ) ) <nl> - } ; <nl> - { Shallow_decl_defs . scc_abstract = false ; <nl> - scc_name = ( [ 23 : 24 - 31 ] , " CKEYSET " ) ; <nl> - scc_type = <nl> - ( Rhint ( root | classes_const_keyword . php line 23 , characters 9 - 22 ) , <nl> - ( Tapply ( ( [ 23 : 9 - 15 ] , " \ \ HH \ \ keyset " ) , <nl> - [ ( Rhint ( root | classes_const_keyword . php line 23 , characters 16 - 21 ) , <nl> - ( Tprim Tstring ) ) ] <nl> - ) ) ) <nl> - } ; <nl> - { Shallow_decl_defs . scc_abstract = false ; <nl> - scc_name = ( [ 24 : 27 - 44 ] , " CCLASSNAME_KEYSET " ) ; <nl> - scc_type = <nl> - ( Rhint ( root | classes_const_keyword . php line 24 , characters 9 - 25 ) , <nl> - ( Tapply ( ( [ 24 : 9 - 15 ] , " \ \ HH \ \ keyset " ) , <nl> - [ ( Rhint ( root | classes_const_keyword . php line 24 , characters 16 - 24 ) , <nl> - ( Tprim Tstring ) ) ] <nl> - ) ) ) <nl> - } ; <nl> - { Shallow_decl_defs . scc_abstract = false ; <nl> - scc_name = ( [ 25 : 24 - 31 ] , " CVARRAY " ) ; <nl> - scc_type = <nl> - ( Rhint ( root | classes_const_keyword . php line 25 , characters 9 - 22 ) , <nl> - ( Tvarray <nl> - ( Rhint ( root | classes_const_keyword . php line 25 , characters 16 - 21 ) , <nl> - ( Tprim Tstring ) ) ) ) <nl> - } <nl> - ] ; <nl> - sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> - sc_constructor = None ; sc_static_methods = [ ] ; sc_methods = [ ] ; <nl> - sc_user_attributes = [ ] ; sc_enum_type = None } ; <nl> - " \ \ BinopConsts " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> - sc_name = ( [ 28 : 7 - 18 ] , " \ \ BinopConsts " ) ; sc_tparams = [ ] ; <nl> - sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> - sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> - sc_implements = [ ] ; <nl> - sc_consts = <nl> - [ { Shallow_decl_defs . scc_abstract = false ; <nl> - scc_name = ( [ 29 : 13 - 17 ] , " CINT " ) ; <nl> - scc_type = <nl> - ( Rhint ( root | classes_const_keyword . php line 29 , characters 9 - 11 ) , <nl> - ( Tprim Tint ) ) <nl> - } ; <nl> - { Shallow_decl_defs . scc_abstract = false ; <nl> - scc_name = ( [ 30 : 15 - 21 ] , " CFLOAT " ) ; <nl> - scc_type = <nl> - ( Rhint ( root | classes_const_keyword . php line 30 , characters 9 - 13 ) , <nl> - ( Tprim Tfloat ) ) <nl> - } ; <nl> - { Shallow_decl_defs . scc_abstract = false ; <nl> - scc_name = ( [ 31 : 16 - 23 ] , " CSTRING " ) ; <nl> - scc_type = <nl> - ( Rhint ( root | classes_const_keyword . php line 31 , characters 9 - 14 ) , <nl> - ( Tprim Tstring ) ) <nl> - } ; <nl> - { Shallow_decl_defs . scc_abstract = false ; <nl> - scc_name = ( [ 32 : 14 - 19 ] , " CBOOL " ) ; <nl> - scc_type = <nl> - ( Rhint ( root | classes_const_keyword . php line 32 , characters 9 - 12 ) , <nl> - ( Tprim Tbool ) ) <nl> - } <nl> - ] ; <nl> - sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> - sc_constructor = None ; sc_static_methods = [ ] ; sc_methods = [ ] ; <nl> - sc_user_attributes = [ ] ; sc_enum_type = None } ; <nl> - " \ \ ClassnameConsts " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> - sc_name = ( [ 44 : 7 - 22 ] , " \ \ ClassnameConsts " ) ; sc_tparams = [ ] ; <nl> - sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> - sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> - sc_implements = [ ] ; <nl> - sc_consts = <nl> - [ { Shallow_decl_defs . scc_abstract = false ; <nl> - scc_name = ( [ 45 : 32 - 42 ] , " CCLASSNAME " ) ; <nl> - scc_type = <nl> - ( Rhint ( root | classes_const_keyword . php line 45 , characters 9 - 30 ) , <nl> - ( Tapply ( ( [ 45 : 9 - 18 ] , " \ \ HH \ \ classname " ) , <nl> - [ ( Rhint ( root | classes_const_keyword . php line 45 , characters 19 - 29 ) , <nl> - ( Tapply ( ( [ 45 : 19 - 30 ] , " \ \ TupleConsts " ) , [ ] ) ) ) ] <nl> - ) ) ) <nl> - } ; <nl> - { Shallow_decl_defs . scc_abstract = false ; <nl> - scc_name = ( [ 46 : 36 - 47 ] , " CCLASSNAME2 " ) ; <nl> - scc_type = <nl> - ( Rhint ( root | classes_const_keyword . php line 46 , characters 9 - 34 ) , <nl> - ( Tapply ( ( [ 46 : 9 - 18 ] , " \ \ HH \ \ classname " ) , <nl> - [ ( Rhint ( root | classes_const_keyword . php line 46 , characters 19 - 33 ) , <nl> - ( Tapply ( ( [ 46 : 19 - 34 ] , " \ \ ClassnameConsts " ) , [ ] ) ) ) ] <nl> - ) ) ) <nl> - } <nl> - ] ; <nl> - sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> - sc_constructor = None ; sc_static_methods = [ ] ; sc_methods = [ ] ; <nl> - sc_user_attributes = [ ] ; sc_enum_type = None } ; <nl> - " \ \ DictConsts " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> - sc_name = ( [ 4 : 7 - 17 ] , " \ \ DictConsts " ) ; sc_tparams = [ ] ; <nl> - sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> - sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> - sc_implements = [ ] ; <nl> - sc_consts = <nl> - [ { Shallow_decl_defs . scc_abstract = false ; <nl> - scc_name = ( [ 5 : 27 - 32 ] , " CDICT " ) ; <nl> - scc_type = <nl> - ( Rhint ( root | classes_const_keyword . php line 5 , characters 9 - 25 ) , <nl> - ( Tapply ( ( [ 5 : 9 - 13 ] , " \ \ HH \ \ dict " ) , <nl> - [ ( Rhint ( root | classes_const_keyword . php line 5 , characters 14 - 16 ) , <nl> - ( Tprim Tint ) ) ; <nl> - ( Rhint ( root | classes_const_keyword . php line 5 , characters 19 - 24 ) , <nl> - ( Tprim Tstring ) ) <nl> - ] <nl> - ) ) ) <nl> - } ; <nl> - { Shallow_decl_defs . scc_abstract = false ; <nl> - scc_name = ( [ 6 : 38 - 50 ] , " CNESTED_DICT " ) ; <nl> + [ ( " \ \ DictConsts " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> + sc_name = ( [ 4 : 7 - 17 ] , " \ \ DictConsts " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> + sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> + sc_implements = [ ] ; <nl> + sc_consts = <nl> + [ { Shallow_decl_defs . scc_abstract = false ; <nl> + scc_name = ( [ 5 : 27 - 32 ] , " CDICT " ) ; <nl> scc_type = <nl> - ( Rhint ( root | classes_const_keyword . php line 6 , characters 9 - 36 ) , <nl> - ( Tapply ( ( [ 6 : 9 - 13 ] , " \ \ HH \ \ dict " ) , <nl> - [ ( Rhint ( root | classes_const_keyword . php line 6 , characters 14 - 16 ) , <nl> + ( Rhint ( root | classes_const_keyword . php line 5 , characters 9 - 25 ) , <nl> + ( Tapply ( ( [ 5 : 9 - 13 ] , " \ \ HH \ \ dict " ) , <nl> + [ ( Rhint ( root | classes_const_keyword . php line 5 , characters 14 - 16 ) , <nl> ( Tprim Tint ) ) ; <nl> - ( Rhint ( root | classes_const_keyword . php line 6 , characters 19 - 35 ) , <nl> - ( Tapply ( ( [ 6 : 19 - 23 ] , " \ \ HH \ \ dict " ) , <nl> - [ ( Rhint ( root | classes_const_keyword . php line 6 , characters 24 - 26 ) , <nl> - ( Tprim Tint ) ) ; <nl> - ( Rhint ( root | classes_const_keyword . php line 6 , characters 29 - 34 ) , <nl> - ( Tprim Tstring ) ) <nl> - ] <nl> - ) ) ) <nl> + ( Rhint ( root | classes_const_keyword . php line 5 , characters 19 - 24 ) , <nl> + ( Tprim Tstring ) ) <nl> ] <nl> ) ) ) <nl> } ; <nl> - { Shallow_decl_defs . scc_abstract = false ; <nl> - scc_name = ( [ 8 : 37 - 55 ] , " CNESTED_DICT_FLOAT " ) ; <nl> - scc_type = <nl> - ( Rhint ( root | classes_const_keyword . php line 8 , characters 9 - 35 ) , <nl> - ( Tapply ( ( [ 8 : 9 - 13 ] , " \ \ HH \ \ dict " ) , <nl> - [ ( Rhint ( root | classes_const_keyword . php line 8 , characters 14 - 16 ) , <nl> - ( Tprim Tint ) ) ; <nl> - ( Rhint ( root | classes_const_keyword . php line 8 , characters 19 - 34 ) , <nl> - ( Tapply ( ( [ 8 : 19 - 23 ] , " \ \ HH \ \ dict " ) , <nl> - [ ( Rhint ( root | classes_const_keyword . php line 8 , characters 24 - 26 ) , <nl> - ( Tprim Tint ) ) ; <nl> - ( Rhint ( root | classes_const_keyword . php line 8 , characters 29 - 33 ) , <nl> - ( Tprim Tfloat ) ) <nl> - ] <nl> - ) ) ) <nl> - ] <nl> - ) ) ) <nl> - } <nl> - ] ; <nl> - sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> - sc_constructor = None ; sc_static_methods = [ ] ; sc_methods = [ ] ; <nl> - sc_user_attributes = [ ] ; sc_enum_type = None } ; <nl> - " \ \ ShapeConsts " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> - sc_name = ( [ 35 : 7 - 18 ] , " \ \ ShapeConsts " ) ; sc_tparams = [ ] ; <nl> - sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> - sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> - sc_implements = [ ] ; <nl> - sc_consts = <nl> - [ { Shallow_decl_defs . scc_abstract = false ; <nl> - scc_name = ( [ 36 : 47 - 53 ] , " CSHAPE " ) ; <nl> - scc_type = <nl> - ( Rhint ( root | classes_const_keyword . php line 36 , characters 9 - 45 ) , <nl> - ( Tshape ( Typing_defs_core . Open_shape , <nl> - { ( SFlit_str ( [ 36 : 15 - 18 ] , " a " ) ) - > <nl> - { sft_optional = false ; <nl> - sft_ty = <nl> - ( Rhint ( root | classes_const_keyword . php line 36 , characters 22 - 24 ) , <nl> - ( Tprim Tint ) ) <nl> - } ; <nl> - ( SFlit_str ( [ 36 : 27 - 30 ] , " b " ) ) - > <nl> - { sft_optional = false ; <nl> - sft_ty = <nl> - ( Rhint ( root | classes_const_keyword . php line 36 , characters 34 - 39 ) , <nl> - ( Tprim Tstring ) ) <nl> - } } <nl> - ) ) ) <nl> - } <nl> - ] ; <nl> - sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> - sc_constructor = None ; sc_static_methods = [ ] ; sc_methods = [ ] ; <nl> - sc_user_attributes = [ ] ; sc_enum_type = None } ; <nl> - " \ \ TupleConsts " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> - sc_name = ( [ 40 : 7 - 18 ] , " \ \ TupleConsts " ) ; sc_tparams = [ ] ; <nl> - sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> - sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> - sc_implements = [ ] ; <nl> - sc_consts = <nl> - [ { Shallow_decl_defs . scc_abstract = false ; <nl> - scc_name = ( [ 41 : 33 - 40 ] , " COPTION " ) ; <nl> - scc_type = <nl> - ( Rhint ( root | classes_const_keyword . php line 41 , characters 9 - 31 ) , <nl> - ( Ttuple <nl> - [ ( Rhint ( root | classes_const_keyword . php line 41 , characters 10 - 12 ) , <nl> - ( Tprim Tint ) ) ; <nl> - ( Rhint ( root | classes_const_keyword . php line 41 , characters 15 - 30 ) , <nl> - ( Toption <nl> - ( Rhint ( root | classes_const_keyword . php line 41 , characters 16 - 30 ) , <nl> - ( Ttuple <nl> - [ ( Rhint ( root | classes_const_keyword . php line 41 , characters 17 - 22 ) , <nl> - ( Tprim Tstring ) ) ; <nl> - ( Rhint ( root | classes_const_keyword . php line 41 , characters 25 - 29 ) , <nl> - ( Tprim Tfloat ) ) <nl> - ] ) ) ) ) <nl> - ] ) ) <nl> - } <nl> - ] ; <nl> - sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> - sc_constructor = None ; sc_static_methods = [ ] ; sc_methods = [ ] ; <nl> - sc_user_attributes = [ ] ; sc_enum_type = None } ; <nl> - " \ \ VecConsts " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> - sc_name = ( [ 16 : 7 - 16 ] , " \ \ VecConsts " ) ; sc_tparams = [ ] ; <nl> - sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> - sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> - sc_implements = [ ] ; <nl> - sc_consts = <nl> - [ { Shallow_decl_defs . scc_abstract = false ; <nl> - scc_name = ( [ 17 : 18 - 22 ] , " CVEC " ) ; <nl> - scc_type = <nl> - ( Rhint ( root | classes_const_keyword . php line 17 , characters 9 - 16 ) , <nl> - ( Tapply ( ( [ 17 : 9 - 12 ] , " \ \ HH \ \ vec " ) , <nl> - [ ( Rhint ( root | classes_const_keyword . php line 17 , characters 13 - 15 ) , <nl> - ( Tprim Tint ) ) ] <nl> - ) ) ) <nl> - } ; <nl> - { Shallow_decl_defs . scc_abstract = false ; <nl> - scc_name = ( [ 18 : 23 - 34 ] , " CNESTED_VEC " ) ; <nl> - scc_type = <nl> - ( Rhint ( root | classes_const_keyword . php line 18 , characters 9 - 21 ) , <nl> - ( Tapply ( ( [ 18 : 9 - 12 ] , " \ \ HH \ \ vec " ) , <nl> - [ ( Rhint ( root | classes_const_keyword . php line 18 , characters 13 - 20 ) , <nl> - ( Tapply ( ( [ 18 : 13 - 16 ] , " \ \ HH \ \ vec " ) , <nl> - [ ( Rhint ( root | classes_const_keyword . php line 18 , characters 17 - 19 ) , <nl> - ( Tprim Tint ) ) ] <nl> - ) ) ) <nl> - ] <nl> - ) ) ) <nl> - } <nl> - ] ; <nl> - sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> - sc_constructor = None ; sc_static_methods = [ ] ; sc_methods = [ ] ; <nl> - sc_user_attributes = [ ] ; sc_enum_type = None } } ; <nl> - funs = { } ; typedefs = { } ; consts = { } ; records = { } } <nl> + { Shallow_decl_defs . scc_abstract = false ; <nl> + scc_name = ( [ 6 : 38 - 50 ] , " CNESTED_DICT " ) ; <nl> + scc_type = <nl> + ( Rhint ( root | classes_const_keyword . php line 6 , characters 9 - 36 ) , <nl> + ( Tapply ( ( [ 6 : 9 - 13 ] , " \ \ HH \ \ dict " ) , <nl> + [ ( Rhint ( root | classes_const_keyword . php line 6 , characters 14 - 16 ) , <nl> + ( Tprim Tint ) ) ; <nl> + ( Rhint ( root | classes_const_keyword . php line 6 , characters 19 - 35 ) , <nl> + ( Tapply ( ( [ 6 : 19 - 23 ] , " \ \ HH \ \ dict " ) , <nl> + [ ( Rhint ( root | classes_const_keyword . php line 6 , characters 24 - 26 ) , <nl> + ( Tprim Tint ) ) ; <nl> + ( Rhint ( root | classes_const_keyword . php line 6 , characters 29 - 34 ) , <nl> + ( Tprim Tstring ) ) <nl> + ] <nl> + ) ) ) <nl> + ] <nl> + ) ) ) <nl> + } ; <nl> + { Shallow_decl_defs . scc_abstract = false ; <nl> + scc_name = ( [ 8 : 37 - 55 ] , " CNESTED_DICT_FLOAT " ) ; <nl> + scc_type = <nl> + ( Rhint ( root | classes_const_keyword . php line 8 , characters 9 - 35 ) , <nl> + ( Tapply ( ( [ 8 : 9 - 13 ] , " \ \ HH \ \ dict " ) , <nl> + [ ( Rhint ( root | classes_const_keyword . php line 8 , characters 14 - 16 ) , <nl> + ( Tprim Tint ) ) ; <nl> + ( Rhint ( root | classes_const_keyword . php line 8 , characters 19 - 34 ) , <nl> + ( Tapply ( ( [ 8 : 19 - 23 ] , " \ \ HH \ \ dict " ) , <nl> + [ ( Rhint ( root | classes_const_keyword . php line 8 , characters 24 - 26 ) , <nl> + ( Tprim Tint ) ) ; <nl> + ( Rhint ( root | classes_const_keyword . php line 8 , characters 29 - 33 ) , <nl> + ( Tprim Tfloat ) ) <nl> + ] <nl> + ) ) ) <nl> + ] <nl> + ) ) ) <nl> + } <nl> + ] ; <nl> + sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> + sc_constructor = None ; sc_static_methods = [ ] ; sc_methods = [ ] ; <nl> + sc_user_attributes = [ ] ; sc_enum_type = None } ) ) ; <nl> + ( " \ \ AbstractConsts " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cabstract ; <nl> + sc_name = ( [ 12 : 16 - 30 ] , " \ \ AbstractConsts " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> + sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> + sc_implements = [ ] ; <nl> + sc_consts = <nl> + [ { Shallow_decl_defs . scc_abstract = true ; <nl> + scc_name = ( [ 13 : 22 - 35 ] , " CABSTRACT_INT " ) ; <nl> + scc_type = <nl> + ( Rhint ( root | classes_const_keyword . php line 13 , characters 18 - 20 ) , <nl> + ( Tprim Tint ) ) <nl> + } <nl> + ] ; <nl> + sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> + sc_constructor = None ; sc_static_methods = [ ] ; sc_methods = [ ] ; <nl> + sc_user_attributes = [ ] ; sc_enum_type = None } ) ) ; <nl> + ( " \ \ VecConsts " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> + sc_name = ( [ 16 : 7 - 16 ] , " \ \ VecConsts " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> + sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> + sc_implements = [ ] ; <nl> + sc_consts = <nl> + [ { Shallow_decl_defs . scc_abstract = false ; <nl> + scc_name = ( [ 17 : 18 - 22 ] , " CVEC " ) ; <nl> + scc_type = <nl> + ( Rhint ( root | classes_const_keyword . php line 17 , characters 9 - 16 ) , <nl> + ( Tapply ( ( [ 17 : 9 - 12 ] , " \ \ HH \ \ vec " ) , <nl> + [ ( Rhint ( root | classes_const_keyword . php line 17 , characters 13 - 15 ) , <nl> + ( Tprim Tint ) ) ] <nl> + ) ) ) <nl> + } ; <nl> + { Shallow_decl_defs . scc_abstract = false ; <nl> + scc_name = ( [ 18 : 23 - 34 ] , " CNESTED_VEC " ) ; <nl> + scc_type = <nl> + ( Rhint ( root | classes_const_keyword . php line 18 , characters 9 - 21 ) , <nl> + ( Tapply ( ( [ 18 : 9 - 12 ] , " \ \ HH \ \ vec " ) , <nl> + [ ( Rhint ( root | classes_const_keyword . php line 18 , characters 13 - 20 ) , <nl> + ( Tapply ( ( [ 18 : 13 - 16 ] , " \ \ HH \ \ vec " ) , <nl> + [ ( Rhint ( root | classes_const_keyword . php line 18 , characters 17 - 19 ) , <nl> + ( Tprim Tint ) ) ] <nl> + ) ) ) <nl> + ] <nl> + ) ) ) <nl> + } <nl> + ] ; <nl> + sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> + sc_constructor = None ; sc_static_methods = [ ] ; sc_methods = [ ] ; <nl> + sc_user_attributes = [ ] ; sc_enum_type = None } ) ) ; <nl> + ( " \ \ ArrayConsts " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> + sc_name = ( [ 21 : 7 - 18 ] , " \ \ ArrayConsts " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> + sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> + sc_implements = [ ] ; <nl> + sc_consts = <nl> + [ { Shallow_decl_defs . scc_abstract = false ; <nl> + scc_name = ( [ 22 : 29 - 36 ] , " CDARRAY " ) ; <nl> + scc_type = <nl> + ( Rhint ( root | classes_const_keyword . php line 22 , characters 9 - 27 ) , <nl> + ( Tdarray ( <nl> + ( Rhint ( root | classes_const_keyword . php line 22 , characters 16 - 21 ) , <nl> + ( Tprim Tstring ) ) , <nl> + ( Rhint ( root | classes_const_keyword . php line 22 , characters 24 - 26 ) , <nl> + ( Tprim Tint ) ) <nl> + ) ) ) <nl> + } ; <nl> + { Shallow_decl_defs . scc_abstract = false ; <nl> + scc_name = ( [ 23 : 24 - 31 ] , " CKEYSET " ) ; <nl> + scc_type = <nl> + ( Rhint ( root | classes_const_keyword . php line 23 , characters 9 - 22 ) , <nl> + ( Tapply ( ( [ 23 : 9 - 15 ] , " \ \ HH \ \ keyset " ) , <nl> + [ ( Rhint ( root | classes_const_keyword . php line 23 , characters 16 - 21 ) , <nl> + ( Tprim Tstring ) ) ] <nl> + ) ) ) <nl> + } ; <nl> + { Shallow_decl_defs . scc_abstract = false ; <nl> + scc_name = ( [ 24 : 27 - 44 ] , " CCLASSNAME_KEYSET " ) ; <nl> + scc_type = <nl> + ( Rhint ( root | classes_const_keyword . php line 24 , characters 9 - 25 ) , <nl> + ( Tapply ( ( [ 24 : 9 - 15 ] , " \ \ HH \ \ keyset " ) , <nl> + [ ( Rhint ( root | classes_const_keyword . php line 24 , characters 16 - 24 ) , <nl> + ( Tprim Tstring ) ) ] <nl> + ) ) ) <nl> + } ; <nl> + { Shallow_decl_defs . scc_abstract = false ; <nl> + scc_name = ( [ 25 : 24 - 31 ] , " CVARRAY " ) ; <nl> + scc_type = <nl> + ( Rhint ( root | classes_const_keyword . php line 25 , characters 9 - 22 ) , <nl> + ( Tvarray <nl> + ( Rhint ( root | classes_const_keyword . php line 25 , characters 16 - 21 ) , <nl> + ( Tprim Tstring ) ) ) ) <nl> + } <nl> + ] ; <nl> + sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> + sc_constructor = None ; sc_static_methods = [ ] ; sc_methods = [ ] ; <nl> + sc_user_attributes = [ ] ; sc_enum_type = None } ) ) ; <nl> + ( " \ \ BinopConsts " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> + sc_name = ( [ 28 : 7 - 18 ] , " \ \ BinopConsts " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> + sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> + sc_implements = [ ] ; <nl> + sc_consts = <nl> + [ { Shallow_decl_defs . scc_abstract = false ; <nl> + scc_name = ( [ 29 : 13 - 17 ] , " CINT " ) ; <nl> + scc_type = <nl> + ( Rhint ( root | classes_const_keyword . php line 29 , characters 9 - 11 ) , <nl> + ( Tprim Tint ) ) <nl> + } ; <nl> + { Shallow_decl_defs . scc_abstract = false ; <nl> + scc_name = ( [ 30 : 15 - 21 ] , " CFLOAT " ) ; <nl> + scc_type = <nl> + ( Rhint ( root | classes_const_keyword . php line 30 , characters 9 - 13 ) , <nl> + ( Tprim Tfloat ) ) <nl> + } ; <nl> + { Shallow_decl_defs . scc_abstract = false ; <nl> + scc_name = ( [ 31 : 16 - 23 ] , " CSTRING " ) ; <nl> + scc_type = <nl> + ( Rhint ( root | classes_const_keyword . php line 31 , characters 9 - 14 ) , <nl> + ( Tprim Tstring ) ) <nl> + } ; <nl> + { Shallow_decl_defs . scc_abstract = false ; <nl> + scc_name = ( [ 32 : 14 - 19 ] , " CBOOL " ) ; <nl> + scc_type = <nl> + ( Rhint ( root | classes_const_keyword . php line 32 , characters 9 - 12 ) , <nl> + ( Tprim Tbool ) ) <nl> + } <nl> + ] ; <nl> + sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> + sc_constructor = None ; sc_static_methods = [ ] ; sc_methods = [ ] ; <nl> + sc_user_attributes = [ ] ; sc_enum_type = None } ) ) ; <nl> + ( " \ \ ShapeConsts " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> + sc_name = ( [ 35 : 7 - 18 ] , " \ \ ShapeConsts " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> + sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> + sc_implements = [ ] ; <nl> + sc_consts = <nl> + [ { Shallow_decl_defs . scc_abstract = false ; <nl> + scc_name = ( [ 36 : 47 - 53 ] , " CSHAPE " ) ; <nl> + scc_type = <nl> + ( Rhint ( root | classes_const_keyword . php line 36 , characters 9 - 45 ) , <nl> + ( Tshape ( Typing_defs_core . Open_shape , <nl> + { ( SFlit_str ( [ 36 : 15 - 18 ] , " a " ) ) - > <nl> + { sft_optional = false ; <nl> + sft_ty = <nl> + ( Rhint ( root | classes_const_keyword . php line 36 , characters 22 - 24 ) , <nl> + ( Tprim Tint ) ) <nl> + } ; <nl> + ( SFlit_str ( [ 36 : 27 - 30 ] , " b " ) ) - > <nl> + { sft_optional = false ; <nl> + sft_ty = <nl> + ( Rhint ( root | classes_const_keyword . php line 36 , characters 34 - 39 ) , <nl> + ( Tprim Tstring ) ) <nl> + } } <nl> + ) ) ) <nl> + } <nl> + ] ; <nl> + sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> + sc_constructor = None ; sc_static_methods = [ ] ; sc_methods = [ ] ; <nl> + sc_user_attributes = [ ] ; sc_enum_type = None } ) ) ; <nl> + ( " \ \ TupleConsts " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> + sc_name = ( [ 40 : 7 - 18 ] , " \ \ TupleConsts " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> + sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> + sc_implements = [ ] ; <nl> + sc_consts = <nl> + [ { Shallow_decl_defs . scc_abstract = false ; <nl> + scc_name = ( [ 41 : 33 - 40 ] , " COPTION " ) ; <nl> + scc_type = <nl> + ( Rhint ( root | classes_const_keyword . php line 41 , characters 9 - 31 ) , <nl> + ( Ttuple <nl> + [ ( Rhint ( root | classes_const_keyword . php line 41 , characters 10 - 12 ) , <nl> + ( Tprim Tint ) ) ; <nl> + ( Rhint ( root | classes_const_keyword . php line 41 , characters 15 - 30 ) , <nl> + ( Toption <nl> + ( Rhint ( root | classes_const_keyword . php line 41 , characters 16 - 30 ) , <nl> + ( Ttuple <nl> + [ ( Rhint ( root | classes_const_keyword . php line 41 , characters 17 - 22 ) , <nl> + ( Tprim Tstring ) ) ; <nl> + ( Rhint ( root | classes_const_keyword . php line 41 , characters 25 - 29 ) , <nl> + ( Tprim Tfloat ) ) <nl> + ] ) ) ) ) <nl> + ] ) ) <nl> + } <nl> + ] ; <nl> + sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> + sc_constructor = None ; sc_static_methods = [ ] ; sc_methods = [ ] ; <nl> + sc_user_attributes = [ ] ; sc_enum_type = None } ) ) ; <nl> + ( " \ \ ClassnameConsts " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> + sc_name = ( [ 44 : 7 - 22 ] , " \ \ ClassnameConsts " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> + sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> + sc_implements = [ ] ; <nl> + sc_consts = <nl> + [ { Shallow_decl_defs . scc_abstract = false ; <nl> + scc_name = ( [ 45 : 32 - 42 ] , " CCLASSNAME " ) ; <nl> + scc_type = <nl> + ( Rhint ( root | classes_const_keyword . php line 45 , characters 9 - 30 ) , <nl> + ( Tapply ( ( [ 45 : 9 - 18 ] , " \ \ HH \ \ classname " ) , <nl> + [ ( Rhint ( root | classes_const_keyword . php line 45 , characters 19 - 29 ) , <nl> + ( Tapply ( ( [ 45 : 19 - 30 ] , " \ \ TupleConsts " ) , [ ] ) ) ) ] <nl> + ) ) ) <nl> + } ; <nl> + { Shallow_decl_defs . scc_abstract = false ; <nl> + scc_name = ( [ 46 : 36 - 47 ] , " CCLASSNAME2 " ) ; <nl> + scc_type = <nl> + ( Rhint ( root | classes_const_keyword . php line 46 , characters 9 - 34 ) , <nl> + ( Tapply ( ( [ 46 : 9 - 18 ] , " \ \ HH \ \ classname " ) , <nl> + [ ( Rhint ( root | classes_const_keyword . php line 46 , characters 19 - 33 ) , <nl> + ( Tapply ( ( [ 46 : 19 - 34 ] , " \ \ ClassnameConsts " ) , [ ] ) ) ) ] <nl> + ) ) ) <nl> + } <nl> + ] ; <nl> + sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> + sc_constructor = None ; sc_static_methods = [ ] ; sc_methods = [ ] ; <nl> + sc_user_attributes = [ ] ; sc_enum_type = None } ) ) <nl> + ] <nl> <nl> They matched ! <nl> mmm a / hphp / hack / test / decl / classes_inferred_constant_types . php . exp <nl> ppp b / hphp / hack / test / decl / classes_inferred_constant_types . php . exp <nl> <nl> - Parsed decls : <nl> - <nl> - { classes = <nl> - { " \ \ C " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> - sc_name = ( [ 3 : 7 - 8 ] , " \ \ C " ) ; sc_tparams = [ ] ; sc_where_constraints = [ ] ; <nl> - sc_extends = [ ] ; sc_uses = [ ] ; sc_xhp_attr_uses = [ ] ; <nl> - sc_req_extends = [ ] ; sc_req_implements = [ ] ; sc_implements = [ ] ; <nl> - sc_consts = <nl> - [ { Shallow_decl_defs . scc_abstract = false ; <nl> - scc_name = ( [ 4 : 9 - 12 ] , " FOO " ) ; <nl> - scc_type = <nl> - ( Rwitness ( root | classes_inferred_constant_types . php line 4 , characters 15 - 16 ) , <nl> - ( Tprim Tint ) ) <nl> - } ; <nl> - { Shallow_decl_defs . scc_abstract = false ; <nl> - scc_name = ( [ 5 : 9 - 12 ] , " BAR " ) ; <nl> + [ ( " \ \ C " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> + sc_name = ( [ 3 : 7 - 8 ] , " \ \ C " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> + sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> + sc_implements = [ ] ; <nl> + sc_consts = <nl> + [ { Shallow_decl_defs . scc_abstract = false ; <nl> + scc_name = ( [ 4 : 9 - 12 ] , " FOO " ) ; <nl> scc_type = <nl> - ( Rwitness ( root | classes_inferred_constant_types . php line 5 , characters 15 - 15 ) , <nl> + ( Rwitness ( root | classes_inferred_constant_types . php line 4 , characters 15 - 16 ) , <nl> ( Tprim Tint ) ) <nl> } ; <nl> - { Shallow_decl_defs . scc_abstract = false ; <nl> - scc_name = ( [ 6 : 9 - 12 ] , " BAZ " ) ; <nl> - scc_type = <nl> - ( Rwitness ( root | classes_inferred_constant_types . php line 6 , characters 15 - 16 ) , <nl> - ( Tprim Tint ) ) <nl> - } <nl> - ] ; <nl> - sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> - sc_constructor = None ; sc_static_methods = [ ] ; <nl> - sc_methods = <nl> - [ { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> - sm_memoizelsb = false ; sm_name = ( [ 8 : 19 - 20 ] , " f " ) ; <nl> - sm_override = false ; sm_dynamicallycallable = false ; <nl> - sm_reactivity = None ; <nl> - sm_type = <nl> - ( Rwitness ( root | classes_inferred_constant_types . php line 8 , characters 19 - 19 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | classes_inferred_constant_types . php line 8 , characters 19 - 19 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | classes_inferred_constant_types . php line 8 , characters 24 - 27 ) , <nl> - ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } <nl> - } ) ) ; <nl> - sm_visibility = Public ; sm_deprecated = None } <nl> - ] ; <nl> - sc_user_attributes = [ ] ; sc_enum_type = None } } ; <nl> - funs = { } ; typedefs = { } ; consts = { } ; records = { } } <nl> + { Shallow_decl_defs . scc_abstract = false ; <nl> + scc_name = ( [ 5 : 9 - 12 ] , " BAR " ) ; <nl> + scc_type = <nl> + ( Rwitness ( root | classes_inferred_constant_types . php line 5 , characters 15 - 15 ) , <nl> + ( Tprim Tint ) ) <nl> + } ; <nl> + { Shallow_decl_defs . scc_abstract = false ; <nl> + scc_name = ( [ 6 : 9 - 12 ] , " BAZ " ) ; <nl> + scc_type = <nl> + ( Rwitness ( root | classes_inferred_constant_types . php line 6 , characters 15 - 16 ) , <nl> + ( Tprim Tint ) ) <nl> + } <nl> + ] ; <nl> + sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> + sc_constructor = None ; sc_static_methods = [ ] ; <nl> + sc_methods = <nl> + [ { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> + sm_memoizelsb = false ; sm_name = ( [ 8 : 19 - 20 ] , " f " ) ; <nl> + sm_override = false ; sm_dynamicallycallable = false ; <nl> + sm_reactivity = None ; <nl> + sm_type = <nl> + ( Rwitness ( root | classes_inferred_constant_types . php line 8 , characters 19 - 19 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | classes_inferred_constant_types . php line 8 , characters 19 - 19 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | classes_inferred_constant_types . php line 8 , characters 24 - 27 ) , <nl> + ( Tprim Tvoid ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } <nl> + } ) ) ; <nl> + sm_visibility = Public ; sm_deprecated = None } <nl> + ] ; <nl> + sc_user_attributes = [ ] ; sc_enum_type = None } ) ) <nl> + ] <nl> <nl> They matched ! <nl> mmm a / hphp / hack / test / decl / classes_inheritance . php . exp <nl> ppp b / hphp / hack / test / decl / classes_inheritance . php . exp <nl> <nl> - Parsed decls : <nl> - <nl> - { classes = <nl> - { " \ \ A " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> - sc_name = ( [ 3 : 7 - 8 ] , " \ \ A " ) ; sc_tparams = [ ] ; sc_where_constraints = [ ] ; <nl> - sc_extends = [ ] ; sc_uses = [ ] ; sc_xhp_attr_uses = [ ] ; <nl> - sc_req_extends = [ ] ; sc_req_implements = [ ] ; sc_implements = [ ] ; <nl> - sc_consts = [ ] ; sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; sc_props = [ ] ; <nl> - sc_sprops = [ ] ; sc_constructor = None ; sc_static_methods = [ ] ; <nl> - sc_methods = <nl> - [ { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> - sm_memoizelsb = false ; sm_name = ( [ 4 : 19 - 20 ] , " a " ) ; <nl> - sm_override = false ; sm_dynamicallycallable = false ; <nl> - sm_reactivity = None ; <nl> - sm_type = <nl> - ( Rwitness ( root | classes_inheritance . php line 4 , characters 19 - 19 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | classes_inheritance . php line 4 , characters 19 - 19 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | classes_inheritance . php line 4 , characters 24 - 27 ) , <nl> - ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } <nl> - } ) ) ; <nl> - sm_visibility = Public ; sm_deprecated = None } ; <nl> - { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> - sm_memoizelsb = false ; sm_name = ( [ 5 : 19 - 20 ] , " b " ) ; <nl> - sm_override = false ; sm_dynamicallycallable = false ; <nl> - sm_reactivity = None ; <nl> - sm_type = <nl> - ( Rwitness ( root | classes_inheritance . php line 5 , characters 19 - 19 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | classes_inheritance . php line 5 , characters 19 - 19 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | classes_inheritance . php line 5 , characters 24 - 27 ) , <nl> - ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } <nl> - } ) ) ; <nl> - sm_visibility = Public ; sm_deprecated = None } <nl> - ] ; <nl> - sc_user_attributes = [ ] ; sc_enum_type = None } ; <nl> - " \ \ B " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> - sc_name = ( [ 8 : 7 - 8 ] , " \ \ B " ) ; sc_tparams = [ ] ; sc_where_constraints = [ ] ; <nl> - sc_extends = <nl> - [ ( Rhint ( root | classes_inheritance . php line 8 , characters 17 - 17 ) , <nl> - ( Tapply ( ( [ 8 : 17 - 18 ] , " \ \ A " ) , [ ] ) ) ) ] ; <nl> - sc_uses = [ ] ; sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; <nl> - sc_req_implements = [ ] ; sc_implements = [ ] ; sc_consts = [ ] ; <nl> - sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> - sc_constructor = None ; sc_static_methods = [ ] ; <nl> - sc_methods = <nl> - [ { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> - sm_memoizelsb = false ; sm_name = ( [ 9 : 19 - 20 ] , " b " ) ; <nl> - sm_override = false ; sm_dynamicallycallable = false ; <nl> - sm_reactivity = None ; <nl> - sm_type = <nl> - ( Rwitness ( root | classes_inheritance . php line 9 , characters 19 - 19 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | classes_inheritance . php line 9 , characters 19 - 19 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | classes_inheritance . php line 9 , characters 24 - 27 ) , <nl> - ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } <nl> - } ) ) ; <nl> - sm_visibility = Public ; sm_deprecated = None } ; <nl> - { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> - sm_memoizelsb = false ; sm_name = ( [ 10 : 19 - 20 ] , " c " ) ; <nl> + [ ( " \ \ A " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> + sc_name = ( [ 3 : 7 - 8 ] , " \ \ A " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> + sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> + sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; <nl> + sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> + sc_constructor = None ; sc_static_methods = [ ] ; <nl> + sc_methods = <nl> + [ { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> + sm_memoizelsb = false ; sm_name = ( [ 4 : 19 - 20 ] , " a " ) ; <nl> sm_override = false ; sm_dynamicallycallable = false ; <nl> sm_reactivity = None ; <nl> sm_type = <nl> - ( Rwitness ( root | classes_inheritance . php line 10 , characters 19 - 19 ) , <nl> + ( Rwitness ( root | classes_inheritance . php line 4 , characters 19 - 19 ) , <nl> ( Tfun <nl> { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> ft_implicit_params = <nl> { capability = <nl> - ( Rhint ( root | classes_inheritance . php line 10 , characters 19 - 19 ) , <nl> + ( Rhint ( root | classes_inheritance . php line 4 , characters 19 - 19 ) , <nl> ( Tunion [ ] ) ) <nl> } ; <nl> ft_ret = <nl> { et_enforced = false ; <nl> et_type = <nl> - ( Rhint ( root | classes_inheritance . php line 10 , characters 24 - 27 ) , <nl> + ( Rhint ( root | classes_inheritance . php line 4 , characters 24 - 27 ) , <nl> ( Tprim Tvoid ) ) <nl> } ; <nl> ft_flags = <nl> Parsed decls : <nl> ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } <nl> } ) ) ; <nl> - sm_visibility = Public ; sm_deprecated = None } <nl> - ] ; <nl> - sc_user_attributes = [ ] ; sc_enum_type = None } ; <nl> - " \ \ C " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cinterface ; <nl> - sc_name = ( [ 13 : 11 - 12 ] , " \ \ C " ) ; sc_tparams = [ ] ; <nl> - sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> - sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> - sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; <nl> - sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; sc_constructor = None ; <nl> - sc_static_methods = [ ] ; <nl> - sc_methods = <nl> - [ { Shallow_decl_defs . sm_abstract = true ; sm_final = false ; <nl> - sm_memoizelsb = false ; sm_name = ( [ 14 : 19 - 20 ] , " c " ) ; <nl> - sm_override = false ; sm_dynamicallycallable = false ; <nl> - sm_reactivity = None ; <nl> - sm_type = <nl> - ( Rwitness ( root | classes_inheritance . php line 14 , characters 19 - 19 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | classes_inheritance . php line 14 , characters 19 - 19 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | classes_inheritance . php line 14 , characters 24 - 27 ) , <nl> - ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } <nl> - } ) ) ; <nl> - sm_visibility = Public ; sm_deprecated = None } <nl> - ] ; <nl> - sc_user_attributes = [ ] ; sc_enum_type = None } ; <nl> - " \ \ D " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cinterface ; <nl> - sc_name = ( [ 17 : 11 - 12 ] , " \ \ D " ) ; sc_tparams = [ ] ; <nl> - sc_where_constraints = [ ] ; <nl> - sc_extends = <nl> - [ ( Rhint ( root | classes_inheritance . php line 17 , characters 21 - 21 ) , <nl> - ( Tapply ( ( [ 17 : 21 - 22 ] , " \ \ C " ) , [ ] ) ) ) ] ; <nl> - sc_uses = [ ] ; sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; <nl> - sc_req_implements = [ ] ; sc_implements = [ ] ; sc_consts = [ ] ; <nl> - sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> - sc_constructor = None ; sc_static_methods = [ ] ; <nl> - sc_methods = <nl> - [ { Shallow_decl_defs . sm_abstract = true ; sm_final = false ; <nl> - sm_memoizelsb = false ; sm_name = ( [ 18 : 19 - 20 ] , " d " ) ; <nl> - sm_override = false ; sm_dynamicallycallable = false ; <nl> - sm_reactivity = None ; <nl> - sm_type = <nl> - ( Rwitness ( root | classes_inheritance . php line 18 , characters 19 - 19 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | classes_inheritance . php line 18 , characters 19 - 19 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | classes_inheritance . php line 18 , characters 24 - 27 ) , <nl> - ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } <nl> - } ) ) ; <nl> - sm_visibility = Public ; sm_deprecated = None } <nl> - ] ; <nl> - sc_user_attributes = [ ] ; sc_enum_type = None } ; <nl> - " \ \ E " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> - sc_name = ( [ 21 : 7 - 8 ] , " \ \ E " ) ; sc_tparams = [ ] ; <nl> - sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> - sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> - sc_implements = <nl> - [ ( Rhint ( root | classes_inheritance . php line 21 , characters 20 - 20 ) , <nl> - ( Tapply ( ( [ 21 : 20 - 21 ] , " \ \ C " ) , [ ] ) ) ) ] ; <nl> - sc_consts = [ ] ; sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; sc_props = [ ] ; <nl> - sc_sprops = [ ] ; sc_constructor = None ; sc_static_methods = [ ] ; <nl> - sc_methods = <nl> - [ { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> - sm_memoizelsb = false ; sm_name = ( [ 22 : 19 - 20 ] , " c " ) ; <nl> - sm_override = false ; sm_dynamicallycallable = false ; <nl> - sm_reactivity = None ; <nl> - sm_type = <nl> - ( Rwitness ( root | classes_inheritance . php line 22 , characters 19 - 19 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | classes_inheritance . php line 22 , characters 19 - 19 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | classes_inheritance . php line 22 , characters 24 - 27 ) , <nl> - ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } <nl> - } ) ) ; <nl> - sm_visibility = Public ; sm_deprecated = None } <nl> - ] ; <nl> - sc_user_attributes = [ ] ; sc_enum_type = None } ; <nl> - " \ \ F " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> - sc_name = ( [ 25 : 7 - 8 ] , " \ \ F " ) ; sc_tparams = [ ] ; <nl> - sc_where_constraints = [ ] ; <nl> - sc_extends = <nl> - [ ( Rhint ( root | classes_inheritance . php line 25 , characters 17 - 17 ) , <nl> - ( Tapply ( ( [ 25 : 17 - 18 ] , " \ \ E " ) , [ ] ) ) ) ] ; <nl> - sc_uses = [ ] ; sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; <nl> - sc_req_implements = [ ] ; <nl> - sc_implements = <nl> - [ ( Rhint ( root | classes_inheritance . php line 25 , characters 30 - 30 ) , <nl> - ( Tapply ( ( [ 25 : 30 - 31 ] , " \ \ D " ) , [ ] ) ) ) ] ; <nl> - sc_consts = [ ] ; sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; sc_props = [ ] ; <nl> - sc_sprops = [ ] ; sc_constructor = None ; sc_static_methods = [ ] ; <nl> - sc_methods = <nl> - [ { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> - sm_memoizelsb = false ; sm_name = ( [ 26 : 19 - 20 ] , " d " ) ; <nl> - sm_override = false ; sm_dynamicallycallable = false ; <nl> - sm_reactivity = None ; <nl> - sm_type = <nl> - ( Rwitness ( root | classes_inheritance . php line 26 , characters 19 - 19 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | classes_inheritance . php line 26 , characters 19 - 19 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | classes_inheritance . php line 26 , characters 24 - 27 ) , <nl> - ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } <nl> - } ) ) ; <nl> - sm_visibility = Public ; sm_deprecated = None } <nl> - ] ; <nl> - sc_user_attributes = [ ] ; sc_enum_type = None } } ; <nl> - funs = { } ; typedefs = { } ; consts = { } ; records = { } } <nl> + sm_visibility = Public ; sm_deprecated = None } ; <nl> + { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> + sm_memoizelsb = false ; sm_name = ( [ 5 : 19 - 20 ] , " b " ) ; <nl> + sm_override = false ; sm_dynamicallycallable = false ; <nl> + sm_reactivity = None ; <nl> + sm_type = <nl> + ( Rwitness ( root | classes_inheritance . php line 5 , characters 19 - 19 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | classes_inheritance . php line 5 , characters 19 - 19 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | classes_inheritance . php line 5 , characters 24 - 27 ) , <nl> + ( Tprim Tvoid ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; <nl> + ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + sm_visibility = Public ; sm_deprecated = None } <nl> + ] ; <nl> + sc_user_attributes = [ ] ; sc_enum_type = None } ) ) ; <nl> + ( " \ \ B " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> + sc_name = ( [ 8 : 7 - 8 ] , " \ \ B " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = [ ] ; <nl> + sc_extends = <nl> + [ ( Rhint ( root | classes_inheritance . php line 8 , characters 17 - 17 ) , <nl> + ( Tapply ( ( [ 8 : 17 - 18 ] , " \ \ A " ) , [ ] ) ) ) ] ; <nl> + sc_uses = [ ] ; sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; <nl> + sc_req_implements = [ ] ; sc_implements = [ ] ; sc_consts = [ ] ; <nl> + sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> + sc_constructor = None ; sc_static_methods = [ ] ; <nl> + sc_methods = <nl> + [ { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> + sm_memoizelsb = false ; sm_name = ( [ 9 : 19 - 20 ] , " b " ) ; <nl> + sm_override = false ; sm_dynamicallycallable = false ; <nl> + sm_reactivity = None ; <nl> + sm_type = <nl> + ( Rwitness ( root | classes_inheritance . php line 9 , characters 19 - 19 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | classes_inheritance . php line 9 , characters 19 - 19 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | classes_inheritance . php line 9 , characters 24 - 27 ) , <nl> + ( Tprim Tvoid ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; <nl> + ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + sm_visibility = Public ; sm_deprecated = None } ; <nl> + { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> + sm_memoizelsb = false ; sm_name = ( [ 10 : 19 - 20 ] , " c " ) ; <nl> + sm_override = false ; sm_dynamicallycallable = false ; <nl> + sm_reactivity = None ; <nl> + sm_type = <nl> + ( Rwitness ( root | classes_inheritance . php line 10 , characters 19 - 19 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | classes_inheritance . php line 10 , characters 19 - 19 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | classes_inheritance . php line 10 , characters 24 - 27 ) , <nl> + ( Tprim Tvoid ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; <nl> + ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + sm_visibility = Public ; sm_deprecated = None } <nl> + ] ; <nl> + sc_user_attributes = [ ] ; sc_enum_type = None } ) ) ; <nl> + ( " \ \ C " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cinterface ; <nl> + sc_name = ( [ 13 : 11 - 12 ] , " \ \ C " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> + sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> + sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; <nl> + sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> + sc_constructor = None ; sc_static_methods = [ ] ; <nl> + sc_methods = <nl> + [ { Shallow_decl_defs . sm_abstract = true ; sm_final = false ; <nl> + sm_memoizelsb = false ; sm_name = ( [ 14 : 19 - 20 ] , " c " ) ; <nl> + sm_override = false ; sm_dynamicallycallable = false ; <nl> + sm_reactivity = None ; <nl> + sm_type = <nl> + ( Rwitness ( root | classes_inheritance . php line 14 , characters 19 - 19 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | classes_inheritance . php line 14 , characters 19 - 19 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | classes_inheritance . php line 14 , characters 24 - 27 ) , <nl> + ( Tprim Tvoid ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; <nl> + ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + sm_visibility = Public ; sm_deprecated = None } <nl> + ] ; <nl> + sc_user_attributes = [ ] ; sc_enum_type = None } ) ) ; <nl> + ( " \ \ D " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cinterface ; <nl> + sc_name = ( [ 17 : 11 - 12 ] , " \ \ D " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = [ ] ; <nl> + sc_extends = <nl> + [ ( Rhint ( root | classes_inheritance . php line 17 , characters 21 - 21 ) , <nl> + ( Tapply ( ( [ 17 : 21 - 22 ] , " \ \ C " ) , [ ] ) ) ) ] ; <nl> + sc_uses = [ ] ; sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; <nl> + sc_req_implements = [ ] ; sc_implements = [ ] ; sc_consts = [ ] ; <nl> + sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> + sc_constructor = None ; sc_static_methods = [ ] ; <nl> + sc_methods = <nl> + [ { Shallow_decl_defs . sm_abstract = true ; sm_final = false ; <nl> + sm_memoizelsb = false ; sm_name = ( [ 18 : 19 - 20 ] , " d " ) ; <nl> + sm_override = false ; sm_dynamicallycallable = false ; <nl> + sm_reactivity = None ; <nl> + sm_type = <nl> + ( Rwitness ( root | classes_inheritance . php line 18 , characters 19 - 19 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | classes_inheritance . php line 18 , characters 19 - 19 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | classes_inheritance . php line 18 , characters 24 - 27 ) , <nl> + ( Tprim Tvoid ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; <nl> + ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + sm_visibility = Public ; sm_deprecated = None } <nl> + ] ; <nl> + sc_user_attributes = [ ] ; sc_enum_type = None } ) ) ; <nl> + ( " \ \ E " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> + sc_name = ( [ 21 : 7 - 8 ] , " \ \ E " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> + sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> + sc_implements = <nl> + [ ( Rhint ( root | classes_inheritance . php line 21 , characters 20 - 20 ) , <nl> + ( Tapply ( ( [ 21 : 20 - 21 ] , " \ \ C " ) , [ ] ) ) ) ] ; <nl> + sc_consts = [ ] ; sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; sc_props = [ ] ; <nl> + sc_sprops = [ ] ; sc_constructor = None ; sc_static_methods = [ ] ; <nl> + sc_methods = <nl> + [ { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> + sm_memoizelsb = false ; sm_name = ( [ 22 : 19 - 20 ] , " c " ) ; <nl> + sm_override = false ; sm_dynamicallycallable = false ; <nl> + sm_reactivity = None ; <nl> + sm_type = <nl> + ( Rwitness ( root | classes_inheritance . php line 22 , characters 19 - 19 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | classes_inheritance . php line 22 , characters 19 - 19 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | classes_inheritance . php line 22 , characters 24 - 27 ) , <nl> + ( Tprim Tvoid ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; <nl> + ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + sm_visibility = Public ; sm_deprecated = None } <nl> + ] ; <nl> + sc_user_attributes = [ ] ; sc_enum_type = None } ) ) ; <nl> + ( " \ \ F " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> + sc_name = ( [ 25 : 7 - 8 ] , " \ \ F " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = [ ] ; <nl> + sc_extends = <nl> + [ ( Rhint ( root | classes_inheritance . php line 25 , characters 17 - 17 ) , <nl> + ( Tapply ( ( [ 25 : 17 - 18 ] , " \ \ E " ) , [ ] ) ) ) ] ; <nl> + sc_uses = [ ] ; sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; <nl> + sc_req_implements = [ ] ; <nl> + sc_implements = <nl> + [ ( Rhint ( root | classes_inheritance . php line 25 , characters 30 - 30 ) , <nl> + ( Tapply ( ( [ 25 : 30 - 31 ] , " \ \ D " ) , [ ] ) ) ) ] ; <nl> + sc_consts = [ ] ; sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; sc_props = [ ] ; <nl> + sc_sprops = [ ] ; sc_constructor = None ; sc_static_methods = [ ] ; <nl> + sc_methods = <nl> + [ { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> + sm_memoizelsb = false ; sm_name = ( [ 26 : 19 - 20 ] , " d " ) ; <nl> + sm_override = false ; sm_dynamicallycallable = false ; <nl> + sm_reactivity = None ; <nl> + sm_type = <nl> + ( Rwitness ( root | classes_inheritance . php line 26 , characters 19 - 19 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | classes_inheritance . php line 26 , characters 19 - 19 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | classes_inheritance . php line 26 , characters 24 - 27 ) , <nl> + ( Tprim Tvoid ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; <nl> + ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + sm_visibility = Public ; sm_deprecated = None } <nl> + ] ; <nl> + sc_user_attributes = [ ] ; sc_enum_type = None } ) ) <nl> + ] <nl> <nl> They matched ! <nl> mmm a / hphp / hack / test / decl / classes_reified_generics . php . exp <nl> ppp b / hphp / hack / test / decl / classes_reified_generics . php . exp <nl> <nl> - Parsed decls : <nl> - <nl> - { classes = <nl> - { " \ \ C " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> - sc_name = ( [ 3 : 7 - 8 ] , " \ \ C " ) ; <nl> - sc_tparams = <nl> - [ { Typing_defs_core . tp_variance = Invariant ; <nl> - tp_name = ( [ 3 : 15 - 16 ] , " T " ) ; tp_tparams = [ ] ; tp_constraints = [ ] ; <nl> - tp_reified = Reified ; tp_user_attributes = [ ] } <nl> - ] ; <nl> - sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> - sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> - sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; <nl> - sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; sc_constructor = None ; <nl> - sc_static_methods = [ ] ; sc_methods = [ ] ; sc_user_attributes = [ ] ; <nl> - sc_enum_type = None } ; <nl> - " \ \ X " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cabstract ; <nl> - sc_name = ( [ 5 : 16 - 17 ] , " \ \ X " ) ; sc_tparams = [ ] ; <nl> - sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> - sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> - sc_implements = [ ] ; sc_consts = [ ] ; <nl> - sc_typeconsts = <nl> - [ { Shallow_decl_defs . stc_abstract = Typing_defs . TCConcrete ; <nl> - stc_constraint = None ; stc_name = ( [ 7 : 14 - 18 ] , " TFoo " ) ; <nl> - stc_type = <nl> - ( Some ( Rhint ( root | classes_reified_generics . php line 7 , characters 21 - 23 ) , <nl> - ( Tprim Tint ) ) ) ; <nl> - stc_enforceable = ( [ Pos . none ] , false ) ; <nl> - stc_reifiable = ( Some [ 6 : 5 - 16 ] ) } ; <nl> - { Shallow_decl_defs . stc_abstract = Typing_defs . TCConcrete ; <nl> - stc_constraint = None ; stc_name = ( [ 9 : 14 - 16 ] , " X2 " ) ; <nl> - stc_type = <nl> - ( Some ( Rhint ( root | classes_reified_generics . php line 9 , characters 19 - 31 ) , <nl> - ( Tapply ( ( [ 9 : 19 - 20 ] , " \ \ C " ) , <nl> - [ ( Rhint ( root | classes_reified_generics . php line 9 , characters 21 - 30 ) , <nl> - ( Taccess <nl> - ( ( Rhint ( root | classes_reified_generics . php line 9 , characters 21 - 24 ) , <nl> - Tthis ) , <nl> - [ ( [ 9 : 27 - 31 ] , " TFoo " ) ] ) ) ) <nl> - ] <nl> - ) ) ) ) ; <nl> - stc_enforceable = ( [ Pos . none ] , false ) ; stc_reifiable = None } <nl> - ] ; <nl> - sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; sc_constructor = None ; <nl> - sc_static_methods = [ ] ; sc_methods = [ ] ; sc_user_attributes = [ ] ; <nl> - sc_enum_type = None } } ; <nl> - funs = { } ; typedefs = { } ; consts = { } ; records = { } } <nl> + [ ( " \ \ C " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> + sc_name = ( [ 3 : 7 - 8 ] , " \ \ C " ) ; <nl> + sc_tparams = <nl> + [ { Typing_defs_core . tp_variance = Invariant ; <nl> + tp_name = ( [ 3 : 15 - 16 ] , " T " ) ; tp_tparams = [ ] ; tp_constraints = [ ] ; <nl> + tp_reified = Reified ; tp_user_attributes = [ ] } <nl> + ] ; <nl> + sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> + sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> + sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; <nl> + sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> + sc_constructor = None ; sc_static_methods = [ ] ; sc_methods = [ ] ; <nl> + sc_user_attributes = [ ] ; sc_enum_type = None } ) ) ; <nl> + ( " \ \ X " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cabstract ; <nl> + sc_name = ( [ 5 : 16 - 17 ] , " \ \ X " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> + sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> + sc_implements = [ ] ; sc_consts = [ ] ; <nl> + sc_typeconsts = <nl> + [ { Shallow_decl_defs . stc_abstract = Typing_defs . TCConcrete ; <nl> + stc_constraint = None ; stc_name = ( [ 7 : 14 - 18 ] , " TFoo " ) ; <nl> + stc_type = <nl> + ( Some ( Rhint ( root | classes_reified_generics . php line 7 , characters 21 - 23 ) , <nl> + ( Tprim Tint ) ) ) ; <nl> + stc_enforceable = ( [ Pos . none ] , false ) ; <nl> + stc_reifiable = ( Some [ 6 : 5 - 16 ] ) } ; <nl> + { Shallow_decl_defs . stc_abstract = Typing_defs . TCConcrete ; <nl> + stc_constraint = None ; stc_name = ( [ 9 : 14 - 16 ] , " X2 " ) ; <nl> + stc_type = <nl> + ( Some ( Rhint ( root | classes_reified_generics . php line 9 , characters 19 - 31 ) , <nl> + ( Tapply ( ( [ 9 : 19 - 20 ] , " \ \ C " ) , <nl> + [ ( Rhint ( root | classes_reified_generics . php line 9 , characters 21 - 30 ) , <nl> + ( Taccess <nl> + ( ( Rhint ( root | classes_reified_generics . php line 9 , characters 21 - 24 ) , <nl> + Tthis ) , <nl> + [ ( [ 9 : 27 - 31 ] , " TFoo " ) ] ) ) ) <nl> + ] <nl> + ) ) ) ) ; <nl> + stc_enforceable = ( [ Pos . none ] , false ) ; stc_reifiable = None } <nl> + ] ; <nl> + sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> + sc_constructor = None ; sc_static_methods = [ ] ; sc_methods = [ ] ; <nl> + sc_user_attributes = [ ] ; sc_enum_type = None } ) ) <nl> + ] <nl> <nl> They matched ! <nl> mmm a / hphp / hack / test / decl / classes_require . php . exp <nl> ppp b / hphp / hack / test / decl / classes_require . php . exp <nl> <nl> - Parsed decls : <nl> - <nl> - { classes = <nl> - { " \ \ AirBus " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> - sc_name = ( [ 23 : 7 - 13 ] , " \ \ AirBus " ) ; sc_tparams = [ ] ; <nl> - sc_where_constraints = [ ] ; <nl> - sc_extends = <nl> - [ ( Rhint ( root | classes_require . php line 23 , characters 22 - 28 ) , <nl> - ( Tapply ( ( [ 23 : 22 - 29 ] , " \ \ Machine " ) , [ ] ) ) ) ] ; <nl> - sc_uses = <nl> - [ ( Rhint ( root | classes_require . php line 24 , characters 7 - 11 ) , <nl> - ( Tapply ( ( [ 24 : 7 - 12 ] , " \ \ Plane " ) , [ ] ) ) ) ] ; <nl> - sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> - sc_implements = <nl> - [ ( Rhint ( root | classes_require . php line 23 , characters 41 - 46 ) , <nl> - ( Tapply ( ( [ 23 : 41 - 47 ] , " \ \ Fliers " ) , [ ] ) ) ) ] ; <nl> - sc_consts = [ ] ; sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; sc_props = [ ] ; <nl> - sc_sprops = [ ] ; sc_constructor = None ; sc_static_methods = [ ] ; <nl> - sc_methods = <nl> - [ { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> - sm_memoizelsb = false ; sm_name = ( [ 26 : 19 - 22 ] , " fly " ) ; <nl> - sm_override = false ; sm_dynamicallycallable = false ; <nl> - sm_reactivity = None ; <nl> - sm_type = <nl> - ( Rwitness ( root | classes_require . php line 26 , characters 19 - 21 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | classes_require . php line 26 , characters 19 - 21 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | classes_require . php line 26 , characters 26 - 29 ) , <nl> - ( Tprim Tbool ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } <nl> - } ) ) ; <nl> - sm_visibility = Public ; sm_deprecated = None } <nl> - ] ; <nl> - sc_user_attributes = [ ] ; sc_enum_type = None } ; <nl> - " \ \ Fliers " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cinterface ; <nl> - sc_name = ( [ 8 : 11 - 17 ] , " \ \ Fliers " ) ; sc_tparams = [ ] ; <nl> - sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> - sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> - sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; <nl> - sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; sc_constructor = None ; <nl> - sc_static_methods = [ ] ; <nl> - sc_methods = <nl> - [ { Shallow_decl_defs . sm_abstract = true ; sm_final = false ; <nl> - sm_memoizelsb = false ; sm_name = ( [ 9 : 19 - 22 ] , " fly " ) ; <nl> - sm_override = false ; sm_dynamicallycallable = false ; <nl> - sm_reactivity = None ; <nl> - sm_type = <nl> - ( Rwitness ( root | classes_require . php line 9 , characters 19 - 21 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | classes_require . php line 9 , characters 19 - 21 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | classes_require . php line 9 , characters 26 - 29 ) , <nl> - ( Tprim Tbool ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } <nl> - } ) ) ; <nl> - sm_visibility = Public ; sm_deprecated = None } <nl> - ] ; <nl> - sc_user_attributes = [ ] ; sc_enum_type = None } ; <nl> - " \ \ Machine " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cabstract ; <nl> - sc_name = ( [ 3 : 16 - 23 ] , " \ \ Machine " ) ; sc_tparams = [ ] ; <nl> - sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> - sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> - sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; <nl> - sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; sc_constructor = None ; <nl> - sc_static_methods = [ ] ; <nl> - sc_methods = <nl> - [ { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> - sm_memoizelsb = false ; sm_name = ( [ 4 : 19 - 28 ] , " openDoors " ) ; <nl> - sm_override = false ; sm_dynamicallycallable = false ; <nl> - sm_reactivity = None ; <nl> - sm_type = <nl> - ( Rwitness ( root | classes_require . php line 4 , characters 19 - 27 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | classes_require . php line 4 , characters 19 - 27 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | classes_require . php line 4 , characters 32 - 35 ) , <nl> - ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } <nl> - } ) ) ; <nl> - sm_visibility = Public ; sm_deprecated = None } ; <nl> - { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> - sm_memoizelsb = false ; sm_name = ( [ 5 : 19 - 29 ] , " closeDoors " ) ; <nl> + [ ( " \ \ Machine " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cabstract ; <nl> + sc_name = ( [ 3 : 16 - 23 ] , " \ \ Machine " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> + sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> + sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; <nl> + sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> + sc_constructor = None ; sc_static_methods = [ ] ; <nl> + sc_methods = <nl> + [ { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> + sm_memoizelsb = false ; sm_name = ( [ 4 : 19 - 28 ] , " openDoors " ) ; <nl> sm_override = false ; sm_dynamicallycallable = false ; <nl> sm_reactivity = None ; <nl> sm_type = <nl> - ( Rwitness ( root | classes_require . php line 5 , characters 19 - 28 ) , <nl> + ( Rwitness ( root | classes_require . php line 4 , characters 19 - 27 ) , <nl> ( Tfun <nl> { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> ft_implicit_params = <nl> { capability = <nl> - ( Rhint ( root | classes_require . php line 5 , characters 19 - 28 ) , <nl> + ( Rhint ( root | classes_require . php line 4 , characters 19 - 27 ) , <nl> ( Tunion [ ] ) ) <nl> } ; <nl> ft_ret = <nl> { et_enforced = false ; <nl> et_type = <nl> - ( Rhint ( root | classes_require . php line 5 , characters 33 - 36 ) , <nl> + ( Rhint ( root | classes_require . php line 4 , characters 32 - 35 ) , <nl> ( Tprim Tvoid ) ) <nl> } ; <nl> ft_flags = <nl> Parsed decls : <nl> ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } <nl> } ) ) ; <nl> - sm_visibility = Public ; sm_deprecated = None } <nl> - ] ; <nl> - sc_user_attributes = [ ] ; sc_enum_type = None } ; <nl> - " \ \ Plane " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Ctrait ; <nl> - sc_name = ( [ 12 : 7 - 12 ] , " \ \ Plane " ) ; sc_tparams = [ ] ; <nl> - sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> - sc_xhp_attr_uses = [ ] ; <nl> - sc_req_extends = <nl> - [ ( Rhint ( root | classes_require . php line 13 , characters 19 - 25 ) , <nl> - ( Tapply ( ( [ 13 : 19 - 26 ] , " \ \ Machine " ) , [ ] ) ) ) ] ; <nl> - sc_req_implements = <nl> - [ ( Rhint ( root | classes_require . php line 14 , characters 22 - 27 ) , <nl> - ( Tapply ( ( [ 14 : 22 - 28 ] , " \ \ Fliers " ) , [ ] ) ) ) ] ; <nl> - sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; <nl> - sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; sc_constructor = None ; <nl> - sc_static_methods = [ ] ; <nl> - sc_methods = <nl> - [ { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> - sm_memoizelsb = false ; sm_name = ( [ 16 : 19 - 26 ] , " takeOff " ) ; <nl> - sm_override = false ; sm_dynamicallycallable = false ; <nl> - sm_reactivity = None ; <nl> - sm_type = <nl> - ( Rwitness ( root | classes_require . php line 16 , characters 19 - 25 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | classes_require . php line 16 , characters 19 - 25 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | classes_require . php line 16 , characters 30 - 33 ) , <nl> - ( Tprim Tbool ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } <nl> - } ) ) ; <nl> - sm_visibility = Public ; sm_deprecated = None } <nl> - ] ; <nl> - sc_user_attributes = [ ] ; sc_enum_type = None } } ; <nl> - funs = { } ; typedefs = { } ; consts = { } ; records = { } } <nl> + sm_visibility = Public ; sm_deprecated = None } ; <nl> + { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> + sm_memoizelsb = false ; sm_name = ( [ 5 : 19 - 29 ] , " closeDoors " ) ; <nl> + sm_override = false ; sm_dynamicallycallable = false ; <nl> + sm_reactivity = None ; <nl> + sm_type = <nl> + ( Rwitness ( root | classes_require . php line 5 , characters 19 - 28 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | classes_require . php line 5 , characters 19 - 28 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | classes_require . php line 5 , characters 33 - 36 ) , <nl> + ( Tprim Tvoid ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; <nl> + ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + sm_visibility = Public ; sm_deprecated = None } <nl> + ] ; <nl> + sc_user_attributes = [ ] ; sc_enum_type = None } ) ) ; <nl> + ( " \ \ Fliers " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cinterface ; <nl> + sc_name = ( [ 8 : 11 - 17 ] , " \ \ Fliers " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> + sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> + sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; <nl> + sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> + sc_constructor = None ; sc_static_methods = [ ] ; <nl> + sc_methods = <nl> + [ { Shallow_decl_defs . sm_abstract = true ; sm_final = false ; <nl> + sm_memoizelsb = false ; sm_name = ( [ 9 : 19 - 22 ] , " fly " ) ; <nl> + sm_override = false ; sm_dynamicallycallable = false ; <nl> + sm_reactivity = None ; <nl> + sm_type = <nl> + ( Rwitness ( root | classes_require . php line 9 , characters 19 - 21 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | classes_require . php line 9 , characters 19 - 21 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | classes_require . php line 9 , characters 26 - 29 ) , <nl> + ( Tprim Tbool ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; <nl> + ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + sm_visibility = Public ; sm_deprecated = None } <nl> + ] ; <nl> + sc_user_attributes = [ ] ; sc_enum_type = None } ) ) ; <nl> + ( " \ \ Plane " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Ctrait ; <nl> + sc_name = ( [ 12 : 7 - 12 ] , " \ \ Plane " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> + sc_xhp_attr_uses = [ ] ; <nl> + sc_req_extends = <nl> + [ ( Rhint ( root | classes_require . php line 13 , characters 19 - 25 ) , <nl> + ( Tapply ( ( [ 13 : 19 - 26 ] , " \ \ Machine " ) , [ ] ) ) ) ] ; <nl> + sc_req_implements = <nl> + [ ( Rhint ( root | classes_require . php line 14 , characters 22 - 27 ) , <nl> + ( Tapply ( ( [ 14 : 22 - 28 ] , " \ \ Fliers " ) , [ ] ) ) ) ] ; <nl> + sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; <nl> + sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> + sc_constructor = None ; sc_static_methods = [ ] ; <nl> + sc_methods = <nl> + [ { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> + sm_memoizelsb = false ; sm_name = ( [ 16 : 19 - 26 ] , " takeOff " ) ; <nl> + sm_override = false ; sm_dynamicallycallable = false ; <nl> + sm_reactivity = None ; <nl> + sm_type = <nl> + ( Rwitness ( root | classes_require . php line 16 , characters 19 - 25 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | classes_require . php line 16 , characters 19 - 25 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | classes_require . php line 16 , characters 30 - 33 ) , <nl> + ( Tprim Tbool ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; <nl> + ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + sm_visibility = Public ; sm_deprecated = None } <nl> + ] ; <nl> + sc_user_attributes = [ ] ; sc_enum_type = None } ) ) ; <nl> + ( " \ \ AirBus " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> + sc_name = ( [ 23 : 7 - 13 ] , " \ \ AirBus " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = [ ] ; <nl> + sc_extends = <nl> + [ ( Rhint ( root | classes_require . php line 23 , characters 22 - 28 ) , <nl> + ( Tapply ( ( [ 23 : 22 - 29 ] , " \ \ Machine " ) , [ ] ) ) ) ] ; <nl> + sc_uses = <nl> + [ ( Rhint ( root | classes_require . php line 24 , characters 7 - 11 ) , <nl> + ( Tapply ( ( [ 24 : 7 - 12 ] , " \ \ Plane " ) , [ ] ) ) ) ] ; <nl> + sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> + sc_implements = <nl> + [ ( Rhint ( root | classes_require . php line 23 , characters 41 - 46 ) , <nl> + ( Tapply ( ( [ 23 : 41 - 47 ] , " \ \ Fliers " ) , [ ] ) ) ) ] ; <nl> + sc_consts = [ ] ; sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; sc_props = [ ] ; <nl> + sc_sprops = [ ] ; sc_constructor = None ; sc_static_methods = [ ] ; <nl> + sc_methods = <nl> + [ { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> + sm_memoizelsb = false ; sm_name = ( [ 26 : 19 - 22 ] , " fly " ) ; <nl> + sm_override = false ; sm_dynamicallycallable = false ; <nl> + sm_reactivity = None ; <nl> + sm_type = <nl> + ( Rwitness ( root | classes_require . php line 26 , characters 19 - 21 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | classes_require . php line 26 , characters 19 - 21 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | classes_require . php line 26 , characters 26 - 29 ) , <nl> + ( Tprim Tbool ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; <nl> + ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + sm_visibility = Public ; sm_deprecated = None } <nl> + ] ; <nl> + sc_user_attributes = [ ] ; sc_enum_type = None } ) ) <nl> + ] <nl> <nl> They matched ! <nl> mmm a / hphp / hack / test / decl / classes_typeconst . php . exp <nl> ppp b / hphp / hack / test / decl / classes_typeconst . php . exp <nl> <nl> - Parsed decls : <nl> - <nl> - { classes = <nl> - { " \ \ C " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> - sc_name = ( [ 4 : 7 - 8 ] , " \ \ C " ) ; sc_tparams = [ ] ; sc_where_constraints = [ ] ; <nl> - sc_extends = [ ] ; sc_uses = [ ] ; sc_xhp_attr_uses = [ ] ; <nl> - sc_req_extends = [ ] ; sc_req_implements = [ ] ; sc_implements = [ ] ; <nl> - sc_consts = [ ] ; <nl> - sc_typeconsts = <nl> - [ { Shallow_decl_defs . stc_abstract = Typing_defs . TCConcrete ; <nl> - stc_constraint = None ; stc_name = ( [ 5 : 14 - 15 ] , " T " ) ; <nl> - stc_type = <nl> - ( Some ( Rhint ( root | classes_typeconst . php line 5 , characters 18 - 20 ) , <nl> - ( Tprim Tint ) ) ) ; <nl> - stc_enforceable = ( [ Pos . none ] , false ) ; stc_reifiable = None } ; <nl> - { Shallow_decl_defs . stc_abstract = Typing_defs . TCConcrete ; <nl> - stc_constraint = None ; stc_name = ( [ 15 : 14 - 16 ] , " T2 " ) ; <nl> + [ ( " \ \ C " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> + sc_name = ( [ 4 : 7 - 8 ] , " \ \ C " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> + sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> + sc_implements = [ ] ; sc_consts = [ ] ; <nl> + sc_typeconsts = <nl> + [ { Shallow_decl_defs . stc_abstract = Typing_defs . TCConcrete ; <nl> + stc_constraint = None ; stc_name = ( [ 5 : 14 - 15 ] , " T " ) ; <nl> stc_type = <nl> - ( Some ( Rhint ( root | classes_typeconst . php line 15 , characters 19 - 24 ) , <nl> - ( Tprim Tstring ) ) ) ; <nl> - stc_enforceable = ( [ Pos . none ] , false ) ; stc_reifiable = None } <nl> - ] ; <nl> - sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; sc_constructor = None ; <nl> - sc_static_methods = [ ] ; <nl> - sc_methods = <nl> - [ { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> - sm_memoizelsb = false ; sm_name = ( [ 7 : 19 - 20 ] , " f " ) ; <nl> - sm_override = false ; sm_dynamicallycallable = false ; <nl> - sm_reactivity = None ; <nl> - sm_type = <nl> - ( Rwitness ( root | classes_typeconst . php line 7 , characters 19 - 19 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | classes_typeconst . php line 7 , characters 19 - 19 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | classes_typeconst . php line 7 , characters 24 - 30 ) , <nl> - ( Taccess <nl> - ( ( Rhint ( root | classes_typeconst . php line 7 , characters 24 - 27 ) , <nl> - Tthis ) , <nl> - [ ( [ 7 : 30 - 31 ] , " T " ) ] ) ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } <nl> - } ) ) ; <nl> - sm_visibility = Public ; sm_deprecated = None } ; <nl> - { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> - sm_memoizelsb = false ; sm_name = ( [ 11 : 19 - 20 ] , " g " ) ; <nl> + ( Some ( Rhint ( root | classes_typeconst . php line 5 , characters 18 - 20 ) , <nl> + ( Tprim Tint ) ) ) ; <nl> + stc_enforceable = ( [ Pos . none ] , false ) ; stc_reifiable = None } ; <nl> + { Shallow_decl_defs . stc_abstract = Typing_defs . TCConcrete ; <nl> + stc_constraint = None ; stc_name = ( [ 15 : 14 - 16 ] , " T2 " ) ; <nl> + stc_type = <nl> + ( Some ( Rhint ( root | classes_typeconst . php line 15 , characters 19 - 24 ) , <nl> + ( Tprim Tstring ) ) ) ; <nl> + stc_enforceable = ( [ Pos . none ] , false ) ; stc_reifiable = None } <nl> + ] ; <nl> + sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> + sc_constructor = None ; sc_static_methods = [ ] ; <nl> + sc_methods = <nl> + [ { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> + sm_memoizelsb = false ; sm_name = ( [ 7 : 19 - 20 ] , " f " ) ; <nl> sm_override = false ; sm_dynamicallycallable = false ; <nl> sm_reactivity = None ; <nl> sm_type = <nl> - ( Rwitness ( root | classes_typeconst . php line 11 , characters 19 - 19 ) , <nl> + ( Rwitness ( root | classes_typeconst . php line 7 , characters 19 - 19 ) , <nl> ( Tfun <nl> { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> ft_implicit_params = <nl> { capability = <nl> - ( Rhint ( root | classes_typeconst . php line 11 , characters 19 - 19 ) , <nl> + ( Rhint ( root | classes_typeconst . php line 7 , characters 19 - 19 ) , <nl> ( Tunion [ ] ) ) <nl> } ; <nl> ft_ret = <nl> { et_enforced = false ; <nl> et_type = <nl> - ( Rhint ( root | classes_typeconst . php line 11 , characters 24 - 31 ) , <nl> + ( Rhint ( root | classes_typeconst . php line 7 , characters 24 - 30 ) , <nl> ( Taccess <nl> - ( ( Rhint ( root | classes_typeconst . php line 11 , characters 24 - 27 ) , <nl> + ( ( Rhint ( root | classes_typeconst . php line 7 , characters 24 - 27 ) , <nl> Tthis ) , <nl> - [ ( [ 11 : 30 - 32 ] , " T2 " ) ] ) ) ) <nl> + [ ( [ 7 : 30 - 31 ] , " T " ) ] ) ) ) <nl> } ; <nl> ft_flags = <nl> ( make_ft_flags FSync None ~ return_disposable : false <nl> ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } <nl> } ) ) ; <nl> - sm_visibility = Public ; sm_deprecated = None } <nl> - ] ; <nl> - sc_user_attributes = [ ] ; sc_enum_type = None } ; <nl> - " \ \ C2 " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cabstract ; <nl> - sc_name = ( [ 18 : 16 - 18 ] , " \ \ C2 " ) ; sc_tparams = [ ] ; <nl> - sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> - sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> - sc_implements = [ ] ; sc_consts = [ ] ; <nl> - sc_typeconsts = <nl> - [ { Shallow_decl_defs . stc_abstract = ( Typing_defs . TCAbstract None ) ; <nl> - stc_constraint = <nl> - ( Some ( Rhint ( root | classes_typeconst . php line 19 , characters 37 - 37 ) , <nl> - ( Tapply ( ( [ 19 : 37 - 38 ] , " \ \ C " ) , [ ] ) ) ) ) ; <nl> - stc_name = ( [ 19 : 23 - 33 ] , " TConstType " ) ; stc_type = None ; <nl> - stc_enforceable = ( [ Pos . none ] , false ) ; stc_reifiable = None } <nl> - ] ; <nl> - sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; sc_constructor = None ; <nl> - sc_static_methods = [ ] ; <nl> - sc_methods = <nl> - [ { Shallow_decl_defs . sm_abstract = true ; sm_final = false ; <nl> - sm_memoizelsb = false ; sm_name = ( [ 20 : 28 - 39 ] , " instantiate " ) ; <nl> - sm_override = false ; sm_dynamicallycallable = false ; <nl> - sm_reactivity = None ; <nl> - sm_type = <nl> - ( Rwitness ( root | classes_typeconst . php line 20 , characters 28 - 38 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; <nl> - ft_params = <nl> - [ { fp_pos = [ 20 : 60 - 68 ] ; fp_name = ( Some " $ request " ) ; <nl> - fp_type = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | classes_typeconst . php line 20 , characters 40 - 58 ) , <nl> - ( Taccess <nl> - ( ( Rhint ( root | classes_typeconst . php line 20 , characters 40 - 43 ) , <nl> - Tthis ) , <nl> - [ ( [ 20 : 46 - 56 ] , " TConstType " ) ; ( [ 20 : 58 - 59 ] , " T " ) ] ) ) ) <nl> - } ; <nl> - fp_flags = <nl> - ( make_fp_flags ~ mutability : None ~ accept_disposable : false <nl> - ~ has_default : false ~ mode : Typing_defs_core . FPnormal <nl> - ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> - } <nl> - ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | classes_typeconst . php line 20 , characters 28 - 38 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | classes_typeconst . php line 20 , characters 71 - 86 ) , <nl> - ( Taccess <nl> - ( ( Rhint ( root | classes_typeconst . php line 20 , characters 71 - 74 ) , <nl> - Tthis ) , <nl> - [ ( [ 20 : 77 - 87 ] , " TConstType " ) ] ) ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } <nl> - } ) ) ; <nl> - sm_visibility = Public ; sm_deprecated = None } <nl> - ] ; <nl> - sc_user_attributes = [ ] ; sc_enum_type = None } } ; <nl> - funs = { } ; typedefs = { } ; consts = { } ; records = { } } <nl> + sm_visibility = Public ; sm_deprecated = None } ; <nl> + { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> + sm_memoizelsb = false ; sm_name = ( [ 11 : 19 - 20 ] , " g " ) ; <nl> + sm_override = false ; sm_dynamicallycallable = false ; <nl> + sm_reactivity = None ; <nl> + sm_type = <nl> + ( Rwitness ( root | classes_typeconst . php line 11 , characters 19 - 19 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | classes_typeconst . php line 11 , characters 19 - 19 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | classes_typeconst . php line 11 , characters 24 - 31 ) , <nl> + ( Taccess <nl> + ( ( Rhint ( root | classes_typeconst . php line 11 , characters 24 - 27 ) , <nl> + Tthis ) , <nl> + [ ( [ 11 : 30 - 32 ] , " T2 " ) ] ) ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; <nl> + ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + sm_visibility = Public ; sm_deprecated = None } <nl> + ] ; <nl> + sc_user_attributes = [ ] ; sc_enum_type = None } ) ) ; <nl> + ( " \ \ C2 " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cabstract ; <nl> + sc_name = ( [ 18 : 16 - 18 ] , " \ \ C2 " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> + sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> + sc_implements = [ ] ; sc_consts = [ ] ; <nl> + sc_typeconsts = <nl> + [ { Shallow_decl_defs . stc_abstract = ( Typing_defs . TCAbstract None ) ; <nl> + stc_constraint = <nl> + ( Some ( Rhint ( root | classes_typeconst . php line 19 , characters 37 - 37 ) , <nl> + ( Tapply ( ( [ 19 : 37 - 38 ] , " \ \ C " ) , [ ] ) ) ) ) ; <nl> + stc_name = ( [ 19 : 23 - 33 ] , " TConstType " ) ; stc_type = None ; <nl> + stc_enforceable = ( [ Pos . none ] , false ) ; stc_reifiable = None } <nl> + ] ; <nl> + sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> + sc_constructor = None ; sc_static_methods = [ ] ; <nl> + sc_methods = <nl> + [ { Shallow_decl_defs . sm_abstract = true ; sm_final = false ; <nl> + sm_memoizelsb = false ; sm_name = ( [ 20 : 28 - 39 ] , " instantiate " ) ; <nl> + sm_override = false ; sm_dynamicallycallable = false ; <nl> + sm_reactivity = None ; <nl> + sm_type = <nl> + ( Rwitness ( root | classes_typeconst . php line 20 , characters 28 - 38 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; <nl> + ft_params = <nl> + [ { fp_pos = [ 20 : 60 - 68 ] ; fp_name = ( Some " $ request " ) ; <nl> + fp_type = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | classes_typeconst . php line 20 , characters 40 - 58 ) , <nl> + ( Taccess <nl> + ( ( Rhint ( root | classes_typeconst . php line 20 , characters 40 - 43 ) , <nl> + Tthis ) , <nl> + [ ( [ 20 : 46 - 56 ] , " TConstType " ) ; ( [ 20 : 58 - 59 ] , " T " ) ] ) ) ) <nl> + } ; <nl> + fp_flags = <nl> + ( make_fp_flags ~ mutability : None ~ accept_disposable : false <nl> + ~ has_default : false ~ mode : Typing_defs_core . FPnormal <nl> + ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> + } <nl> + ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | classes_typeconst . php line 20 , characters 28 - 38 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | classes_typeconst . php line 20 , characters 71 - 86 ) , <nl> + ( Taccess <nl> + ( ( Rhint ( root | classes_typeconst . php line 20 , characters 71 - 74 ) , <nl> + Tthis ) , <nl> + [ ( [ 20 : 77 - 87 ] , " TConstType " ) ] ) ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; <nl> + ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + sm_visibility = Public ; sm_deprecated = None } <nl> + ] ; <nl> + sc_user_attributes = [ ] ; sc_enum_type = None } ) ) <nl> + ] <nl> <nl> They matched ! <nl> mmm a / hphp / hack / test / decl / classname . php . exp <nl> ppp b / hphp / hack / test / decl / classname . php . exp <nl> <nl> - Parsed decls : <nl> - <nl> - { classes = <nl> - { " \ \ E " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cenum ; <nl> - sc_name = ( [ 6 : 6 - 7 ] , " \ \ E " ) ; sc_tparams = [ ] ; sc_where_constraints = [ ] ; <nl> - sc_extends = <nl> - [ ( Rhint ( root | classname . php line 6 , characters 6 - 6 ) , <nl> - ( Tapply ( ( [ 6 : 6 - 7 ] , " \ \ HH \ \ BuiltinEnum " ) , <nl> - [ ( Rhint ( root | classname . php line 6 , characters 6 - 6 ) , <nl> - ( Tapply ( ( [ 6 : 6 - 7 ] , " \ \ E " ) , [ ] ) ) ) ] <nl> - ) ) ) <nl> - ] ; <nl> - sc_uses = [ ] ; sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; <nl> - sc_req_implements = [ ] ; sc_implements = [ ] ; <nl> - sc_consts = <nl> - [ { Shallow_decl_defs . scc_abstract = false ; scc_name = ( [ 7 : 3 - 6 ] , " FOO " ) ; <nl> - scc_type = <nl> - ( Rwitness ( root | classname . php line 7 , characters 3 - 5 ) , Tany ) } <nl> - ] ; <nl> - sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> - sc_constructor = None ; sc_static_methods = [ ] ; sc_methods = [ ] ; <nl> - sc_user_attributes = [ ] ; <nl> - sc_enum_type = <nl> - ( Some { Typing_defs . te_base = <nl> - ( Rhint ( root | classname . php line 6 , characters 9 - 14 ) , <nl> - ( Tprim Tstring ) ) ; <nl> - te_constraint = None ; te_includes = [ ] ; te_enum_class = false } ) <nl> - } ; <nl> - " \ \ Foo " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> - sc_name = ( [ 3 : 7 - 10 ] , " \ \ Foo " ) ; sc_tparams = [ ] ; <nl> - sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> - sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> - sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; <nl> - sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; sc_constructor = None ; <nl> - sc_static_methods = [ ] ; sc_methods = [ ] ; sc_user_attributes = [ ] ; <nl> - sc_enum_type = None } } ; <nl> - funs = { } ; typedefs = { } ; consts = { } ; records = { } } <nl> + [ ( " \ \ Foo " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> + sc_name = ( [ 3 : 7 - 10 ] , " \ \ Foo " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> + sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> + sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; <nl> + sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> + sc_constructor = None ; sc_static_methods = [ ] ; sc_methods = [ ] ; <nl> + sc_user_attributes = [ ] ; sc_enum_type = None } ) ) ; <nl> + ( " \ \ E " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cenum ; <nl> + sc_name = ( [ 6 : 6 - 7 ] , " \ \ E " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = [ ] ; <nl> + sc_extends = <nl> + [ ( Rhint ( root | classname . php line 6 , characters 6 - 6 ) , <nl> + ( Tapply ( ( [ 6 : 6 - 7 ] , " \ \ HH \ \ BuiltinEnum " ) , <nl> + [ ( Rhint ( root | classname . php line 6 , characters 6 - 6 ) , <nl> + ( Tapply ( ( [ 6 : 6 - 7 ] , " \ \ E " ) , [ ] ) ) ) ] <nl> + ) ) ) <nl> + ] ; <nl> + sc_uses = [ ] ; sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; <nl> + sc_req_implements = [ ] ; sc_implements = [ ] ; <nl> + sc_consts = <nl> + [ { Shallow_decl_defs . scc_abstract = false ; <nl> + scc_name = ( [ 7 : 3 - 6 ] , " FOO " ) ; <nl> + scc_type = <nl> + ( Rwitness ( root | classname . php line 7 , characters 3 - 5 ) , Tany ) } <nl> + ] ; <nl> + sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> + sc_constructor = None ; sc_static_methods = [ ] ; sc_methods = [ ] ; <nl> + sc_user_attributes = [ ] ; <nl> + sc_enum_type = <nl> + ( Some { Typing_defs . te_base = <nl> + ( Rhint ( root | classname . php line 6 , characters 9 - 14 ) , <nl> + ( Tprim Tstring ) ) ; <nl> + te_constraint = None ; te_includes = [ ] ; te_enum_class = false <nl> + } ) <nl> + } ) ) <nl> + ] <nl> <nl> They matched ! <nl> mmm a / hphp / hack / test / decl / classname_in_namespace . php . exp <nl> ppp b / hphp / hack / test / decl / classname_in_namespace . php . exp <nl> <nl> - Parsed decls : <nl> - <nl> - { classes = { } ; funs = { } ; <nl> - typedefs = <nl> - { " \ \ A " - > <nl> - { Typing_defs . td_pos = [ 4 : 8 - 9 ] ; td_vis = Transparent ; td_tparams = [ ] ; <nl> - td_constraint = None ; <nl> - td_type = <nl> - ( Rhint ( root | classname_in_namespace . php line 4 , characters 12 - 23 ) , <nl> - ( Tapply ( ( [ 4 : 12 - 21 ] , " \ \ HH \ \ classname " ) , <nl> - [ ( Rhint ( root | classname_in_namespace . php line 4 , characters 22 - 22 ) , <nl> - ( Tapply ( ( [ 4 : 22 - 23 ] , " \ \ C " ) , [ ] ) ) ) ] <nl> - ) ) ) <nl> - } ; <nl> - " \ \ B " - > <nl> - { Typing_defs . td_pos = [ 5 : 8 - 9 ] ; td_vis = Transparent ; td_tparams = [ ] ; <nl> - td_constraint = None ; <nl> - td_type = <nl> - ( Rhint ( root | classname_in_namespace . php line 5 , characters 12 - 24 ) , <nl> - ( Tapply ( ( [ 5 : 12 - 22 ] , " \ \ classname " ) , <nl> - [ ( Rhint ( root | classname_in_namespace . php line 5 , characters 23 - 23 ) , <nl> - ( Tapply ( ( [ 5 : 23 - 24 ] , " \ \ C " ) , [ ] ) ) ) ] <nl> - ) ) ) <nl> - } ; <nl> - " \ \ NS \ \ A " - > <nl> - { Typing_defs . td_pos = [ 8 : 10 - 11 ] ; td_vis = Transparent ; td_tparams = [ ] ; <nl> - td_constraint = None ; <nl> - td_type = <nl> - ( Rhint ( root | classname_in_namespace . php line 8 , characters 14 - 25 ) , <nl> - ( Tapply ( ( [ 8 : 14 - 23 ] , " \ \ HH \ \ classname " ) , <nl> - [ ( Rhint ( root | classname_in_namespace . php line 8 , characters 24 - 24 ) , <nl> - ( Tapply ( ( [ 8 : 24 - 25 ] , " \ \ NS \ \ C " ) , [ ] ) ) ) ] <nl> - ) ) ) <nl> - } ; <nl> - " \ \ NS \ \ B " - > <nl> - { Typing_defs . td_pos = [ 9 : 10 - 11 ] ; td_vis = Transparent ; td_tparams = [ ] ; <nl> - td_constraint = None ; <nl> - td_type = <nl> - ( Rhint ( root | classname_in_namespace . php line 9 , characters 14 - 26 ) , <nl> - ( Tapply ( ( [ 9 : 14 - 24 ] , " \ \ classname " ) , <nl> - [ ( Rhint ( root | classname_in_namespace . php line 9 , characters 25 - 25 ) , <nl> - ( Tapply ( ( [ 9 : 25 - 26 ] , " \ \ NS \ \ C " ) , [ ] ) ) ) ] <nl> - ) ) ) <nl> - } } ; <nl> - consts = { } ; records = { } } <nl> + [ ( " \ \ A " , <nl> + ( Shallow_decl_defs . Typedef <nl> + { Typing_defs . td_pos = [ 4 : 8 - 9 ] ; td_vis = Transparent ; td_tparams = [ ] ; <nl> + td_constraint = None ; <nl> + td_type = <nl> + ( Rhint ( root | classname_in_namespace . php line 4 , characters 12 - 23 ) , <nl> + ( Tapply ( ( [ 4 : 12 - 21 ] , " \ \ HH \ \ classname " ) , <nl> + [ ( Rhint ( root | classname_in_namespace . php line 4 , characters 22 - 22 ) , <nl> + ( Tapply ( ( [ 4 : 22 - 23 ] , " \ \ C " ) , [ ] ) ) ) ] <nl> + ) ) ) <nl> + } ) ) ; <nl> + ( " \ \ B " , <nl> + ( Shallow_decl_defs . Typedef <nl> + { Typing_defs . td_pos = [ 5 : 8 - 9 ] ; td_vis = Transparent ; td_tparams = [ ] ; <nl> + td_constraint = None ; <nl> + td_type = <nl> + ( Rhint ( root | classname_in_namespace . php line 5 , characters 12 - 24 ) , <nl> + ( Tapply ( ( [ 5 : 12 - 22 ] , " \ \ classname " ) , <nl> + [ ( Rhint ( root | classname_in_namespace . php line 5 , characters 23 - 23 ) , <nl> + ( Tapply ( ( [ 5 : 23 - 24 ] , " \ \ C " ) , [ ] ) ) ) ] <nl> + ) ) ) <nl> + } ) ) ; <nl> + ( " \ \ NS \ \ A " , <nl> + ( Shallow_decl_defs . Typedef <nl> + { Typing_defs . td_pos = [ 8 : 10 - 11 ] ; td_vis = Transparent ; <nl> + td_tparams = [ ] ; td_constraint = None ; <nl> + td_type = <nl> + ( Rhint ( root | classname_in_namespace . php line 8 , characters 14 - 25 ) , <nl> + ( Tapply ( ( [ 8 : 14 - 23 ] , " \ \ HH \ \ classname " ) , <nl> + [ ( Rhint ( root | classname_in_namespace . php line 8 , characters 24 - 24 ) , <nl> + ( Tapply ( ( [ 8 : 24 - 25 ] , " \ \ NS \ \ C " ) , [ ] ) ) ) ] <nl> + ) ) ) <nl> + } ) ) ; <nl> + ( " \ \ NS \ \ B " , <nl> + ( Shallow_decl_defs . Typedef <nl> + { Typing_defs . td_pos = [ 9 : 10 - 11 ] ; td_vis = Transparent ; <nl> + td_tparams = [ ] ; td_constraint = None ; <nl> + td_type = <nl> + ( Rhint ( root | classname_in_namespace . php line 9 , characters 14 - 26 ) , <nl> + ( Tapply ( ( [ 9 : 14 - 24 ] , " \ \ classname " ) , <nl> + [ ( Rhint ( root | classname_in_namespace . php line 9 , characters 25 - 25 ) , <nl> + ( Tapply ( ( [ 9 : 25 - 26 ] , " \ \ NS \ \ C " ) , [ ] ) ) ) ] <nl> + ) ) ) <nl> + } ) ) <nl> + ] <nl> <nl> They matched ! <nl> mmm a / hphp / hack / test / decl / const_missing_hint . php . exp <nl> ppp b / hphp / hack / test / decl / const_missing_hint . php . exp <nl> <nl> - Parsed decls : <nl> - <nl> - { classes = <nl> - { " \ \ E " - > <nl> - { Shallow_decl_defs . sc_mode = Mpartial ; sc_final = false ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cenum ; <nl> - sc_name = ( [ 13 : 6 - 7 ] , " \ \ E " ) ; sc_tparams = [ ] ; <nl> - sc_where_constraints = [ ] ; <nl> - sc_extends = <nl> - [ ( Rhint ( root | const_missing_hint . php line 13 , characters 6 - 6 ) , <nl> - ( Tapply ( ( [ 13 : 6 - 7 ] , " \ \ HH \ \ BuiltinEnum " ) , <nl> - [ ( Rhint ( root | const_missing_hint . php line 13 , characters 6 - 6 ) , <nl> - ( Tapply ( ( [ 13 : 6 - 7 ] , " \ \ E " ) , [ ] ) ) ) ] <nl> - ) ) ) <nl> - ] ; <nl> - sc_uses = [ ] ; sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; <nl> - sc_req_implements = [ ] ; sc_implements = [ ] ; <nl> - sc_consts = <nl> - [ { Shallow_decl_defs . scc_abstract = false ; <nl> - scc_name = ( [ 14 : 3 - 12 ] , " FromConst " ) ; <nl> - scc_type = <nl> - ( Rwitness ( root | const_missing_hint . php line 14 , characters 3 - 11 ) , <nl> - Tany ) <nl> - } <nl> - ] ; <nl> - sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> - sc_constructor = None ; sc_static_methods = [ ] ; sc_methods = [ ] ; <nl> - sc_user_attributes = [ ] ; <nl> - sc_enum_type = <nl> - ( Some { Typing_defs . te_base = <nl> - ( Rhint ( root | const_missing_hint . php line 13 , characters 10 - 12 ) , <nl> - ( Tprim Tint ) ) ; <nl> - te_constraint = None ; te_includes = [ ] ; te_enum_class = false } ) <nl> - } } ; <nl> - funs = { } ; typedefs = { } ; <nl> - consts = <nl> - { " \ \ CBool " - > <nl> - { Typing_defs . cd_pos = [ 4 : 7 - 12 ] ; <nl> - cd_type = <nl> - ( Rwitness ( root | const_missing_hint . php line 4 , characters 15 - 18 ) , <nl> - ( Tprim Tbool ) ) <nl> - } ; <nl> - " \ \ CInt " - > <nl> - { Typing_defs . cd_pos = [ 3 : 7 - 11 ] ; <nl> - cd_type = <nl> - ( Rwitness ( root | const_missing_hint . php line 3 , characters 14 - 14 ) , <nl> - ( Tprim Tint ) ) <nl> - } ; <nl> - " \ \ FromConst " - > <nl> - { Typing_defs . cd_pos = [ 11 : 7 - 16 ] ; <nl> - cd_type = <nl> - ( Rwitness ( root | const_missing_hint . php line 11 , characters 7 - 15 ) , Tany ) <nl> - } ; <nl> - " \ \ Uminus " - > <nl> - { Typing_defs . cd_pos = [ 9 : 7 - 13 ] ; <nl> - cd_type = <nl> - ( Rwitness ( root | const_missing_hint . php line 9 , characters 16 - 17 ) , <nl> - ( Tprim Tint ) ) <nl> - } ; <nl> - " \ \ Unot " - > <nl> - { Typing_defs . cd_pos = [ 7 : 7 - 11 ] ; <nl> - cd_type = <nl> - ( Rwitness ( root | const_missing_hint . php line 7 , characters 7 - 10 ) , Tany ) <nl> - } ; <nl> - " \ \ Uplus " - > <nl> - { Typing_defs . cd_pos = [ 8 : 7 - 12 ] ; <nl> - cd_type = <nl> - ( Rwitness ( root | const_missing_hint . php line 8 , characters 15 - 16 ) , <nl> - ( Tprim Tint ) ) <nl> - } ; <nl> - " \ \ Utild " - > <nl> - { Typing_defs . cd_pos = [ 6 : 7 - 12 ] ; <nl> - cd_type = <nl> - ( Rwitness ( root | const_missing_hint . php line 6 , characters 7 - 11 ) , Tany ) <nl> - } } ; <nl> - records = { } } <nl> + [ ( " \ \ CInt " , <nl> + ( Shallow_decl_defs . Const <nl> + { Typing_defs . cd_pos = [ 3 : 7 - 11 ] ; <nl> + cd_type = <nl> + ( Rwitness ( root | const_missing_hint . php line 3 , characters 14 - 14 ) , <nl> + ( Tprim Tint ) ) <nl> + } ) ) ; <nl> + ( " \ \ CBool " , <nl> + ( Shallow_decl_defs . Const <nl> + { Typing_defs . cd_pos = [ 4 : 7 - 12 ] ; <nl> + cd_type = <nl> + ( Rwitness ( root | const_missing_hint . php line 4 , characters 15 - 18 ) , <nl> + ( Tprim Tbool ) ) <nl> + } ) ) ; <nl> + ( " \ \ Utild " , <nl> + ( Shallow_decl_defs . Const <nl> + { Typing_defs . cd_pos = [ 6 : 7 - 12 ] ; <nl> + cd_type = <nl> + ( Rwitness ( root | const_missing_hint . php line 6 , characters 7 - 11 ) , Tany ) <nl> + } ) ) ; <nl> + ( " \ \ Unot " , <nl> + ( Shallow_decl_defs . Const <nl> + { Typing_defs . cd_pos = [ 7 : 7 - 11 ] ; <nl> + cd_type = <nl> + ( Rwitness ( root | const_missing_hint . php line 7 , characters 7 - 10 ) , Tany ) <nl> + } ) ) ; <nl> + ( " \ \ Uplus " , <nl> + ( Shallow_decl_defs . Const <nl> + { Typing_defs . cd_pos = [ 8 : 7 - 12 ] ; <nl> + cd_type = <nl> + ( Rwitness ( root | const_missing_hint . php line 8 , characters 15 - 16 ) , <nl> + ( Tprim Tint ) ) <nl> + } ) ) ; <nl> + ( " \ \ Uminus " , <nl> + ( Shallow_decl_defs . Const <nl> + { Typing_defs . cd_pos = [ 9 : 7 - 13 ] ; <nl> + cd_type = <nl> + ( Rwitness ( root | const_missing_hint . php line 9 , characters 16 - 17 ) , <nl> + ( Tprim Tint ) ) <nl> + } ) ) ; <nl> + ( " \ \ FromConst " , <nl> + ( Shallow_decl_defs . Const <nl> + { Typing_defs . cd_pos = [ 11 : 7 - 16 ] ; <nl> + cd_type = <nl> + ( Rwitness ( root | const_missing_hint . php line 11 , characters 7 - 15 ) , <nl> + Tany ) <nl> + } ) ) ; <nl> + ( " \ \ E " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mpartial ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cenum ; <nl> + sc_name = ( [ 13 : 6 - 7 ] , " \ \ E " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = [ ] ; <nl> + sc_extends = <nl> + [ ( Rhint ( root | const_missing_hint . php line 13 , characters 6 - 6 ) , <nl> + ( Tapply ( ( [ 13 : 6 - 7 ] , " \ \ HH \ \ BuiltinEnum " ) , <nl> + [ ( Rhint ( root | const_missing_hint . php line 13 , characters 6 - 6 ) , <nl> + ( Tapply ( ( [ 13 : 6 - 7 ] , " \ \ E " ) , [ ] ) ) ) ] <nl> + ) ) ) <nl> + ] ; <nl> + sc_uses = [ ] ; sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; <nl> + sc_req_implements = [ ] ; sc_implements = [ ] ; <nl> + sc_consts = <nl> + [ { Shallow_decl_defs . scc_abstract = false ; <nl> + scc_name = ( [ 14 : 3 - 12 ] , " FromConst " ) ; <nl> + scc_type = <nl> + ( Rwitness ( root | const_missing_hint . php line 14 , characters 3 - 11 ) , <nl> + Tany ) <nl> + } <nl> + ] ; <nl> + sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> + sc_constructor = None ; sc_static_methods = [ ] ; sc_methods = [ ] ; <nl> + sc_user_attributes = [ ] ; <nl> + sc_enum_type = <nl> + ( Some { Typing_defs . te_base = <nl> + ( Rhint ( root | const_missing_hint . php line 13 , characters 10 - 12 ) , <nl> + ( Tprim Tint ) ) ; <nl> + te_constraint = None ; te_includes = [ ] ; te_enum_class = false <nl> + } ) <nl> + } ) ) <nl> + ] <nl> <nl> They matched ! <nl> mmm a / hphp / hack / test / decl / const_string_escaping . php . exp <nl> ppp b / hphp / hack / test / decl / const_string_escaping . php . exp <nl> <nl> - Parsed decls : <nl> - <nl> - { classes = <nl> - { " \ \ C " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> - sc_name = ( [ 3 : 7 - 8 ] , " \ \ C " ) ; sc_tparams = [ ] ; sc_where_constraints = [ ] ; <nl> - sc_extends = [ ] ; sc_uses = [ ] ; sc_xhp_attr_uses = [ ] ; <nl> - sc_req_extends = [ ] ; sc_req_implements = [ ] ; sc_implements = [ ] ; <nl> - sc_consts = <nl> - [ { Shallow_decl_defs . scc_abstract = false ; <nl> - scc_name = ( [ 4 : 16 - 22 ] , " SINGLE " ) ; <nl> - scc_type = <nl> - ( Rhint ( root | const_string_escaping . php line 4 , characters 9 - 14 ) , <nl> - ( Tprim Tstring ) ) <nl> - } ; <nl> - { Shallow_decl_defs . scc_abstract = false ; <nl> - scc_name = ( [ 5 : 16 - 22 ] , " DOUBLE " ) ; <nl> - scc_type = <nl> - ( Rhint ( root | const_string_escaping . php line 5 , characters 9 - 14 ) , <nl> - ( Tprim Tstring ) ) <nl> - } ; <nl> - { Shallow_decl_defs . scc_abstract = false ; <nl> - scc_name = ( [ 6 : 16 - 37 ] , " SINGLE_ENDS_IN_SINGLE " ) ; <nl> - scc_type = <nl> - ( Rhint ( root | const_string_escaping . php line 6 , characters 9 - 14 ) , <nl> - ( Tprim Tstring ) ) <nl> - } ; <nl> - { Shallow_decl_defs . scc_abstract = false ; <nl> - scc_name = ( [ 7 : 16 - 37 ] , " DOUBLE_ENDS_IN_DOUBLE " ) ; <nl> - scc_type = <nl> - ( Rhint ( root | const_string_escaping . php line 7 , characters 9 - 14 ) , <nl> - ( Tprim Tstring ) ) <nl> - } ; <nl> - { Shallow_decl_defs . scc_abstract = false ; <nl> - scc_name = ( [ 8 : 16 - 40 ] , " SINGLE_ESCAPED_BACKSLASH " ) ; <nl> - scc_type = <nl> - ( Rhint ( root | const_string_escaping . php line 8 , characters 9 - 14 ) , <nl> - ( Tprim Tstring ) ) <nl> - } ; <nl> - { Shallow_decl_defs . scc_abstract = false ; <nl> - scc_name = ( [ 9 : 16 - 40 ] , " DOUBLE_ESCAPED_BACKSLASH " ) ; <nl> - scc_type = <nl> - ( Rhint ( root | const_string_escaping . php line 9 , characters 9 - 14 ) , <nl> - ( Tprim Tstring ) ) <nl> - } ; <nl> - { Shallow_decl_defs . scc_abstract = false ; <nl> - scc_name = ( [ 10 : 16 - 37 ] , " SINGLE_ESCAPED_DOLLAR " ) ; <nl> - scc_type = <nl> - ( Rhint ( root | const_string_escaping . php line 10 , characters 9 - 14 ) , <nl> - ( Tprim Tstring ) ) <nl> - } ; <nl> - { Shallow_decl_defs . scc_abstract = false ; <nl> - scc_name = ( [ 11 : 16 - 37 ] , " DOUBLE_ESCAPED_DOLLAR " ) ; <nl> - scc_type = <nl> - ( Rhint ( root | const_string_escaping . php line 11 , characters 9 - 14 ) , <nl> - ( Tprim Tstring ) ) <nl> - } ; <nl> - { Shallow_decl_defs . scc_abstract = false ; <nl> - scc_name = ( [ 12 : 16 - 23 ] , " HEREDOC " ) ; <nl> + [ ( " \ \ C " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> + sc_name = ( [ 3 : 7 - 8 ] , " \ \ C " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> + sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> + sc_implements = [ ] ; <nl> + sc_consts = <nl> + [ { Shallow_decl_defs . scc_abstract = false ; <nl> + scc_name = ( [ 4 : 16 - 22 ] , " SINGLE " ) ; <nl> scc_type = <nl> - ( Rhint ( root | const_string_escaping . php line 12 , characters 9 - 14 ) , <nl> + ( Rhint ( root | const_string_escaping . php line 4 , characters 9 - 14 ) , <nl> ( Tprim Tstring ) ) <nl> } ; <nl> - { Shallow_decl_defs . scc_abstract = false ; <nl> - scc_name = ( [ 15 : 16 - 22 ] , " NOWDOC " ) ; <nl> - scc_type = <nl> - ( Rhint ( root | const_string_escaping . php line 15 , characters 9 - 14 ) , <nl> - ( Tprim Tstring ) ) <nl> - } <nl> - ] ; <nl> - sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> - sc_constructor = None ; sc_static_methods = [ ] ; sc_methods = [ ] ; <nl> - sc_user_attributes = [ ] ; sc_enum_type = None } } ; <nl> - funs = { } ; typedefs = { } ; consts = { } ; records = { } } <nl> + { Shallow_decl_defs . scc_abstract = false ; <nl> + scc_name = ( [ 5 : 16 - 22 ] , " DOUBLE " ) ; <nl> + scc_type = <nl> + ( Rhint ( root | const_string_escaping . php line 5 , characters 9 - 14 ) , <nl> + ( Tprim Tstring ) ) <nl> + } ; <nl> + { Shallow_decl_defs . scc_abstract = false ; <nl> + scc_name = ( [ 6 : 16 - 37 ] , " SINGLE_ENDS_IN_SINGLE " ) ; <nl> + scc_type = <nl> + ( Rhint ( root | const_string_escaping . php line 6 , characters 9 - 14 ) , <nl> + ( Tprim Tstring ) ) <nl> + } ; <nl> + { Shallow_decl_defs . scc_abstract = false ; <nl> + scc_name = ( [ 7 : 16 - 37 ] , " DOUBLE_ENDS_IN_DOUBLE " ) ; <nl> + scc_type = <nl> + ( Rhint ( root | const_string_escaping . php line 7 , characters 9 - 14 ) , <nl> + ( Tprim Tstring ) ) <nl> + } ; <nl> + { Shallow_decl_defs . scc_abstract = false ; <nl> + scc_name = ( [ 8 : 16 - 40 ] , " SINGLE_ESCAPED_BACKSLASH " ) ; <nl> + scc_type = <nl> + ( Rhint ( root | const_string_escaping . php line 8 , characters 9 - 14 ) , <nl> + ( Tprim Tstring ) ) <nl> + } ; <nl> + { Shallow_decl_defs . scc_abstract = false ; <nl> + scc_name = ( [ 9 : 16 - 40 ] , " DOUBLE_ESCAPED_BACKSLASH " ) ; <nl> + scc_type = <nl> + ( Rhint ( root | const_string_escaping . php line 9 , characters 9 - 14 ) , <nl> + ( Tprim Tstring ) ) <nl> + } ; <nl> + { Shallow_decl_defs . scc_abstract = false ; <nl> + scc_name = ( [ 10 : 16 - 37 ] , " SINGLE_ESCAPED_DOLLAR " ) ; <nl> + scc_type = <nl> + ( Rhint ( root | const_string_escaping . php line 10 , characters 9 - 14 ) , <nl> + ( Tprim Tstring ) ) <nl> + } ; <nl> + { Shallow_decl_defs . scc_abstract = false ; <nl> + scc_name = ( [ 11 : 16 - 37 ] , " DOUBLE_ESCAPED_DOLLAR " ) ; <nl> + scc_type = <nl> + ( Rhint ( root | const_string_escaping . php line 11 , characters 9 - 14 ) , <nl> + ( Tprim Tstring ) ) <nl> + } ; <nl> + { Shallow_decl_defs . scc_abstract = false ; <nl> + scc_name = ( [ 12 : 16 - 23 ] , " HEREDOC " ) ; <nl> + scc_type = <nl> + ( Rhint ( root | const_string_escaping . php line 12 , characters 9 - 14 ) , <nl> + ( Tprim Tstring ) ) <nl> + } ; <nl> + { Shallow_decl_defs . scc_abstract = false ; <nl> + scc_name = ( [ 15 : 16 - 22 ] , " NOWDOC " ) ; <nl> + scc_type = <nl> + ( Rhint ( root | const_string_escaping . php line 15 , characters 9 - 14 ) , <nl> + ( Tprim Tstring ) ) <nl> + } <nl> + ] ; <nl> + sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> + sc_constructor = None ; sc_static_methods = [ ] ; sc_methods = [ ] ; <nl> + sc_user_attributes = [ ] ; sc_enum_type = None } ) ) <nl> + ] <nl> <nl> They matched ! <nl> mmm a / hphp / hack / test / decl / constants . php . exp <nl> ppp b / hphp / hack / test / decl / constants . php . exp <nl> <nl> - Parsed decls : <nl> - <nl> - { classes = { } ; funs = { } ; typedefs = { } ; <nl> - consts = <nl> - { " \ \ MY_CONST " - > <nl> - { Typing_defs . cd_pos = [ 6 : 14 - 22 ] ; <nl> - cd_type = <nl> - ( Rhint ( root | constants . php line 6 , characters 7 - 12 ) , ( Tprim Tstring ) ) } ; <nl> - " \ \ MY_CONST2 " - > <nl> - { Typing_defs . cd_pos = [ 7 : 11 - 20 ] ; <nl> - cd_type = <nl> - ( Rhint ( root | constants . php line 7 , characters 7 - 9 ) , ( Tprim Tint ) ) } ; <nl> - " \ \ MY_CONST3 " - > <nl> - { Typing_defs . cd_pos = [ 8 : 13 - 22 ] ; <nl> - cd_type = <nl> - ( Rhint ( root | constants . php line 8 , characters 7 - 11 ) , ( Tprim Tfloat ) ) } ; <nl> - " \ \ MY_CONST5 " - > <nl> - { Typing_defs . cd_pos = [ 9 : 11 - 20 ] ; <nl> - cd_type = <nl> - ( Rhint ( root | constants . php line 9 , characters 7 - 9 ) , ( Tprim Tnum ) ) } ; <nl> - " \ \ MY_CONST6 " - > <nl> - { Typing_defs . cd_pos = [ 10 : 12 - 21 ] ; <nl> - cd_type = <nl> - ( Rhint ( root | constants . php line 10 , characters 7 - 10 ) , ( Tprim Tbool ) ) } ; <nl> - " \ \ MY_VEC " - > <nl> - { Typing_defs . cd_pos = [ 11 : 16 - 22 ] ; <nl> - cd_type = <nl> - ( Rhint ( root | constants . php line 11 , characters 7 - 14 ) , <nl> - ( Tapply ( ( [ 11 : 7 - 10 ] , " \ \ HH \ \ vec " ) , <nl> - [ ( Rhint ( root | constants . php line 11 , characters 11 - 13 ) , <nl> - ( Tprim Tint ) ) ] <nl> - ) ) ) <nl> - } } ; <nl> - records = { } } <nl> + [ ( " \ \ MY_CONST " , <nl> + ( Shallow_decl_defs . Const <nl> + { Typing_defs . cd_pos = [ 6 : 14 - 22 ] ; <nl> + cd_type = <nl> + ( Rhint ( root | constants . php line 6 , characters 7 - 12 ) , ( Tprim Tstring ) ) <nl> + } ) ) ; <nl> + ( " \ \ MY_CONST2 " , <nl> + ( Shallow_decl_defs . Const <nl> + { Typing_defs . cd_pos = [ 7 : 11 - 20 ] ; <nl> + cd_type = <nl> + ( Rhint ( root | constants . php line 7 , characters 7 - 9 ) , ( Tprim Tint ) ) } ) ) ; <nl> + ( " \ \ MY_CONST3 " , <nl> + ( Shallow_decl_defs . Const <nl> + { Typing_defs . cd_pos = [ 8 : 13 - 22 ] ; <nl> + cd_type = <nl> + ( Rhint ( root | constants . php line 8 , characters 7 - 11 ) , ( Tprim Tfloat ) ) <nl> + } ) ) ; <nl> + ( " \ \ MY_CONST5 " , <nl> + ( Shallow_decl_defs . Const <nl> + { Typing_defs . cd_pos = [ 9 : 11 - 20 ] ; <nl> + cd_type = <nl> + ( Rhint ( root | constants . php line 9 , characters 7 - 9 ) , ( Tprim Tnum ) ) } ) ) ; <nl> + ( " \ \ MY_CONST6 " , <nl> + ( Shallow_decl_defs . Const <nl> + { Typing_defs . cd_pos = [ 10 : 12 - 21 ] ; <nl> + cd_type = <nl> + ( Rhint ( root | constants . php line 10 , characters 7 - 10 ) , ( Tprim Tbool ) ) <nl> + } ) ) ; <nl> + ( " \ \ MY_VEC " , <nl> + ( Shallow_decl_defs . Const <nl> + { Typing_defs . cd_pos = [ 11 : 16 - 22 ] ; <nl> + cd_type = <nl> + ( Rhint ( root | constants . php line 11 , characters 7 - 14 ) , <nl> + ( Tapply ( ( [ 11 : 7 - 10 ] , " \ \ HH \ \ vec " ) , <nl> + [ ( Rhint ( root | constants . php line 11 , characters 11 - 13 ) , <nl> + ( Tprim Tint ) ) ] <nl> + ) ) ) <nl> + } ) ) <nl> + ] <nl> <nl> They matched ! <nl> mmm a / hphp / hack / test / decl / constraints_mentioning_tparams_in_same_list . php . exp <nl> ppp b / hphp / hack / test / decl / constraints_mentioning_tparams_in_same_list . php . exp <nl> <nl> - Parsed decls : <nl> - <nl> - { classes = <nl> - { " \ \ E " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> - sc_name = ( [ 3 : 7 - 8 ] , " \ \ E " ) ; <nl> - sc_tparams = <nl> - [ { Typing_defs_core . tp_variance = Invariant ; <nl> - tp_name = ( [ 3 : 9 - 11 ] , " Ta " ) ; tp_tparams = [ ] ; tp_constraints = [ ] ; <nl> - tp_reified = Erased ; tp_user_attributes = [ ] } ; <nl> - { Typing_defs_core . tp_variance = Invariant ; <nl> - tp_name = ( [ 3 : 13 - 15 ] , " Tb " ) ; tp_tparams = [ ] ; tp_constraints = [ ] ; <nl> - tp_reified = Erased ; tp_user_attributes = [ ] } <nl> - ] ; <nl> - sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> - sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> - sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; <nl> - sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; sc_constructor = None ; <nl> - sc_static_methods = [ ] ; sc_methods = [ ] ; sc_user_attributes = [ ] ; <nl> - sc_enum_type = None } ; <nl> - " \ \ I " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cinterface ; <nl> - sc_name = ( [ 5 : 11 - 12 ] , " \ \ I " ) ; <nl> - sc_tparams = <nl> - [ { Typing_defs_core . tp_variance = Invariant ; tp_name = ( [ 6 : 3 - 5 ] , " Ta " ) ; <nl> - tp_tparams = [ ] ; <nl> - tp_constraints = <nl> - [ ( Constraint_as , <nl> - ( Rhint ( root | constraints_mentioning_tparams_in_same_list . php line 6 , characters 9 - 16 ) , <nl> - ( Tprim Tarraykey ) ) ) <nl> - ] ; <nl> - tp_reified = Erased ; tp_user_attributes = [ ] } ; <nl> + [ ( " \ \ E " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> + sc_name = ( [ 3 : 7 - 8 ] , " \ \ E " ) ; <nl> + sc_tparams = <nl> + [ { Typing_defs_core . tp_variance = Invariant ; <nl> + tp_name = ( [ 3 : 9 - 11 ] , " Ta " ) ; tp_tparams = [ ] ; tp_constraints = [ ] ; <nl> + tp_reified = Erased ; tp_user_attributes = [ ] } ; <nl> + { Typing_defs_core . tp_variance = Invariant ; <nl> + tp_name = ( [ 3 : 13 - 15 ] , " Tb " ) ; tp_tparams = [ ] ; tp_constraints = [ ] ; <nl> + tp_reified = Erased ; tp_user_attributes = [ ] } <nl> + ] ; <nl> + sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> + sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> + sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; <nl> + sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> + sc_constructor = None ; sc_static_methods = [ ] ; sc_methods = [ ] ; <nl> + sc_user_attributes = [ ] ; sc_enum_type = None } ) ) ; <nl> + ( " \ \ I " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cinterface ; <nl> + sc_name = ( [ 5 : 11 - 12 ] , " \ \ I " ) ; <nl> + sc_tparams = <nl> + [ { Typing_defs_core . tp_variance = Invariant ; <nl> + tp_name = ( [ 6 : 3 - 5 ] , " Ta " ) ; tp_tparams = [ ] ; <nl> + tp_constraints = <nl> + [ ( Constraint_as , <nl> + ( Rhint ( root | constraints_mentioning_tparams_in_same_list . php line 6 , characters 9 - 16 ) , <nl> + ( Tprim Tarraykey ) ) ) <nl> + ] ; <nl> + tp_reified = Erased ; tp_user_attributes = [ ] } ; <nl> + { Typing_defs_core . tp_variance = Invariant ; <nl> + tp_name = ( [ 7 : 3 - 5 ] , " Tb " ) ; tp_tparams = [ ] ; <nl> + tp_constraints = <nl> + [ ( Constraint_as , <nl> + ( Rhint ( root | constraints_mentioning_tparams_in_same_list . php line 7 , characters 9 - 10 ) , <nl> + ( Tgeneric ( " Ta " , [ ] ) ) ) ) <nl> + ] ; <nl> + tp_reified = Erased ; tp_user_attributes = [ ] } ; <nl> { Typing_defs_core . tp_variance = Invariant ; <nl> - tp_name = ( [ 7 : 3 - 5 ] , " Tb " ) ; tp_tparams = [ ] ; <nl> + tp_name = ( [ 8 : 3 - 5 ] , " Tc " ) ; tp_tparams = [ ] ; <nl> tp_constraints = <nl> [ ( Constraint_as , <nl> - ( Rhint ( root | constraints_mentioning_tparams_in_same_list . php line 7 , characters 9 - 10 ) , <nl> - ( Tgeneric ( " Ta " , [ ] ) ) ) ) <nl> + ( Rhint ( root | constraints_mentioning_tparams_in_same_list . php line 8 , characters 9 - 10 ) , <nl> + ( Tgeneric ( " Td " , [ ] ) ) ) ) <nl> ] ; <nl> tp_reified = Erased ; tp_user_attributes = [ ] } ; <nl> - { Typing_defs_core . tp_variance = Invariant ; tp_name = ( [ 8 : 3 - 5 ] , " Tc " ) ; <nl> - tp_tparams = [ ] ; <nl> - tp_constraints = <nl> - [ ( Constraint_as , <nl> - ( Rhint ( root | constraints_mentioning_tparams_in_same_list . php line 8 , characters 9 - 10 ) , <nl> - ( Tgeneric ( " Td " , [ ] ) ) ) ) <nl> - ] ; <nl> + { Typing_defs_core . tp_variance = Invariant ; <nl> + tp_name = ( [ 9 : 3 - 5 ] , " Td " ) ; tp_tparams = [ ] ; <nl> + tp_constraints = <nl> + [ ( Constraint_as , <nl> + ( Rhint ( root | constraints_mentioning_tparams_in_same_list . php line 9 , characters 9 - 17 ) , <nl> + ( Tapply ( ( [ 9 : 9 - 10 ] , " \ \ E " ) , <nl> + [ ( Rhint ( root | constraints_mentioning_tparams_in_same_list . php line 9 , characters 11 - 12 ) , <nl> + ( Tgeneric ( " Ta " , [ ] ) ) ) ; <nl> + ( Rhint ( root | constraints_mentioning_tparams_in_same_list . php line 9 , characters 15 - 16 ) , <nl> + ( Tgeneric ( " Tf " , [ ] ) ) ) <nl> + ] <nl> + ) ) ) ) <nl> + ] ; <nl> tp_reified = Erased ; tp_user_attributes = [ ] } ; <nl> - { Typing_defs_core . tp_variance = Invariant ; tp_name = ( [ 9 : 3 - 5 ] , " Td " ) ; <nl> - tp_tparams = [ ] ; <nl> - tp_constraints = <nl> - [ ( Constraint_as , <nl> - ( Rhint ( root | constraints_mentioning_tparams_in_same_list . php line 9 , characters 9 - 17 ) , <nl> - ( Tapply ( ( [ 9 : 9 - 10 ] , " \ \ E " ) , <nl> - [ ( Rhint ( root | constraints_mentioning_tparams_in_same_list . php line 9 , characters 11 - 12 ) , <nl> - ( Tgeneric ( " Ta " , [ ] ) ) ) ; <nl> - ( Rhint ( root | constraints_mentioning_tparams_in_same_list . php line 9 , characters 15 - 16 ) , <nl> - ( Tgeneric ( " Tf " , [ ] ) ) ) <nl> - ] <nl> - ) ) ) ) <nl> - ] ; <nl> - tp_reified = Erased ; tp_user_attributes = [ ] } ; <nl> - { Typing_defs_core . tp_variance = Invariant ; tp_name = ( [ 10 : 3 - 5 ] , " Tf " ) ; <nl> - tp_tparams = [ ] ; tp_constraints = [ ] ; tp_reified = Erased ; <nl> - tp_user_attributes = [ ] } ; <nl> - { Typing_defs_core . tp_variance = Invariant ; tp_name = ( [ 11 : 3 - 7 ] , " Tarr " ) ; <nl> - tp_tparams = [ ] ; <nl> - tp_constraints = <nl> - [ ( Constraint_as , <nl> - ( Rhint ( root | constraints_mentioning_tparams_in_same_list . php line 11 , characters 11 - 20 ) , <nl> - ( Tvarray <nl> - ( Rhint ( root | constraints_mentioning_tparams_in_same_list . php line 11 , characters 18 - 19 ) , <nl> - ( Tgeneric ( " Ta " , [ ] ) ) ) ) ) ) <nl> - ] ; <nl> - tp_reified = Erased ; <nl> - tp_user_attributes = [ ] <nl> - } ; <nl> + { Typing_defs_core . tp_variance = Invariant ; tp_name = ( [ 10 : 3 - 5 ] , " Tf " ) ; <nl> + tp_tparams = [ ] ; tp_constraints = [ ] ; tp_reified = Erased ; <nl> + tp_user_attributes = [ ] } ; <nl> + { Typing_defs_core . tp_variance = Invariant ; tp_name = ( [ 11 : 3 - 7 ] , " Tarr " ) ; <nl> + tp_tparams = [ ] ; <nl> + tp_constraints = <nl> + [ ( Constraint_as , <nl> + ( Rhint ( root | constraints_mentioning_tparams_in_same_list . php line 11 , characters 11 - 20 ) , <nl> + ( Tvarray <nl> + ( Rhint ( root | constraints_mentioning_tparams_in_same_list . php line 11 , characters 18 - 19 ) , <nl> + ( Tgeneric ( " Ta " , [ ] ) ) ) ) ) ) <nl> + ] ; <nl> + tp_reified = Erased ; tp_user_attributes = [ ] } ; <nl> { Typing_defs_core . tp_variance = Invariant ; tp_name = ( [ 12 : 3 - 8 ] , " Tlike " ) ; <nl> tp_tparams = [ ] ; <nl> tp_constraints = <nl> Parsed decls : <nl> ( Tgeneric ( " Ta " , [ ] ) ) ) ) ) ) <nl> ] ; <nl> tp_reified = Erased ; tp_user_attributes = [ ] } ; <nl> - { Typing_defs_core . tp_variance = Invariant ; tp_name = ( [ 13 : 3 - 7 ] , " Topt " ) ; <nl> - tp_tparams = [ ] ; <nl> - tp_constraints = <nl> - [ ( Constraint_as , <nl> - ( Rhint ( root | constraints_mentioning_tparams_in_same_list . php line 13 , characters 11 - 13 ) , <nl> - ( Toption <nl> - ( Rhint ( root | constraints_mentioning_tparams_in_same_list . php line 13 , characters 12 - 13 ) , <nl> - ( Tgeneric ( " Ta " , [ ] ) ) ) ) ) ) <nl> - ] ; <nl> - tp_reified = Erased ; tp_user_attributes = [ ] } ; <nl> + { Typing_defs_core . tp_variance = Invariant ; tp_name = ( [ 13 : 3 - 7 ] , " Topt " ) ; <nl> + tp_tparams = [ ] ; <nl> + tp_constraints = <nl> + [ ( Constraint_as , <nl> + ( Rhint ( root | constraints_mentioning_tparams_in_same_list . php line 13 , characters 11 - 13 ) , <nl> + ( Toption <nl> + ( Rhint ( root | constraints_mentioning_tparams_in_same_list . php line 13 , characters 12 - 13 ) , <nl> + ( Tgeneric ( " Ta " , [ ] ) ) ) ) ) ) <nl> + ] ; tp_reified = Erased ; tp_user_attributes = [ ] } ; <nl> { Typing_defs_core . tp_variance = Invariant ; tp_name = ( [ 14 : 3 - 7 ] , " Tfun " ) ; <nl> tp_tparams = [ ] ; <nl> tp_constraints = <nl> sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; <nl> sc_props = [ ] ; sc_sprops = [ ] ; sc_constructor = None ; sc_static_methods = [ ] ; <nl> - sc_methods = [ ] ; sc_user_attributes = [ ] ; sc_enum_type = None } } ; funs = { } ; <nl> - typedefs = { } ; consts = { } ; records = { } <nl> - } <nl> + sc_methods = [ ] ; sc_user_attributes = [ ] ; sc_enum_type = None } ) ) <nl> + ] <nl> <nl> They matched ! <nl> mmm a / hphp / hack / test / decl / constraints_with_fully_qualified_name . php . exp <nl> ppp b / hphp / hack / test / decl / constraints_with_fully_qualified_name . php . exp <nl> <nl> - Parsed decls : <nl> - <nl> - { classes = <nl> - { " \ \ I " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cinterface ; <nl> - sc_name = ( [ 6 : 11 - 12 ] , " \ \ I " ) ; <nl> - sc_tparams = <nl> - [ { Typing_defs_core . tp_variance = Invariant ; tp_name = ( [ 7 : 3 - 5 ] , " Ta " ) ; <nl> - tp_tparams = [ ] ; <nl> - tp_constraints = <nl> - [ ( Constraint_as , <nl> - ( Rhint ( root | constraints_with_fully_qualified_name . php line 7 , characters 9 - 16 ) , <nl> - ( Tprim Tarraykey ) ) ) <nl> - ] ; <nl> - tp_reified = Erased ; tp_user_attributes = [ ] } ; <nl> + [ ( " \ \ Ta " , <nl> + ( Shallow_decl_defs . Typedef <nl> + { Typing_defs . td_pos = [ 3 : 6 - 8 ] ; td_vis = Transparent ; td_tparams = [ ] ; <nl> + td_constraint = None ; <nl> + td_type = <nl> + ( Rhint ( root | constraints_with_fully_qualified_name . php line 3 , characters 11 - 13 ) , <nl> + ( Tprim Tint ) ) <nl> + } ) ) ; <nl> + ( " \ \ Td " , <nl> + ( Shallow_decl_defs . Typedef <nl> + { Typing_defs . td_pos = [ 4 : 6 - 8 ] ; td_vis = Transparent ; td_tparams = [ ] ; <nl> + td_constraint = None ; <nl> + td_type = <nl> + ( Rhint ( root | constraints_with_fully_qualified_name . php line 4 , characters 11 - 16 ) , <nl> + ( Tprim Tstring ) ) <nl> + } ) ) ; <nl> + ( " \ \ I " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cinterface ; <nl> + sc_name = ( [ 6 : 11 - 12 ] , " \ \ I " ) ; <nl> + sc_tparams = <nl> + [ { Typing_defs_core . tp_variance = Invariant ; <nl> + tp_name = ( [ 7 : 3 - 5 ] , " Ta " ) ; tp_tparams = [ ] ; <nl> + tp_constraints = <nl> + [ ( Constraint_as , <nl> + ( Rhint ( root | constraints_with_fully_qualified_name . php line 7 , characters 9 - 16 ) , <nl> + ( Tprim Tarraykey ) ) ) <nl> + ] ; <nl> + tp_reified = Erased ; tp_user_attributes = [ ] } ; <nl> + { Typing_defs_core . tp_variance = Invariant ; <nl> + tp_name = ( [ 8 : 3 - 5 ] , " Tb " ) ; tp_tparams = [ ] ; <nl> + tp_constraints = <nl> + [ ( Constraint_as , <nl> + ( Rhint ( root | constraints_with_fully_qualified_name . php line 8 , characters 9 - 19 ) , <nl> + ( Tapply ( ( [ 8 : 9 - 12 ] , " \ \ HH \ \ Map " ) , <nl> + [ ( Rhint ( root | constraints_with_fully_qualified_name . php line 8 , characters 13 - 14 ) , <nl> + ( Tgeneric ( " Ta " , [ ] ) ) ) ; <nl> + ( Rhint ( root | constraints_with_fully_qualified_name . php line 8 , characters 17 - 18 ) , <nl> + ( Tgeneric ( " Td " , [ ] ) ) ) <nl> + ] <nl> + ) ) ) ) <nl> + ] ; <nl> + tp_reified = Erased ; tp_user_attributes = [ ] } ; <nl> { Typing_defs_core . tp_variance = Invariant ; <nl> - tp_name = ( [ 8 : 3 - 5 ] , " Tb " ) ; tp_tparams = [ ] ; <nl> + tp_name = ( [ 9 : 3 - 5 ] , " Tc " ) ; tp_tparams = [ ] ; <nl> tp_constraints = <nl> [ ( Constraint_as , <nl> - ( Rhint ( root | constraints_with_fully_qualified_name . php line 8 , characters 9 - 19 ) , <nl> - ( Tapply ( ( [ 8 : 9 - 12 ] , " \ \ HH \ \ Map " ) , <nl> - [ ( Rhint ( root | constraints_with_fully_qualified_name . php line 8 , characters 13 - 14 ) , <nl> - ( Tgeneric ( " Ta " , [ ] ) ) ) ; <nl> - ( Rhint ( root | constraints_with_fully_qualified_name . php line 8 , characters 17 - 18 ) , <nl> - ( Tgeneric ( " Td " , [ ] ) ) ) <nl> - ] <nl> - ) ) ) ) <nl> - ] ; <nl> - tp_reified = Erased ; tp_user_attributes = [ ] } ; <nl> - { Typing_defs_core . tp_variance = Invariant ; tp_name = ( [ 9 : 3 - 5 ] , " Tc " ) ; <nl> - tp_tparams = [ ] ; <nl> - tp_constraints = <nl> - [ ( Constraint_as , <nl> - ( Rhint ( root | constraints_with_fully_qualified_name . php line 9 , characters 9 - 21 ) , <nl> - ( Tapply ( ( [ 9 : 9 - 12 ] , " \ \ HH \ \ Map " ) , <nl> - [ ( Rhint ( root | constraints_with_fully_qualified_name . php line 9 , characters 13 - 15 ) , <nl> - ( Tapply ( ( [ 9 : 13 - 16 ] , " \ \ Ta " ) , [ ] ) ) ) ; <nl> - ( Rhint ( root | constraints_with_fully_qualified_name . php line 9 , characters 18 - 20 ) , <nl> - ( Tapply ( ( [ 9 : 18 - 21 ] , " \ \ Td " ) , [ ] ) ) ) <nl> - ] <nl> - ) ) ) ) <nl> - ] ; <nl> - tp_reified = Erased ; tp_user_attributes = [ ] } ; <nl> - { Typing_defs_core . tp_variance = Invariant ; tp_name = ( [ 10 : 3 - 5 ] , " Td " ) ; <nl> - tp_tparams = [ ] ; tp_constraints = [ ] ; tp_reified = Erased ; <nl> - tp_user_attributes = [ ] } <nl> - ] ; <nl> - sc_where_constraints = [ ] ; <nl> - sc_extends = [ ] ; <nl> - sc_uses = [ ] ; <nl> - sc_xhp_attr_uses = [ ] ; <nl> - sc_req_extends = [ ] ; <nl> - sc_req_implements = [ ] ; <nl> - sc_implements = [ ] ; <nl> - sc_consts = [ ] ; <nl> - sc_typeconsts = [ ] ; <nl> - sc_pu_enums = [ ] ; <nl> - sc_props = [ ] ; <nl> - sc_sprops = [ ] ; <nl> - sc_constructor = None ; <nl> - sc_static_methods = [ ] ; <nl> - sc_methods = [ ] ; <nl> - sc_user_attributes = [ ] ; <nl> - sc_enum_type = None <nl> - } } ; funs = { } ; <nl> - typedefs = <nl> - { " \ \ Ta " - > <nl> - { Typing_defs . td_pos = [ 3 : 6 - 8 ] ; td_vis = Transparent ; td_tparams = [ ] ; <nl> - td_constraint = None ; <nl> - td_type = <nl> - ( Rhint ( root | constraints_with_fully_qualified_name . php line 3 , characters 11 - 13 ) , <nl> - ( Tprim Tint ) ) <nl> - } ; <nl> - " \ \ Td " - > <nl> - { Typing_defs . td_pos = [ 4 : 6 - 8 ] ; td_vis = Transparent ; td_tparams = [ ] ; <nl> - td_constraint = None ; <nl> - td_type = <nl> - ( Rhint ( root | constraints_with_fully_qualified_name . php line 4 , characters 11 - 16 ) , <nl> - ( Tprim Tstring ) ) <nl> - } } ; consts = { } ; records = { } <nl> - } <nl> + ( Rhint ( root | constraints_with_fully_qualified_name . php line 9 , characters 9 - 21 ) , <nl> + ( Tapply ( ( [ 9 : 9 - 12 ] , " \ \ HH \ \ Map " ) , <nl> + [ ( Rhint ( root | constraints_with_fully_qualified_name . php line 9 , characters 13 - 15 ) , <nl> + ( Tapply ( ( [ 9 : 13 - 16 ] , " \ \ Ta " ) , [ ] ) ) ) ; <nl> + ( Rhint ( root | constraints_with_fully_qualified_name . php line 9 , characters 18 - 20 ) , <nl> + ( Tapply ( ( [ 9 : 18 - 21 ] , " \ \ Td " ) , [ ] ) ) ) <nl> + ] <nl> + ) ) ) ) <nl> + ] ; <nl> + tp_reified = Erased ; tp_user_attributes = [ ] } ; <nl> + { Typing_defs_core . tp_variance = Invariant ; <nl> + tp_name = ( [ 10 : 3 - 5 ] , " Td " ) ; tp_tparams = [ ] ; tp_constraints = [ ] ; <nl> + tp_reified = Erased ; tp_user_attributes = [ ] } <nl> + ] ; <nl> + sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> + sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> + sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; <nl> + sc_props = [ ] ; sc_sprops = [ ] ; sc_constructor = None ; <nl> + sc_static_methods = [ ] ; sc_methods = [ ] ; sc_user_attributes = [ ] ; <nl> + sc_enum_type = None } ) ) <nl> + ] <nl> <nl> They matched ! <nl> mmm a / hphp / hack / test / decl / constraints_with_fully_qualified_name_in_namespace . php . exp <nl> ppp b / hphp / hack / test / decl / constraints_with_fully_qualified_name_in_namespace . php . exp <nl> <nl> - Parsed decls : <nl> - <nl> - { classes = <nl> - { " \ \ NS \ \ I " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cinterface ; <nl> - sc_name = ( [ 12 : 13 - 14 ] , " \ \ NS \ \ I " ) ; <nl> - sc_tparams = <nl> - [ { Typing_defs_core . tp_variance = Invariant ; <nl> - tp_name = ( [ 13 : 5 - 7 ] , " Ta " ) ; tp_tparams = [ ] ; <nl> - tp_constraints = <nl> - [ ( Constraint_as , <nl> - ( Rhint ( root | constraints_with_fully_qualified_name_in_namespace . php line 13 , characters 11 - 18 ) , <nl> - ( Tprim Tarraykey ) ) ) <nl> - ] ; <nl> - tp_reified = Erased ; tp_user_attributes = [ ] } ; <nl> + [ ( " \ \ Ta " , <nl> + ( Shallow_decl_defs . Typedef <nl> + { Typing_defs . td_pos = [ 4 : 8 - 10 ] ; td_vis = Transparent ; td_tparams = [ ] ; <nl> + td_constraint = None ; <nl> + td_type = <nl> + ( Rhint ( root | constraints_with_fully_qualified_name_in_namespace . php line 4 , characters 13 - 15 ) , <nl> + ( Tprim Tint ) ) <nl> + } ) ) ; <nl> + ( " \ \ Te " , <nl> + ( Shallow_decl_defs . Typedef <nl> + { Typing_defs . td_pos = [ 5 : 8 - 10 ] ; td_vis = Transparent ; td_tparams = [ ] ; <nl> + td_constraint = None ; <nl> + td_type = <nl> + ( Rhint ( root | constraints_with_fully_qualified_name_in_namespace . php line 5 , characters 13 - 18 ) , <nl> + ( Tprim Tstring ) ) <nl> + } ) ) ; <nl> + ( " \ \ NS \ \ Ta " , <nl> + ( Shallow_decl_defs . Typedef <nl> + { Typing_defs . td_pos = [ 9 : 8 - 10 ] ; td_vis = Transparent ; td_tparams = [ ] ; <nl> + td_constraint = None ; <nl> + td_type = <nl> + ( Rhint ( root | constraints_with_fully_qualified_name_in_namespace . php line 9 , characters 13 - 15 ) , <nl> + ( Tprim Tint ) ) <nl> + } ) ) ; <nl> + ( " \ \ NS \ \ Te " , <nl> + ( Shallow_decl_defs . Typedef <nl> + { Typing_defs . td_pos = [ 10 : 8 - 10 ] ; td_vis = Transparent ; <nl> + td_tparams = [ ] ; td_constraint = None ; <nl> + td_type = <nl> + ( Rhint ( root | constraints_with_fully_qualified_name_in_namespace . php line 10 , characters 13 - 18 ) , <nl> + ( Tprim Tstring ) ) <nl> + } ) ) ; <nl> + ( " \ \ NS \ \ I " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cinterface ; <nl> + sc_name = ( [ 12 : 13 - 14 ] , " \ \ NS \ \ I " ) ; <nl> + sc_tparams = <nl> + [ { Typing_defs_core . tp_variance = Invariant ; <nl> + tp_name = ( [ 13 : 5 - 7 ] , " Ta " ) ; tp_tparams = [ ] ; <nl> + tp_constraints = <nl> + [ ( Constraint_as , <nl> + ( Rhint ( root | constraints_with_fully_qualified_name_in_namespace . php line 13 , characters 11 - 18 ) , <nl> + ( Tprim Tarraykey ) ) ) <nl> + ] ; <nl> + tp_reified = Erased ; tp_user_attributes = [ ] } ; <nl> + { Typing_defs_core . tp_variance = Invariant ; <nl> + tp_name = ( [ 14 : 5 - 7 ] , " Tb " ) ; tp_tparams = [ ] ; <nl> + tp_constraints = <nl> + [ ( Constraint_as , <nl> + ( Rhint ( root | constraints_with_fully_qualified_name_in_namespace . php line 14 , characters 11 - 21 ) , <nl> + ( Tapply ( ( [ 14 : 11 - 14 ] , " \ \ HH \ \ Map " ) , <nl> + [ ( Rhint ( root | constraints_with_fully_qualified_name_in_namespace . php line 14 , characters 15 - 16 ) , <nl> + ( Tgeneric ( " Ta " , [ ] ) ) ) ; <nl> + ( Rhint ( root | constraints_with_fully_qualified_name_in_namespace . php line 14 , characters 19 - 20 ) , <nl> + ( Tgeneric ( " Te " , [ ] ) ) ) <nl> + ] <nl> + ) ) ) ) <nl> + ] ; <nl> + tp_reified = Erased ; tp_user_attributes = [ ] } ; <nl> { Typing_defs_core . tp_variance = Invariant ; <nl> - tp_name = ( [ 14 : 5 - 7 ] , " Tb " ) ; tp_tparams = [ ] ; <nl> + tp_name = ( [ 15 : 5 - 7 ] , " Tc " ) ; tp_tparams = [ ] ; <nl> tp_constraints = <nl> [ ( Constraint_as , <nl> - ( Rhint ( root | constraints_with_fully_qualified_name_in_namespace . php line 14 , characters 11 - 21 ) , <nl> - ( Tapply ( ( [ 14 : 11 - 14 ] , " \ \ HH \ \ Map " ) , <nl> - [ ( Rhint ( root | constraints_with_fully_qualified_name_in_namespace . php line 14 , characters 15 - 16 ) , <nl> - ( Tgeneric ( " Ta " , [ ] ) ) ) ; <nl> - ( Rhint ( root | constraints_with_fully_qualified_name_in_namespace . php line 14 , characters 19 - 20 ) , <nl> - ( Tgeneric ( " Te " , [ ] ) ) ) <nl> - ] <nl> - ) ) ) ) <nl> - ] ; <nl> - tp_reified = Erased ; tp_user_attributes = [ ] } ; <nl> - { Typing_defs_core . tp_variance = Invariant ; tp_name = ( [ 15 : 5 - 7 ] , " Tc " ) ; <nl> - tp_tparams = [ ] ; <nl> - tp_constraints = <nl> - [ ( Constraint_as , <nl> - ( Rhint ( root | constraints_with_fully_qualified_name_in_namespace . php line 15 , characters 11 - 23 ) , <nl> - ( Tapply ( ( [ 15 : 11 - 14 ] , " \ \ HH \ \ Map " ) , <nl> - [ ( Rhint ( root | constraints_with_fully_qualified_name_in_namespace . php line 15 , characters 15 - 17 ) , <nl> - ( Tapply ( ( [ 15 : 15 - 18 ] , " \ \ Ta " ) , [ ] ) ) ) ; <nl> - ( Rhint ( root | constraints_with_fully_qualified_name_in_namespace . php line 15 , characters 20 - 22 ) , <nl> - ( Tapply ( ( [ 15 : 20 - 23 ] , " \ \ Te " ) , [ ] ) ) ) <nl> - ] <nl> - ) ) ) ) <nl> - ] ; <nl> - tp_reified = Erased ; tp_user_attributes = [ ] } ; <nl> - { Typing_defs_core . tp_variance = Invariant ; tp_name = ( [ 16 : 5 - 7 ] , " Td " ) ; <nl> - tp_tparams = [ ] ; <nl> - tp_constraints = <nl> - [ ( Constraint_as , <nl> - ( Rhint ( root | constraints_with_fully_qualified_name_in_namespace . php line 16 , characters 11 - 29 ) , <nl> - ( Tapply ( ( [ 16 : 11 - 14 ] , " \ \ HH \ \ Map " ) , <nl> - [ ( Rhint ( root | constraints_with_fully_qualified_name_in_namespace . php line 16 , characters 15 - 20 ) , <nl> - ( Tapply ( ( [ 16 : 15 - 21 ] , " \ \ NS \ \ Ta " ) , [ ] ) ) ) ; <nl> - ( Rhint ( root | constraints_with_fully_qualified_name_in_namespace . php line 16 , characters 23 - 28 ) , <nl> - ( Tapply ( ( [ 16 : 23 - 29 ] , " \ \ NS \ \ Te " ) , [ ] ) ) ) <nl> - ] <nl> - ) ) ) ) <nl> - ] ; <nl> - tp_reified = Erased ; tp_user_attributes = [ ] } ; <nl> - { Typing_defs_core . tp_variance = Invariant ; tp_name = ( [ 17 : 5 - 7 ] , " Te " ) ; <nl> - tp_tparams = [ ] ; tp_constraints = [ ] ; tp_reified = Erased ; <nl> - tp_user_attributes = [ ] } <nl> - ] ; <nl> - sc_where_constraints = [ ] ; <nl> - sc_extends = [ ] ; <nl> - sc_uses = [ ] ; <nl> - sc_xhp_attr_uses = [ ] ; <nl> - sc_req_extends = [ ] ; <nl> - sc_req_implements = [ ] ; <nl> - sc_implements = [ ] ; <nl> - sc_consts = [ ] ; <nl> - sc_typeconsts = [ ] ; <nl> - sc_pu_enums = [ ] ; <nl> - sc_props = [ ] ; <nl> - sc_sprops = [ ] ; <nl> - sc_constructor = None ; <nl> - sc_static_methods = [ ] ; <nl> - sc_methods = [ ] ; <nl> - sc_user_attributes = [ ] ; <nl> - sc_enum_type = None <nl> - } } ; funs = { } ; <nl> - typedefs = <nl> - { " \ \ NS \ \ Ta " - > <nl> - { Typing_defs . td_pos = [ 9 : 8 - 10 ] ; td_vis = Transparent ; td_tparams = [ ] ; <nl> - td_constraint = None ; <nl> - td_type = <nl> - ( Rhint ( root | constraints_with_fully_qualified_name_in_namespace . php line 9 , characters 13 - 15 ) , <nl> - ( Tprim Tint ) ) <nl> - } ; <nl> - " \ \ NS \ \ Te " - > <nl> - { Typing_defs . td_pos = [ 10 : 8 - 10 ] ; td_vis = Transparent ; td_tparams = [ ] ; <nl> - td_constraint = None ; <nl> - td_type = <nl> - ( Rhint ( root | constraints_with_fully_qualified_name_in_namespace . php line 10 , characters 13 - 18 ) , <nl> - ( Tprim Tstring ) ) <nl> - } ; <nl> - " \ \ Ta " - > <nl> - { Typing_defs . td_pos = [ 4 : 8 - 10 ] ; td_vis = Transparent ; td_tparams = [ ] ; <nl> - td_constraint = None ; <nl> - td_type = <nl> - ( Rhint ( root | constraints_with_fully_qualified_name_in_namespace . php line 4 , characters 13 - 15 ) , <nl> - ( Tprim Tint ) ) <nl> - } ; <nl> - " \ \ Te " - > <nl> - { Typing_defs . td_pos = [ 5 : 8 - 10 ] ; td_vis = Transparent ; td_tparams = [ ] ; <nl> - td_constraint = None ; <nl> - td_type = <nl> - ( Rhint ( root | constraints_with_fully_qualified_name_in_namespace . php line 5 , characters 13 - 18 ) , <nl> - ( Tprim Tstring ) ) <nl> - } } ; consts = { } ; records = { } <nl> - } <nl> + ( Rhint ( root | constraints_with_fully_qualified_name_in_namespace . php line 15 , characters 11 - 23 ) , <nl> + ( Tapply ( ( [ 15 : 11 - 14 ] , " \ \ HH \ \ Map " ) , <nl> + [ ( Rhint ( root | constraints_with_fully_qualified_name_in_namespace . php line 15 , characters 15 - 17 ) , <nl> + ( Tapply ( ( [ 15 : 15 - 18 ] , " \ \ Ta " ) , [ ] ) ) ) ; <nl> + ( Rhint ( root | constraints_with_fully_qualified_name_in_namespace . php line 15 , characters 20 - 22 ) , <nl> + ( Tapply ( ( [ 15 : 20 - 23 ] , " \ \ Te " ) , [ ] ) ) ) <nl> + ] <nl> + ) ) ) ) <nl> + ] ; <nl> + tp_reified = Erased ; tp_user_attributes = [ ] } ; <nl> + { Typing_defs_core . tp_variance = Invariant ; <nl> + tp_name = ( [ 16 : 5 - 7 ] , " Td " ) ; tp_tparams = [ ] ; <nl> + tp_constraints = <nl> + [ ( Constraint_as , <nl> + ( Rhint ( root | constraints_with_fully_qualified_name_in_namespace . php line 16 , characters 11 - 29 ) , <nl> + ( Tapply ( ( [ 16 : 11 - 14 ] , " \ \ HH \ \ Map " ) , <nl> + [ ( Rhint ( root | constraints_with_fully_qualified_name_in_namespace . php line 16 , characters 15 - 20 ) , <nl> + ( Tapply ( ( [ 16 : 15 - 21 ] , " \ \ NS \ \ Ta " ) , [ ] ) ) ) ; <nl> + ( Rhint ( root | constraints_with_fully_qualified_name_in_namespace . php line 16 , characters 23 - 28 ) , <nl> + ( Tapply ( ( [ 16 : 23 - 29 ] , " \ \ NS \ \ Te " ) , [ ] ) ) ) <nl> + ] <nl> + ) ) ) ) <nl> + ] ; <nl> + tp_reified = Erased ; tp_user_attributes = [ ] } ; <nl> + { Typing_defs_core . tp_variance = Invariant ; <nl> + tp_name = ( [ 17 : 5 - 7 ] , " Te " ) ; tp_tparams = [ ] ; tp_constraints = [ ] ; <nl> + tp_reified = Erased ; tp_user_attributes = [ ] } <nl> + ] ; <nl> + sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> + sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> + sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; <nl> + sc_props = [ ] ; sc_sprops = [ ] ; sc_constructor = None ; <nl> + sc_static_methods = [ ] ; sc_methods = [ ] ; sc_user_attributes = [ ] ; <nl> + sc_enum_type = None } ) ) <nl> + ] <nl> <nl> They matched ! <nl> mmm a / hphp / hack / test / decl / denotable_unions . php . exp <nl> ppp b / hphp / hack / test / decl / denotable_unions . php . exp <nl> <nl> - Parsed decls : <nl> - <nl> - { classes = <nl> - { " \ \ I " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cinterface ; <nl> - sc_name = ( [ 6 : 11 - 12 ] , " \ \ I " ) ; sc_tparams = [ ] ; <nl> - sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> - sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> - sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; <nl> - sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; sc_constructor = None ; <nl> - sc_static_methods = [ ] ; sc_methods = [ ] ; sc_user_attributes = [ ] ; <nl> - sc_enum_type = None } ; <nl> - " \ \ J " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cinterface ; <nl> - sc_name = ( [ 7 : 11 - 12 ] , " \ \ J " ) ; sc_tparams = [ ] ; <nl> - sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> - sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> - sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; <nl> - sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; sc_constructor = None ; <nl> - sc_static_methods = [ ] ; sc_methods = [ ] ; sc_user_attributes = [ ] ; <nl> - sc_enum_type = None } } ; <nl> - funs = <nl> - { " \ \ f " - > <nl> - { Typing_defs . fe_deprecated = None ; <nl> - fe_type = <nl> - ( Rwitness ( root | denotable_unions . php line 9 , characters 10 - 10 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; <nl> - ft_params = <nl> - [ { fp_pos = [ 9 : 19 - 22 ] ; fp_name = ( Some " $ _x " ) ; <nl> - fp_type = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | denotable_unions . php line 9 , characters 12 - 17 ) , <nl> - ( Tintersection <nl> - [ ( Rhint ( root | denotable_unions . php line 9 , characters 13 - 13 ) , <nl> - ( Tapply ( ( [ 9 : 13 - 14 ] , " \ \ I " ) , [ ] ) ) ) ; <nl> - ( Rhint ( root | denotable_unions . php line 9 , characters 16 - 16 ) , <nl> - ( Tapply ( ( [ 9 : 16 - 17 ] , " \ \ J " ) , [ ] ) ) ) <nl> - ] ) ) <nl> - } ; <nl> - fp_flags = <nl> - ( make_fp_flags ~ mutability : None ~ accept_disposable : false <nl> - ~ has_default : false ~ mode : Typing_defs_core . FPnormal <nl> - ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> - } <nl> - ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | denotable_unions . php line 9 , characters 10 - 10 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | denotable_unions . php line 9 , characters 25 - 28 ) , <nl> - ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - fe_pos = [ 9 : 10 - 11 ] ; fe_php_std_lib = false } ; <nl> - " \ \ g " - > <nl> - { Typing_defs . fe_deprecated = None ; <nl> - fe_type = <nl> - ( Rwitness ( root | denotable_unions . php line 10 , characters 10 - 10 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; <nl> - ft_params = <nl> - [ { fp_pos = [ 10 : 19 - 22 ] ; fp_name = ( Some " $ _x " ) ; <nl> - fp_type = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | denotable_unions . php line 10 , characters 12 - 17 ) , <nl> - ( Tunion <nl> - [ ( Rhint ( root | denotable_unions . php line 10 , characters 13 - 13 ) , <nl> - ( Tapply ( ( [ 10 : 13 - 14 ] , " \ \ I " ) , [ ] ) ) ) ; <nl> - ( Rhint ( root | denotable_unions . php line 10 , characters 16 - 16 ) , <nl> - ( Tapply ( ( [ 10 : 16 - 17 ] , " \ \ J " ) , [ ] ) ) ) <nl> - ] ) ) <nl> - } ; <nl> - fp_flags = <nl> - ( make_fp_flags ~ mutability : None ~ accept_disposable : false <nl> - ~ has_default : false ~ mode : Typing_defs_core . FPnormal <nl> - ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> - } <nl> - ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | denotable_unions . php line 10 , characters 10 - 10 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | denotable_unions . php line 10 , characters 25 - 28 ) , <nl> - ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - fe_pos = [ 10 : 10 - 11 ] ; fe_php_std_lib = false } } ; <nl> - typedefs = { } ; consts = { } ; records = { } } <nl> + [ ( " \ \ I " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cinterface ; <nl> + sc_name = ( [ 6 : 11 - 12 ] , " \ \ I " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> + sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> + sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; <nl> + sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> + sc_constructor = None ; sc_static_methods = [ ] ; sc_methods = [ ] ; <nl> + sc_user_attributes = [ ] ; sc_enum_type = None } ) ) ; <nl> + ( " \ \ J " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cinterface ; <nl> + sc_name = ( [ 7 : 11 - 12 ] , " \ \ J " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> + sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> + sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; <nl> + sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> + sc_constructor = None ; sc_static_methods = [ ] ; sc_methods = [ ] ; <nl> + sc_user_attributes = [ ] ; sc_enum_type = None } ) ) ; <nl> + ( " \ \ f " , <nl> + ( Shallow_decl_defs . Fun <nl> + { Typing_defs . fe_deprecated = None ; <nl> + fe_type = <nl> + ( Rwitness ( root | denotable_unions . php line 9 , characters 10 - 10 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; <nl> + ft_params = <nl> + [ { fp_pos = [ 9 : 19 - 22 ] ; fp_name = ( Some " $ _x " ) ; <nl> + fp_type = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | denotable_unions . php line 9 , characters 12 - 17 ) , <nl> + ( Tintersection <nl> + [ ( Rhint ( root | denotable_unions . php line 9 , characters 13 - 13 ) , <nl> + ( Tapply ( ( [ 9 : 13 - 14 ] , " \ \ I " ) , [ ] ) ) ) ; <nl> + ( Rhint ( root | denotable_unions . php line 9 , characters 16 - 16 ) , <nl> + ( Tapply ( ( [ 9 : 16 - 17 ] , " \ \ J " ) , [ ] ) ) ) <nl> + ] ) ) <nl> + } ; <nl> + fp_flags = <nl> + ( make_fp_flags ~ mutability : None ~ accept_disposable : false <nl> + ~ has_default : false ~ mode : Typing_defs_core . FPnormal <nl> + ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> + } <nl> + ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | denotable_unions . php line 9 , characters 10 - 10 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | denotable_unions . php line 9 , characters 25 - 28 ) , <nl> + ( Tprim Tvoid ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + fe_pos = [ 9 : 10 - 11 ] ; fe_php_std_lib = false } ) ) ; <nl> + ( " \ \ g " , <nl> + ( Shallow_decl_defs . Fun <nl> + { Typing_defs . fe_deprecated = None ; <nl> + fe_type = <nl> + ( Rwitness ( root | denotable_unions . php line 10 , characters 10 - 10 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; <nl> + ft_params = <nl> + [ { fp_pos = [ 10 : 19 - 22 ] ; fp_name = ( Some " $ _x " ) ; <nl> + fp_type = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | denotable_unions . php line 10 , characters 12 - 17 ) , <nl> + ( Tunion <nl> + [ ( Rhint ( root | denotable_unions . php line 10 , characters 13 - 13 ) , <nl> + ( Tapply ( ( [ 10 : 13 - 14 ] , " \ \ I " ) , [ ] ) ) ) ; <nl> + ( Rhint ( root | denotable_unions . php line 10 , characters 16 - 16 ) , <nl> + ( Tapply ( ( [ 10 : 16 - 17 ] , " \ \ J " ) , [ ] ) ) ) <nl> + ] ) ) <nl> + } ; <nl> + fp_flags = <nl> + ( make_fp_flags ~ mutability : None ~ accept_disposable : false <nl> + ~ has_default : false ~ mode : Typing_defs_core . FPnormal <nl> + ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> + } <nl> + ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | denotable_unions . php line 10 , characters 10 - 10 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | denotable_unions . php line 10 , characters 25 - 28 ) , <nl> + ( Tprim Tvoid ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + fe_pos = [ 10 : 10 - 11 ] ; fe_php_std_lib = false } ) ) <nl> + ] <nl> <nl> They matched ! <nl> mmm a / hphp / hack / test / decl / deprecated . php . exp <nl> ppp b / hphp / hack / test / decl / deprecated . php . exp <nl> <nl> - Parsed decls : <nl> - <nl> - { classes = <nl> - { " \ \ DeprecatedClass " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> - sc_name = ( [ 3 : 7 - 22 ] , " \ \ DeprecatedClass " ) ; sc_tparams = [ ] ; <nl> - sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> - sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> - sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; <nl> - sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; sc_constructor = None ; <nl> - sc_static_methods = [ ] ; <nl> - sc_methods = <nl> - [ { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> - sm_memoizelsb = false ; sm_name = ( [ 5 : 19 - 22 ] , " foo " ) ; <nl> - sm_override = false ; sm_dynamicallycallable = false ; <nl> - sm_reactivity = None ; <nl> - sm_type = <nl> - ( Rwitness ( root | deprecated . php line 5 , characters 19 - 21 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | deprecated . php line 5 , characters 19 - 21 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | deprecated . php line 5 , characters 26 - 29 ) , <nl> - ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } <nl> - } ) ) ; <nl> - sm_visibility = Public ; <nl> - sm_deprecated = <nl> - ( Some " The method foo is deprecated : use bar ( ) instead " ) } ; <nl> - { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> - sm_memoizelsb = false ; sm_name = ( [ 8 : 19 - 22 ] , " bar " ) ; <nl> - sm_override = false ; sm_dynamicallycallable = false ; <nl> - sm_reactivity = None ; <nl> - sm_type = <nl> - ( Rwitness ( root | deprecated . php line 8 , characters 19 - 21 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | deprecated . php line 8 , characters 19 - 21 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | deprecated . php line 8 , characters 26 - 29 ) , <nl> - ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } <nl> - } ) ) ; <nl> - sm_visibility = Public ; sm_deprecated = None } ; <nl> - { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> - sm_memoizelsb = false ; sm_name = ( [ 11 : 19 - 22 ] , " baz " ) ; <nl> - sm_override = false ; sm_dynamicallycallable = false ; <nl> - sm_reactivity = None ; <nl> - sm_type = <nl> - ( Rwitness ( root | deprecated . php line 11 , characters 19 - 21 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | deprecated . php line 11 , characters 19 - 21 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | deprecated . php line 11 , characters 26 - 29 ) , <nl> - ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } <nl> - } ) ) ; <nl> - sm_visibility = Public ; sm_deprecated = None } ; <nl> - { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> - sm_memoizelsb = false ; sm_name = ( [ 14 : 19 - 23 ] , " foo2 " ) ; <nl> + [ ( " \ \ DeprecatedClass " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> + sc_name = ( [ 3 : 7 - 22 ] , " \ \ DeprecatedClass " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> + sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> + sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; <nl> + sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> + sc_constructor = None ; sc_static_methods = [ ] ; <nl> + sc_methods = <nl> + [ { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> + sm_memoizelsb = false ; sm_name = ( [ 5 : 19 - 22 ] , " foo " ) ; <nl> sm_override = false ; sm_dynamicallycallable = false ; <nl> sm_reactivity = None ; <nl> sm_type = <nl> - ( Rwitness ( root | deprecated . php line 14 , characters 19 - 22 ) , <nl> + ( Rwitness ( root | deprecated . php line 5 , characters 19 - 21 ) , <nl> ( Tfun <nl> { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> ft_implicit_params = <nl> { capability = <nl> - ( Rhint ( root | deprecated . php line 14 , characters 19 - 22 ) , <nl> + ( Rhint ( root | deprecated . php line 5 , characters 19 - 21 ) , <nl> ( Tunion [ ] ) ) <nl> } ; <nl> ft_ret = <nl> { et_enforced = false ; <nl> et_type = <nl> - ( Rhint ( root | deprecated . php line 14 , characters 27 - 30 ) , <nl> + ( Rhint ( root | deprecated . php line 5 , characters 26 - 29 ) , <nl> ( Tprim Tvoid ) ) <nl> } ; <nl> ft_flags = <nl> Parsed decls : <nl> } ) ) ; <nl> sm_visibility = Public ; <nl> sm_deprecated = <nl> - ( Some " The method foo2 is deprecated : use bar2 ( ) instead " ) } <nl> - ] ; <nl> - sc_user_attributes = [ ] ; sc_enum_type = None } } ; <nl> - funs = <nl> - { " \ \ bar " - > <nl> - { Typing_defs . fe_deprecated = None ; <nl> - fe_type = <nl> - ( Rwitness ( root | deprecated . php line 21 , characters 10 - 12 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | deprecated . php line 21 , characters 10 - 12 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | deprecated . php line 21 , characters 17 - 20 ) , <nl> - ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - fe_pos = [ 21 : 10 - 13 ] ; fe_php_std_lib = false } ; <nl> - " \ \ baz " - > <nl> - { Typing_defs . fe_deprecated = None ; <nl> - fe_type = <nl> - ( Rwitness ( root | deprecated . php line 24 , characters 10 - 12 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | deprecated . php line 24 , characters 10 - 12 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | deprecated . php line 24 , characters 17 - 20 ) , <nl> - ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - fe_pos = [ 24 : 10 - 13 ] ; fe_php_std_lib = false } ; <nl> - " \ \ foo " - > <nl> - { Typing_defs . fe_deprecated = <nl> - ( Some " The function foo is deprecated : use bar ( ) instead " ) ; <nl> - fe_type = <nl> - ( Rwitness ( root | deprecated . php line 18 , characters 10 - 12 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | deprecated . php line 18 , characters 10 - 12 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | deprecated . php line 18 , characters 17 - 20 ) , <nl> - ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - fe_pos = [ 18 : 10 - 13 ] ; fe_php_std_lib = false } ; <nl> - " \ \ foo2 " - > <nl> - { Typing_defs . fe_deprecated = <nl> - ( Some " The function foo2 is deprecated : use bar2 ( ) instead " ) ; <nl> - fe_type = <nl> - ( Rwitness ( root | deprecated . php line 27 , characters 10 - 13 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | deprecated . php line 27 , characters 10 - 13 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | deprecated . php line 27 , characters 18 - 21 ) , <nl> - ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - fe_pos = [ 27 : 10 - 14 ] ; fe_php_std_lib = false } } ; <nl> - typedefs = { } ; consts = { } ; records = { } } <nl> + ( Some " The method foo is deprecated : use bar ( ) instead " ) } ; <nl> + { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> + sm_memoizelsb = false ; sm_name = ( [ 8 : 19 - 22 ] , " bar " ) ; <nl> + sm_override = false ; sm_dynamicallycallable = false ; <nl> + sm_reactivity = None ; <nl> + sm_type = <nl> + ( Rwitness ( root | deprecated . php line 8 , characters 19 - 21 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | deprecated . php line 8 , characters 19 - 21 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | deprecated . php line 8 , characters 26 - 29 ) , <nl> + ( Tprim Tvoid ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; <nl> + ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + sm_visibility = Public ; sm_deprecated = None } ; <nl> + { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> + sm_memoizelsb = false ; sm_name = ( [ 11 : 19 - 22 ] , " baz " ) ; <nl> + sm_override = false ; sm_dynamicallycallable = false ; <nl> + sm_reactivity = None ; <nl> + sm_type = <nl> + ( Rwitness ( root | deprecated . php line 11 , characters 19 - 21 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | deprecated . php line 11 , characters 19 - 21 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | deprecated . php line 11 , characters 26 - 29 ) , <nl> + ( Tprim Tvoid ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; <nl> + ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + sm_visibility = Public ; sm_deprecated = None } ; <nl> + { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> + sm_memoizelsb = false ; sm_name = ( [ 14 : 19 - 23 ] , " foo2 " ) ; <nl> + sm_override = false ; sm_dynamicallycallable = false ; <nl> + sm_reactivity = None ; <nl> + sm_type = <nl> + ( Rwitness ( root | deprecated . php line 14 , characters 19 - 22 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | deprecated . php line 14 , characters 19 - 22 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | deprecated . php line 14 , characters 27 - 30 ) , <nl> + ( Tprim Tvoid ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; <nl> + ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + sm_visibility = Public ; <nl> + sm_deprecated = <nl> + ( Some " The method foo2 is deprecated : use bar2 ( ) instead " ) } <nl> + ] ; <nl> + sc_user_attributes = [ ] ; sc_enum_type = None } ) ) ; <nl> + ( " \ \ foo " , <nl> + ( Shallow_decl_defs . Fun <nl> + { Typing_defs . fe_deprecated = <nl> + ( Some " The function foo is deprecated : use bar ( ) instead " ) ; <nl> + fe_type = <nl> + ( Rwitness ( root | deprecated . php line 18 , characters 10 - 12 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | deprecated . php line 18 , characters 10 - 12 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | deprecated . php line 18 , characters 17 - 20 ) , <nl> + ( Tprim Tvoid ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + fe_pos = [ 18 : 10 - 13 ] ; fe_php_std_lib = false } ) ) ; <nl> + ( " \ \ bar " , <nl> + ( Shallow_decl_defs . Fun <nl> + { Typing_defs . fe_deprecated = None ; <nl> + fe_type = <nl> + ( Rwitness ( root | deprecated . php line 21 , characters 10 - 12 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | deprecated . php line 21 , characters 10 - 12 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | deprecated . php line 21 , characters 17 - 20 ) , <nl> + ( Tprim Tvoid ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + fe_pos = [ 21 : 10 - 13 ] ; fe_php_std_lib = false } ) ) ; <nl> + ( " \ \ baz " , <nl> + ( Shallow_decl_defs . Fun <nl> + { Typing_defs . fe_deprecated = None ; <nl> + fe_type = <nl> + ( Rwitness ( root | deprecated . php line 24 , characters 10 - 12 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | deprecated . php line 24 , characters 10 - 12 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | deprecated . php line 24 , characters 17 - 20 ) , <nl> + ( Tprim Tvoid ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + fe_pos = [ 24 : 10 - 13 ] ; fe_php_std_lib = false } ) ) ; <nl> + ( " \ \ foo2 " , <nl> + ( Shallow_decl_defs . Fun <nl> + { Typing_defs . fe_deprecated = <nl> + ( Some " The function foo2 is deprecated : use bar2 ( ) instead " ) ; <nl> + fe_type = <nl> + ( Rwitness ( root | deprecated . php line 27 , characters 10 - 13 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | deprecated . php line 27 , characters 10 - 13 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | deprecated . php line 27 , characters 18 - 21 ) , <nl> + ( Tprim Tvoid ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + fe_pos = [ 27 : 10 - 14 ] ; fe_php_std_lib = false } ) ) <nl> + ] <nl> <nl> They matched ! <nl> mmm a / hphp / hack / test / decl / deprecated_string_concat . php . exp <nl> ppp b / hphp / hack / test / decl / deprecated_string_concat . php . exp <nl> <nl> - Parsed decls : <nl> - <nl> - { classes = { } ; <nl> - funs = <nl> - { " \ \ doubledouble " - > <nl> - { Typing_defs . fe_deprecated = <nl> - ( Some " The function doubledouble is deprecated : doubledouble " ) ; <nl> - fe_type = <nl> - ( Rwitness ( root | deprecated_string_concat . php line 7 , characters 10 - 21 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | deprecated_string_concat . php line 7 , characters 10 - 21 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | deprecated_string_concat . php line 7 , characters 26 - 29 ) , <nl> - ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - fe_pos = [ 7 : 10 - 22 ] ; fe_php_std_lib = false } ; <nl> - " \ \ heredoc " - > <nl> - { Typing_defs . fe_deprecated = <nl> - ( Some " The function heredoc is deprecated : single heredoc " ) ; <nl> - fe_type = <nl> - ( Rwitness ( root | deprecated_string_concat . php line 19 , characters 10 - 16 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | deprecated_string_concat . php line 19 , characters 10 - 16 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | deprecated_string_concat . php line 19 , characters 21 - 24 ) , <nl> - ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - fe_pos = [ 19 : 10 - 17 ] ; fe_php_std_lib = false } ; <nl> - " \ \ nowdoc " - > <nl> - { Typing_defs . fe_deprecated = <nl> - ( Some " The function nowdoc is deprecated : single nowdoc " ) ; <nl> - fe_type = <nl> - ( Rwitness ( root | deprecated_string_concat . php line 25 , characters 10 - 15 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | deprecated_string_concat . php line 25 , characters 10 - 15 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | deprecated_string_concat . php line 25 , characters 20 - 23 ) , <nl> - ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - fe_pos = [ 25 : 10 - 16 ] ; fe_php_std_lib = false } ; <nl> - " \ \ singledouble " - > <nl> - { Typing_defs . fe_deprecated = <nl> - ( Some " The function singledouble is deprecated : singledouble " ) ; <nl> - fe_type = <nl> - ( Rwitness ( root | deprecated_string_concat . php line 10 , characters 10 - 21 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | deprecated_string_concat . php line 10 , characters 10 - 21 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | deprecated_string_concat . php line 10 , characters 26 - 29 ) , <nl> - ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - fe_pos = [ 10 : 10 - 22 ] ; fe_php_std_lib = false } ; <nl> - " \ \ singledoublesingle " - > <nl> - { Typing_defs . fe_deprecated = <nl> - ( Some " The function singledoublesingle is deprecated : singledoublesingle " ) ; <nl> - fe_type = <nl> - ( Rwitness ( root | deprecated_string_concat . php line 13 , characters 10 - 27 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | deprecated_string_concat . php line 13 , characters 10 - 27 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | deprecated_string_concat . php line 13 , characters 32 - 35 ) , <nl> - ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - fe_pos = [ 13 : 10 - 28 ] ; fe_php_std_lib = false } ; <nl> - " \ \ singlesingle " - > <nl> - { Typing_defs . fe_deprecated = <nl> - ( Some " The function singlesingle is deprecated : singlesingle " ) ; <nl> - fe_type = <nl> - ( Rwitness ( root | deprecated_string_concat . php line 4 , characters 10 - 21 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | deprecated_string_concat . php line 4 , characters 10 - 21 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | deprecated_string_concat . php line 4 , characters 26 - 29 ) , <nl> - ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - fe_pos = [ 4 : 10 - 22 ] ; fe_php_std_lib = false } } ; <nl> - typedefs = { } ; consts = { } ; records = { } } <nl> + [ ( " \ \ singlesingle " , <nl> + ( Shallow_decl_defs . Fun <nl> + { Typing_defs . fe_deprecated = <nl> + ( Some " The function singlesingle is deprecated : singlesingle " ) ; <nl> + fe_type = <nl> + ( Rwitness ( root | deprecated_string_concat . php line 4 , characters 10 - 21 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | deprecated_string_concat . php line 4 , characters 10 - 21 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | deprecated_string_concat . php line 4 , characters 26 - 29 ) , <nl> + ( Tprim Tvoid ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + fe_pos = [ 4 : 10 - 22 ] ; fe_php_std_lib = false } ) ) ; <nl> + ( " \ \ doubledouble " , <nl> + ( Shallow_decl_defs . Fun <nl> + { Typing_defs . fe_deprecated = <nl> + ( Some " The function doubledouble is deprecated : doubledouble " ) ; <nl> + fe_type = <nl> + ( Rwitness ( root | deprecated_string_concat . php line 7 , characters 10 - 21 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | deprecated_string_concat . php line 7 , characters 10 - 21 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | deprecated_string_concat . php line 7 , characters 26 - 29 ) , <nl> + ( Tprim Tvoid ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + fe_pos = [ 7 : 10 - 22 ] ; fe_php_std_lib = false } ) ) ; <nl> + ( " \ \ singledouble " , <nl> + ( Shallow_decl_defs . Fun <nl> + { Typing_defs . fe_deprecated = <nl> + ( Some " The function singledouble is deprecated : singledouble " ) ; <nl> + fe_type = <nl> + ( Rwitness ( root | deprecated_string_concat . php line 10 , characters 10 - 21 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | deprecated_string_concat . php line 10 , characters 10 - 21 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | deprecated_string_concat . php line 10 , characters 26 - 29 ) , <nl> + ( Tprim Tvoid ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + fe_pos = [ 10 : 10 - 22 ] ; fe_php_std_lib = false } ) ) ; <nl> + ( " \ \ singledoublesingle " , <nl> + ( Shallow_decl_defs . Fun <nl> + { Typing_defs . fe_deprecated = <nl> + ( Some " The function singledoublesingle is deprecated : singledoublesingle " ) ; <nl> + fe_type = <nl> + ( Rwitness ( root | deprecated_string_concat . php line 13 , characters 10 - 27 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | deprecated_string_concat . php line 13 , characters 10 - 27 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | deprecated_string_concat . php line 13 , characters 32 - 35 ) , <nl> + ( Tprim Tvoid ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + fe_pos = [ 13 : 10 - 28 ] ; fe_php_std_lib = false } ) ) ; <nl> + ( " \ \ heredoc " , <nl> + ( Shallow_decl_defs . Fun <nl> + { Typing_defs . fe_deprecated = <nl> + ( Some " The function heredoc is deprecated : single heredoc " ) ; <nl> + fe_type = <nl> + ( Rwitness ( root | deprecated_string_concat . php line 19 , characters 10 - 16 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | deprecated_string_concat . php line 19 , characters 10 - 16 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | deprecated_string_concat . php line 19 , characters 21 - 24 ) , <nl> + ( Tprim Tvoid ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + fe_pos = [ 19 : 10 - 17 ] ; fe_php_std_lib = false } ) ) ; <nl> + ( " \ \ nowdoc " , <nl> + ( Shallow_decl_defs . Fun <nl> + { Typing_defs . fe_deprecated = <nl> + ( Some " The function nowdoc is deprecated : single nowdoc " ) ; <nl> + fe_type = <nl> + ( Rwitness ( root | deprecated_string_concat . php line 25 , characters 10 - 15 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | deprecated_string_concat . php line 25 , characters 10 - 15 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | deprecated_string_concat . php line 25 , characters 20 - 23 ) , <nl> + ( Tprim Tvoid ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + fe_pos = [ 25 : 10 - 16 ] ; fe_php_std_lib = false } ) ) <nl> + ] <nl> <nl> They matched ! <nl> mmm a / hphp / hack / test / decl / deprecated_string_escaping . php . exp <nl> ppp b / hphp / hack / test / decl / deprecated_string_escaping . php . exp <nl> <nl> - Parsed decls : <nl> - <nl> - { classes = { } ; <nl> - funs = <nl> - { " \ \ double " - > <nl> - { Typing_defs . fe_deprecated = <nl> - ( Some " The function double is deprecated : other escapes like \ n and \ t available in double quotes " ) ; <nl> - fe_type = <nl> - ( Rwitness ( root | deprecated_string_escaping . php line 7 , characters 10 - 15 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | deprecated_string_escaping . php line 7 , characters 10 - 15 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | deprecated_string_escaping . php line 7 , characters 20 - 23 ) , <nl> - ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - fe_pos = [ 7 : 10 - 16 ] ; fe_php_std_lib = false } ; <nl> - " \ \ single " - > <nl> - { Typing_defs . fe_deprecated = <nl> - ( Some " The function single is deprecated : can ' t write an apostrophe without escaping in single quotes " ) ; <nl> - fe_type = <nl> - ( Rwitness ( root | deprecated_string_escaping . php line 4 , characters 10 - 15 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | deprecated_string_escaping . php line 4 , characters 10 - 15 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | deprecated_string_escaping . php line 4 , characters 20 - 23 ) , <nl> - ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - fe_pos = [ 4 : 10 - 16 ] ; fe_php_std_lib = false } } ; <nl> - typedefs = { } ; consts = { } ; records = { } } <nl> + [ ( " \ \ single " , <nl> + ( Shallow_decl_defs . Fun <nl> + { Typing_defs . fe_deprecated = <nl> + ( Some " The function single is deprecated : can ' t write an apostrophe without escaping in single quotes " ) ; <nl> + fe_type = <nl> + ( Rwitness ( root | deprecated_string_escaping . php line 4 , characters 10 - 15 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | deprecated_string_escaping . php line 4 , characters 10 - 15 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | deprecated_string_escaping . php line 4 , characters 20 - 23 ) , <nl> + ( Tprim Tvoid ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + fe_pos = [ 4 : 10 - 16 ] ; fe_php_std_lib = false } ) ) ; <nl> + ( " \ \ double " , <nl> + ( Shallow_decl_defs . Fun <nl> + { Typing_defs . fe_deprecated = <nl> + ( Some " The function double is deprecated : other escapes like \ n and \ t available in double quotes " ) ; <nl> + fe_type = <nl> + ( Rwitness ( root | deprecated_string_escaping . php line 7 , characters 10 - 15 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | deprecated_string_escaping . php line 7 , characters 10 - 15 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | deprecated_string_escaping . php line 7 , characters 20 - 23 ) , <nl> + ( Tprim Tvoid ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + fe_pos = [ 7 : 10 - 16 ] ; fe_php_std_lib = false } ) ) <nl> + ] <nl> <nl> They matched ! <nl> mmm a / hphp / hack / test / decl / dynamically_callable . php . exp <nl> ppp b / hphp / hack / test / decl / dynamically_callable . php . exp <nl> <nl> - Parsed decls : <nl> - <nl> - { classes = <nl> - { " \ \ X " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> - sc_name = ( [ 12 : 7 - 8 ] , " \ \ X " ) ; sc_tparams = [ ] ; <nl> - sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> - sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> - sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; <nl> - sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; sc_constructor = None ; <nl> - sc_static_methods = [ ] ; <nl> - sc_methods = <nl> - [ { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> - sm_memoizelsb = false ; sm_name = ( [ 14 : 19 - 22 ] , " pub " ) ; <nl> - sm_override = false ; sm_dynamicallycallable = true ; <nl> - sm_reactivity = None ; <nl> - sm_type = <nl> - ( Rwitness ( root | dynamically_callable . php line 14 , characters 19 - 21 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | dynamically_callable . php line 14 , characters 19 - 21 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | dynamically_callable . php line 14 , characters 26 - 29 ) , <nl> - ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } <nl> - } ) ) ; <nl> - sm_visibility = Public ; sm_deprecated = None } <nl> - ] ; <nl> - sc_user_attributes = [ ] ; sc_enum_type = None } } ; <nl> - funs = { } ; typedefs = { } ; consts = { } ; records = { } } <nl> + [ ( " \ \ X " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> + sc_name = ( [ 12 : 7 - 8 ] , " \ \ X " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> + sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> + sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; <nl> + sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> + sc_constructor = None ; sc_static_methods = [ ] ; <nl> + sc_methods = <nl> + [ { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> + sm_memoizelsb = false ; sm_name = ( [ 14 : 19 - 22 ] , " pub " ) ; <nl> + sm_override = false ; sm_dynamicallycallable = true ; <nl> + sm_reactivity = None ; <nl> + sm_type = <nl> + ( Rwitness ( root | dynamically_callable . php line 14 , characters 19 - 21 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | dynamically_callable . php line 14 , characters 19 - 21 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | dynamically_callable . php line 14 , characters 26 - 29 ) , <nl> + ( Tprim Tvoid ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } <nl> + } ) ) ; <nl> + sm_visibility = Public ; sm_deprecated = None } <nl> + ] ; <nl> + sc_user_attributes = [ ] ; sc_enum_type = None } ) ) <nl> + ] <nl> <nl> They matched ! <nl> mmm a / hphp / hack / test / decl / empty_method_name . php . exp <nl> ppp b / hphp / hack / test / decl / empty_method_name . php . exp <nl> <nl> - Parsed decls : <nl> - <nl> - { classes = <nl> - { " \ \ A " - > <nl> - { Shallow_decl_defs . sc_mode = Mpartial ; sc_final = false ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> - sc_name = ( [ 3 : 7 - 8 ] , " \ \ A " ) ; sc_tparams = [ ] ; sc_where_constraints = [ ] ; <nl> - sc_extends = [ ] ; sc_uses = [ ] ; sc_xhp_attr_uses = [ ] ; <nl> - sc_req_extends = [ ] ; sc_req_implements = [ ] ; sc_implements = [ ] ; <nl> - sc_consts = [ ] ; sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; sc_props = [ ] ; <nl> - sc_sprops = [ ] ; sc_constructor = None ; sc_static_methods = [ ] ; <nl> - sc_methods = <nl> - [ { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> - sm_memoizelsb = false ; sm_name = ( [ 4 : 19 - 20 ] , " " ) ; <nl> - sm_override = false ; sm_dynamicallycallable = false ; <nl> - sm_reactivity = None ; <nl> - sm_type = <nl> - ( Rwitness ( root | empty_method_name . php line 4 , characters 19 - 19 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | empty_method_name . php line 4 , characters 19 - 19 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | empty_method_name . php line 4 , characters 24 - 27 ) , <nl> - ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } <nl> - } ) ) ; <nl> - sm_visibility = Public ; sm_deprecated = None } <nl> - ] ; <nl> - sc_user_attributes = [ ] ; sc_enum_type = None } } ; <nl> - funs = { } ; typedefs = { } ; consts = { } ; records = { } } <nl> + [ ( " \ \ A " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mpartial ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> + sc_name = ( [ 3 : 7 - 8 ] , " \ \ A " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> + sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> + sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; <nl> + sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> + sc_constructor = None ; sc_static_methods = [ ] ; <nl> + sc_methods = <nl> + [ { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> + sm_memoizelsb = false ; sm_name = ( [ 4 : 19 - 20 ] , " " ) ; <nl> + sm_override = false ; sm_dynamicallycallable = false ; <nl> + sm_reactivity = None ; <nl> + sm_type = <nl> + ( Rwitness ( root | empty_method_name . php line 4 , characters 19 - 19 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | empty_method_name . php line 4 , characters 19 - 19 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | empty_method_name . php line 4 , characters 24 - 27 ) , <nl> + ( Tprim Tvoid ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } <nl> + } ) ) ; <nl> + sm_visibility = Public ; sm_deprecated = None } <nl> + ] ; <nl> + sc_user_attributes = [ ] ; sc_enum_type = None } ) ) <nl> + ] <nl> <nl> They matched ! <nl> mmm a / hphp / hack / test / decl / enforceable_type_const . php . exp <nl> ppp b / hphp / hack / test / decl / enforceable_type_const . php . exp <nl> <nl> - Parsed decls : <nl> - <nl> - { classes = <nl> - { " \ \ I " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cinterface ; <nl> - sc_name = ( [ 3 : 11 - 12 ] , " \ \ I " ) ; sc_tparams = [ ] ; <nl> - sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> - sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> - sc_implements = [ ] ; sc_consts = [ ] ; <nl> - sc_typeconsts = <nl> - [ { Shallow_decl_defs . stc_abstract = ( Typing_defs . TCAbstract None ) ; <nl> - stc_constraint = <nl> - ( Some ( Rhint ( root | enforceable_type_const . php line 4 , characters 46 - 53 ) , <nl> - ( Tprim Tarraykey ) ) ) ; <nl> - stc_name = ( [ 4 : 41 - 42 ] , " T " ) ; stc_type = None ; <nl> - stc_enforceable = ( [ 4 : 5 - 18 ] , true ) ; stc_reifiable = None } <nl> - ] ; <nl> - sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; sc_constructor = None ; <nl> - sc_static_methods = [ ] ; sc_methods = [ ] ; sc_user_attributes = [ ] ; <nl> - sc_enum_type = None } } ; <nl> - funs = { } ; typedefs = { } ; consts = { } ; records = { } } <nl> + [ ( " \ \ I " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cinterface ; <nl> + sc_name = ( [ 3 : 11 - 12 ] , " \ \ I " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> + sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> + sc_implements = [ ] ; sc_consts = [ ] ; <nl> + sc_typeconsts = <nl> + [ { Shallow_decl_defs . stc_abstract = ( Typing_defs . TCAbstract None ) ; <nl> + stc_constraint = <nl> + ( Some ( Rhint ( root | enforceable_type_const . php line 4 , characters 46 - 53 ) , <nl> + ( Tprim Tarraykey ) ) ) ; <nl> + stc_name = ( [ 4 : 41 - 42 ] , " T " ) ; stc_type = None ; <nl> + stc_enforceable = ( [ 4 : 5 - 18 ] , true ) ; stc_reifiable = None } <nl> + ] ; <nl> + sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> + sc_constructor = None ; sc_static_methods = [ ] ; sc_methods = [ ] ; <nl> + sc_user_attributes = [ ] ; sc_enum_type = None } ) ) <nl> + ] <nl> <nl> They matched ! <nl> mmm a / hphp / hack / test / decl / enum_constraint . php . exp <nl> ppp b / hphp / hack / test / decl / enum_constraint . php . exp <nl> <nl> - Parsed decls : <nl> - <nl> - { classes = <nl> - { " \ \ A " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cenum ; <nl> - sc_name = ( [ 3 : 6 - 7 ] , " \ \ A " ) ; sc_tparams = [ ] ; sc_where_constraints = [ ] ; <nl> - sc_extends = <nl> - [ ( Rhint ( root | enum_constraint . php line 3 , characters 6 - 6 ) , <nl> - ( Tapply ( ( [ 3 : 6 - 7 ] , " \ \ HH \ \ BuiltinEnum " ) , <nl> - [ ( Rhint ( root | enum_constraint . php line 3 , characters 6 - 6 ) , <nl> - ( Tapply ( ( [ 3 : 6 - 7 ] , " \ \ A " ) , [ ] ) ) ) ] <nl> - ) ) ) <nl> - ] ; <nl> - sc_uses = [ ] ; sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; <nl> - sc_req_implements = [ ] ; sc_implements = [ ] ; sc_consts = [ ] ; <nl> - sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> - sc_constructor = None ; sc_static_methods = [ ] ; sc_methods = [ ] ; <nl> - sc_user_attributes = [ ] ; <nl> - sc_enum_type = <nl> - ( Some { Typing_defs . te_base = <nl> - ( Rhint ( root | enum_constraint . php line 3 , characters 10 - 15 ) , <nl> - ( Tprim Tstring ) ) ; <nl> - te_constraint = <nl> - ( Some ( Rhint ( root | enum_constraint . php line 3 , characters 20 - 25 ) , <nl> - ( Tprim Tstring ) ) ) ; <nl> - te_includes = [ ] ; te_enum_class = false } ) <nl> - } ; <nl> - " \ \ B " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cenum ; <nl> - sc_name = ( [ 5 : 6 - 7 ] , " \ \ B " ) ; sc_tparams = [ ] ; sc_where_constraints = [ ] ; <nl> - sc_extends = <nl> - [ ( Rhint ( root | enum_constraint . php line 5 , characters 6 - 6 ) , <nl> - ( Tapply ( ( [ 5 : 6 - 7 ] , " \ \ HH \ \ BuiltinEnum " ) , <nl> - [ ( Rhint ( root | enum_constraint . php line 5 , characters 6 - 6 ) , <nl> - ( Tapply ( ( [ 5 : 6 - 7 ] , " \ \ B " ) , [ ] ) ) ) ] <nl> - ) ) ) <nl> - ] ; <nl> - sc_uses = [ ] ; sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; <nl> - sc_req_implements = [ ] ; sc_implements = [ ] ; sc_consts = [ ] ; <nl> - sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> - sc_constructor = None ; sc_static_methods = [ ] ; sc_methods = [ ] ; <nl> - sc_user_attributes = [ ] ; <nl> - sc_enum_type = <nl> - ( Some { Typing_defs . te_base = <nl> - ( Rhint ( root | enum_constraint . php line 5 , characters 10 - 12 ) , <nl> - ( Tprim Tint ) ) ; <nl> - te_constraint = <nl> - ( Some ( Rhint ( root | enum_constraint . php line 5 , characters 17 - 23 ) , <nl> - ( Tapply ( ( [ 5 : 17 - 21 ] , " \ \ IdOf " ) , <nl> - [ ( Rhint ( root | enum_constraint . php line 5 , characters 22 - 22 ) , <nl> - ( Tapply ( ( [ 5 : 22 - 23 ] , " \ \ X " ) , [ ] ) ) ) ] <nl> - ) ) ) ) ; <nl> - te_includes = [ ] ; te_enum_class = false } ) <nl> - } } ; <nl> - funs = { } ; typedefs = { } ; consts = { } ; records = { } } <nl> + [ ( " \ \ A " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cenum ; <nl> + sc_name = ( [ 3 : 6 - 7 ] , " \ \ A " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = [ ] ; <nl> + sc_extends = <nl> + [ ( Rhint ( root | enum_constraint . php line 3 , characters 6 - 6 ) , <nl> + ( Tapply ( ( [ 3 : 6 - 7 ] , " \ \ HH \ \ BuiltinEnum " ) , <nl> + [ ( Rhint ( root | enum_constraint . php line 3 , characters 6 - 6 ) , <nl> + ( Tapply ( ( [ 3 : 6 - 7 ] , " \ \ A " ) , [ ] ) ) ) ] <nl> + ) ) ) <nl> + ] ; <nl> + sc_uses = [ ] ; sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; <nl> + sc_req_implements = [ ] ; sc_implements = [ ] ; sc_consts = [ ] ; <nl> + sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> + sc_constructor = None ; sc_static_methods = [ ] ; sc_methods = [ ] ; <nl> + sc_user_attributes = [ ] ; <nl> + sc_enum_type = <nl> + ( Some { Typing_defs . te_base = <nl> + ( Rhint ( root | enum_constraint . php line 3 , characters 10 - 15 ) , <nl> + ( Tprim Tstring ) ) ; <nl> + te_constraint = <nl> + ( Some ( Rhint ( root | enum_constraint . php line 3 , characters 20 - 25 ) , <nl> + ( Tprim Tstring ) ) ) ; <nl> + te_includes = [ ] ; te_enum_class = false } ) <nl> + } ) ) ; <nl> + ( " \ \ B " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cenum ; <nl> + sc_name = ( [ 5 : 6 - 7 ] , " \ \ B " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = [ ] ; <nl> + sc_extends = <nl> + [ ( Rhint ( root | enum_constraint . php line 5 , characters 6 - 6 ) , <nl> + ( Tapply ( ( [ 5 : 6 - 7 ] , " \ \ HH \ \ BuiltinEnum " ) , <nl> + [ ( Rhint ( root | enum_constraint . php line 5 , characters 6 - 6 ) , <nl> + ( Tapply ( ( [ 5 : 6 - 7 ] , " \ \ B " ) , [ ] ) ) ) ] <nl> + ) ) ) <nl> + ] ; <nl> + sc_uses = [ ] ; sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; <nl> + sc_req_implements = [ ] ; sc_implements = [ ] ; sc_consts = [ ] ; <nl> + sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> + sc_constructor = None ; sc_static_methods = [ ] ; sc_methods = [ ] ; <nl> + sc_user_attributes = [ ] ; <nl> + sc_enum_type = <nl> + ( Some { Typing_defs . te_base = <nl> + ( Rhint ( root | enum_constraint . php line 5 , characters 10 - 12 ) , <nl> + ( Tprim Tint ) ) ; <nl> + te_constraint = <nl> + ( Some ( Rhint ( root | enum_constraint . php line 5 , characters 17 - 23 ) , <nl> + ( Tapply ( ( [ 5 : 17 - 21 ] , " \ \ IdOf " ) , <nl> + [ ( Rhint ( root | enum_constraint . php line 5 , characters 22 - 22 ) , <nl> + ( Tapply ( ( [ 5 : 22 - 23 ] , " \ \ X " ) , [ ] ) ) ) ] <nl> + ) ) ) ) ; <nl> + te_includes = [ ] ; te_enum_class = false } ) <nl> + } ) ) <nl> + ] <nl> <nl> They matched ! <nl> mmm a / hphp / hack / test / decl / enum_user_attributes . php . exp <nl> ppp b / hphp / hack / test / decl / enum_user_attributes . php . exp <nl> <nl> - Parsed decls : <nl> - <nl> - { classes = <nl> - { " \ \ E " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cenum ; <nl> - sc_name = ( [ 4 : 6 - 7 ] , " \ \ E " ) ; sc_tparams = [ ] ; sc_where_constraints = [ ] ; <nl> - sc_extends = <nl> - [ ( Rhint ( root | enum_user_attributes . php line 4 , characters 6 - 6 ) , <nl> - ( Tapply ( ( [ 4 : 6 - 7 ] , " \ \ HH \ \ BuiltinEnum " ) , <nl> - [ ( Rhint ( root | enum_user_attributes . php line 4 , characters 6 - 6 ) , <nl> - ( Tapply ( ( [ 4 : 6 - 7 ] , " \ \ E " ) , [ ] ) ) ) ] <nl> - ) ) ) <nl> - ] ; <nl> - sc_uses = [ ] ; sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; <nl> - sc_req_implements = [ ] ; sc_implements = [ ] ; <nl> - sc_consts = <nl> - [ { Shallow_decl_defs . scc_abstract = false ; scc_name = ( [ 5 : 3 - 4 ] , " A " ) ; <nl> - scc_type = <nl> - ( Rwitness ( root | enum_user_attributes . php line 5 , characters 7 - 9 ) , <nl> - ( Tprim Tstring ) ) <nl> - } ; <nl> - { Shallow_decl_defs . scc_abstract = false ; scc_name = ( [ 6 : 3 - 4 ] , " B " ) ; <nl> + [ ( " \ \ E " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cenum ; <nl> + sc_name = ( [ 4 : 6 - 7 ] , " \ \ E " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = [ ] ; <nl> + sc_extends = <nl> + [ ( Rhint ( root | enum_user_attributes . php line 4 , characters 6 - 6 ) , <nl> + ( Tapply ( ( [ 4 : 6 - 7 ] , " \ \ HH \ \ BuiltinEnum " ) , <nl> + [ ( Rhint ( root | enum_user_attributes . php line 4 , characters 6 - 6 ) , <nl> + ( Tapply ( ( [ 4 : 6 - 7 ] , " \ \ E " ) , [ ] ) ) ) ] <nl> + ) ) ) <nl> + ] ; <nl> + sc_uses = [ ] ; sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; <nl> + sc_req_implements = [ ] ; sc_implements = [ ] ; <nl> + sc_consts = <nl> + [ { Shallow_decl_defs . scc_abstract = false ; scc_name = ( [ 5 : 3 - 4 ] , " A " ) ; <nl> scc_type = <nl> - ( Rwitness ( root | enum_user_attributes . php line 6 , characters 7 - 9 ) , <nl> + ( Rwitness ( root | enum_user_attributes . php line 5 , characters 7 - 9 ) , <nl> ( Tprim Tstring ) ) <nl> - } <nl> - ] ; <nl> - sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> - sc_constructor = None ; sc_static_methods = [ ] ; sc_methods = [ ] ; <nl> - sc_user_attributes = <nl> - [ { Typing_defs_core . ua_name = ( [ 3 : 18 - 21 ] , " \ \ Bar " ) ; <nl> - ua_classname_params = [ ] } ; <nl> - { Typing_defs_core . ua_name = ( [ 3 : 3 - 6 ] , " \ \ Foo " ) ; <nl> - ua_classname_params = [ ] } <nl> - ] ; <nl> - sc_enum_type = <nl> - ( Some { Typing_defs . te_base = <nl> - ( Rhint ( root | enum_user_attributes . php line 4 , characters 10 - 15 ) , <nl> - ( Tprim Tstring ) ) ; <nl> - te_constraint = None ; te_includes = [ ] ; te_enum_class = false } ) <nl> - } } ; <nl> - funs = { } ; typedefs = { } ; consts = { } ; records = { } } <nl> + } ; <nl> + { Shallow_decl_defs . scc_abstract = false ; scc_name = ( [ 6 : 3 - 4 ] , " B " ) ; <nl> + scc_type = <nl> + ( Rwitness ( root | enum_user_attributes . php line 6 , characters 7 - 9 ) , <nl> + ( Tprim Tstring ) ) <nl> + } <nl> + ] ; <nl> + sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> + sc_constructor = None ; sc_static_methods = [ ] ; sc_methods = [ ] ; <nl> + sc_user_attributes = <nl> + [ { Typing_defs_core . ua_name = ( [ 3 : 18 - 21 ] , " \ \ Bar " ) ; <nl> + ua_classname_params = [ ] } ; <nl> + { Typing_defs_core . ua_name = ( [ 3 : 3 - 6 ] , " \ \ Foo " ) ; <nl> + ua_classname_params = [ ] } <nl> + ] ; <nl> + sc_enum_type = <nl> + ( Some { Typing_defs . te_base = <nl> + ( Rhint ( root | enum_user_attributes . php line 4 , characters 10 - 15 ) , <nl> + ( Tprim Tstring ) ) ; <nl> + te_constraint = None ; te_includes = [ ] ; te_enum_class = false <nl> + } ) <nl> + } ) ) <nl> + ] <nl> <nl> They matched ! <nl> mmm a / hphp / hack / test / decl / enums . php . exp <nl> ppp b / hphp / hack / test / decl / enums . php . exp <nl> <nl> - Parsed decls : <nl> - <nl> - { classes = <nl> - { " \ \ Foo " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cenum ; <nl> - sc_name = ( [ 3 : 6 - 9 ] , " \ \ Foo " ) ; sc_tparams = [ ] ; <nl> - sc_where_constraints = [ ] ; <nl> - sc_extends = <nl> - [ ( Rhint ( root | enums . php line 3 , characters 6 - 8 ) , <nl> - ( Tapply ( ( [ 3 : 6 - 9 ] , " \ \ HH \ \ BuiltinEnum " ) , <nl> - [ ( Rhint ( root | enums . php line 3 , characters 6 - 8 ) , <nl> - ( Tapply ( ( [ 3 : 6 - 9 ] , " \ \ Foo " ) , [ ] ) ) ) ] <nl> - ) ) ) <nl> - ] ; <nl> - sc_uses = [ ] ; sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; <nl> - sc_req_implements = [ ] ; sc_implements = [ ] ; <nl> - sc_consts = <nl> - [ { Shallow_decl_defs . scc_abstract = false ; scc_name = ( [ 4 : 3 - 6 ] , " FOO " ) ; <nl> - scc_type = <nl> - ( Rwitness ( root | enums . php line 4 , characters 9 - 9 ) , ( Tprim Tint ) ) } ; <nl> - { Shallow_decl_defs . scc_abstract = false ; <nl> - scc_name = ( [ 5 : 3 - 6 ] , " BAR " ) ; <nl> - scc_type = <nl> - ( Rwitness ( root | enums . php line 5 , characters 9 - 9 ) , ( Tprim Tint ) ) } ; <nl> - { Shallow_decl_defs . scc_abstract = false ; <nl> - scc_name = ( [ 6 : 3 - 6 ] , " BAZ " ) ; <nl> + [ ( " \ \ Foo " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cenum ; <nl> + sc_name = ( [ 3 : 6 - 9 ] , " \ \ Foo " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = [ ] ; <nl> + sc_extends = <nl> + [ ( Rhint ( root | enums . php line 3 , characters 6 - 8 ) , <nl> + ( Tapply ( ( [ 3 : 6 - 9 ] , " \ \ HH \ \ BuiltinEnum " ) , <nl> + [ ( Rhint ( root | enums . php line 3 , characters 6 - 8 ) , <nl> + ( Tapply ( ( [ 3 : 6 - 9 ] , " \ \ Foo " ) , [ ] ) ) ) ] <nl> + ) ) ) <nl> + ] ; <nl> + sc_uses = [ ] ; sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; <nl> + sc_req_implements = [ ] ; sc_implements = [ ] ; <nl> + sc_consts = <nl> + [ { Shallow_decl_defs . scc_abstract = false ; <nl> + scc_name = ( [ 4 : 3 - 6 ] , " FOO " ) ; <nl> scc_type = <nl> - ( Rwitness ( root | enums . php line 6 , characters 9 - 9 ) , ( Tprim Tint ) ) } <nl> - ] ; <nl> - sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> - sc_constructor = None ; sc_static_methods = [ ] ; sc_methods = [ ] ; <nl> - sc_user_attributes = [ ] ; <nl> - sc_enum_type = <nl> - ( Some { Typing_defs . te_base = <nl> - ( Rhint ( root | enums . php line 3 , characters 11 - 13 ) , ( Tprim Tint ) ) ; <nl> - te_constraint = None ; te_includes = [ ] ; te_enum_class = false } ) <nl> - } } ; <nl> - funs = { } ; typedefs = { } ; consts = { } ; records = { } } <nl> + ( Rwitness ( root | enums . php line 4 , characters 9 - 9 ) , ( Tprim Tint ) ) } ; <nl> + { Shallow_decl_defs . scc_abstract = false ; <nl> + scc_name = ( [ 5 : 3 - 6 ] , " BAR " ) ; <nl> + scc_type = <nl> + ( Rwitness ( root | enums . php line 5 , characters 9 - 9 ) , ( Tprim Tint ) ) } ; <nl> + { Shallow_decl_defs . scc_abstract = false ; <nl> + scc_name = ( [ 6 : 3 - 6 ] , " BAZ " ) ; <nl> + scc_type = <nl> + ( Rwitness ( root | enums . php line 6 , characters 9 - 9 ) , ( Tprim Tint ) ) } <nl> + ] ; <nl> + sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> + sc_constructor = None ; sc_static_methods = [ ] ; sc_methods = [ ] ; <nl> + sc_user_attributes = [ ] ; <nl> + sc_enum_type = <nl> + ( Some { Typing_defs . te_base = <nl> + ( Rhint ( root | enums . php line 3 , characters 11 - 13 ) , ( Tprim Tint ) ) ; <nl> + te_constraint = None ; te_includes = [ ] ; te_enum_class = false <nl> + } ) <nl> + } ) ) <nl> + ] <nl> <nl> They matched ! <nl> mmm a / hphp / hack / test / decl / explicit_type_collection . php . exp <nl> ppp b / hphp / hack / test / decl / explicit_type_collection . php . exp <nl> <nl> - Parsed decls : <nl> - <nl> - { classes = <nl> - { " \ \ A " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> - sc_name = ( [ 3 : 7 - 8 ] , " \ \ A " ) ; sc_tparams = [ ] ; sc_where_constraints = [ ] ; <nl> - sc_extends = [ ] ; sc_uses = [ ] ; sc_xhp_attr_uses = [ ] ; <nl> - sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> - sc_implements = <nl> - [ ( Rhint ( root | explicit_type_collection . php line 3 , characters 20 - 36 ) , <nl> - ( Tapply ( ( [ 3 : 20 - 37 ] , " \ \ HH \ \ ClassAttribute " ) , [ ] ) ) ) ] ; <nl> - sc_consts = [ ] ; sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; <nl> - sc_props = <nl> - [ { Shallow_decl_defs . sp_const = false ; sp_xhp_attr = None ; <nl> - sp_lateinit = false ; sp_lsb = false ; sp_name = ( [ 4 : 49 - 51 ] , " i " ) ; <nl> - sp_needs_init = true ; <nl> - sp_type = <nl> - ( Some ( Rhint ( root | explicit_type_collection . php line 4 , characters 38 - 47 ) , <nl> - ( Tapply ( ( [ 4 : 38 - 41 ] , " \ \ HH \ \ vec " ) , <nl> - [ ( Rhint ( root | explicit_type_collection . php line 4 , characters 42 - 46 ) , <nl> - Tmixed ) ] <nl> - ) ) ) ) ; <nl> - sp_abstract = false ; sp_visibility = Public } <nl> - ] ; <nl> - sc_sprops = [ ] ; <nl> - sc_constructor = <nl> - ( Some { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> - sm_memoizelsb = false ; sm_name = ( [ 4 : 19 - 30 ] , " __construct " ) ; <nl> - sm_override = false ; sm_dynamicallycallable = false ; <nl> - sm_reactivity = None ; <nl> - sm_type = <nl> - ( Rwitness ( root | explicit_type_collection . php line 4 , characters 19 - 29 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; <nl> - ft_params = <nl> - [ { fp_pos = [ 4 : 49 - 51 ] ; fp_name = ( Some " $ i " ) ; <nl> - fp_type = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | explicit_type_collection . php line 4 , characters 38 - 47 ) , <nl> - ( Tapply ( ( [ 4 : 38 - 41 ] , " \ \ HH \ \ vec " ) , <nl> - [ ( Rhint ( root | explicit_type_collection . php line 4 , characters 42 - 46 ) , <nl> - Tmixed ) ] <nl> - ) ) ) <nl> - } ; <nl> - fp_flags = <nl> - ( make_fp_flags ~ mutability : None <nl> - ~ accept_disposable : false ~ has_default : false <nl> - ~ mode : Typing_defs_core . FPnormal ~ ifc_external : false <nl> - ~ ifc_can_call : false ) ; <nl> - } <nl> - ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | explicit_type_collection . php line 4 , characters 19 - 29 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rwitness ( root | explicit_type_collection . php line 4 , characters 19 - 29 ) , <nl> - ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; <nl> - ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - sm_visibility = Public ; sm_deprecated = None } ) ; <nl> - sc_static_methods = [ ] ; sc_methods = [ ] ; sc_user_attributes = [ ] ; <nl> - sc_enum_type = None } ; <nl> - " \ \ Bar " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> - sc_name = ( [ 15 : 7 - 10 ] , " \ \ Bar " ) ; sc_tparams = [ ] ; <nl> - sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> - sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> - sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; <nl> - sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; sc_constructor = None ; <nl> - sc_static_methods = [ ] ; sc_methods = [ ] ; <nl> - sc_user_attributes = <nl> - [ { Typing_defs_core . ua_name = ( [ 12 : 3 - 4 ] , " \ \ A " ) ; <nl> - ua_classname_params = [ ] } <nl> - ] ; <nl> - sc_enum_type = None } ; <nl> - " \ \ Foo " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> - sc_name = ( [ 8 : 7 - 10 ] , " \ \ Foo " ) ; sc_tparams = [ ] ; <nl> - sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> - sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> - sc_implements = [ ] ; <nl> - sc_consts = <nl> - [ { Shallow_decl_defs . scc_abstract = false ; <nl> - scc_name = ( [ 9 : 16 - 19 ] , " KEY " ) ; <nl> - scc_type = <nl> - ( Rhint ( root | explicit_type_collection . php line 9 , characters 9 - 14 ) , <nl> - ( Tprim Tstring ) ) <nl> - } <nl> - ] ; <nl> - sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> - sc_constructor = None ; sc_static_methods = [ ] ; sc_methods = [ ] ; <nl> - sc_user_attributes = <nl> - [ { Typing_defs_core . ua_name = ( [ 7 : 3 - 4 ] , " \ \ A " ) ; <nl> - ua_classname_params = [ ] } <nl> - ] ; <nl> - sc_enum_type = None } } ; <nl> - funs = { } ; typedefs = { } ; consts = { } ; records = { } } <nl> + [ ( " \ \ A " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> + sc_name = ( [ 3 : 7 - 8 ] , " \ \ A " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> + sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> + sc_implements = <nl> + [ ( Rhint ( root | explicit_type_collection . php line 3 , characters 20 - 36 ) , <nl> + ( Tapply ( ( [ 3 : 20 - 37 ] , " \ \ HH \ \ ClassAttribute " ) , [ ] ) ) ) ] ; <nl> + sc_consts = [ ] ; sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; <nl> + sc_props = <nl> + [ { Shallow_decl_defs . sp_const = false ; sp_xhp_attr = None ; <nl> + sp_lateinit = false ; sp_lsb = false ; sp_name = ( [ 4 : 49 - 51 ] , " i " ) ; <nl> + sp_needs_init = true ; <nl> + sp_type = <nl> + ( Some ( Rhint ( root | explicit_type_collection . php line 4 , characters 38 - 47 ) , <nl> + ( Tapply ( ( [ 4 : 38 - 41 ] , " \ \ HH \ \ vec " ) , <nl> + [ ( Rhint ( root | explicit_type_collection . php line 4 , characters 42 - 46 ) , <nl> + Tmixed ) ] <nl> + ) ) ) ) ; <nl> + sp_abstract = false ; sp_visibility = Public } <nl> + ] ; <nl> + sc_sprops = [ ] ; <nl> + sc_constructor = <nl> + ( Some { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> + sm_memoizelsb = false ; sm_name = ( [ 4 : 19 - 30 ] , " __construct " ) ; <nl> + sm_override = false ; sm_dynamicallycallable = false ; <nl> + sm_reactivity = None ; <nl> + sm_type = <nl> + ( Rwitness ( root | explicit_type_collection . php line 4 , characters 19 - 29 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; <nl> + ft_params = <nl> + [ { fp_pos = [ 4 : 49 - 51 ] ; fp_name = ( Some " $ i " ) ; <nl> + fp_type = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | explicit_type_collection . php line 4 , characters 38 - 47 ) , <nl> + ( Tapply ( ( [ 4 : 38 - 41 ] , " \ \ HH \ \ vec " ) , <nl> + [ ( Rhint ( root | explicit_type_collection . php line 4 , characters 42 - 46 ) , <nl> + Tmixed ) ] <nl> + ) ) ) <nl> + } ; <nl> + fp_flags = <nl> + ( make_fp_flags ~ mutability : None <nl> + ~ accept_disposable : false ~ has_default : false <nl> + ~ mode : Typing_defs_core . FPnormal ~ ifc_external : false <nl> + ~ ifc_can_call : false ) ; <nl> + } <nl> + ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | explicit_type_collection . php line 4 , characters 19 - 29 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rwitness ( root | explicit_type_collection . php line 4 , characters 19 - 29 ) , <nl> + ( Tprim Tvoid ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; <nl> + ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + sm_visibility = Public ; sm_deprecated = None } ) ; <nl> + sc_static_methods = [ ] ; sc_methods = [ ] ; sc_user_attributes = [ ] ; <nl> + sc_enum_type = None } ) ) ; <nl> + ( " \ \ Foo " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> + sc_name = ( [ 8 : 7 - 10 ] , " \ \ Foo " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> + sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> + sc_implements = [ ] ; <nl> + sc_consts = <nl> + [ { Shallow_decl_defs . scc_abstract = false ; <nl> + scc_name = ( [ 9 : 16 - 19 ] , " KEY " ) ; <nl> + scc_type = <nl> + ( Rhint ( root | explicit_type_collection . php line 9 , characters 9 - 14 ) , <nl> + ( Tprim Tstring ) ) <nl> + } <nl> + ] ; <nl> + sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> + sc_constructor = None ; sc_static_methods = [ ] ; sc_methods = [ ] ; <nl> + sc_user_attributes = <nl> + [ { Typing_defs_core . ua_name = ( [ 7 : 3 - 4 ] , " \ \ A " ) ; <nl> + ua_classname_params = [ ] } <nl> + ] ; <nl> + sc_enum_type = None } ) ) ; <nl> + ( " \ \ Bar " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> + sc_name = ( [ 15 : 7 - 10 ] , " \ \ Bar " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> + sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> + sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; <nl> + sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> + sc_constructor = None ; sc_static_methods = [ ] ; sc_methods = [ ] ; <nl> + sc_user_attributes = <nl> + [ { Typing_defs_core . ua_name = ( [ 12 : 3 - 4 ] , " \ \ A " ) ; <nl> + ua_classname_params = [ ] } <nl> + ] ; <nl> + sc_enum_type = None } ) ) <nl> + ] <nl> <nl> They matched ! <nl> mmm a / hphp / hack / test / decl / file_mode . php . exp <nl> ppp b / hphp / hack / test / decl / file_mode . php . exp <nl> <nl> - Parsed decls : <nl> - <nl> - { classes = <nl> - { " \ \ MyPartialClass " - > <nl> - { Shallow_decl_defs . sc_mode = Mpartial ; sc_final = false ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> - sc_name = ( [ 3 : 7 - 21 ] , " \ \ MyPartialClass " ) ; sc_tparams = [ ] ; <nl> - sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> - sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> - sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; <nl> - sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; sc_constructor = None ; <nl> - sc_static_methods = [ ] ; sc_methods = [ ] ; sc_user_attributes = [ ] ; <nl> - sc_enum_type = None } } ; <nl> - funs = <nl> - { " \ \ my_partial_function " - > <nl> - { Typing_defs . fe_deprecated = None ; <nl> - fe_type = <nl> - ( Rwitness ( root | file_mode . php line 5 , characters 10 - 28 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | file_mode . php line 5 , characters 10 - 28 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | file_mode . php line 5 , characters 33 - 36 ) , <nl> - ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - fe_pos = [ 5 : 10 - 29 ] ; fe_php_std_lib = false } } ; <nl> - typedefs = <nl> - { " \ \ MyPartialType " - > <nl> - { Typing_defs . td_pos = [ 7 : 6 - 19 ] ; td_vis = Transparent ; td_tparams = [ ] ; <nl> - td_constraint = None ; <nl> - td_type = <nl> - ( Rhint ( root | file_mode . php line 7 , characters 22 - 27 ) , ( Tprim Tstring ) ) <nl> - } } ; <nl> - consts = <nl> - { " \ \ MY_PARTIAL_CONST " - > <nl> - { Typing_defs . cd_pos = [ 9 : 21 - 37 ] ; <nl> - cd_type = <nl> - ( Rhint ( root | file_mode . php line 9 , characters 7 - 19 ) , <nl> - ( Tapply ( ( [ 9 : 7 - 20 ] , " \ \ MyPartialType " ) , [ ] ) ) ) <nl> - } } ; <nl> - records = { } } <nl> + [ ( " \ \ MyPartialClass " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mpartial ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> + sc_name = ( [ 3 : 7 - 21 ] , " \ \ MyPartialClass " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> + sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> + sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; <nl> + sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> + sc_constructor = None ; sc_static_methods = [ ] ; sc_methods = [ ] ; <nl> + sc_user_attributes = [ ] ; sc_enum_type = None } ) ) ; <nl> + ( " \ \ my_partial_function " , <nl> + ( Shallow_decl_defs . Fun <nl> + { Typing_defs . fe_deprecated = None ; <nl> + fe_type = <nl> + ( Rwitness ( root | file_mode . php line 5 , characters 10 - 28 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | file_mode . php line 5 , characters 10 - 28 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | file_mode . php line 5 , characters 33 - 36 ) , <nl> + ( Tprim Tvoid ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + fe_pos = [ 5 : 10 - 29 ] ; fe_php_std_lib = false } ) ) ; <nl> + ( " \ \ MyPartialType " , <nl> + ( Shallow_decl_defs . Typedef <nl> + { Typing_defs . td_pos = [ 7 : 6 - 19 ] ; td_vis = Transparent ; td_tparams = [ ] ; <nl> + td_constraint = None ; <nl> + td_type = <nl> + ( Rhint ( root | file_mode . php line 7 , characters 22 - 27 ) , ( Tprim Tstring ) ) <nl> + } ) ) ; <nl> + ( " \ \ MY_PARTIAL_CONST " , <nl> + ( Shallow_decl_defs . Const <nl> + { Typing_defs . cd_pos = [ 9 : 21 - 37 ] ; <nl> + cd_type = <nl> + ( Rhint ( root | file_mode . php line 9 , characters 7 - 19 ) , <nl> + ( Tapply ( ( [ 9 : 7 - 20 ] , " \ \ MyPartialType " ) , [ ] ) ) ) <nl> + } ) ) <nl> + ] <nl> <nl> They matched ! <nl> mmm a / hphp / hack / test / decl / final_method . php . exp <nl> ppp b / hphp / hack / test / decl / final_method . php . exp <nl> <nl> - Parsed decls : <nl> - <nl> - { classes = <nl> - { " \ \ C " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> - sc_name = ( [ 3 : 7 - 8 ] , " \ \ C " ) ; sc_tparams = [ ] ; sc_where_constraints = [ ] ; <nl> - sc_extends = [ ] ; sc_uses = [ ] ; sc_xhp_attr_uses = [ ] ; <nl> - sc_req_extends = [ ] ; sc_req_implements = [ ] ; sc_implements = [ ] ; <nl> - sc_consts = [ ] ; sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; sc_props = [ ] ; <nl> - sc_sprops = [ ] ; sc_constructor = None ; sc_static_methods = [ ] ; <nl> - sc_methods = <nl> - [ { Shallow_decl_defs . sm_abstract = false ; sm_final = true ; <nl> - sm_memoizelsb = false ; sm_name = ( [ 4 : 25 - 26 ] , " f " ) ; <nl> - sm_override = false ; sm_dynamicallycallable = false ; <nl> - sm_reactivity = None ; <nl> - sm_type = <nl> - ( Rwitness ( root | final_method . php line 4 , characters 25 - 25 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | final_method . php line 4 , characters 25 - 25 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | final_method . php line 4 , characters 30 - 33 ) , <nl> - ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } <nl> - } ) ) ; <nl> - sm_visibility = Public ; sm_deprecated = None } <nl> - ] ; <nl> - sc_user_attributes = [ ] ; sc_enum_type = None } } ; <nl> - funs = { } ; typedefs = { } ; consts = { } ; records = { } } <nl> + [ ( " \ \ C " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> + sc_name = ( [ 3 : 7 - 8 ] , " \ \ C " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> + sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> + sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; <nl> + sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> + sc_constructor = None ; sc_static_methods = [ ] ; <nl> + sc_methods = <nl> + [ { Shallow_decl_defs . sm_abstract = false ; sm_final = true ; <nl> + sm_memoizelsb = false ; sm_name = ( [ 4 : 25 - 26 ] , " f " ) ; <nl> + sm_override = false ; sm_dynamicallycallable = false ; <nl> + sm_reactivity = None ; <nl> + sm_type = <nl> + ( Rwitness ( root | final_method . php line 4 , characters 25 - 25 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | final_method . php line 4 , characters 25 - 25 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | final_method . php line 4 , characters 30 - 33 ) , <nl> + ( Tprim Tvoid ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } <nl> + } ) ) ; <nl> + sm_visibility = Public ; sm_deprecated = None } <nl> + ] ; <nl> + sc_user_attributes = [ ] ; sc_enum_type = None } ) ) <nl> + ] <nl> <nl> They matched ! <nl> mmm a / hphp / hack / test / decl / functions . php . exp <nl> ppp b / hphp / hack / test / decl / functions . php . exp <nl> <nl> - Parsed decls : <nl> - <nl> - { classes = <nl> - { " \ \ C " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> - sc_name = ( [ 67 : 7 - 8 ] , " \ \ C " ) ; sc_tparams = [ ] ; <nl> - sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> - sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> - sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; <nl> - sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; sc_constructor = None ; <nl> - sc_static_methods = [ ] ; sc_methods = [ ] ; sc_user_attributes = [ ] ; <nl> - sc_enum_type = None } } ; <nl> - funs = <nl> - { " \ \ function_with_args " - > <nl> - { Typing_defs . fe_deprecated = None ; <nl> - fe_type = <nl> - ( Rwitness ( root | functions . php line 11 , characters 10 - 27 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; <nl> - ft_params = <nl> - [ { fp_pos = [ 11 : 33 - 38 ] ; fp_name = ( Some " $ arg1 " ) ; <nl> - fp_type = <nl> + mmm legacy <nl> ppp + direct decl <nl> + <nl> + [ ( " \ \ simple_function " , <nl> + ( Shallow_decl_defs . Fun <nl> + { Typing_defs . fe_deprecated = None ; <nl> + fe_type = <nl> + ( Rwitness ( root | functions . php line 3 , characters 10 - 24 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | functions . php line 3 , characters 10 - 24 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | functions . php line 3 , characters 29 - 32 ) , <nl> + ( Tprim Tvoid ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + fe_pos = [ 3 : 10 - 25 ] ; fe_php_std_lib = false } ) ) ; <nl> + ( " \ \ simple_int_function " , <nl> + ( Shallow_decl_defs . Fun <nl> + { Typing_defs . fe_deprecated = None ; <nl> + fe_type = <nl> + ( Rwitness ( root | functions . php line 4 , characters 10 - 28 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | functions . php line 4 , characters 10 - 28 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> { et_enforced = false ; <nl> et_type = <nl> - ( Rhint ( root | functions . php line 11 , characters 29 - 31 ) , <nl> + ( Rhint ( root | functions . php line 4 , characters 33 - 35 ) , <nl> ( Tprim Tint ) ) <nl> } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + fe_pos = [ 4 : 10 - 29 ] ; fe_php_std_lib = false } ) ) ; <nl> + ( " \ \ simple_function_with_body " , <nl> + ( Shallow_decl_defs . Fun <nl> + { Typing_defs . fe_deprecated = None ; <nl> + fe_type = <nl> + ( Rwitness ( root | functions . php line 7 , characters 10 - 34 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | functions . php line 7 , characters 10 - 34 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | functions . php line 7 , characters 39 - 43 ) , <nl> + ( Tprim Tfloat ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + fe_pos = [ 7 : 10 - 35 ] ; fe_php_std_lib = false } ) ) ; <nl> + ( " \ \ function_with_args " , <nl> + ( Shallow_decl_defs . Fun <nl> + { Typing_defs . fe_deprecated = None ; <nl> + fe_type = <nl> + ( Rwitness ( root | functions . php line 11 , characters 10 - 27 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; <nl> + ft_params = <nl> + [ { fp_pos = [ 11 : 33 - 38 ] ; fp_name = ( Some " $ arg1 " ) ; <nl> + fp_type = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | functions . php line 11 , characters 29 - 31 ) , <nl> + ( Tprim Tint ) ) <nl> + } ; <nl> + fp_flags = <nl> + ( make_fp_flags ~ mutability : None ~ accept_disposable : false <nl> + ~ has_default : false ~ mode : Typing_defs_core . FPnormal <nl> + ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> + } ; <nl> + { fp_pos = [ 11 : 46 - 51 ] ; fp_name = ( Some " $ arg2 " ) ; <nl> + fp_type = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | functions . php line 11 , characters 40 - 44 ) , <nl> + ( Tprim Tfloat ) ) <nl> + } ; <nl> + fp_flags = <nl> + ( make_fp_flags ~ mutability : None ~ accept_disposable : false <nl> + ~ has_default : false ~ mode : Typing_defs_core . FPnormal <nl> + ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> + } <nl> + ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | functions . php line 11 , characters 10 - 27 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | functions . php line 11 , characters 54 - 57 ) , <nl> + ( Tprim Tvoid ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + fe_pos = [ 11 : 10 - 28 ] ; fe_php_std_lib = false } ) ) ; <nl> + ( " \ \ Typedef " , <nl> + ( Shallow_decl_defs . Typedef <nl> + { Typing_defs . td_pos = [ 13 : 6 - 13 ] ; td_vis = Transparent ; <nl> + td_tparams = [ ] ; td_constraint = None ; <nl> + td_type = <nl> + ( Rhint ( root | functions . php line 13 , characters 16 - 21 ) , <nl> + ( Tprim Tstring ) ) <nl> + } ) ) ; <nl> + ( " \ \ function_with_non_primitive_args " , <nl> + ( Shallow_decl_defs . Fun <nl> + { Typing_defs . fe_deprecated = None ; <nl> + fe_type = <nl> + ( Rwitness ( root | functions . php line 14 , characters 10 - 41 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; <nl> + ft_params = <nl> + [ { fp_pos = [ 14 : 51 - 56 ] ; fp_name = ( Some " $ arg1 " ) ; <nl> + fp_type = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | functions . php line 14 , characters 43 - 49 ) , <nl> + ( Tapply ( ( [ 14 : 43 - 50 ] , " \ \ Typedef " ) , [ ] ) ) ) <nl> + } ; <nl> + fp_flags = <nl> + ( make_fp_flags ~ mutability : None ~ accept_disposable : false <nl> + ~ has_default : false ~ mode : Typing_defs_core . FPnormal <nl> + ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> + } <nl> + ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | functions . php line 14 , characters 10 - 41 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | functions . php line 14 , characters 59 - 65 ) , <nl> + ( Tapply ( ( [ 14 : 59 - 66 ] , " \ \ Typedef " ) , [ ] ) ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + fe_pos = [ 14 : 10 - 42 ] ; fe_php_std_lib = false } ) ) ; <nl> + ( " \ \ test_generic_fun " , <nl> + ( Shallow_decl_defs . Fun <nl> + { Typing_defs . fe_deprecated = None ; <nl> + fe_type = <nl> + ( Rwitness ( root | functions . php line 18 , characters 10 - 25 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; <nl> + ft_tparams = <nl> + [ { Typing_defs_core . tp_variance = Invariant ; <nl> + tp_name = ( [ 18 : 27 - 28 ] , " T " ) ; tp_tparams = [ ] ; <nl> + tp_constraints = [ ] ; tp_reified = Erased ; <nl> + tp_user_attributes = [ ] } <nl> + ] ; <nl> + ft_where_constraints = [ ] ; <nl> + ft_params = <nl> + [ { fp_pos = [ 18 : 32 - 37 ] ; fp_name = ( Some " $ arg1 " ) ; <nl> + fp_type = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | functions . php line 18 , characters 30 - 30 ) , <nl> + ( Tgeneric ( " T " , [ ] ) ) ) <nl> + } ; <nl> + fp_flags = <nl> + ( make_fp_flags ~ mutability : None ~ accept_disposable : false <nl> + ~ has_default : false ~ mode : Typing_defs_core . FPnormal <nl> + ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> + } <nl> + ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | functions . php line 18 , characters 10 - 25 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | functions . php line 18 , characters 40 - 40 ) , <nl> + ( Tgeneric ( " T " , [ ] ) ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + fe_pos = [ 18 : 10 - 26 ] ; fe_php_std_lib = false } ) ) ; <nl> + ( " \ \ test_constrained_generic_fun " , <nl> + ( Shallow_decl_defs . Fun <nl> + { Typing_defs . fe_deprecated = None ; <nl> + fe_type = <nl> + ( Rwitness ( root | functions . php line 22 , characters 10 - 37 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; <nl> + ft_tparams = <nl> + [ { Typing_defs_core . tp_variance = Invariant ; <nl> + tp_name = ( [ 22 : 39 - 41 ] , " T1 " ) ; tp_tparams = [ ] ; <nl> + tp_constraints = <nl> + [ ( Constraint_super , <nl> + ( Rhint ( root | functions . php line 22 , characters 48 - 50 ) , <nl> + ( Tprim Tint ) ) ) <nl> + ] ; <nl> + tp_reified = Erased ; tp_user_attributes = [ ] } ; <nl> + { Typing_defs_core . tp_variance = Invariant ; <nl> + tp_name = ( [ 22 : 53 - 55 ] , " T2 " ) ; tp_tparams = [ ] ; <nl> + tp_constraints = <nl> + [ ( Constraint_as , <nl> + ( Rhint ( root | functions . php line 22 , characters 59 - 64 ) , <nl> + ( Tprim Tstring ) ) ) <nl> + ] ; <nl> + tp_reified = Erased ; tp_user_attributes = [ ] } <nl> + ] ; <nl> + ft_where_constraints = [ ] ; <nl> + ft_params = <nl> + [ { fp_pos = [ 23 : 6 - 11 ] ; fp_name = ( Some " $ arg1 " ) ; <nl> + fp_type = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | functions . php line 23 , characters 3 - 4 ) , <nl> + ( Tgeneric ( " T1 " , [ ] ) ) ) <nl> + } ; <nl> fp_flags = <nl> ( make_fp_flags ~ mutability : None ~ accept_disposable : false <nl> ~ has_default : false ~ mode : Typing_defs_core . FPnormal <nl> ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> } ; <nl> - { fp_pos = [ 11 : 46 - 51 ] ; fp_name = ( Some " $ arg2 " ) ; <nl> + { fp_pos = [ 24 : 6 - 11 ] ; fp_name = ( Some " $ arg2 " ) ; <nl> + fp_type = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | functions . php line 24 , characters 3 - 4 ) , <nl> + ( Tgeneric ( " T2 " , [ ] ) ) ) <nl> + } ; <nl> + fp_flags = <nl> + ( make_fp_flags ~ mutability : None ~ accept_disposable : false <nl> + ~ has_default : false ~ mode : Typing_defs_core . FPnormal <nl> + ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> + } ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | functions . php line 22 , characters 10 - 37 ) , ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | functions . php line 25 , characters 4 - 5 ) , <nl> + ( Tgeneric ( " T1 " , [ ] ) ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + fe_pos = [ 22 : 10 - 38 ] ; fe_php_std_lib = false } ) ) ; <nl> + ( " \ \ test_returns_generic " , <nl> + ( Shallow_decl_defs . Fun <nl> + { Typing_defs . fe_deprecated = None ; <nl> + fe_type = <nl> + ( Rwitness ( root | functions . php line 29 , characters 10 - 29 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | functions . php line 29 , characters 10 - 29 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | functions . php line 29 , characters 34 - 52 ) , <nl> + ( Tapply ( ( [ 29 : 34 - 48 ] , " \ \ HH \ \ Traversable " ) , <nl> + [ ( Rhint ( root | functions . php line 29 , characters 49 - 51 ) , <nl> + ( Tprim Tint ) ) ] <nl> + ) ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + fe_pos = [ 29 : 10 - 30 ] ; fe_php_std_lib = false } ) ) ; <nl> + ( " \ \ takes_optional " , <nl> + ( Shallow_decl_defs . Fun <nl> + { Typing_defs . fe_deprecated = None ; <nl> + fe_type = <nl> + ( Rwitness ( root | functions . php line 33 , characters 10 - 23 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; <nl> + ft_params = <nl> + [ { fp_pos = [ 33 : 30 - 32 ] ; fp_name = ( Some " $ x " ) ; <nl> fp_type = <nl> { et_enforced = false ; <nl> et_type = <nl> - ( Rhint ( root | functions . php line 11 , characters 40 - 44 ) , <nl> - ( Tprim Tfloat ) ) <nl> + ( Rhint ( root | functions . php line 33 , characters 25 - 28 ) , <nl> + ( Toption <nl> + ( Rhint ( root | functions . php line 33 , characters 26 - 28 ) , <nl> + ( Tprim Tint ) ) ) ) <nl> } ; <nl> fp_flags = <nl> ( make_fp_flags ~ mutability : None ~ accept_disposable : false <nl> ~ has_default : false ~ mode : Typing_defs_core . FPnormal <nl> ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> } <nl> - ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | functions . php line 11 , characters 10 - 27 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | functions . php line 11 , characters 54 - 57 ) , <nl> - ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - fe_pos = [ 11 : 10 - 28 ] ; fe_php_std_lib = false } ; <nl> - " \ \ function_with_non_primitive_args " - > <nl> - { Typing_defs . fe_deprecated = None ; <nl> - fe_type = <nl> - ( Rwitness ( root | functions . php line 14 , characters 10 - 41 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; <nl> - ft_params = <nl> - [ { fp_pos = [ 14 : 51 - 56 ] ; fp_name = ( Some " $ arg1 " ) ; <nl> - fp_type = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | functions . php line 14 , characters 43 - 49 ) , <nl> - ( Tapply ( ( [ 14 : 43 - 50 ] , " \ \ Typedef " ) , [ ] ) ) ) <nl> - } ; <nl> + ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | functions . php line 33 , characters 10 - 23 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | functions . php line 33 , characters 35 - 38 ) , <nl> + ( Tprim Tvoid ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + fe_pos = [ 33 : 10 - 24 ] ; fe_php_std_lib = false } ) ) ; <nl> + ( " \ \ in_out " , <nl> + ( Shallow_decl_defs . Fun <nl> + { Typing_defs . fe_deprecated = None ; <nl> + fe_type = <nl> + ( Rwitness ( root | functions . php line 35 , characters 10 - 15 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; <nl> + ft_params = <nl> + [ { fp_pos = [ 35 : 27 - 29 ] ; fp_name = ( Some " $ x " ) ; <nl> + fp_type = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | functions . php line 35 , characters 23 - 25 ) , <nl> + ( Tprim Tint ) ) <nl> + } ; <nl> + fp_flags = <nl> + ( make_fp_flags ~ mutability : None ~ accept_disposable : false <nl> + ~ has_default : false ~ mode : Typing_defs_core . FPinout <nl> + ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> + } <nl> + ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | functions . php line 35 , characters 10 - 15 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | functions . php line 35 , characters 32 - 35 ) , <nl> + ( Tprim Tvoid ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + fe_pos = [ 35 : 10 - 16 ] ; fe_php_std_lib = false } ) ) ; <nl> + ( " \ \ takes_returns_function_type " , <nl> + ( Shallow_decl_defs . Fun <nl> + { Typing_defs . fe_deprecated = None ; <nl> + fe_type = <nl> + ( Rwitness ( root | functions . php line 37 , characters 10 - 36 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; <nl> + ft_tparams = <nl> + [ { Typing_defs_core . tp_variance = Invariant ; <nl> + tp_name = ( [ 37 : 38 - 40 ] , " Tu " ) ; tp_tparams = [ ] ; <nl> + tp_constraints = [ ] ; tp_reified = Erased ; <nl> + tp_user_attributes = [ ] } <nl> + ] ; <nl> + ft_where_constraints = [ ] ; <nl> + ft_params = <nl> + [ { fp_pos = [ 38 : 6 - 8 ] ; fp_name = ( Some " $ x " ) ; <nl> + fp_type = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | functions . php line 38 , characters 3 - 4 ) , <nl> + ( Tgeneric ( " Tu " , [ ] ) ) ) <nl> + } ; <nl> fp_flags = <nl> ( make_fp_flags ~ mutability : None ~ accept_disposable : false <nl> ~ has_default : false ~ mode : Typing_defs_core . FPnormal <nl> ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> - } <nl> - ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | functions . php line 14 , characters 10 - 41 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | functions . php line 14 , characters 59 - 65 ) , <nl> - ( Tapply ( ( [ 14 : 59 - 66 ] , " \ \ Typedef " ) , [ ] ) ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - fe_pos = [ 14 : 10 - 42 ] ; fe_php_std_lib = false } ; <nl> - " \ \ in_out " - > <nl> - { Typing_defs . fe_deprecated = None ; <nl> - fe_type = <nl> - ( Rwitness ( root | functions . php line 35 , characters 10 - 15 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; <nl> - ft_params = <nl> - [ { fp_pos = [ 35 : 27 - 29 ] ; fp_name = ( Some " $ x " ) ; <nl> - fp_type = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | functions . php line 35 , characters 23 - 25 ) , <nl> - ( Tprim Tint ) ) <nl> - } ; <nl> - fp_flags = <nl> - ( make_fp_flags ~ mutability : None ~ accept_disposable : false <nl> - ~ has_default : false ~ mode : Typing_defs_core . FPinout <nl> - ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> - } <nl> - ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | functions . php line 35 , characters 10 - 15 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | functions . php line 35 , characters 32 - 35 ) , <nl> - ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - fe_pos = [ 35 : 10 - 16 ] ; fe_php_std_lib = false } ; <nl> - " \ \ local_reactive_function " - > <nl> - { Typing_defs . fe_deprecated = None ; <nl> - fe_type = <nl> - ( Rwitness ( root | functions . php line 57 , characters 10 - 32 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | functions . php line 57 , characters 10 - 32 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | functions . php line 57 , characters 37 - 40 ) , <nl> - ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Local { } ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - fe_pos = [ 57 : 10 - 33 ] ; fe_php_std_lib = false } ; <nl> - " \ \ make " - > <nl> - { Typing_defs . fe_deprecated = None ; <nl> - fe_type = <nl> - ( Rwitness ( root | functions . php line 70 , characters 10 - 13 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | functions . php line 70 , characters 10 - 13 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | functions . php line 70 , characters 18 - 18 ) , <nl> - ( Tapply ( ( [ 70 : 18 - 19 ] , " \ \ C " ) , [ ] ) ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : true ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Reactive { } ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - fe_pos = [ 70 : 10 - 14 ] ; fe_php_std_lib = false } ; <nl> - " \ \ noreturn_type_hint " - > <nl> - { Typing_defs . fe_deprecated = None ; <nl> - fe_type = <nl> - ( Rwitness ( root | functions . php line 82 , characters 10 - 27 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | functions . php line 82 , characters 10 - 27 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | functions . php line 82 , characters 32 - 39 ) , <nl> - ( Tprim Tnoreturn ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - fe_pos = [ 82 : 10 - 28 ] ; fe_php_std_lib = false } ; <nl> - " \ \ null_type_hint " - > <nl> - { Typing_defs . fe_deprecated = None ; <nl> - fe_type = <nl> - ( Rwitness ( root | functions . php line 74 , characters 10 - 23 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; <nl> - ft_tparams = <nl> - [ { Typing_defs_core . tp_variance = Invariant ; <nl> - tp_name = ( [ 74 : 25 - 26 ] , " T " ) ; tp_tparams = [ ] ; <nl> - tp_constraints = <nl> - [ ( Constraint_as , <nl> - ( Rhint ( root | functions . php line 74 , characters 30 - 36 ) , <nl> - ( Tunion [ ] ) ) ) <nl> - ] ; <nl> - tp_reified = Erased ; tp_user_attributes = [ ] } <nl> - ] ; <nl> - ft_where_constraints = [ ] ; <nl> - ft_params = <nl> - [ { fp_pos = [ 74 : 42 - 44 ] ; fp_name = ( Some " $ x " ) ; <nl> + } ; <nl> + { fp_pos = [ 39 : 24 - 31 ] ; fp_name = ( Some " $ unused " ) ; <nl> fp_type = <nl> { et_enforced = false ; <nl> et_type = <nl> - ( Rhint ( root | functions . php line 74 , characters 39 - 40 ) , <nl> - ( Toption <nl> - ( Rhint ( root | functions . php line 74 , characters 40 - 40 ) , <nl> - ( Tgeneric ( " T " , [ ] ) ) ) ) ) <nl> - } ; <nl> - fp_flags = <nl> - ( make_fp_flags ~ mutability : None ~ accept_disposable : false <nl> - ~ has_default : false ~ mode : Typing_defs_core . FPnormal <nl> - ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> - } <nl> - ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | functions . php line 74 , characters 10 - 23 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | functions . php line 74 , characters 47 - 50 ) , <nl> - ( Tprim Tnull ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - fe_pos = [ 74 : 10 - 24 ] ; fe_php_std_lib = false } ; <nl> - " \ \ reactive_function " - > <nl> - { Typing_defs . fe_deprecated = None ; <nl> - fe_type = <nl> - ( Rwitness ( root | functions . php line 51 , characters 10 - 26 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | functions . php line 51 , characters 10 - 26 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | functions . php line 51 , characters 31 - 34 ) , <nl> - ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Reactive { } ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - fe_pos = [ 51 : 10 - 27 ] ; fe_php_std_lib = false } ; <nl> - " \ \ reactive_function_mutable_args " - > <nl> - { Typing_defs . fe_deprecated = None ; <nl> - fe_type = <nl> - ( Rwitness ( root | functions . php line 60 , characters 10 - 39 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; <nl> - ft_params = <nl> - [ { fp_pos = [ 61 : 25 - 27 ] ; fp_name = ( Some " $ a " ) ; <nl> - fp_type = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | functions . php line 61 , characters 17 - 23 ) , <nl> - ( Tapply ( ( [ 61 : 17 - 24 ] , " \ \ Typedef " ) , [ ] ) ) ) <nl> + ( Rhint ( root | functions . php line 39 , characters 3 - 22 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; <nl> + ft_params = <nl> + [ { fp_pos = [ 39 : 13 - 15 ] ; fp_name = None ; <nl> + fp_type = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | functions . php line 39 , characters 13 - 14 ) , <nl> + ( Tgeneric ( " Tu " , [ ] ) ) ) <nl> + } ; <nl> + fp_flags = <nl> + ( make_fp_flags ~ mutability : None <nl> + ~ accept_disposable : false ~ has_default : false <nl> + ~ mode : Typing_defs_core . FPnormal ~ ifc_external : false <nl> + ~ ifc_can_call : false ) ; <nl> + } <nl> + ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | functions . php line 39 , characters 3 - 22 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | functions . php line 39 , characters 18 - 21 ) , <nl> + ( Tprim Tvoid ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; <nl> + ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) <nl> } ; <nl> fp_flags = <nl> - ( make_fp_flags <nl> - ~ mutability : ( Some Typing_defs_core . Param_borrowed_mutable ) <nl> - ~ accept_disposable : false ~ has_default : false <nl> - ~ mode : Typing_defs_core . FPnormal ~ ifc_external : false <nl> - ~ ifc_can_call : false ) ; <nl> - } ; <nl> - { fp_pos = [ 62 : 30 - 32 ] ; fp_name = ( Some " $ b " ) ; <nl> - fp_type = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | functions . php line 62 , characters 22 - 28 ) , <nl> - ( Tapply ( ( [ 62 : 22 - 29 ] , " \ \ Typedef " ) , [ ] ) ) ) <nl> + ( make_fp_flags ~ mutability : None ~ accept_disposable : false <nl> + ~ has_default : false ~ mode : Typing_defs_core . FPnormal <nl> + ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> + } ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | functions . php line 37 , characters 10 - 36 ) , ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | functions . php line 40 , characters 4 - 41 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; <nl> + ft_params = <nl> + [ { fp_pos = [ 40 : 14 - 34 ] ; fp_name = None ; <nl> + fp_type = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | functions . php line 40 , characters 14 - 33 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; <nl> + ft_params = <nl> + [ { fp_pos = [ 40 : 24 - 26 ] ; fp_name = None ; <nl> + fp_type = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | functions . php line 40 , characters 24 - 25 ) , <nl> + ( Tgeneric ( " Tu " , [ ] ) ) ) <nl> + } ; <nl> + fp_flags = <nl> + ( make_fp_flags ~ mutability : None <nl> + ~ accept_disposable : false ~ has_default : false <nl> + ~ mode : Typing_defs_core . FPnormal <nl> + ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> + } <nl> + ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | functions . php line 40 , characters 14 - 33 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | functions . php line 40 , characters 29 - 32 ) , <nl> + ( Tprim Tvoid ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; <nl> + ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) <nl> + } ; <nl> + fp_flags = <nl> + ( make_fp_flags ~ mutability : None ~ accept_disposable : false <nl> + ~ has_default : false ~ mode : Typing_defs_core . FPnormal <nl> + ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> + } <nl> + ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | functions . php line 40 , characters 4 - 41 ) , <nl> + ( Tunion [ ] ) ) <nl> } ; <nl> - fp_flags = <nl> - ( make_fp_flags <nl> - ~ mutability : ( Some Typing_defs_core . Param_maybe_mutable ) <nl> - ~ accept_disposable : false ~ has_default : false <nl> - ~ mode : Typing_defs_core . FPnormal ~ ifc_external : false <nl> - ~ ifc_can_call : false ) ; <nl> - } ; <nl> - { fp_pos = [ 63 : 30 - 32 ] ; fp_name = ( Some " $ c " ) ; <nl> - fp_type = <nl> + ft_ret = <nl> { et_enforced = false ; <nl> et_type = <nl> - ( Rhint ( root | functions . php line 63 , characters 22 - 28 ) , <nl> - ( Tapply ( ( [ 63 : 22 - 29 ] , " \ \ Typedef " ) , [ ] ) ) ) <nl> + ( Rhint ( root | functions . php line 40 , characters 37 - 40 ) , <nl> + ( Tprim Tvoid ) ) <nl> } ; <nl> - fp_flags = <nl> - ( make_fp_flags <nl> - ~ mutability : ( Some Typing_defs_core . Param_owned_mutable ) <nl> - ~ accept_disposable : false ~ has_default : false <nl> - ~ mode : Typing_defs_core . FPnormal ~ ifc_external : false <nl> - ~ ifc_can_call : false ) ; <nl> - } <nl> - ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | functions . php line 60 , characters 10 - 39 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | functions . php line 64 , characters 4 - 7 ) , <nl> - ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Reactive { } ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - fe_pos = [ 60 : 10 - 40 ] ; fe_php_std_lib = false } ; <nl> - " \ \ resource_type_hint " - > <nl> - { Typing_defs . fe_deprecated = None ; <nl> - fe_type = <nl> - ( Rwitness ( root | functions . php line 78 , characters 10 - 27 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; <nl> - ft_params = <nl> - [ { fp_pos = [ 78 : 38 - 40 ] ; fp_name = ( Some " $ i " ) ; <nl> - fp_type = <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + fe_pos = [ 37 : 10 - 37 ] ; fe_php_std_lib = false } ) ) ; <nl> + ( " \ \ takes_returns_dict " , <nl> + ( Shallow_decl_defs . Fun <nl> + { Typing_defs . fe_deprecated = None ; <nl> + fe_type = <nl> + ( Rwitness ( root | functions . php line 46 , characters 10 - 27 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; <nl> + ft_params = <nl> + [ { fp_pos = [ 46 : 48 - 50 ] ; fp_name = ( Some " $ m " ) ; <nl> + fp_type = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | functions . php line 46 , characters 29 - 46 ) , <nl> + ( Tapply ( ( [ 46 : 29 - 33 ] , " \ \ HH \ \ dict " ) , <nl> + [ ( Rhint ( root | functions . php line 46 , characters 34 - 39 ) , <nl> + ( Tprim Tstring ) ) ; <nl> + ( Rhint ( root | functions . php line 46 , characters 42 - 45 ) , <nl> + ( Tprim Tbool ) ) <nl> + ] <nl> + ) ) ) <nl> + } ; <nl> + fp_flags = <nl> + ( make_fp_flags ~ mutability : None ~ accept_disposable : false <nl> + ~ has_default : false ~ mode : Typing_defs_core . FPnormal <nl> + ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> + } <nl> + ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | functions . php line 46 , characters 10 - 27 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> { et_enforced = false ; <nl> et_type = <nl> - ( Rhint ( root | functions . php line 78 , characters 29 - 36 ) , <nl> - ( Tprim Tresource ) ) <nl> + ( Rhint ( root | functions . php line 46 , characters 53 - 70 ) , <nl> + ( Tapply ( ( [ 46 : 53 - 57 ] , " \ \ HH \ \ dict " ) , <nl> + [ ( Rhint ( root | functions . php line 46 , characters 58 - 63 ) , <nl> + ( Tprim Tstring ) ) ; <nl> + ( Rhint ( root | functions . php line 46 , characters 66 - 69 ) , <nl> + ( Tprim Tbool ) ) <nl> + ] <nl> + ) ) ) <nl> } ; <nl> - fp_flags = <nl> - ( make_fp_flags ~ mutability : None ~ accept_disposable : false <nl> - ~ has_default : false ~ mode : Typing_defs_core . FPnormal <nl> - ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> - } <nl> - ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | functions . php line 78 , characters 10 - 27 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | functions . php line 78 , characters 43 - 50 ) , <nl> - ( Tprim Tresource ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - fe_pos = [ 78 : 10 - 28 ] ; fe_php_std_lib = false } ; <nl> - " \ \ shallow_reactive_function " - > <nl> - { Typing_defs . fe_deprecated = None ; <nl> - fe_type = <nl> - ( Rwitness ( root | functions . php line 54 , characters 10 - 34 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | functions . php line 54 , characters 10 - 34 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | functions . php line 54 , characters 39 - 42 ) , <nl> - ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Shallow { } ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - fe_pos = [ 54 : 10 - 35 ] ; fe_php_std_lib = false } ; <nl> - " \ \ simple_function " - > <nl> - { Typing_defs . fe_deprecated = None ; <nl> - fe_type = <nl> - ( Rwitness ( root | functions . php line 3 , characters 10 - 24 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | functions . php line 3 , characters 10 - 24 ) , ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | functions . php line 3 , characters 29 - 32 ) , <nl> - ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - fe_pos = [ 3 : 10 - 25 ] ; fe_php_std_lib = false } ; <nl> - " \ \ simple_function_with_body " - > <nl> - { Typing_defs . fe_deprecated = None ; <nl> - fe_type = <nl> - ( Rwitness ( root | functions . php line 7 , characters 10 - 34 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | functions . php line 7 , characters 10 - 34 ) , ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | functions . php line 7 , characters 39 - 43 ) , <nl> - ( Tprim Tfloat ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - fe_pos = [ 7 : 10 - 35 ] ; fe_php_std_lib = false } ; <nl> - " \ \ simple_int_function " - > <nl> - { Typing_defs . fe_deprecated = None ; <nl> - fe_type = <nl> - ( Rwitness ( root | functions . php line 4 , characters 10 - 28 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | functions . php line 4 , characters 10 - 28 ) , ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | functions . php line 4 , characters 33 - 35 ) , <nl> - ( Tprim Tint ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - fe_pos = [ 4 : 10 - 29 ] ; fe_php_std_lib = false } ; <nl> - " \ \ takes_optional " - > <nl> - { Typing_defs . fe_deprecated = None ; <nl> - fe_type = <nl> - ( Rwitness ( root | functions . php line 33 , characters 10 - 23 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; <nl> - ft_params = <nl> - [ { fp_pos = [ 33 : 30 - 32 ] ; fp_name = ( Some " $ x " ) ; <nl> - fp_type = <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + fe_pos = [ 46 : 10 - 28 ] ; fe_php_std_lib = false } ) ) ; <nl> + ( " \ \ reactive_function " , <nl> + ( Shallow_decl_defs . Fun <nl> + { Typing_defs . fe_deprecated = None ; <nl> + fe_type = <nl> + ( Rwitness ( root | functions . php line 51 , characters 10 - 26 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | functions . php line 51 , characters 10 - 26 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> { et_enforced = false ; <nl> et_type = <nl> - ( Rhint ( root | functions . php line 33 , characters 25 - 28 ) , <nl> - ( Toption <nl> - ( Rhint ( root | functions . php line 33 , characters 26 - 28 ) , <nl> - ( Tprim Tint ) ) ) ) <nl> + ( Rhint ( root | functions . php line 51 , characters 31 - 34 ) , <nl> + ( Tprim Tvoid ) ) <nl> } ; <nl> - fp_flags = <nl> - ( make_fp_flags ~ mutability : None ~ accept_disposable : false <nl> - ~ has_default : false ~ mode : Typing_defs_core . FPnormal <nl> - ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> - } <nl> - ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | functions . php line 33 , characters 10 - 23 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | functions . php line 33 , characters 35 - 38 ) , <nl> - ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - fe_pos = [ 33 : 10 - 24 ] ; fe_php_std_lib = false } ; <nl> - " \ \ takes_returns_dict " - > <nl> - { Typing_defs . fe_deprecated = None ; <nl> - fe_type = <nl> - ( Rwitness ( root | functions . php line 46 , characters 10 - 27 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; <nl> - ft_params = <nl> - [ { fp_pos = [ 46 : 48 - 50 ] ; fp_name = ( Some " $ m " ) ; <nl> - fp_type = <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Reactive { } ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + fe_pos = [ 51 : 10 - 27 ] ; fe_php_std_lib = false } ) ) ; <nl> + ( " \ \ shallow_reactive_function " , <nl> + ( Shallow_decl_defs . Fun <nl> + { Typing_defs . fe_deprecated = None ; <nl> + fe_type = <nl> + ( Rwitness ( root | functions . php line 54 , characters 10 - 34 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | functions . php line 54 , characters 10 - 34 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> { et_enforced = false ; <nl> et_type = <nl> - ( Rhint ( root | functions . php line 46 , characters 29 - 46 ) , <nl> - ( Tapply ( ( [ 46 : 29 - 33 ] , " \ \ HH \ \ dict " ) , <nl> - [ ( Rhint ( root | functions . php line 46 , characters 34 - 39 ) , <nl> - ( Tprim Tstring ) ) ; <nl> - ( Rhint ( root | functions . php line 46 , characters 42 - 45 ) , <nl> - ( Tprim Tbool ) ) <nl> - ] <nl> - ) ) ) <nl> + ( Rhint ( root | functions . php line 54 , characters 39 - 42 ) , <nl> + ( Tprim Tvoid ) ) <nl> } ; <nl> - fp_flags = <nl> - ( make_fp_flags ~ mutability : None ~ accept_disposable : false <nl> - ~ has_default : false ~ mode : Typing_defs_core . FPnormal <nl> - ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> - } <nl> - ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | functions . php line 46 , characters 10 - 27 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | functions . php line 46 , characters 53 - 70 ) , <nl> - ( Tapply ( ( [ 46 : 53 - 57 ] , " \ \ HH \ \ dict " ) , <nl> - [ ( Rhint ( root | functions . php line 46 , characters 58 - 63 ) , <nl> - ( Tprim Tstring ) ) ; <nl> - ( Rhint ( root | functions . php line 46 , characters 66 - 69 ) , <nl> - ( Tprim Tbool ) ) <nl> - ] <nl> - ) ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - fe_pos = [ 46 : 10 - 28 ] ; fe_php_std_lib = false } ; <nl> - " \ \ takes_returns_function_type " - > <nl> - { Typing_defs . fe_deprecated = None ; <nl> - fe_type = <nl> - ( Rwitness ( root | functions . php line 37 , characters 10 - 36 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; <nl> - ft_tparams = <nl> - [ { Typing_defs_core . tp_variance = Invariant ; <nl> - tp_name = ( [ 37 : 38 - 40 ] , " Tu " ) ; tp_tparams = [ ] ; <nl> - tp_constraints = [ ] ; tp_reified = Erased ; <nl> - tp_user_attributes = [ ] } <nl> - ] ; <nl> - ft_where_constraints = [ ] ; <nl> - ft_params = <nl> - [ { fp_pos = [ 38 : 6 - 8 ] ; fp_name = ( Some " $ x " ) ; <nl> - fp_type = <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Shallow { } ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + fe_pos = [ 54 : 10 - 35 ] ; fe_php_std_lib = false } ) ) ; <nl> + ( " \ \ local_reactive_function " , <nl> + ( Shallow_decl_defs . Fun <nl> + { Typing_defs . fe_deprecated = None ; <nl> + fe_type = <nl> + ( Rwitness ( root | functions . php line 57 , characters 10 - 32 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | functions . php line 57 , characters 10 - 32 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> { et_enforced = false ; <nl> et_type = <nl> - ( Rhint ( root | functions . php line 38 , characters 3 - 4 ) , <nl> - ( Tgeneric ( " Tu " , [ ] ) ) ) <nl> - } ; <nl> - fp_flags = <nl> - ( make_fp_flags ~ mutability : None ~ accept_disposable : false <nl> - ~ has_default : false ~ mode : Typing_defs_core . FPnormal <nl> - ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> - } ; <nl> - { fp_pos = [ 39 : 24 - 31 ] ; fp_name = ( Some " $ unused " ) ; <nl> - fp_type = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | functions . php line 39 , characters 3 - 22 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; <nl> - ft_params = <nl> - [ { fp_pos = [ 39 : 13 - 15 ] ; fp_name = None ; <nl> - fp_type = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | functions . php line 39 , characters 13 - 14 ) , <nl> - ( Tgeneric ( " Tu " , [ ] ) ) ) <nl> - } ; <nl> - fp_flags = <nl> - ( make_fp_flags ~ mutability : None <nl> - ~ accept_disposable : false ~ has_default : false <nl> - ~ mode : Typing_defs_core . FPnormal ~ ifc_external : false <nl> - ~ ifc_can_call : false ) ; <nl> - } <nl> - ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | functions . php line 39 , characters 3 - 22 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | functions . php line 39 , characters 18 - 21 ) , <nl> - ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; <nl> - ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) <nl> - } ; <nl> - fp_flags = <nl> - ( make_fp_flags ~ mutability : None ~ accept_disposable : false <nl> - ~ has_default : false ~ mode : Typing_defs_core . FPnormal <nl> - ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> - } ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | functions . php line 37 , characters 10 - 36 ) , ( Tunion [ ] ) ) } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | functions . php line 40 , characters 4 - 41 ) , <nl> + ( Rhint ( root | functions . php line 57 , characters 37 - 40 ) , <nl> + ( Tprim Tvoid ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Local { } ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + fe_pos = [ 57 : 10 - 33 ] ; fe_php_std_lib = false } ) ) ; <nl> + ( " \ \ reactive_function_mutable_args " , <nl> + ( Shallow_decl_defs . Fun <nl> + { Typing_defs . fe_deprecated = None ; <nl> + fe_type = <nl> + ( Rwitness ( root | functions . php line 60 , characters 10 - 39 ) , <nl> ( Tfun <nl> { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> ft_where_constraints = [ ] ; <nl> ft_params = <nl> - [ { fp_pos = [ 40 : 14 - 34 ] ; fp_name = None ; <nl> + [ { fp_pos = [ 61 : 25 - 27 ] ; fp_name = ( Some " $ a " ) ; <nl> fp_type = <nl> { et_enforced = false ; <nl> et_type = <nl> - ( Rhint ( root | functions . php line 40 , characters 14 - 33 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; <nl> - ft_params = <nl> - [ { fp_pos = [ 40 : 24 - 26 ] ; fp_name = None ; <nl> - fp_type = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | functions . php line 40 , characters 24 - 25 ) , <nl> - ( Tgeneric ( " Tu " , [ ] ) ) ) <nl> - } ; <nl> - fp_flags = <nl> - ( make_fp_flags ~ mutability : None <nl> - ~ accept_disposable : false ~ has_default : false <nl> - ~ mode : Typing_defs_core . FPnormal <nl> - ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> - } <nl> - ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | functions . php line 40 , characters 14 - 33 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | functions . php line 40 , characters 29 - 32 ) , <nl> - ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; <nl> - ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) <nl> + ( Rhint ( root | functions . php line 61 , characters 17 - 23 ) , <nl> + ( Tapply ( ( [ 61 : 17 - 24 ] , " \ \ Typedef " ) , [ ] ) ) ) <nl> + } ; <nl> + fp_flags = <nl> + ( make_fp_flags <nl> + ~ mutability : ( Some Typing_defs_core . Param_borrowed_mutable ) <nl> + ~ accept_disposable : false ~ has_default : false <nl> + ~ mode : Typing_defs_core . FPnormal ~ ifc_external : false <nl> + ~ ifc_can_call : false ) ; <nl> + } ; <nl> + { fp_pos = [ 62 : 30 - 32 ] ; fp_name = ( Some " $ b " ) ; <nl> + fp_type = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | functions . php line 62 , characters 22 - 28 ) , <nl> + ( Tapply ( ( [ 62 : 22 - 29 ] , " \ \ Typedef " ) , [ ] ) ) ) <nl> + } ; <nl> + fp_flags = <nl> + ( make_fp_flags <nl> + ~ mutability : ( Some Typing_defs_core . Param_maybe_mutable ) <nl> + ~ accept_disposable : false ~ has_default : false <nl> + ~ mode : Typing_defs_core . FPnormal ~ ifc_external : false <nl> + ~ ifc_can_call : false ) ; <nl> + } ; <nl> + { fp_pos = [ 63 : 30 - 32 ] ; fp_name = ( Some " $ c " ) ; <nl> + fp_type = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | functions . php line 63 , characters 22 - 28 ) , <nl> + ( Tapply ( ( [ 63 : 22 - 29 ] , " \ \ Typedef " ) , [ ] ) ) ) <nl> + } ; <nl> + fp_flags = <nl> + ( make_fp_flags <nl> + ~ mutability : ( Some Typing_defs_core . Param_owned_mutable ) <nl> + ~ accept_disposable : false ~ has_default : false <nl> + ~ mode : Typing_defs_core . FPnormal ~ ifc_external : false <nl> + ~ ifc_can_call : false ) ; <nl> + } <nl> + ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | functions . php line 60 , characters 10 - 39 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | functions . php line 64 , characters 4 - 7 ) , <nl> + ( Tprim Tvoid ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Reactive { } ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + fe_pos = [ 60 : 10 - 40 ] ; fe_php_std_lib = false } ) ) ; <nl> + ( " \ \ C " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> + sc_name = ( [ 67 : 7 - 8 ] , " \ \ C " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> + sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> + sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; <nl> + sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; sc_constructor = None ; <nl> + sc_static_methods = [ ] ; sc_methods = [ ] ; sc_user_attributes = [ ] ; <nl> + sc_enum_type = None } ) ) ; <nl> + ( " \ \ make " , <nl> + ( Shallow_decl_defs . Fun <nl> + { Typing_defs . fe_deprecated = None ; <nl> + fe_type = <nl> + ( Rwitness ( root | functions . php line 70 , characters 10 - 13 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | functions . php line 70 , characters 10 - 13 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | functions . php line 70 , characters 18 - 18 ) , <nl> + ( Tapply ( ( [ 70 : 18 - 19 ] , " \ \ C " ) , [ ] ) ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : true ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Reactive { } ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + fe_pos = [ 70 : 10 - 14 ] ; fe_php_std_lib = false } ) ) ; <nl> + ( " \ \ null_type_hint " , <nl> + ( Shallow_decl_defs . Fun <nl> + { Typing_defs . fe_deprecated = None ; <nl> + fe_type = <nl> + ( Rwitness ( root | functions . php line 74 , characters 10 - 23 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; <nl> + ft_tparams = <nl> + [ { Typing_defs_core . tp_variance = Invariant ; <nl> + tp_name = ( [ 74 : 25 - 26 ] , " T " ) ; tp_tparams = [ ] ; <nl> + tp_constraints = <nl> + [ ( Constraint_as , <nl> + ( Rhint ( root | functions . php line 74 , characters 30 - 36 ) , <nl> + ( Tunion [ ] ) ) ) <nl> + ] ; <nl> + tp_reified = Erased ; tp_user_attributes = [ ] } <nl> + ] ; <nl> + ft_where_constraints = [ ] ; <nl> + ft_params = <nl> + [ { fp_pos = [ 74 : 42 - 44 ] ; fp_name = ( Some " $ x " ) ; <nl> + fp_type = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | functions . php line 74 , characters 39 - 40 ) , <nl> + ( Toption <nl> + ( Rhint ( root | functions . php line 74 , characters 40 - 40 ) , <nl> + ( Tgeneric ( " T " , [ ] ) ) ) ) ) <nl> } ; <nl> fp_flags = <nl> ( make_fp_flags ~ mutability : None ~ accept_disposable : false <nl> Parsed decls : <nl> ] ; <nl> ft_implicit_params = <nl> { capability = <nl> - ( Rhint ( root | functions . php line 40 , characters 4 - 41 ) , <nl> + ( Rhint ( root | functions . php line 74 , characters 10 - 23 ) , <nl> ( Tunion [ ] ) ) <nl> } ; <nl> ft_ret = <nl> { et_enforced = false ; <nl> et_type = <nl> - ( Rhint ( root | functions . php line 40 , characters 37 - 40 ) , <nl> - ( Tprim Tvoid ) ) <nl> + ( Rhint ( root | functions . php line 74 , characters 47 - 50 ) , <nl> + ( Tprim Tnull ) ) <nl> } ; <nl> ft_flags = <nl> ( make_ft_flags FSync None ~ return_disposable : false <nl> ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false ~ returns_mutable : false <nl> - ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - fe_pos = [ 37 : 10 - 37 ] ; fe_php_std_lib = false } ; <nl> - " \ \ test_constrained_generic_fun " - > <nl> - { Typing_defs . fe_deprecated = None ; <nl> - fe_type = <nl> - ( Rwitness ( root | functions . php line 22 , characters 10 - 37 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; <nl> - ft_tparams = <nl> - [ { Typing_defs_core . tp_variance = Invariant ; <nl> - tp_name = ( [ 22 : 39 - 41 ] , " T1 " ) ; tp_tparams = [ ] ; <nl> - tp_constraints = <nl> - [ ( Constraint_super , <nl> - ( Rhint ( root | functions . php line 22 , characters 48 - 50 ) , <nl> - ( Tprim Tint ) ) ) <nl> - ] ; <nl> - tp_reified = Erased ; tp_user_attributes = [ ] } ; <nl> - { Typing_defs_core . tp_variance = Invariant ; <nl> - tp_name = ( [ 22 : 53 - 55 ] , " T2 " ) ; tp_tparams = [ ] ; <nl> - tp_constraints = <nl> - [ ( Constraint_as , <nl> - ( Rhint ( root | functions . php line 22 , characters 59 - 64 ) , <nl> - ( Tprim Tstring ) ) ) <nl> - ] ; <nl> - tp_reified = Erased ; tp_user_attributes = [ ] } <nl> - ] ; <nl> - ft_where_constraints = [ ] ; <nl> - ft_params = <nl> - [ { fp_pos = [ 23 : 6 - 11 ] ; fp_name = ( Some " $ arg1 " ) ; <nl> - fp_type = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | functions . php line 23 , characters 3 - 4 ) , <nl> - ( Tgeneric ( " T1 " , [ ] ) ) ) <nl> - } ; <nl> - fp_flags = <nl> - ( make_fp_flags ~ mutability : None ~ accept_disposable : false <nl> - ~ has_default : false ~ mode : Typing_defs_core . FPnormal <nl> - ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> - } ; <nl> - { fp_pos = [ 24 : 6 - 11 ] ; fp_name = ( Some " $ arg2 " ) ; <nl> - fp_type = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | functions . php line 24 , characters 3 - 4 ) , <nl> - ( Tgeneric ( " T2 " , [ ] ) ) ) <nl> - } ; <nl> - fp_flags = <nl> - ( make_fp_flags ~ mutability : None ~ accept_disposable : false <nl> - ~ has_default : false ~ mode : Typing_defs_core . FPnormal <nl> - ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> - } ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | functions . php line 22 , characters 10 - 37 ) , ( Tunion [ ] ) ) } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | functions . php line 25 , characters 4 - 5 ) , <nl> - ( Tgeneric ( " T1 " , [ ] ) ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false ~ returns_mutable : false <nl> - ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - fe_pos = [ 22 : 10 - 38 ] ; fe_php_std_lib = false } ; <nl> - " \ \ test_generic_fun " - > <nl> - { Typing_defs . fe_deprecated = None ; <nl> - fe_type = <nl> - ( Rwitness ( root | functions . php line 18 , characters 10 - 25 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; <nl> - ft_tparams = <nl> - [ { Typing_defs_core . tp_variance = Invariant ; <nl> - tp_name = ( [ 18 : 27 - 28 ] , " T " ) ; tp_tparams = [ ] ; tp_constraints = [ ] ; <nl> - tp_reified = Erased ; tp_user_attributes = [ ] } <nl> - ] ; <nl> - ft_where_constraints = [ ] ; <nl> - ft_params = <nl> - [ { fp_pos = [ 18 : 32 - 37 ] ; fp_name = ( Some " $ arg1 " ) ; <nl> - fp_type = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | functions . php line 18 , characters 30 - 30 ) , <nl> - ( Tgeneric ( " T " , [ ] ) ) ) <nl> - } ; <nl> - fp_flags = <nl> - ( make_fp_flags ~ mutability : None ~ accept_disposable : false <nl> - ~ has_default : false ~ mode : Typing_defs_core . FPnormal <nl> - ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> - } <nl> - ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | functions . php line 18 , characters 10 - 25 ) , ( Tunion [ ] ) ) } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | functions . php line 18 , characters 40 - 40 ) , <nl> - ( Tgeneric ( " T " , [ ] ) ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false ~ returns_mutable : false <nl> - ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - fe_pos = [ 18 : 10 - 26 ] ; fe_php_std_lib = false } ; <nl> - " \ \ test_returns_generic " - > <nl> - { Typing_defs . fe_deprecated = None ; <nl> - fe_type = <nl> - ( Rwitness ( root | functions . php line 29 , characters 10 - 29 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | functions . php line 29 , characters 10 - 29 ) , ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | functions . php line 29 , characters 34 - 52 ) , <nl> - ( Tapply ( ( [ 29 : 34 - 48 ] , " \ \ HH \ \ Traversable " ) , <nl> - [ ( Rhint ( root | functions . php line 29 , characters 49 - 51 ) , <nl> - ( Tprim Tint ) ) ] <nl> - ) ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - fe_pos = [ 29 : 10 - 30 ] ; fe_php_std_lib = false } ; <nl> - " \ \ variadic_function " - > <nl> - { Typing_defs . fe_deprecated = None ; <nl> - fe_type = <nl> - ( Rwitness ( root | functions . php line 87 , characters 10 - 26 ) , <nl> - ( Tfun <nl> - { ft_arity = <nl> - ( Fvariadic ( <nl> - { fp_pos = [ 87 : 37 - 42 ] ; fp_name = ( Some " $ args " ) ; <nl> - fp_type = <nl> + ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + fe_pos = [ 74 : 10 - 24 ] ; fe_php_std_lib = false } ) ) ; <nl> + ( " \ \ resource_type_hint " , <nl> + ( Shallow_decl_defs . Fun <nl> + { Typing_defs . fe_deprecated = None ; <nl> + fe_type = <nl> + ( Rwitness ( root | functions . php line 78 , characters 10 - 27 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; <nl> + ft_params = <nl> + [ { fp_pos = [ 78 : 38 - 40 ] ; fp_name = ( Some " $ i " ) ; <nl> + fp_type = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | functions . php line 78 , characters 29 - 36 ) , <nl> + ( Tprim Tresource ) ) <nl> + } ; <nl> + fp_flags = <nl> + ( make_fp_flags ~ mutability : None ~ accept_disposable : false <nl> + ~ has_default : false ~ mode : Typing_defs_core . FPnormal <nl> + ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> + } <nl> + ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | functions . php line 78 , characters 10 - 27 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> { et_enforced = false ; <nl> et_type = <nl> - ( Rhint ( root | functions . php line 87 , characters 28 - 32 ) , Tmixed ) <nl> + ( Rhint ( root | functions . php line 78 , characters 43 - 50 ) , <nl> + ( Tprim Tresource ) ) <nl> } ; <nl> - fp_flags = <nl> - ( make_fp_flags ~ mutability : None ~ accept_disposable : false <nl> - ~ has_default : false ~ mode : Typing_defs_core . FPnormal <nl> - ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> - } <nl> - ) ) ; <nl> - ft_tparams = [ ] ; ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | functions . php line 87 , characters 10 - 26 ) , ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | functions . php line 87 , characters 45 - 48 ) , <nl> - ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - fe_pos = [ 87 : 10 - 27 ] ; fe_php_std_lib = false } } ; <nl> - typedefs = <nl> - { " \ \ Typedef " - > <nl> - { Typing_defs . td_pos = [ 13 : 6 - 13 ] ; td_vis = Transparent ; td_tparams = [ ] ; <nl> - td_constraint = None ; <nl> - td_type = <nl> - ( Rhint ( root | functions . php line 13 , characters 16 - 21 ) , ( Tprim Tstring ) ) } } ; <nl> - consts = { } ; records = { } <nl> - } <nl> - <nl> - They matched ! <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + fe_pos = [ 78 : 10 - 28 ] ; fe_php_std_lib = false } ) ) ; <nl> + ( " \ \ noreturn_type_hint " , <nl> + ( Shallow_decl_defs . Fun <nl> + { Typing_defs . fe_deprecated = None ; <nl> + fe_type = <nl> + ( Rwitness ( root | functions . php line 82 , characters 10 - 27 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | functions . php line 82 , characters 10 - 27 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | functions . php line 82 , characters 32 - 39 ) , <nl> + ( Tprim Tnoreturn ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + fe_pos = [ 82 : 10 - 28 ] ; fe_php_std_lib = false } ) ) ; <nl> + ( " \ \ variadic_function " , <nl> + ( Shallow_decl_defs . Fun <nl> + { Typing_defs . fe_deprecated = None ; <nl> + fe_type = <nl> + ( Rwitness ( root | functions . php line 87 , characters 10 - 26 ) , <nl> + ( Tfun <nl> + { ft_arity = <nl> + ( Fvariadic ( <nl> + { fp_pos = [ 87 : 37 - 42 ] ; fp_name = ( Some " $ args " ) ; <nl> + fp_type = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + - ( Rvar_param ( root | functions . php line 87 , characters 37 - 41 ) , <nl> + + ( Rhint ( root | functions . php line 87 , characters 28 - 32 ) , <nl> + Tmixed ) <nl> + } ; <nl> + fp_flags = <nl> + ( make_fp_flags ~ mutability : None ~ accept_disposable : false <nl> + ~ has_default : false ~ mode : Typing_defs_core . FPnormal <nl> + ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> + } <nl> + ) ) ; <nl> + ft_tparams = [ ] ; ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | functions . php line 87 , characters 10 - 26 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | functions . php line 87 , characters 45 - 48 ) , <nl> + ( Tprim Tvoid ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + fe_pos = [ 87 : 10 - 27 ] ; fe_php_std_lib = false } ) ) <nl> + ] <nl> mmm a / hphp / hack / test / decl / generic_classes . php . exp <nl> ppp b / hphp / hack / test / decl / generic_classes . php . exp <nl> <nl> - Parsed decls : <nl> - <nl> - { classes = <nl> - { " \ \ Bag " - > <nl> + [ ( " \ \ Bag " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> + sc_name = ( [ 3 : 7 - 10 ] , " \ \ Bag " ) ; <nl> + sc_tparams = <nl> + [ { Typing_defs_core . tp_variance = Invariant ; <nl> + tp_name = ( [ 3 : 11 - 12 ] , " T " ) ; tp_tparams = [ ] ; tp_constraints = [ ] ; <nl> + tp_reified = Erased ; tp_user_attributes = [ ] } <nl> + ] ; <nl> + sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> + sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> + sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; <nl> + sc_pu_enums = [ ] ; <nl> + sc_props = <nl> + [ { Shallow_decl_defs . sp_const = false ; sp_xhp_attr = None ; <nl> + sp_lateinit = false ; sp_lsb = false ; sp_name = ( [ 4 : 13 - 18 ] , " data " ) ; <nl> + sp_needs_init = true ; <nl> + sp_type = <nl> + ( Some ( Rhint ( root | generic_classes . php line 4 , characters 11 - 11 ) , <nl> + ( Tgeneric ( " T " , [ ] ) ) ) ) ; <nl> + sp_abstract = false ; sp_visibility = Private } <nl> + ] ; <nl> + sc_sprops = [ ] ; <nl> + sc_constructor = <nl> + ( Some { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> + sm_memoizelsb = false ; sm_name = ( [ 6 : 19 - 30 ] , " __construct " ) ; <nl> + sm_override = false ; sm_dynamicallycallable = false ; <nl> + sm_reactivity = None ; <nl> + sm_type = <nl> + ( Rwitness ( root | generic_classes . php line 6 , characters 19 - 29 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; <nl> + ft_params = <nl> + [ { fp_pos = [ 6 : 33 - 38 ] ; fp_name = ( Some " $ data " ) ; <nl> + fp_type = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | generic_classes . php line 6 , characters 31 - 31 ) , <nl> + ( Tgeneric ( " T " , [ ] ) ) ) <nl> + } ; <nl> + fp_flags = <nl> + ( make_fp_flags ~ mutability : None ~ accept_disposable : false <nl> + ~ has_default : false ~ mode : Typing_defs_core . FPnormal <nl> + ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> + } <nl> + ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | generic_classes . php line 6 , characters 19 - 29 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rwitness ( root | generic_classes . php line 6 , characters 19 - 29 ) , <nl> + ( Tprim Tvoid ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; <nl> + ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + sm_visibility = Public ; sm_deprecated = None } ) ; <nl> + sc_static_methods = [ ] ; <nl> + sc_methods = <nl> + [ { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> + sm_memoizelsb = false ; sm_name = ( [ 10 : 19 - 22 ] , " get " ) ; <nl> + sm_override = false ; sm_dynamicallycallable = false ; <nl> + sm_reactivity = None ; <nl> + sm_type = <nl> + ( Rwitness ( root | generic_classes . php line 10 , characters 19 - 21 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | generic_classes . php line 10 , characters 19 - 21 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | generic_classes . php line 10 , characters 26 - 26 ) , <nl> + ( Tgeneric ( " T " , [ ] ) ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + sm_visibility = Public ; sm_deprecated = None } <nl> + ] ; sc_user_attributes = [ ] ; sc_enum_type = None } ) ) ; <nl> + ( " \ \ ContravariantBag " , <nl> + ( Shallow_decl_defs . Class <nl> { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> - sc_name = ( [ 3 : 7 - 10 ] , " \ \ Bag " ) ; <nl> + sc_name = ( [ 15 : 7 - 23 ] , " \ \ ContravariantBag " ) ; <nl> sc_tparams = <nl> - [ { Typing_defs_core . tp_variance = Invariant ; <nl> - tp_name = ( [ 3 : 11 - 12 ] , " T " ) ; tp_tparams = [ ] ; tp_constraints = [ ] ; <nl> + [ { Typing_defs_core . tp_variance = Contravariant ; <nl> + tp_name = ( [ 15 : 25 - 26 ] , " T " ) ; tp_tparams = [ ] ; tp_constraints = [ ] ; <nl> tp_reified = Erased ; tp_user_attributes = [ ] } <nl> ] ; <nl> sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> Parsed decls : <nl> sc_pu_enums = [ ] ; <nl> sc_props = <nl> [ { Shallow_decl_defs . sp_const = false ; sp_xhp_attr = None ; <nl> - sp_lateinit = false ; sp_lsb = false ; sp_name = ( [ 4 : 13 - 18 ] , " data " ) ; <nl> + sp_lateinit = false ; sp_lsb = false ; sp_name = ( [ 16 : 13 - 18 ] , " data " ) ; <nl> sp_needs_init = true ; <nl> sp_type = <nl> - ( Some ( Rhint ( root | generic_classes . php line 4 , characters 11 - 11 ) , <nl> + ( Some ( Rhint ( root | generic_classes . php line 16 , characters 11 - 11 ) , <nl> ( Tgeneric ( " T " , [ ] ) ) ) ) ; <nl> sp_abstract = false ; sp_visibility = Private } <nl> ] ; <nl> sc_sprops = [ ] ; <nl> sc_constructor = <nl> ( Some { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> - sm_memoizelsb = false ; sm_name = ( [ 6 : 19 - 30 ] , " __construct " ) ; <nl> + sm_memoizelsb = false ; sm_name = ( [ 18 : 19 - 30 ] , " __construct " ) ; <nl> sm_override = false ; sm_dynamicallycallable = false ; <nl> sm_reactivity = None ; <nl> sm_type = <nl> - ( Rwitness ( root | generic_classes . php line 6 , characters 19 - 29 ) , <nl> + ( Rwitness ( root | generic_classes . php line 18 , characters 19 - 29 ) , <nl> ( Tfun <nl> { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> ft_where_constraints = [ ] ; <nl> ft_params = <nl> - [ { fp_pos = [ 6 : 33 - 38 ] ; fp_name = ( Some " $ data " ) ; <nl> + [ { fp_pos = [ 18 : 33 - 38 ] ; fp_name = ( Some " $ data " ) ; <nl> fp_type = <nl> { et_enforced = false ; <nl> et_type = <nl> - ( Rhint ( root | generic_classes . php line 6 , characters 31 - 31 ) , <nl> + ( Rhint ( root | generic_classes . php line 18 , characters 31 - 31 ) , <nl> ( Tgeneric ( " T " , [ ] ) ) ) <nl> } ; <nl> fp_flags = <nl> Parsed decls : <nl> ] ; <nl> ft_implicit_params = <nl> { capability = <nl> - ( Rhint ( root | generic_classes . php line 6 , characters 19 - 29 ) , <nl> + ( Rhint ( root | generic_classes . php line 18 , characters 19 - 29 ) , <nl> ( Tunion [ ] ) ) <nl> } ; <nl> ft_ret = <nl> { et_enforced = false ; <nl> et_type = <nl> - ( Rwitness ( root | generic_classes . php line 6 , characters 19 - 29 ) , <nl> + ( Rwitness ( root | generic_classes . php line 18 , characters 19 - 29 ) , <nl> ( Tprim Tvoid ) ) <nl> } ; <nl> ft_flags = <nl> Parsed decls : <nl> ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } <nl> } ) ) ; <nl> sm_visibility = Public ; sm_deprecated = None } ) ; <nl> - sc_static_methods = [ ] ; <nl> - sc_methods = <nl> - [ { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> - sm_memoizelsb = false ; sm_name = ( [ 10 : 19 - 22 ] , " get " ) ; <nl> - sm_override = false ; sm_dynamicallycallable = false ; <nl> - sm_reactivity = None ; <nl> - sm_type = <nl> - ( Rwitness ( root | generic_classes . php line 10 , characters 19 - 21 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | generic_classes . php line 10 , characters 19 - 21 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | generic_classes . php line 10 , characters 26 - 26 ) , <nl> - ( Tgeneric ( " T " , [ ] ) ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - sm_visibility = Public ; sm_deprecated = None } <nl> - ] ; <nl> - sc_user_attributes = [ ] ; sc_enum_type = None } ; <nl> - " \ \ ContravariantBag " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; sc_is_xhp = false ; <nl> - sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> - sc_name = ( [ 15 : 7 - 23 ] , " \ \ ContravariantBag " ) ; <nl> - sc_tparams = <nl> - [ { Typing_defs_core . tp_variance = Contravariant ; <nl> - tp_name = ( [ 15 : 25 - 26 ] , " T " ) ; tp_tparams = [ ] ; tp_constraints = [ ] ; <nl> - tp_reified = Erased ; tp_user_attributes = [ ] } <nl> - ] ; <nl> - sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> - sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> - sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; <nl> - sc_props = <nl> - [ { Shallow_decl_defs . sp_const = false ; sp_xhp_attr = None ; <nl> - sp_lateinit = false ; sp_lsb = false ; sp_name = ( [ 16 : 13 - 18 ] , " data " ) ; <nl> - sp_needs_init = true ; <nl> - sp_type = <nl> - ( Some ( Rhint ( root | generic_classes . php line 16 , characters 11 - 11 ) , <nl> - ( Tgeneric ( " T " , [ ] ) ) ) ) ; <nl> - sp_abstract = false ; sp_visibility = Private } <nl> - ] ; <nl> - sc_sprops = [ ] ; <nl> - sc_constructor = <nl> - ( Some { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> - sm_memoizelsb = false ; sm_name = ( [ 18 : 19 - 30 ] , " __construct " ) ; <nl> - sm_override = false ; sm_dynamicallycallable = false ; <nl> - sm_reactivity = None ; <nl> - sm_type = <nl> - ( Rwitness ( root | generic_classes . php line 18 , characters 19 - 29 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; <nl> - ft_params = <nl> - [ { fp_pos = [ 18 : 33 - 38 ] ; fp_name = ( Some " $ data " ) ; <nl> - fp_type = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | generic_classes . php line 18 , characters 31 - 31 ) , <nl> - ( Tgeneric ( " T " , [ ] ) ) ) <nl> - } ; <nl> - fp_flags = <nl> - ( make_fp_flags ~ mutability : None ~ accept_disposable : false <nl> - ~ has_default : false ~ mode : Typing_defs_core . FPnormal <nl> - ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> - } <nl> - ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | generic_classes . php line 18 , characters 19 - 29 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rwitness ( root | generic_classes . php line 18 , characters 19 - 29 ) , <nl> - ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - sm_visibility = Public ; sm_deprecated = None } ) ; sc_static_methods = [ ] ; <nl> - sc_methods = [ ] ; sc_user_attributes = [ ] ; sc_enum_type = None } ; <nl> - " \ \ CovariantBag " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; sc_is_xhp = false ; <nl> - sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> - sc_name = ( [ 23 : 7 - 19 ] , " \ \ CovariantBag " ) ; <nl> - sc_tparams = <nl> - [ { Typing_defs_core . tp_variance = Covariant ; tp_name = ( [ 23 : 21 - 22 ] , " T " ) ; <nl> - tp_tparams = [ ] ; tp_constraints = [ ] ; tp_reified = Erased ; <nl> - tp_user_attributes = [ ] } <nl> - ] ; <nl> - sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> - sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> - sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; <nl> - sc_props = <nl> - [ { Shallow_decl_defs . sp_const = false ; sp_xhp_attr = None ; <nl> - sp_lateinit = false ; sp_lsb = false ; sp_name = ( [ 24 : 13 - 18 ] , " data " ) ; <nl> - sp_needs_init = true ; <nl> - sp_type = <nl> - ( Some ( Rhint ( root | generic_classes . php line 24 , characters 11 - 11 ) , <nl> - ( Tgeneric ( " T " , [ ] ) ) ) ) ; <nl> - sp_abstract = false ; sp_visibility = Private } <nl> - ] ; <nl> - sc_sprops = [ ] ; <nl> - sc_constructor = <nl> - ( Some { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> - sm_memoizelsb = false ; sm_name = ( [ 26 : 19 - 30 ] , " __construct " ) ; <nl> - sm_override = false ; sm_dynamicallycallable = false ; <nl> - sm_reactivity = None ; <nl> - sm_type = <nl> - ( Rwitness ( root | generic_classes . php line 26 , characters 19 - 29 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; <nl> - ft_params = <nl> - [ { fp_pos = [ 26 : 33 - 38 ] ; fp_name = ( Some " $ data " ) ; <nl> - fp_type = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | generic_classes . php line 26 , characters 31 - 31 ) , <nl> - ( Tgeneric ( " T " , [ ] ) ) ) <nl> - } ; <nl> - fp_flags = <nl> - ( make_fp_flags ~ mutability : None ~ accept_disposable : false <nl> - ~ has_default : false ~ mode : Typing_defs_core . FPnormal <nl> - ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> - } <nl> - ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | generic_classes . php line 26 , characters 19 - 29 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rwitness ( root | generic_classes . php line 26 , characters 19 - 29 ) , <nl> - ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - sm_visibility = Public ; sm_deprecated = None } ) ; sc_static_methods = [ ] ; <nl> - sc_methods = <nl> - [ { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> - sm_memoizelsb = false ; sm_name = ( [ 30 : 19 - 22 ] , " get " ) ; sm_override = false ; <nl> - sm_dynamicallycallable = false ; sm_reactivity = None ; <nl> - sm_type = <nl> - ( Rwitness ( root | generic_classes . php line 30 , characters 19 - 21 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | generic_classes . php line 30 , characters 19 - 21 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | generic_classes . php line 30 , characters 26 - 26 ) , <nl> - ( Tgeneric ( " T " , [ ] ) ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - sm_visibility = Public ; sm_deprecated = None } <nl> - ] ; sc_user_attributes = [ ] ; sc_enum_type = None } } ; funs = { } ; <nl> - typedefs = { } ; consts = { } ; records = { } <nl> - } <nl> + sc_static_methods = [ ] ; sc_methods = [ ] ; sc_user_attributes = [ ] ; <nl> + sc_enum_type = None } ) ) ; <nl> + ( " \ \ CovariantBag " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> + sc_name = ( [ 23 : 7 - 19 ] , " \ \ CovariantBag " ) ; <nl> + sc_tparams = <nl> + [ { Typing_defs_core . tp_variance = Covariant ; <nl> + tp_name = ( [ 23 : 21 - 22 ] , " T " ) ; tp_tparams = [ ] ; tp_constraints = [ ] ; <nl> + tp_reified = Erased ; tp_user_attributes = [ ] } <nl> + ] ; <nl> + sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> + sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> + sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; <nl> + sc_pu_enums = [ ] ; <nl> + sc_props = <nl> + [ { Shallow_decl_defs . sp_const = false ; sp_xhp_attr = None ; <nl> + sp_lateinit = false ; sp_lsb = false ; sp_name = ( [ 24 : 13 - 18 ] , " data " ) ; <nl> + sp_needs_init = true ; <nl> + sp_type = <nl> + ( Some ( Rhint ( root | generic_classes . php line 24 , characters 11 - 11 ) , <nl> + ( Tgeneric ( " T " , [ ] ) ) ) ) ; <nl> + sp_abstract = false ; sp_visibility = Private } <nl> + ] ; <nl> + sc_sprops = [ ] ; <nl> + sc_constructor = <nl> + ( Some { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> + sm_memoizelsb = false ; sm_name = ( [ 26 : 19 - 30 ] , " __construct " ) ; <nl> + sm_override = false ; sm_dynamicallycallable = false ; <nl> + sm_reactivity = None ; <nl> + sm_type = <nl> + ( Rwitness ( root | generic_classes . php line 26 , characters 19 - 29 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; <nl> + ft_params = <nl> + [ { fp_pos = [ 26 : 33 - 38 ] ; fp_name = ( Some " $ data " ) ; <nl> + fp_type = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | generic_classes . php line 26 , characters 31 - 31 ) , <nl> + ( Tgeneric ( " T " , [ ] ) ) ) <nl> + } ; <nl> + fp_flags = <nl> + ( make_fp_flags ~ mutability : None ~ accept_disposable : false <nl> + ~ has_default : false ~ mode : Typing_defs_core . FPnormal <nl> + ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> + } <nl> + ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | generic_classes . php line 26 , characters 19 - 29 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rwitness ( root | generic_classes . php line 26 , characters 19 - 29 ) , <nl> + ( Tprim Tvoid ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } <nl> + } ) ) ; <nl> + sm_visibility = Public ; sm_deprecated = None } ) ; <nl> + sc_static_methods = [ ] ; <nl> + sc_methods = <nl> + [ { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> + sm_memoizelsb = false ; sm_name = ( [ 30 : 19 - 22 ] , " get " ) ; <nl> + sm_override = false ; sm_dynamicallycallable = false ; <nl> + sm_reactivity = None ; <nl> + sm_type = <nl> + ( Rwitness ( root | generic_classes . php line 30 , characters 19 - 21 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | generic_classes . php line 30 , characters 19 - 21 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | generic_classes . php line 30 , characters 26 - 26 ) , <nl> + ( Tgeneric ( " T " , [ ] ) ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + sm_visibility = Public ; sm_deprecated = None } <nl> + ] ; sc_user_attributes = [ ] ; sc_enum_type = None } ) ) <nl> + ] <nl> <nl> They matched ! <nl> mmm a / hphp / hack / test / decl / generic_method_tparam_scope . php . exp <nl> ppp b / hphp / hack / test / decl / generic_method_tparam_scope . php . exp <nl> <nl> - Parsed decls : <nl> - <nl> - { classes = <nl> - { " \ \ C " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> - sc_name = ( [ 3 : 7 - 8 ] , " \ \ C " ) ; sc_tparams = [ ] ; sc_where_constraints = [ ] ; <nl> - sc_extends = [ ] ; sc_uses = [ ] ; sc_xhp_attr_uses = [ ] ; <nl> - sc_req_extends = [ ] ; sc_req_implements = [ ] ; sc_implements = [ ] ; <nl> - sc_consts = [ ] ; sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; sc_props = [ ] ; <nl> - sc_sprops = [ ] ; sc_constructor = None ; sc_static_methods = [ ] ; <nl> - sc_methods = <nl> - [ { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> - sm_memoizelsb = false ; sm_name = ( [ 4 : 19 - 20 ] , " f " ) ; <nl> + [ ( " \ \ C " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> + sc_name = ( [ 3 : 7 - 8 ] , " \ \ C " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> + sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> + sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; <nl> + sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> + sc_constructor = None ; sc_static_methods = [ ] ; <nl> + sc_methods = <nl> + [ { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> + sm_memoizelsb = false ; sm_name = ( [ 4 : 19 - 20 ] , " f " ) ; <nl> + sm_override = false ; sm_dynamicallycallable = false ; <nl> + sm_reactivity = None ; <nl> + sm_type = <nl> + ( Rwitness ( root | generic_method_tparam_scope . php line 4 , characters 19 - 19 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; <nl> + ft_tparams = <nl> + [ { Typing_defs_core . tp_variance = Invariant ; <nl> + tp_name = ( [ 4 : 21 - 23 ] , " Ta " ) ; tp_tparams = [ ] ; <nl> + tp_constraints = [ ] ; tp_reified = Erased ; <nl> + tp_user_attributes = [ ] } <nl> + ] ; <nl> + ft_where_constraints = [ ] ; <nl> + ft_params = <nl> + [ { fp_pos = [ 4 : 28 - 30 ] ; fp_name = ( Some " $ a " ) ; <nl> + fp_type = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | generic_method_tparam_scope . php line 4 , characters 25 - 26 ) , <nl> + ( Tgeneric ( " Ta " , [ ] ) ) ) <nl> + } ; <nl> + fp_flags = <nl> + ( make_fp_flags ~ mutability : None ~ accept_disposable : false <nl> + ~ has_default : false ~ mode : Typing_defs_core . FPnormal <nl> + ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> + } <nl> + ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | generic_method_tparam_scope . php line 4 , characters 19 - 19 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | generic_method_tparam_scope . php line 4 , characters 33 - 34 ) , <nl> + ( Tgeneric ( " Ta " , [ ] ) ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + sm_visibility = Public ; sm_deprecated = None } ; <nl> + { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> + sm_memoizelsb = false ; sm_name = ( [ 8 : 19 - 20 ] , " g " ) ; <nl> sm_override = false ; sm_dynamicallycallable = false ; <nl> sm_reactivity = None ; <nl> sm_type = <nl> - ( Rwitness ( root | generic_method_tparam_scope . php line 4 , characters 19 - 19 ) , <nl> + ( Rwitness ( root | generic_method_tparam_scope . php line 8 , characters 19 - 19 ) , <nl> ( Tfun <nl> { ft_arity = ( Fstandard ( ) ) ; <nl> ft_tparams = <nl> [ { Typing_defs_core . tp_variance = Invariant ; <nl> - tp_name = ( [ 4 : 21 - 23 ] , " Ta " ) ; tp_tparams = [ ] ; <nl> + tp_name = ( [ 8 : 21 - 23 ] , " Tb " ) ; tp_tparams = [ ] ; <nl> tp_constraints = [ ] ; tp_reified = Erased ; <nl> tp_user_attributes = [ ] } <nl> ] ; <nl> ft_where_constraints = [ ] ; <nl> ft_params = <nl> - [ { fp_pos = [ 4 : 28 - 30 ] ; fp_name = ( Some " $ a " ) ; <nl> + [ { fp_pos = [ 8 : 28 - 30 ] ; fp_name = ( Some " $ b " ) ; <nl> fp_type = <nl> { et_enforced = false ; <nl> et_type = <nl> - ( Rhint ( root | generic_method_tparam_scope . php line 4 , characters 25 - 26 ) , <nl> - ( Tgeneric ( " Ta " , [ ] ) ) ) <nl> + ( Rhint ( root | generic_method_tparam_scope . php line 8 , characters 25 - 26 ) , <nl> + ( Tgeneric ( " Tb " , [ ] ) ) ) <nl> } ; <nl> fp_flags = <nl> ( make_fp_flags ~ mutability : None ~ accept_disposable : false <nl> Parsed decls : <nl> ] ; <nl> ft_implicit_params = <nl> { capability = <nl> - ( Rhint ( root | generic_method_tparam_scope . php line 4 , characters 19 - 19 ) , <nl> + ( Rhint ( root | generic_method_tparam_scope . php line 8 , characters 19 - 19 ) , <nl> ( Tunion [ ] ) ) <nl> } ; <nl> ft_ret = <nl> { et_enforced = false ; <nl> et_type = <nl> - ( Rhint ( root | generic_method_tparam_scope . php line 4 , characters 33 - 34 ) , <nl> - ( Tgeneric ( " Ta " , [ ] ) ) ) <nl> + ( Rhint ( root | generic_method_tparam_scope . php line 8 , characters 33 - 34 ) , <nl> + ( Tgeneric ( " Tb " , [ ] ) ) ) <nl> } ; <nl> ft_flags = <nl> ( make_ft_flags FSync None ~ return_disposable : false <nl> ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - sm_visibility = Public ; sm_deprecated = None } ; <nl> - { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> - sm_memoizelsb = false ; sm_name = ( [ 8 : 19 - 20 ] , " g " ) ; <nl> - sm_override = false ; sm_dynamicallycallable = false ; <nl> - sm_reactivity = None ; <nl> - sm_type = <nl> - ( Rwitness ( root | generic_method_tparam_scope . php line 8 , characters 19 - 19 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; <nl> - ft_tparams = <nl> - [ { Typing_defs_core . tp_variance = Invariant ; <nl> - tp_name = ( [ 8 : 21 - 23 ] , " Tb " ) ; tp_tparams = [ ] ; <nl> - tp_constraints = [ ] ; tp_reified = Erased ; <nl> - tp_user_attributes = [ ] } <nl> - ] ; <nl> - ft_where_constraints = [ ] ; <nl> - ft_params = <nl> - [ { fp_pos = [ 8 : 28 - 30 ] ; fp_name = ( Some " $ b " ) ; <nl> - fp_type = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | generic_method_tparam_scope . php line 8 , characters 25 - 26 ) , <nl> - ( Tgeneric ( " Tb " , [ ] ) ) ) <nl> - } ; <nl> - fp_flags = <nl> - ( make_fp_flags ~ mutability : None ~ accept_disposable : false <nl> - ~ has_default : false ~ mode : Typing_defs_core . FPnormal <nl> - ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> - } <nl> - ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | generic_method_tparam_scope . php line 8 , characters 19 - 19 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | generic_method_tparam_scope . php line 8 , characters 33 - 34 ) , <nl> - ( Tgeneric ( " Tb " , [ ] ) ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - sm_visibility = Public ; sm_deprecated = None } <nl> - ] ; <nl> - sc_user_attributes = [ ] ; sc_enum_type = None } } ; funs = { } ; typedefs = { } ; <nl> - consts = { } ; records = { } <nl> - } <nl> + sm_visibility = Public ; sm_deprecated = None } <nl> + ] ; sc_user_attributes = [ ] ; sc_enum_type = None } ) ) <nl> + ] <nl> <nl> They matched ! <nl> mmm a / hphp / hack / test / decl / hhi . hhi . exp <nl> ppp b / hphp / hack / test / decl / hhi . hhi . exp <nl> <nl> - Parsed decls : <nl> - <nl> - { classes = <nl> - { " \ \ C " - > <nl> - { Shallow_decl_defs . sc_mode = Mdecl ; sc_final = false ; sc_is_xhp = false ; <nl> - sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> - sc_name = ( [ 9 : 7 - 8 ] , " \ \ C " ) ; sc_tparams = [ ] ; sc_where_constraints = [ ] ; <nl> - sc_extends = [ ] ; sc_uses = [ ] ; sc_xhp_attr_uses = [ ] ; <nl> - sc_req_extends = [ ] ; sc_req_implements = [ ] ; sc_implements = [ ] ; <nl> - sc_consts = [ ] ; sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; sc_props = [ ] ; <nl> - sc_sprops = [ ] ; sc_constructor = None ; sc_static_methods = [ ] ; <nl> - sc_methods = <nl> - [ { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> - sm_memoizelsb = false ; sm_name = ( [ 10 : 19 - 20 ] , " g " ) ; <nl> - sm_override = false ; sm_dynamicallycallable = false ; <nl> - sm_reactivity = None ; <nl> - sm_type = <nl> - ( Rwitness ( root | hhi . hhi line 10 , characters 19 - 19 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; <nl> - ft_params = <nl> - [ { fp_pos = [ 10 : 23 - 25 ] ; fp_name = ( Some " $ x " ) ; <nl> - fp_type = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | hhi . hhi line 10 , characters 21 - 21 ) , <nl> - ( Tapply ( ( [ 10 : 21 - 22 ] , " \ \ X " ) , [ ] ) ) ) <nl> - } ; <nl> - fp_flags = <nl> - ( make_fp_flags ~ mutability : None ~ accept_disposable : false <nl> - ~ has_default : false ~ mode : Typing_defs_core . FPnormal <nl> - ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> - } <nl> - ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | hhi . hhi line 10 , characters 19 - 19 ) , ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | hhi . hhi line 10 , characters 28 - 30 ) , <nl> - ( Tprim Tint ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } <nl> - } ) ) ; <nl> - sm_visibility = Public ; sm_deprecated = None } <nl> - ] ; <nl> - sc_user_attributes = [ ] ; sc_enum_type = None } } ; <nl> - funs = <nl> - { " \ \ f " - > <nl> - { Typing_defs . fe_deprecated = None ; <nl> - fe_type = <nl> - ( Rwitness ( root | hhi . hhi line 7 , characters 10 - 10 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; <nl> - ft_params = <nl> - [ { fp_pos = [ 7 : 19 - 21 ] ; fp_name = ( Some " $ s " ) ; <nl> - fp_type = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | hhi . hhi line 7 , characters 12 - 17 ) , <nl> - ( Tprim Tstring ) ) <nl> - } ; <nl> - fp_flags = <nl> - ( make_fp_flags ~ mutability : None ~ accept_disposable : false <nl> - ~ has_default : false ~ mode : Typing_defs_core . FPnormal <nl> - ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> - } <nl> - ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | hhi . hhi line 7 , characters 10 - 10 ) , ( Tunion [ ] ) ) } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | hhi . hhi line 7 , characters 24 - 26 ) , ( Tprim Tint ) ) } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - fe_pos = [ 7 : 10 - 11 ] ; fe_php_std_lib = false } } ; <nl> - typedefs = <nl> - { " \ \ X " - > <nl> - { Typing_defs . td_pos = [ 3 : 6 - 7 ] ; td_vis = Transparent ; td_tparams = [ ] ; <nl> - td_constraint = None ; <nl> - td_type = ( Rhint ( root | hhi . hhi line 3 , characters 10 - 12 ) , ( Tprim Tint ) ) <nl> - } } ; <nl> - consts = <nl> - { " \ \ Y " - > <nl> - { Typing_defs . cd_pos = [ 5 : 11 - 12 ] ; <nl> - cd_type = ( Rhint ( root | hhi . hhi line 5 , characters 7 - 9 ) , ( Tprim Tint ) ) } } ; <nl> - records = { } } <nl> + [ ( " \ \ X " , <nl> + ( Shallow_decl_defs . Typedef <nl> + { Typing_defs . td_pos = [ 3 : 6 - 7 ] ; td_vis = Transparent ; td_tparams = [ ] ; <nl> + td_constraint = None ; <nl> + td_type = <nl> + ( Rhint ( root | hhi . hhi line 3 , characters 10 - 12 ) , ( Tprim Tint ) ) } ) ) ; <nl> + ( " \ \ Y " , <nl> + ( Shallow_decl_defs . Const <nl> + { Typing_defs . cd_pos = [ 5 : 11 - 12 ] ; <nl> + cd_type = ( Rhint ( root | hhi . hhi line 5 , characters 7 - 9 ) , ( Tprim Tint ) ) <nl> + } ) ) ; <nl> + ( " \ \ f " , <nl> + ( Shallow_decl_defs . Fun <nl> + { Typing_defs . fe_deprecated = None ; <nl> + fe_type = <nl> + ( Rwitness ( root | hhi . hhi line 7 , characters 10 - 10 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; <nl> + ft_params = <nl> + [ { fp_pos = [ 7 : 19 - 21 ] ; fp_name = ( Some " $ s " ) ; <nl> + fp_type = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | hhi . hhi line 7 , characters 12 - 17 ) , <nl> + ( Tprim Tstring ) ) <nl> + } ; <nl> + fp_flags = <nl> + ( make_fp_flags ~ mutability : None ~ accept_disposable : false <nl> + ~ has_default : false ~ mode : Typing_defs_core . FPnormal <nl> + ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> + } <nl> + ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | hhi . hhi line 7 , characters 10 - 10 ) , ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | hhi . hhi line 7 , characters 24 - 26 ) , ( Tprim Tint ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + fe_pos = [ 7 : 10 - 11 ] ; fe_php_std_lib = false } ) ) ; <nl> + ( " \ \ C " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mdecl ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> + sc_name = ( [ 9 : 7 - 8 ] , " \ \ C " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> + sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> + sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; <nl> + sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> + sc_constructor = None ; sc_static_methods = [ ] ; <nl> + sc_methods = <nl> + [ { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> + sm_memoizelsb = false ; sm_name = ( [ 10 : 19 - 20 ] , " g " ) ; <nl> + sm_override = false ; sm_dynamicallycallable = false ; <nl> + sm_reactivity = None ; <nl> + sm_type = <nl> + ( Rwitness ( root | hhi . hhi line 10 , characters 19 - 19 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; <nl> + ft_params = <nl> + [ { fp_pos = [ 10 : 23 - 25 ] ; fp_name = ( Some " $ x " ) ; <nl> + fp_type = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | hhi . hhi line 10 , characters 21 - 21 ) , <nl> + ( Tapply ( ( [ 10 : 21 - 22 ] , " \ \ X " ) , [ ] ) ) ) <nl> + } ; <nl> + fp_flags = <nl> + ( make_fp_flags ~ mutability : None ~ accept_disposable : false <nl> + ~ has_default : false ~ mode : Typing_defs_core . FPnormal <nl> + ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> + } <nl> + ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | hhi . hhi line 10 , characters 19 - 19 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | hhi . hhi line 10 , characters 28 - 30 ) , <nl> + ( Tprim Tint ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; <nl> + ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + sm_visibility = Public ; sm_deprecated = None } <nl> + ] ; <nl> + sc_user_attributes = [ ] ; sc_enum_type = None } ) ) <nl> + ] <nl> <nl> They matched ! <nl> mmm a / hphp / hack / test / decl / higher_kinded . php . exp <nl> ppp b / hphp / hack / test / decl / higher_kinded . php . exp <nl> <nl> - Parsed decls : <nl> - <nl> - { classes = { } ; funs = { } ; <nl> - typedefs = <nl> - { " \ \ ID " - > <nl> - { Typing_defs . td_pos = [ 3 : 6 - 8 ] ; td_vis = Transparent ; <nl> - td_tparams = <nl> - [ { Typing_defs_core . tp_variance = Invariant ; tp_name = ( [ 3 : 9 - 10 ] , " T " ) ; <nl> - tp_tparams = [ ] ; tp_constraints = [ ] ; tp_reified = Erased ; <nl> - tp_user_attributes = [ ] } <nl> - ] ; <nl> - td_constraint = None ; <nl> - td_type = <nl> - ( Rhint ( root | higher_kinded . php line 3 , characters 14 - 14 ) , <nl> - ( Tgeneric ( " T " , [ ] ) ) ) <nl> - } ; <nl> - " \ \ Test1 " - > <nl> - { Typing_defs . td_pos = [ 5 : 6 - 11 ] ; td_vis = Transparent ; <nl> - td_tparams = <nl> - [ { Typing_defs_core . tp_variance = Invariant ; tp_name = ( [ 5 : 12 - 14 ] , " TC " ) ; <nl> - tp_tparams = <nl> + mmm legacy <nl> ppp + direct decl <nl> + <nl> + [ ( " \ \ ID " , <nl> + ( Shallow_decl_defs . Typedef <nl> + { Typing_defs . td_pos = [ 3 : 6 - 8 ] ; td_vis = Transparent ; <nl> + td_tparams = <nl> + [ { Typing_defs_core . tp_variance = Invariant ; <nl> + tp_name = ( [ 3 : 9 - 10 ] , " T " ) ; tp_tparams = [ ] ; tp_constraints = [ ] ; <nl> + tp_reified = Erased ; tp_user_attributes = [ ] } <nl> + ] ; <nl> + td_constraint = None ; <nl> + td_type = <nl> + ( Rhint ( root | higher_kinded . php line 3 , characters 14 - 14 ) , <nl> + ( Tgeneric ( " T " , [ ] ) ) ) <nl> + } ) ) ; <nl> + ( " \ \ Test1 " , <nl> + ( Shallow_decl_defs . Typedef <nl> + { Typing_defs . td_pos = [ 5 : 6 - 11 ] ; td_vis = Transparent ; <nl> + td_tparams = <nl> [ { Typing_defs_core . tp_variance = Invariant ; <nl> - tp_name = ( [ 5 : 15 - 18 ] , " TA1 " ) ; tp_tparams = [ ] ; tp_constraints = [ ] ; <nl> - tp_reified = Erased ; tp_user_attributes = [ ] } ; <nl> - { Typing_defs_core . tp_variance = Invariant ; <nl> - tp_name = ( [ 5 : 20 - 23 ] , " TA2 " ) ; <nl> - tp_tparams = <nl> - [ { Typing_defs_core . tp_variance = Invariant ; <nl> - tp_name = ( [ 5 : 24 - 27 ] , " TA3 " ) ; tp_tparams = [ ] ; <nl> + tp_name = ( [ 5 : 12 - 14 ] , " TC " ) ; <nl> + tp_tparams = <nl> + [ { Typing_defs_core . tp_variance = Invariant ; <nl> + tp_name = ( [ 5 : 15 - 18 ] , " TA1 " ) ; tp_tparams = [ ] ; <nl> + tp_constraints = [ ] ; tp_reified = Erased ; tp_user_attributes = [ ] <nl> + } ; <nl> + { Typing_defs_core . tp_variance = Invariant ; <nl> + tp_name = ( [ 5 : 20 - 23 ] , " TA2 " ) ; <nl> + tp_tparams = <nl> + [ { Typing_defs_core . tp_variance = Invariant ; <nl> + tp_name = ( [ 5 : 24 - 27 ] , " TA3 " ) ; tp_tparams = [ ] ; <nl> + tp_constraints = [ ] ; tp_reified = Erased ; <nl> + tp_user_attributes = [ ] } <nl> + ] ; <nl> tp_constraints = [ ] ; tp_reified = Erased ; <nl> tp_user_attributes = [ ] } <nl> - ] ; <nl> - tp_constraints = [ ] ; tp_reified = Erased ; tp_user_attributes = [ ] <nl> - } <nl> + ] ; <nl> + tp_constraints = [ ] ; tp_reified = Erased ; tp_user_attributes = [ ] } <nl> ] ; <nl> - tp_constraints = [ ] ; tp_reified = Erased ; tp_user_attributes = [ ] } <nl> - ] ; <nl> - td_constraint = None ; <nl> - td_type = <nl> - ( Rhint ( root | higher_kinded . php line 5 , characters 33 - 34 ) , <nl> - ( Tgeneric ( " TC " , <nl> - [ ( Rhint ( root | higher_kinded . php line 5 , characters 36 - 38 ) , <nl> - ( Tprim Tint ) ) ; <nl> - ( Rhint ( root | higher_kinded . php line 5 , characters 41 - 42 ) , <nl> - ( Tapply ( ( [ 5 : 41 - 43 ] , " \ \ ID " ) , [ ] ) ) ) <nl> - ] ) <nl> - ) ) <nl> - } } ; consts = { } ; records = { } <nl> - } <nl> - <nl> - They matched ! <nl> + td_constraint = None ; <nl> + td_type = <nl> + - ( Rhint ( root | higher_kinded . php line 5 , characters 33 - 43 ) , <nl> + + ( Rhint ( root | higher_kinded . php line 5 , characters 33 - 34 ) , <nl> + ( Tgeneric ( " TC " , <nl> + [ ( Rhint ( root | higher_kinded . php line 5 , characters 36 - 38 ) , <nl> + ( Tprim Tint ) ) ; <nl> + ( Rhint ( root | higher_kinded . php line 5 , characters 41 - 42 ) , <nl> + ( Tapply ( ( [ 5 : 41 - 43 ] , " \ \ ID " ) , [ ] ) ) ) <nl> + ] ) <nl> + ) ) <nl> + } ) ) <nl> + ] <nl> mmm a / hphp / hack / test / decl / ifc_policied . php . exp <nl> ppp b / hphp / hack / test / decl / ifc_policied . php . exp <nl> <nl> - Parsed decls : <nl> - <nl> - { classes = <nl> - { " \ \ C " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> - sc_name = ( [ 5 : 7 - 8 ] , " \ \ C " ) ; sc_tparams = [ ] ; sc_where_constraints = [ ] ; <nl> - sc_extends = [ ] ; sc_uses = [ ] ; sc_xhp_attr_uses = [ ] ; <nl> - sc_req_extends = [ ] ; sc_req_implements = [ ] ; sc_implements = [ ] ; <nl> - sc_consts = [ ] ; sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; sc_props = [ ] ; <nl> - sc_sprops = [ ] ; sc_constructor = None ; sc_static_methods = [ ] ; <nl> - sc_methods = <nl> - [ { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> - sm_memoizelsb = false ; sm_name = ( [ 7 : 19 - 20 ] , " f " ) ; <nl> - sm_override = false ; sm_dynamicallycallable = false ; <nl> - sm_reactivity = None ; <nl> - sm_type = <nl> - ( Rwitness ( root | ifc_policied . php line 7 , characters 19 - 19 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | ifc_policied . php line 7 , characters 19 - 19 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | ifc_policied . php line 7 , characters 24 - 27 ) , <nl> - ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { Test } } ) ) ; <nl> - sm_visibility = Public ; sm_deprecated = None } ; <nl> - { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> - sm_memoizelsb = false ; sm_name = ( [ 10 : 19 - 20 ] , " g " ) ; <nl> - sm_override = false ; sm_dynamicallycallable = false ; <nl> - sm_reactivity = None ; <nl> - sm_type = <nl> - ( Rwitness ( root | ifc_policied . php line 10 , characters 19 - 19 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | ifc_policied . php line 10 , characters 19 - 19 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | ifc_policied . php line 10 , characters 24 - 27 ) , <nl> - ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { Public } <nl> - } ) ) ; <nl> - sm_visibility = Public ; sm_deprecated = None } ; <nl> - { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> - sm_memoizelsb = false ; sm_name = ( [ 13 : 19 - 27 ] , " implicit " ) ; <nl> - sm_override = false ; sm_dynamicallycallable = false ; <nl> - sm_reactivity = None ; <nl> - sm_type = <nl> - ( Rwitness ( root | ifc_policied . php line 13 , characters 19 - 26 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | ifc_policied . php line 13 , characters 19 - 26 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | ifc_policied . php line 13 , characters 31 - 34 ) , <nl> - ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { } } ) ) ; <nl> - sm_visibility = Public ; sm_deprecated = None } ; <nl> - { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> - sm_memoizelsb = false ; sm_name = ( [ 16 : 19 - 29 ] , " inferflows " ) ; <nl> - sm_override = false ; sm_dynamicallycallable = false ; <nl> - sm_reactivity = None ; <nl> - sm_type = <nl> - ( Rwitness ( root | ifc_policied . php line 16 , characters 19 - 28 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | ifc_policied . php line 16 , characters 19 - 28 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | ifc_policied . php line 16 , characters 33 - 36 ) , <nl> - ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDInferFlows } ) ) ; <nl> - sm_visibility = Public ; sm_deprecated = None } ; <nl> - { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> - sm_memoizelsb = false ; sm_name = ( [ 19 : 19 - 28 ] , " classname " ) ; <nl> - sm_override = false ; sm_dynamicallycallable = false ; <nl> - sm_reactivity = None ; <nl> - sm_type = <nl> - ( Rwitness ( root | ifc_policied . php line 19 , characters 19 - 27 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | ifc_policied . php line 19 , characters 19 - 27 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | ifc_policied . php line 19 , characters 32 - 35 ) , <nl> - ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { \ Policy } <nl> - } ) ) ; <nl> - sm_visibility = Public ; sm_deprecated = None } ; <nl> - { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> - sm_memoizelsb = false ; sm_name = ( [ 22 : 19 - 27 ] , " defaults " ) ; <nl> - sm_override = false ; sm_dynamicallycallable = false ; <nl> - sm_reactivity = None ; <nl> - sm_type = <nl> - ( Rwitness ( root | ifc_policied . php line 22 , characters 19 - 26 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | ifc_policied . php line 22 , characters 19 - 26 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | ifc_policied . php line 22 , characters 31 - 34 ) , <nl> - ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } <nl> - } ) ) ; <nl> - sm_visibility = Public ; sm_deprecated = None } ; <nl> - { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> - sm_memoizelsb = false ; sm_name = ( [ 24 : 19 - 28 ] , " with_args " ) ; <nl> - sm_override = false ; sm_dynamicallycallable = false ; <nl> - sm_reactivity = None ; <nl> - sm_type = <nl> - ( Rwitness ( root | ifc_policied . php line 24 , characters 19 - 27 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; <nl> - ft_params = <nl> - [ { fp_pos = [ 25 : 22 - 24 ] ; fp_name = ( Some " $ x " ) ; <nl> - fp_type = <nl> + mmm legacy <nl> ppp + direct decl <nl> + <nl> + [ ( " \ \ Policy " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> + sc_name = ( [ 3 : 7 - 13 ] , " \ \ Policy " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> + sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> + sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; <nl> + sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> + sc_constructor = None ; sc_static_methods = [ ] ; sc_methods = [ ] ; <nl> + sc_user_attributes = [ ] ; sc_enum_type = None } ) ) ; <nl> + ( " \ \ C " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> + sc_name = ( [ 5 : 7 - 8 ] , " \ \ C " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> + sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> + sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; <nl> + sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> + sc_constructor = None ; sc_static_methods = [ ] ; <nl> + sc_methods = <nl> + [ { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> + sm_memoizelsb = false ; sm_name = ( [ 7 : 19 - 20 ] , " f " ) ; <nl> + sm_override = false ; sm_dynamicallycallable = false ; <nl> + sm_reactivity = None ; <nl> + sm_type = <nl> + ( Rwitness ( root | ifc_policied . php line 7 , characters 19 - 19 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | ifc_policied . php line 7 , characters 19 - 19 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | ifc_policied . php line 7 , characters 24 - 27 ) , <nl> + ( Tprim Tvoid ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { Test } } ) ) ; <nl> + sm_visibility = Public ; sm_deprecated = None } ; <nl> + { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> + sm_memoizelsb = false ; sm_name = ( [ 10 : 19 - 20 ] , " g " ) ; <nl> + sm_override = false ; sm_dynamicallycallable = false ; <nl> + sm_reactivity = None ; <nl> + sm_type = <nl> + ( Rwitness ( root | ifc_policied . php line 10 , characters 19 - 19 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | ifc_policied . php line 10 , characters 19 - 19 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> { et_enforced = false ; <nl> et_type = <nl> - ( Rhint ( root | ifc_policied . php line 25 , characters 20 - 20 ) , <nl> - ( Tapply ( ( [ 25 : 20 - 21 ] , " \ \ C " ) , [ ] ) ) ) <nl> + ( Rhint ( root | ifc_policied . php line 10 , characters 24 - 27 ) , <nl> + ( Tprim Tvoid ) ) <nl> } ; <nl> - fp_flags = <nl> - ( make_fp_flags ~ mutability : None ~ accept_disposable : false <nl> - ~ has_default : false ~ mode : Typing_defs_core . FPnormal <nl> - ~ ifc_external : true ~ ifc_can_call : false ) ; <nl> - } ; <nl> - { fp_pos = [ 26 : 38 - 40 ] ; fp_name = ( Some " $ f " ) ; <nl> - fp_type = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | ifc_policied . php line 26 , characters 19 - 36 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | ifc_policied . php line 26 , characters 19 - 36 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | ifc_policied . php line 26 , characters 32 - 35 ) , <nl> - ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None <nl> - ~ return_disposable : false ~ returns_mutable : false <nl> - ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; <nl> - ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) <nl> - } ; <nl> - fp_flags = <nl> - ( make_fp_flags ~ mutability : None ~ accept_disposable : false <nl> - ~ has_default : false ~ mode : Typing_defs_core . FPnormal <nl> - ~ ifc_external : false ~ ifc_can_call : true ) ; <nl> - } <nl> - ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | ifc_policied . php line 24 , characters 19 - 27 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | ifc_policied . php line 27 , characters 6 - 9 ) , <nl> - ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } <nl> - } ) ) ; <nl> - sm_visibility = Public ; sm_deprecated = None } <nl> - ] ; <nl> - sc_user_attributes = [ ] ; sc_enum_type = None } ; <nl> - " \ \ Policy " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> - sc_name = ( [ 3 : 7 - 13 ] , " \ \ Policy " ) ; sc_tparams = [ ] ; <nl> - sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> - sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> - sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; <nl> - sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; sc_constructor = None ; <nl> - sc_static_methods = [ ] ; sc_methods = [ ] ; sc_user_attributes = [ ] ; <nl> - sc_enum_type = None } } ; <nl> - funs = { } ; typedefs = { } ; consts = { } ; records = { } } <nl> - <nl> - They matched ! <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; <nl> + ft_ifc_decl = FDPolicied { Public } } ) ) ; <nl> + sm_visibility = Public ; sm_deprecated = None } ; <nl> + { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> + sm_memoizelsb = false ; sm_name = ( [ 13 : 19 - 27 ] , " implicit " ) ; <nl> + sm_override = false ; sm_dynamicallycallable = false ; <nl> + sm_reactivity = None ; <nl> + sm_type = <nl> + ( Rwitness ( root | ifc_policied . php line 13 , characters 19 - 26 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | ifc_policied . php line 13 , characters 19 - 26 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | ifc_policied . php line 13 , characters 31 - 34 ) , <nl> + ( Tprim Tvoid ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { } } ) ) ; <nl> + sm_visibility = Public ; sm_deprecated = None } ; <nl> + { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> + sm_memoizelsb = false ; sm_name = ( [ 16 : 19 - 29 ] , " inferflows " ) ; <nl> + sm_override = false ; sm_dynamicallycallable = false ; <nl> + sm_reactivity = None ; <nl> + sm_type = <nl> + ( Rwitness ( root | ifc_policied . php line 16 , characters 19 - 28 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | ifc_policied . php line 16 , characters 19 - 28 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | ifc_policied . php line 16 , characters 33 - 36 ) , <nl> + ( Tprim Tvoid ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + - ft_reactive = Nonreactive ; <nl> + - ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + + ft_reactive = Nonreactive ; ft_ifc_decl = FDInferFlows } ) ) ; <nl> + sm_visibility = Public ; sm_deprecated = None } ; <nl> + { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> + sm_memoizelsb = false ; sm_name = ( [ 19 : 19 - 28 ] , " classname " ) ; <nl> + sm_override = false ; sm_dynamicallycallable = false ; <nl> + sm_reactivity = None ; <nl> + sm_type = <nl> + ( Rwitness ( root | ifc_policied . php line 19 , characters 19 - 27 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | ifc_policied . php line 19 , characters 19 - 27 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | ifc_policied . php line 19 , characters 32 - 35 ) , <nl> + ( Tprim Tvoid ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; <nl> + ft_ifc_decl = FDPolicied { \ Policy } } ) ) ; <nl> + sm_visibility = Public ; sm_deprecated = None } ; <nl> + { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> + sm_memoizelsb = false ; sm_name = ( [ 22 : 19 - 27 ] , " defaults " ) ; <nl> + sm_override = false ; sm_dynamicallycallable = false ; <nl> + sm_reactivity = None ; <nl> + sm_type = <nl> + ( Rwitness ( root | ifc_policied . php line 22 , characters 19 - 26 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | ifc_policied . php line 22 , characters 19 - 26 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | ifc_policied . php line 22 , characters 31 - 34 ) , <nl> + ( Tprim Tvoid ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; <nl> + ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + sm_visibility = Public ; sm_deprecated = None } ; <nl> + { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> + sm_memoizelsb = false ; sm_name = ( [ 24 : 19 - 28 ] , " with_args " ) ; <nl> + sm_override = false ; sm_dynamicallycallable = false ; <nl> + sm_reactivity = None ; <nl> + sm_type = <nl> + ( Rwitness ( root | ifc_policied . php line 24 , characters 19 - 27 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; <nl> + ft_params = <nl> + [ { fp_pos = [ 25 : 22 - 24 ] ; fp_name = ( Some " $ x " ) ; <nl> + fp_type = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | ifc_policied . php line 25 , characters 20 - 20 ) , <nl> + ( Tapply ( ( [ 25 : 20 - 21 ] , " \ \ C " ) , [ ] ) ) ) <nl> + } ; <nl> + fp_flags = <nl> + ( make_fp_flags ~ mutability : None ~ accept_disposable : false <nl> + ~ has_default : false ~ mode : Typing_defs_core . FPnormal <nl> + ~ ifc_external : true ~ ifc_can_call : false ) ; <nl> + } ; <nl> + { fp_pos = [ 26 : 38 - 40 ] ; fp_name = ( Some " $ f " ) ; <nl> + fp_type = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | ifc_policied . php line 26 , characters 19 - 36 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | ifc_policied . php line 26 , characters 19 - 36 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | ifc_policied . php line 26 , characters 32 - 35 ) , <nl> + ( Tprim Tvoid ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None <nl> + ~ return_disposable : false <nl> + ~ returns_mutable : false <nl> + ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; <nl> + ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) <nl> + } ; <nl> + fp_flags = <nl> + ( make_fp_flags ~ mutability : None <nl> + ~ accept_disposable : false ~ has_default : false <nl> + ~ mode : Typing_defs_core . FPnormal ~ ifc_external : false <nl> + ~ ifc_can_call : true ) ; <nl> + } <nl> + ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | ifc_policied . php line 24 , characters 19 - 27 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | ifc_policied . php line 27 , characters 6 - 9 ) , <nl> + ( Tprim Tvoid ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; <nl> + ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + sm_visibility = Public ; sm_deprecated = None } <nl> + ] ; <nl> + sc_user_attributes = [ ] ; sc_enum_type = None } ) ) <nl> + ] <nl> mmm a / hphp / hack / test / decl / inout . php . exp <nl> ppp b / hphp / hack / test / decl / inout . php . exp <nl> <nl> - Parsed decls : <nl> - <nl> - { classes = { } ; <nl> - funs = <nl> - { " \ \ f " - > <nl> - { Typing_defs . fe_deprecated = None ; <nl> - fe_type = <nl> - ( Rwitness ( root | inout . php line 3 , characters 10 - 10 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; <nl> - ft_params = <nl> - [ { fp_pos = [ 3 : 40 - 42 ] ; fp_name = ( Some " $ f " ) ; <nl> - fp_type = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | inout . php line 3 , characters 12 - 38 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; <nl> - ft_params = <nl> - [ { fp_pos = [ 3 : 28 - 31 ] ; fp_name = None ; <nl> - fp_type = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | inout . php line 3 , characters 28 - 30 ) , <nl> - ( Tprim Tint ) ) <nl> - } ; <nl> - fp_flags = <nl> - ( make_fp_flags ~ mutability : None <nl> - ~ accept_disposable : false ~ has_default : false <nl> - ~ mode : Typing_defs_core . FPinout <nl> - ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> - } <nl> - ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | inout . php line 3 , characters 12 - 38 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | inout . php line 3 , characters 34 - 37 ) , <nl> - ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; <nl> - ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) <nl> - } ; <nl> - fp_flags = <nl> - ( make_fp_flags ~ mutability : None ~ accept_disposable : false <nl> - ~ has_default : false ~ mode : Typing_defs_core . FPnormal <nl> - ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> - } <nl> - ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | inout . php line 3 , characters 10 - 10 ) , ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | inout . php line 3 , characters 45 - 48 ) , ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - fe_pos = [ 3 : 10 - 11 ] ; fe_php_std_lib = false } } ; <nl> - typedefs = { } ; consts = { } ; records = { } } <nl> + [ ( " \ \ f " , <nl> + ( Shallow_decl_defs . Fun <nl> + { Typing_defs . fe_deprecated = None ; <nl> + fe_type = <nl> + ( Rwitness ( root | inout . php line 3 , characters 10 - 10 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; <nl> + ft_params = <nl> + [ { fp_pos = [ 3 : 40 - 42 ] ; fp_name = ( Some " $ f " ) ; <nl> + fp_type = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | inout . php line 3 , characters 12 - 38 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; <nl> + ft_params = <nl> + [ { fp_pos = [ 3 : 28 - 31 ] ; fp_name = None ; <nl> + fp_type = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | inout . php line 3 , characters 28 - 30 ) , <nl> + ( Tprim Tint ) ) <nl> + } ; <nl> + fp_flags = <nl> + ( make_fp_flags ~ mutability : None <nl> + ~ accept_disposable : false ~ has_default : false <nl> + ~ mode : Typing_defs_core . FPinout <nl> + ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> + } <nl> + ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | inout . php line 3 , characters 12 - 38 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | inout . php line 3 , characters 34 - 37 ) , <nl> + ( Tprim Tvoid ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; <nl> + ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) <nl> + } ; <nl> + fp_flags = <nl> + ( make_fp_flags ~ mutability : None ~ accept_disposable : false <nl> + ~ has_default : false ~ mode : Typing_defs_core . FPnormal <nl> + ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> + } <nl> + ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | inout . php line 3 , characters 10 - 10 ) , ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | inout . php line 3 , characters 45 - 48 ) , <nl> + ( Tprim Tvoid ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + fe_pos = [ 3 : 10 - 11 ] ; fe_php_std_lib = false } ) ) <nl> + ] <nl> <nl> They matched ! <nl> mmm a / hphp / hack / test / decl / interface . php . exp <nl> ppp b / hphp / hack / test / decl / interface . php . exp <nl> <nl> - Parsed decls : <nl> - <nl> - { classes = <nl> - { " \ \ I " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cinterface ; <nl> - sc_name = ( [ 3 : 11 - 12 ] , " \ \ I " ) ; sc_tparams = [ ] ; <nl> - sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> - sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> - sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; <nl> - sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; sc_constructor = None ; <nl> - sc_static_methods = [ ] ; <nl> - sc_methods = <nl> - [ { Shallow_decl_defs . sm_abstract = true ; sm_final = false ; <nl> - sm_memoizelsb = false ; sm_name = ( [ 4 : 19 - 22 ] , " foo " ) ; <nl> - sm_override = false ; sm_dynamicallycallable = false ; <nl> - sm_reactivity = None ; <nl> - sm_type = <nl> - ( Rwitness ( root | interface . php line 4 , characters 19 - 21 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | interface . php line 4 , characters 19 - 21 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | interface . php line 4 , characters 26 - 29 ) , <nl> - ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } <nl> - } ) ) ; <nl> - sm_visibility = Public ; sm_deprecated = None } <nl> - ] ; <nl> - sc_user_attributes = [ ] ; sc_enum_type = None } } ; <nl> - funs = { } ; typedefs = { } ; consts = { } ; records = { } } <nl> + [ ( " \ \ I " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cinterface ; <nl> + sc_name = ( [ 3 : 11 - 12 ] , " \ \ I " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> + sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> + sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; <nl> + sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> + sc_constructor = None ; sc_static_methods = [ ] ; <nl> + sc_methods = <nl> + [ { Shallow_decl_defs . sm_abstract = true ; sm_final = false ; <nl> + sm_memoizelsb = false ; sm_name = ( [ 4 : 19 - 22 ] , " foo " ) ; <nl> + sm_override = false ; sm_dynamicallycallable = false ; <nl> + sm_reactivity = None ; <nl> + sm_type = <nl> + ( Rwitness ( root | interface . php line 4 , characters 19 - 21 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | interface . php line 4 , characters 19 - 21 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | interface . php line 4 , characters 26 - 29 ) , <nl> + ( Tprim Tvoid ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } <nl> + } ) ) ; <nl> + sm_visibility = Public ; sm_deprecated = None } <nl> + ] ; <nl> + sc_user_attributes = [ ] ; sc_enum_type = None } ) ) <nl> + ] <nl> <nl> They matched ! <nl> mmm a / hphp / hack / test / decl / interfaces . php . exp <nl> ppp b / hphp / hack / test / decl / interfaces . php . exp <nl> <nl> - Parsed decls : <nl> - <nl> - { classes = <nl> - { " \ \ IMyInterface " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cinterface ; <nl> - sc_name = ( [ 3 : 11 - 23 ] , " \ \ IMyInterface " ) ; sc_tparams = [ ] ; <nl> - sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> - sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> - sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; <nl> - sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; sc_constructor = None ; <nl> - sc_static_methods = [ ] ; <nl> - sc_methods = <nl> - [ { Shallow_decl_defs . sm_abstract = true ; sm_final = false ; <nl> - sm_memoizelsb = false ; sm_name = ( [ 4 : 19 - 28 ] , " doNothing " ) ; <nl> - sm_override = false ; sm_dynamicallycallable = false ; <nl> - sm_reactivity = None ; <nl> - sm_type = <nl> - ( Rwitness ( root | interfaces . php line 4 , characters 19 - 27 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | interfaces . php line 4 , characters 19 - 27 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | interfaces . php line 4 , characters 32 - 35 ) , <nl> - ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } <nl> - } ) ) ; <nl> - sm_visibility = Public ; sm_deprecated = None } <nl> - ] ; <nl> - sc_user_attributes = [ ] ; sc_enum_type = None } } ; <nl> - funs = { } ; typedefs = { } ; consts = { } ; records = { } } <nl> + [ ( " \ \ IMyInterface " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cinterface ; <nl> + sc_name = ( [ 3 : 11 - 23 ] , " \ \ IMyInterface " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> + sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> + sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; <nl> + sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> + sc_constructor = None ; sc_static_methods = [ ] ; <nl> + sc_methods = <nl> + [ { Shallow_decl_defs . sm_abstract = true ; sm_final = false ; <nl> + sm_memoizelsb = false ; sm_name = ( [ 4 : 19 - 28 ] , " doNothing " ) ; <nl> + sm_override = false ; sm_dynamicallycallable = false ; <nl> + sm_reactivity = None ; <nl> + sm_type = <nl> + ( Rwitness ( root | interfaces . php line 4 , characters 19 - 27 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | interfaces . php line 4 , characters 19 - 27 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | interfaces . php line 4 , characters 32 - 35 ) , <nl> + ( Tprim Tvoid ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } <nl> + } ) ) ; <nl> + sm_visibility = Public ; sm_deprecated = None } <nl> + ] ; <nl> + sc_user_attributes = [ ] ; sc_enum_type = None } ) ) <nl> + ] <nl> <nl> They matched ! <nl> mmm a / hphp / hack / test / decl / late_init . php . exp <nl> ppp b / hphp / hack / test / decl / late_init . php . exp <nl> <nl> - Parsed decls : <nl> - <nl> - { classes = <nl> - { " \ \ C " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = true ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> - sc_name = ( [ 3 : 13 - 14 ] , " \ \ C " ) ; sc_tparams = [ ] ; <nl> - sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> - sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> - sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; <nl> - sc_pu_enums = [ ] ; <nl> - sc_props = <nl> - [ { Shallow_decl_defs . sp_const = false ; sp_xhp_attr = None ; <nl> - sp_lateinit = true ; sp_lsb = false ; sp_name = ( [ 4 : 61 - 66 ] , " prop " ) ; <nl> - sp_needs_init = true ; <nl> - sp_type = <nl> - ( Some ( Rhint ( root | late_init . php line 4 , characters 54 - 59 ) , <nl> - ( Tprim Tstring ) ) ) ; <nl> - sp_abstract = false ; sp_visibility = Private } <nl> - ] ; <nl> - sc_sprops = [ ] ; <nl> - sc_constructor = <nl> - ( Some { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> - sm_memoizelsb = false ; sm_name = ( [ 4 : 19 - 30 ] , " __construct " ) ; <nl> - sm_override = false ; sm_dynamicallycallable = false ; <nl> - sm_reactivity = None ; <nl> - sm_type = <nl> - ( Rwitness ( root | late_init . php line 4 , characters 19 - 29 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; <nl> - ft_params = <nl> - [ { fp_pos = [ 4 : 61 - 66 ] ; fp_name = ( Some " $ prop " ) ; <nl> - fp_type = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | late_init . php line 4 , characters 54 - 59 ) , <nl> - ( Tprim Tstring ) ) <nl> - } ; <nl> - fp_flags = <nl> - ( make_fp_flags ~ mutability : None <nl> - ~ accept_disposable : false ~ has_default : false <nl> - ~ mode : Typing_defs_core . FPnormal ~ ifc_external : false <nl> - ~ ifc_can_call : false ) ; <nl> - } <nl> - ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | late_init . php line 4 , characters 19 - 29 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rwitness ( root | late_init . php line 4 , characters 19 - 29 ) , <nl> - ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; <nl> - ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - sm_visibility = Public ; sm_deprecated = None } ) ; <nl> - sc_static_methods = [ ] ; sc_methods = [ ] ; sc_user_attributes = [ ] ; <nl> - sc_enum_type = None } } ; <nl> - funs = { } ; typedefs = { } ; consts = { } ; records = { } } <nl> + [ ( " \ \ C " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = true ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> + sc_name = ( [ 3 : 13 - 14 ] , " \ \ C " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> + sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> + sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; <nl> + sc_pu_enums = [ ] ; <nl> + sc_props = <nl> + [ { Shallow_decl_defs . sp_const = false ; sp_xhp_attr = None ; <nl> + sp_lateinit = true ; sp_lsb = false ; sp_name = ( [ 4 : 61 - 66 ] , " prop " ) ; <nl> + sp_needs_init = true ; <nl> + sp_type = <nl> + ( Some ( Rhint ( root | late_init . php line 4 , characters 54 - 59 ) , <nl> + ( Tprim Tstring ) ) ) ; <nl> + sp_abstract = false ; sp_visibility = Private } <nl> + ] ; <nl> + sc_sprops = [ ] ; <nl> + sc_constructor = <nl> + ( Some { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> + sm_memoizelsb = false ; sm_name = ( [ 4 : 19 - 30 ] , " __construct " ) ; <nl> + sm_override = false ; sm_dynamicallycallable = false ; <nl> + sm_reactivity = None ; <nl> + sm_type = <nl> + ( Rwitness ( root | late_init . php line 4 , characters 19 - 29 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; <nl> + ft_params = <nl> + [ { fp_pos = [ 4 : 61 - 66 ] ; fp_name = ( Some " $ prop " ) ; <nl> + fp_type = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | late_init . php line 4 , characters 54 - 59 ) , <nl> + ( Tprim Tstring ) ) <nl> + } ; <nl> + fp_flags = <nl> + ( make_fp_flags ~ mutability : None <nl> + ~ accept_disposable : false ~ has_default : false <nl> + ~ mode : Typing_defs_core . FPnormal ~ ifc_external : false <nl> + ~ ifc_can_call : false ) ; <nl> + } <nl> + ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | late_init . php line 4 , characters 19 - 29 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rwitness ( root | late_init . php line 4 , characters 19 - 29 ) , <nl> + ( Tprim Tvoid ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; <nl> + ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + sm_visibility = Public ; sm_deprecated = None } ) ; <nl> + sc_static_methods = [ ] ; sc_methods = [ ] ; sc_user_attributes = [ ] ; <nl> + sc_enum_type = None } ) ) <nl> + ] <nl> <nl> They matched ! <nl> mmm a / hphp / hack / test / decl / like_types . php . exp <nl> ppp b / hphp / hack / test / decl / like_types . php . exp <nl> <nl> - Parsed decls : <nl> - <nl> - { classes = <nl> - { " \ \ X " - > <nl> + [ ( " \ \ expect_int " , <nl> + ( Shallow_decl_defs . Fun <nl> + { Typing_defs . fe_deprecated = None ; <nl> + fe_type = <nl> + ( Rwitness ( root | like_types . php line 4 , characters 10 - 19 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; <nl> + ft_params = <nl> + [ { fp_pos = [ 4 : 25 - 27 ] ; fp_name = ( Some " $ i " ) ; <nl> + fp_type = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | like_types . php line 4 , characters 21 - 23 ) , <nl> + ( Tprim Tint ) ) <nl> + } ; <nl> + fp_flags = <nl> + ( make_fp_flags ~ mutability : None ~ accept_disposable : false <nl> + ~ has_default : false ~ mode : Typing_defs_core . FPnormal <nl> + ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> + } <nl> + ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | like_types . php line 4 , characters 10 - 19 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | like_types . php line 4 , characters 30 - 33 ) , <nl> + ( Tprim Tvoid ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + fe_pos = [ 4 : 10 - 20 ] ; fe_php_std_lib = false } ) ) ; <nl> + ( " \ \ f " , <nl> + ( Shallow_decl_defs . Fun <nl> + { Typing_defs . fe_deprecated = None ; <nl> + fe_type = <nl> + ( Rwitness ( root | like_types . php line 6 , characters 10 - 10 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; <nl> + ft_tparams = <nl> + [ { Typing_defs_core . tp_variance = Invariant ; <nl> + tp_name = ( [ 6 : 12 - 13 ] , " T " ) ; tp_tparams = [ ] ; <nl> + tp_constraints = <nl> + [ ( Constraint_as , <nl> + ( Rhint ( root | like_types . php line 6 , characters 17 - 20 ) , <nl> + ( Tlike <nl> + ( Rhint ( root | like_types . php line 6 , characters 18 - 20 ) , <nl> + ( Tprim Tint ) ) ) ) ) <nl> + ] ; <nl> + tp_reified = Erased ; tp_user_attributes = [ ] } <nl> + ] ; <nl> + ft_where_constraints = [ ] ; <nl> + ft_params = <nl> + [ { fp_pos = [ 6 : 25 - 27 ] ; fp_name = ( Some " $ t " ) ; <nl> + fp_type = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | like_types . php line 6 , characters 23 - 23 ) , <nl> + ( Tgeneric ( " T " , [ ] ) ) ) <nl> + } ; <nl> + fp_flags = <nl> + ( make_fp_flags ~ mutability : None ~ accept_disposable : false <nl> + ~ has_default : false ~ mode : Typing_defs_core . FPnormal <nl> + ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> + } <nl> + ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | like_types . php line 6 , characters 10 - 10 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | like_types . php line 6 , characters 30 - 33 ) , <nl> + ( Tprim Tvoid ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + fe_pos = [ 6 : 10 - 11 ] ; fe_php_std_lib = false } ) ) ; <nl> + ( " \ \ X " , <nl> + ( Shallow_decl_defs . Class <nl> { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cabstract ; <nl> sc_name = ( [ 10 : 16 - 17 ] , " \ \ X " ) ; sc_tparams = [ ] ; <nl> Parsed decls : <nl> } ) ) ; <nl> sm_visibility = Public ; sm_deprecated = None } <nl> ] ; <nl> - sc_user_attributes = [ ] ; sc_enum_type = None } } ; <nl> - funs = <nl> - { " \ \ expect_int " - > <nl> - { Typing_defs . fe_deprecated = None ; <nl> - fe_type = <nl> - ( Rwitness ( root | like_types . php line 4 , characters 10 - 19 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; <nl> - ft_params = <nl> - [ { fp_pos = [ 4 : 25 - 27 ] ; fp_name = ( Some " $ i " ) ; <nl> - fp_type = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | like_types . php line 4 , characters 21 - 23 ) , <nl> - ( Tprim Tint ) ) <nl> - } ; <nl> - fp_flags = <nl> - ( make_fp_flags ~ mutability : None ~ accept_disposable : false <nl> - ~ has_default : false ~ mode : Typing_defs_core . FPnormal <nl> - ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> - } <nl> - ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | like_types . php line 4 , characters 10 - 19 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | like_types . php line 4 , characters 30 - 33 ) , <nl> - ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - fe_pos = [ 4 : 10 - 20 ] ; fe_php_std_lib = false } ; <nl> - " \ \ f " - > <nl> - { Typing_defs . fe_deprecated = None ; <nl> - fe_type = <nl> - ( Rwitness ( root | like_types . php line 6 , characters 10 - 10 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; <nl> - ft_tparams = <nl> - [ { Typing_defs_core . tp_variance = Invariant ; <nl> - tp_name = ( [ 6 : 12 - 13 ] , " T " ) ; tp_tparams = [ ] ; <nl> - tp_constraints = <nl> - [ ( Constraint_as , <nl> - ( Rhint ( root | like_types . php line 6 , characters 17 - 20 ) , <nl> - ( Tlike <nl> - ( Rhint ( root | like_types . php line 6 , characters 18 - 20 ) , <nl> - ( Tprim Tint ) ) ) ) ) <nl> - ] ; <nl> - tp_reified = Erased ; tp_user_attributes = [ ] } <nl> - ] ; <nl> - ft_where_constraints = [ ] ; <nl> - ft_params = <nl> - [ { fp_pos = [ 6 : 25 - 27 ] ; fp_name = ( Some " $ t " ) ; <nl> - fp_type = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | like_types . php line 6 , characters 23 - 23 ) , <nl> - ( Tgeneric ( " T " , [ ] ) ) ) <nl> - } ; <nl> - fp_flags = <nl> - ( make_fp_flags ~ mutability : None ~ accept_disposable : false <nl> - ~ has_default : false ~ mode : Typing_defs_core . FPnormal <nl> - ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> - } <nl> - ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | like_types . php line 6 , characters 10 - 10 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | like_types . php line 6 , characters 30 - 33 ) , <nl> - ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - fe_pos = [ 6 : 10 - 11 ] ; fe_php_std_lib = false } } ; typedefs = { } ; <nl> - consts = { } ; records = { } <nl> - } <nl> + sc_user_attributes = [ ] ; sc_enum_type = None } ) ) <nl> + ] <nl> <nl> They matched ! <nl> mmm a / hphp / hack / test / decl / memoize_lsb . php . exp <nl> ppp b / hphp / hack / test / decl / memoize_lsb . php . exp <nl> <nl> - Parsed decls : <nl> - <nl> - { classes = <nl> - { " \ \ C " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = true ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> - sc_name = ( [ 3 : 13 - 14 ] , " \ \ C " ) ; sc_tparams = [ ] ; <nl> - sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> - sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> - sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; <nl> - sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; sc_constructor = None ; <nl> - sc_static_methods = <nl> - [ { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> - sm_memoizelsb = true ; sm_name = ( [ 5 : 26 - 27 ] , " f " ) ; <nl> - sm_override = false ; sm_dynamicallycallable = false ; <nl> - sm_reactivity = None ; <nl> - sm_type = <nl> - ( Rwitness ( root | memoize_lsb . php line 5 , characters 26 - 26 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | memoize_lsb . php line 5 , characters 26 - 26 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | memoize_lsb . php line 5 , characters 31 - 33 ) , <nl> - ( Tprim Tint ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } <nl> - } ) ) ; <nl> - sm_visibility = Public ; sm_deprecated = None } <nl> - ] ; <nl> - sc_methods = [ ] ; sc_user_attributes = [ ] ; sc_enum_type = None } } ; <nl> - funs = { } ; typedefs = { } ; consts = { } ; records = { } } <nl> + [ ( " \ \ C " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = true ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> + sc_name = ( [ 3 : 13 - 14 ] , " \ \ C " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> + sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> + sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; <nl> + sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> + sc_constructor = None ; <nl> + sc_static_methods = <nl> + [ { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> + sm_memoizelsb = true ; sm_name = ( [ 5 : 26 - 27 ] , " f " ) ; <nl> + sm_override = false ; sm_dynamicallycallable = false ; <nl> + sm_reactivity = None ; <nl> + sm_type = <nl> + ( Rwitness ( root | memoize_lsb . php line 5 , characters 26 - 26 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | memoize_lsb . php line 5 , characters 26 - 26 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | memoize_lsb . php line 5 , characters 31 - 33 ) , <nl> + ( Tprim Tint ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } <nl> + } ) ) ; <nl> + sm_visibility = Public ; sm_deprecated = None } <nl> + ] ; <nl> + sc_methods = [ ] ; sc_user_attributes = [ ] ; sc_enum_type = None } ) ) <nl> + ] <nl> <nl> They matched ! <nl> mmm a / hphp / hack / test / decl / missing_function_typehints . php . exp <nl> ppp b / hphp / hack / test / decl / missing_function_typehints . php . exp <nl> <nl> - Parsed decls : <nl> - <nl> - { classes = { } ; <nl> - funs = <nl> - { " \ \ f " - > <nl> - { Typing_defs . fe_deprecated = None ; <nl> - fe_type = <nl> - ( Rwitness ( root | missing_function_typehints . php line 3 , characters 10 - 10 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; <nl> - ft_params = <nl> - [ { fp_pos = [ 3 : 12 - 14 ] ; fp_name = ( Some " $ x " ) ; <nl> - fp_type = <nl> - { et_enforced = false ; <nl> - et_type = ( Rnone ( | line 0 , characters 0 - 0 ) , Tany ) } ; <nl> - fp_flags = <nl> - ( make_fp_flags ~ mutability : None ~ accept_disposable : false <nl> - ~ has_default : false ~ mode : Typing_defs_core . FPnormal <nl> - ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> - } <nl> - ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | missing_function_typehints . php line 3 , characters 10 - 10 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rwitness ( root | missing_function_typehints . php line 3 , characters 10 - 10 ) , <nl> - Tany ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - fe_pos = [ 3 : 10 - 11 ] ; fe_php_std_lib = false } } ; <nl> - typedefs = { } ; consts = { } ; records = { } } <nl> - <nl> - They matched ! <nl> + mmm legacy <nl> ppp + direct decl <nl> + <nl> + [ ( " \ \ f " , <nl> + ( Shallow_decl_defs . Fun <nl> + { Typing_defs . fe_deprecated = None ; <nl> + fe_type = <nl> + ( Rwitness ( root | missing_function_typehints . php line 3 , characters 10 - 10 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; <nl> + ft_params = <nl> + [ { fp_pos = [ 3 : 12 - 14 ] ; fp_name = ( Some " $ x " ) ; <nl> + fp_type = <nl> + { et_enforced = false ; <nl> + - et_type = <nl> + - ( Rwitness ( root | missing_function_typehints . php line 3 , characters 12 - 13 ) , <nl> + - Tany ) <nl> + - } ; <nl> + + et_type = ( Rnone ( | line 0 , characters 0 - 0 ) , Tany ) } ; <nl> + fp_flags = <nl> + ( make_fp_flags ~ mutability : None ~ accept_disposable : false <nl> + ~ has_default : false ~ mode : Typing_defs_core . FPnormal <nl> + ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> + } <nl> + ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | missing_function_typehints . php line 3 , characters 10 - 10 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rwitness ( root | missing_function_typehints . php line 3 , characters 10 - 10 ) , <nl> + Tany ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + fe_pos = [ 3 : 10 - 11 ] ; fe_php_std_lib = false } ) ) <nl> + ] <nl> mmm a / hphp / hack / test / decl / multiple_user_attributes_on_class . php . exp <nl> ppp b / hphp / hack / test / decl / multiple_user_attributes_on_class . php . exp <nl> <nl> - Parsed decls : <nl> - <nl> - { classes = <nl> - { " \ \ Bar " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> - sc_name = ( [ 4 : 7 - 10 ] , " \ \ Bar " ) ; sc_tparams = [ ] ; <nl> - sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> - sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> - sc_implements = <nl> - [ ( Rhint ( root | multiple_user_attributes_on_class . php line 4 , characters 22 - 38 ) , <nl> - ( Tapply ( ( [ 4 : 22 - 39 ] , " \ \ HH \ \ ClassAttribute " ) , [ ] ) ) ) ] ; <nl> - sc_consts = [ ] ; sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; sc_props = [ ] ; <nl> - sc_sprops = [ ] ; sc_constructor = None ; sc_static_methods = [ ] ; <nl> - sc_methods = [ ] ; sc_user_attributes = [ ] ; sc_enum_type = None } ; <nl> - " \ \ C " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> - sc_name = ( [ 7 : 7 - 8 ] , " \ \ C " ) ; sc_tparams = [ ] ; sc_where_constraints = [ ] ; <nl> - sc_extends = [ ] ; sc_uses = [ ] ; sc_xhp_attr_uses = [ ] ; <nl> - sc_req_extends = [ ] ; sc_req_implements = [ ] ; sc_implements = [ ] ; <nl> - sc_consts = [ ] ; sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; sc_props = [ ] ; <nl> - sc_sprops = [ ] ; sc_constructor = None ; sc_static_methods = [ ] ; <nl> - sc_methods = [ ] ; <nl> - sc_user_attributes = <nl> - [ { Typing_defs_core . ua_name = ( [ 6 : 8 - 11 ] , " \ \ Bar " ) ; <nl> - ua_classname_params = [ ] } ; <nl> - { Typing_defs_core . ua_name = ( [ 6 : 3 - 6 ] , " \ \ Foo " ) ; <nl> - ua_classname_params = [ ] } <nl> - ] ; <nl> - sc_enum_type = None } ; <nl> - " \ \ Foo " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> - sc_name = ( [ 3 : 7 - 10 ] , " \ \ Foo " ) ; sc_tparams = [ ] ; <nl> - sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> - sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> - sc_implements = <nl> - [ ( Rhint ( root | multiple_user_attributes_on_class . php line 3 , characters 22 - 38 ) , <nl> - ( Tapply ( ( [ 3 : 22 - 39 ] , " \ \ HH \ \ ClassAttribute " ) , [ ] ) ) ) ] ; <nl> - sc_consts = [ ] ; sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; sc_props = [ ] ; <nl> - sc_sprops = [ ] ; sc_constructor = None ; sc_static_methods = [ ] ; <nl> - sc_methods = [ ] ; sc_user_attributes = [ ] ; sc_enum_type = None } } ; <nl> - funs = { } ; typedefs = { } ; consts = { } ; records = { } } <nl> + [ ( " \ \ Foo " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> + sc_name = ( [ 3 : 7 - 10 ] , " \ \ Foo " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> + sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> + sc_implements = <nl> + [ ( Rhint ( root | multiple_user_attributes_on_class . php line 3 , characters 22 - 38 ) , <nl> + ( Tapply ( ( [ 3 : 22 - 39 ] , " \ \ HH \ \ ClassAttribute " ) , [ ] ) ) ) ] ; <nl> + sc_consts = [ ] ; sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; sc_props = [ ] ; <nl> + sc_sprops = [ ] ; sc_constructor = None ; sc_static_methods = [ ] ; <nl> + sc_methods = [ ] ; sc_user_attributes = [ ] ; sc_enum_type = None } ) ) ; <nl> + ( " \ \ Bar " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> + sc_name = ( [ 4 : 7 - 10 ] , " \ \ Bar " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> + sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> + sc_implements = <nl> + [ ( Rhint ( root | multiple_user_attributes_on_class . php line 4 , characters 22 - 38 ) , <nl> + ( Tapply ( ( [ 4 : 22 - 39 ] , " \ \ HH \ \ ClassAttribute " ) , [ ] ) ) ) ] ; <nl> + sc_consts = [ ] ; sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; sc_props = [ ] ; <nl> + sc_sprops = [ ] ; sc_constructor = None ; sc_static_methods = [ ] ; <nl> + sc_methods = [ ] ; sc_user_attributes = [ ] ; sc_enum_type = None } ) ) ; <nl> + ( " \ \ C " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> + sc_name = ( [ 7 : 7 - 8 ] , " \ \ C " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> + sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> + sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; <nl> + sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> + sc_constructor = None ; sc_static_methods = [ ] ; sc_methods = [ ] ; <nl> + sc_user_attributes = <nl> + [ { Typing_defs_core . ua_name = ( [ 6 : 8 - 11 ] , " \ \ Bar " ) ; <nl> + ua_classname_params = [ ] } ; <nl> + { Typing_defs_core . ua_name = ( [ 6 : 3 - 6 ] , " \ \ Foo " ) ; <nl> + ua_classname_params = [ ] } <nl> + ] ; <nl> + sc_enum_type = None } ) ) <nl> + ] <nl> <nl> They matched ! <nl> mmm a / hphp / hack / test / decl / mutable . php . exp <nl> ppp b / hphp / hack / test / decl / mutable . php . exp <nl> <nl> - Parsed decls : <nl> - <nl> - { classes = <nl> - { " \ \ A " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> - sc_name = ( [ 3 : 7 - 8 ] , " \ \ A " ) ; sc_tparams = [ ] ; sc_where_constraints = [ ] ; <nl> - sc_extends = [ ] ; sc_uses = [ ] ; sc_xhp_attr_uses = [ ] ; <nl> - sc_req_extends = [ ] ; sc_req_implements = [ ] ; sc_implements = [ ] ; <nl> - sc_consts = [ ] ; sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; sc_props = [ ] ; <nl> - sc_sprops = [ ] ; sc_constructor = None ; sc_static_methods = [ ] ; <nl> - sc_methods = [ ] ; sc_user_attributes = [ ] ; sc_enum_type = None } } ; <nl> - funs = <nl> - { " \ \ f " - > <nl> - { Typing_defs . fe_deprecated = None ; <nl> - fe_type = <nl> - ( Rwitness ( root | mutable . php line 6 , characters 10 - 10 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; <nl> - ft_params = <nl> - [ { fp_pos = [ 6 : 45 - 47 ] ; fp_name = ( Some " $ a " ) ; <nl> - fp_type = <nl> + mmm legacy <nl> ppp + direct decl <nl> + <nl> + [ ( " \ \ A " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> + sc_name = ( [ 3 : 7 - 8 ] , " \ \ A " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> + sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> + sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; <nl> + sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> + sc_constructor = None ; sc_static_methods = [ ] ; sc_methods = [ ] ; <nl> + sc_user_attributes = [ ] ; sc_enum_type = None } ) ) ; <nl> + ( " \ \ f " , <nl> + ( Shallow_decl_defs . Fun <nl> + { Typing_defs . fe_deprecated = None ; <nl> + fe_type = <nl> + ( Rwitness ( root | mutable . php line 6 , characters 10 - 10 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; <nl> + ft_params = <nl> + [ { fp_pos = [ 6 : 45 - 47 ] ; fp_name = ( Some " $ a " ) ; <nl> + fp_type = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | mutable . php line 6 , characters 12 - 43 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; <nl> + ft_params = <nl> + - [ { fp_pos = [ 6 : 33 - 34 ] ; fp_name = None ; <nl> + + [ { fp_pos = [ 6 : 25 - 35 ] ; fp_name = None ; <nl> + fp_type = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | mutable . php line 6 , characters 33 - 33 ) , <nl> + ( Tapply ( ( [ 6 : 33 - 34 ] , " \ \ A " ) , [ ] ) ) ) <nl> + } ; <nl> + fp_flags = <nl> + ( make_fp_flags <nl> + ~ mutability : ( Some Typing_defs_core . Param_borrowed_mutable ) <nl> + ~ accept_disposable : false ~ has_default : false <nl> + ~ mode : Typing_defs_core . FPnormal <nl> + ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> + } <nl> + ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + - ( Rhint ( root | mutable . php line 6 , characters 12 - 43 ) , <nl> + + ( Rhint ( root | mutable . php line 6 , characters 15 - 42 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | mutable . php line 6 , characters 38 - 41 ) , <nl> + ( Tprim Tvoid ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Reactive { } ; <nl> + ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) <nl> + } ; <nl> + fp_flags = <nl> + ( make_fp_flags ~ mutability : None ~ accept_disposable : false <nl> + ~ has_default : false ~ mode : Typing_defs_core . FPnormal <nl> + ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> + } <nl> + ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | mutable . php line 6 , characters 10 - 10 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> { et_enforced = false ; <nl> et_type = <nl> - ( Rhint ( root | mutable . php line 6 , characters 12 - 43 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; <nl> - ft_params = <nl> - [ { fp_pos = [ 6 : 25 - 35 ] ; fp_name = None ; <nl> - fp_type = <nl> + ( Rhint ( root | mutable . php line 6 , characters 50 - 53 ) , <nl> + ( Tprim Tvoid ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Reactive { } ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + fe_pos = [ 6 : 10 - 11 ] ; fe_php_std_lib = false } ) ) ; <nl> + ( " \ \ g " , <nl> + ( Shallow_decl_defs . Fun <nl> + { Typing_defs . fe_deprecated = None ; <nl> + fe_type = <nl> + ( Rwitness ( root | mutable . php line 9 , characters 10 - 10 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; <nl> + ft_params = <nl> + [ { fp_pos = [ 9 : 50 - 52 ] ; fp_name = ( Some " $ a " ) ; <nl> + fp_type = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | mutable . php line 9 , characters 12 - 48 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; <nl> + ft_params = <nl> + - [ { fp_pos = [ 9 : 38 - 39 ] ; fp_name = None ; <nl> + + [ { fp_pos = [ 9 : 25 - 40 ] ; fp_name = None ; <nl> + fp_type = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | mutable . php line 9 , characters 38 - 38 ) , <nl> + ( Tapply ( ( [ 9 : 38 - 39 ] , " \ \ A " ) , [ ] ) ) ) <nl> + } ; <nl> + fp_flags = <nl> + ( make_fp_flags <nl> + ~ mutability : ( Some Typing_defs_core . Param_maybe_mutable ) <nl> + ~ accept_disposable : false ~ has_default : false <nl> + ~ mode : Typing_defs_core . FPnormal <nl> + ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> + } <nl> + ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + - ( Rhint ( root | mutable . php line 9 , characters 12 - 48 ) , <nl> + + ( Rhint ( root | mutable . php line 9 , characters 15 - 47 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> { et_enforced = false ; <nl> et_type = <nl> - ( Rhint ( root | mutable . php line 6 , characters 33 - 33 ) , <nl> - ( Tapply ( ( [ 6 : 33 - 34 ] , " \ \ A " ) , [ ] ) ) ) <nl> + ( Rhint ( root | mutable . php line 9 , characters 43 - 46 ) , <nl> + ( Tprim Tvoid ) ) <nl> } ; <nl> - fp_flags = <nl> - ( make_fp_flags <nl> - ~ mutability : ( Some Typing_defs_core . Param_borrowed_mutable ) <nl> - ~ accept_disposable : false ~ has_default : false <nl> - ~ mode : Typing_defs_core . FPnormal <nl> - ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> - } <nl> - ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | mutable . php line 6 , characters 15 - 42 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | mutable . php line 6 , characters 38 - 41 ) , <nl> - ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Reactive { } ; <nl> - ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Reactive { } ; <nl> + ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) <nl> + } ; <nl> + fp_flags = <nl> + ( make_fp_flags ~ mutability : None ~ accept_disposable : false <nl> + ~ has_default : false ~ mode : Typing_defs_core . FPnormal <nl> + ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> + } <nl> + ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | mutable . php line 9 , characters 10 - 10 ) , <nl> + ( Tunion [ ] ) ) <nl> } ; <nl> - fp_flags = <nl> - ( make_fp_flags ~ mutability : None ~ accept_disposable : false <nl> - ~ has_default : false ~ mode : Typing_defs_core . FPnormal <nl> - ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> - } <nl> - ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | mutable . php line 6 , characters 10 - 10 ) , ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | mutable . php line 6 , characters 50 - 53 ) , <nl> - ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Reactive { } ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - fe_pos = [ 6 : 10 - 11 ] ; fe_php_std_lib = false } ; <nl> - " \ \ g " - > <nl> - { Typing_defs . fe_deprecated = None ; <nl> - fe_type = <nl> - ( Rwitness ( root | mutable . php line 9 , characters 10 - 10 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; <nl> - ft_params = <nl> - [ { fp_pos = [ 9 : 50 - 52 ] ; fp_name = ( Some " $ a " ) ; <nl> - fp_type = <nl> + ft_ret = <nl> { et_enforced = false ; <nl> et_type = <nl> - ( Rhint ( root | mutable . php line 9 , characters 12 - 48 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; <nl> - ft_params = <nl> - [ { fp_pos = [ 9 : 25 - 40 ] ; fp_name = None ; <nl> - fp_type = <nl> + ( Rhint ( root | mutable . php line 9 , characters 55 - 58 ) , <nl> + ( Tprim Tvoid ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Reactive { } ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + fe_pos = [ 9 : 10 - 11 ] ; fe_php_std_lib = false } ) ) ; <nl> + ( " \ \ h " , <nl> + ( Shallow_decl_defs . Fun <nl> + { Typing_defs . fe_deprecated = None ; <nl> + fe_type = <nl> + ( Rwitness ( root | mutable . php line 12 , characters 10 - 10 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; <nl> + ft_params = <nl> + [ { fp_pos = [ 12 : 50 - 52 ] ; fp_name = ( Some " $ a " ) ; <nl> + fp_type = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | mutable . php line 12 , characters 12 - 48 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; <nl> + ft_params = <nl> + - [ { fp_pos = [ 12 : 38 - 39 ] ; fp_name = None ; <nl> + + [ { fp_pos = [ 12 : 25 - 40 ] ; fp_name = None ; <nl> + fp_type = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | mutable . php line 12 , characters 38 - 38 ) , <nl> + ( Tapply ( ( [ 12 : 38 - 39 ] , " \ \ A " ) , [ ] ) ) ) <nl> + } ; <nl> + fp_flags = <nl> + ( make_fp_flags <nl> + ~ mutability : ( Some Typing_defs_core . Param_owned_mutable ) <nl> + ~ accept_disposable : false ~ has_default : false <nl> + ~ mode : Typing_defs_core . FPnormal <nl> + ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> + } <nl> + ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + - ( Rhint ( root | mutable . php line 12 , characters 12 - 48 ) , <nl> + + ( Rhint ( root | mutable . php line 12 , characters 15 - 47 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> { et_enforced = false ; <nl> et_type = <nl> - ( Rhint ( root | mutable . php line 9 , characters 38 - 38 ) , <nl> - ( Tapply ( ( [ 9 : 38 - 39 ] , " \ \ A " ) , [ ] ) ) ) <nl> + ( Rhint ( root | mutable . php line 12 , characters 43 - 46 ) , <nl> + ( Tprim Tvoid ) ) <nl> } ; <nl> - fp_flags = <nl> - ( make_fp_flags <nl> - ~ mutability : ( Some Typing_defs_core . Param_maybe_mutable ) <nl> - ~ accept_disposable : false ~ has_default : false <nl> - ~ mode : Typing_defs_core . FPnormal <nl> - ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> - } <nl> - ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | mutable . php line 9 , characters 15 - 47 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | mutable . php line 9 , characters 43 - 46 ) , <nl> - ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Reactive { } ; <nl> - ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Reactive { } ; <nl> + ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) <nl> + } ; <nl> + fp_flags = <nl> + ( make_fp_flags ~ mutability : None ~ accept_disposable : false <nl> + ~ has_default : false ~ mode : Typing_defs_core . FPnormal <nl> + ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> + } <nl> + ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | mutable . php line 12 , characters 10 - 10 ) , <nl> + ( Tunion [ ] ) ) <nl> } ; <nl> - fp_flags = <nl> - ( make_fp_flags ~ mutability : None ~ accept_disposable : false <nl> - ~ has_default : false ~ mode : Typing_defs_core . FPnormal <nl> - ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> - } <nl> - ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | mutable . php line 9 , characters 10 - 10 ) , ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | mutable . php line 9 , characters 55 - 58 ) , <nl> - ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Reactive { } ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - fe_pos = [ 9 : 10 - 11 ] ; fe_php_std_lib = false } ; <nl> - " \ \ h " - > <nl> - { Typing_defs . fe_deprecated = None ; <nl> - fe_type = <nl> - ( Rwitness ( root | mutable . php line 12 , characters 10 - 10 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; <nl> - ft_params = <nl> - [ { fp_pos = [ 12 : 50 - 52 ] ; fp_name = ( Some " $ a " ) ; <nl> - fp_type = <nl> + ft_ret = <nl> { et_enforced = false ; <nl> et_type = <nl> - ( Rhint ( root | mutable . php line 12 , characters 12 - 48 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; <nl> - ft_params = <nl> - [ { fp_pos = [ 12 : 25 - 40 ] ; fp_name = None ; <nl> - fp_type = <nl> + ( Rhint ( root | mutable . php line 12 , characters 55 - 58 ) , <nl> + ( Tprim Tvoid ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Reactive { } ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + fe_pos = [ 12 : 10 - 11 ] ; fe_php_std_lib = false } ) ) ; <nl> + ( " \ \ i " , <nl> + ( Shallow_decl_defs . Fun <nl> + { Typing_defs . fe_deprecated = None ; <nl> + fe_type = <nl> + ( Rwitness ( root | mutable . php line 15 , characters 10 - 10 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; <nl> + ft_params = <nl> + [ { fp_pos = [ 15 : 46 - 48 ] ; fp_name = ( Some " $ a " ) ; <nl> + fp_type = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | mutable . php line 15 , characters 12 - 44 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + - ( Rhint ( root | mutable . php line 15 , characters 12 - 44 ) , <nl> + + ( Rhint ( root | mutable . php line 15 , characters 15 - 43 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> { et_enforced = false ; <nl> et_type = <nl> - ( Rhint ( root | mutable . php line 12 , characters 38 - 38 ) , <nl> - ( Tapply ( ( [ 12 : 38 - 39 ] , " \ \ A " ) , [ ] ) ) ) <nl> + ( Rhint ( root | mutable . php line 15 , characters 41 - 41 ) , <nl> + ( Tapply ( ( [ 15 : 41 - 42 ] , " \ \ A " ) , [ ] ) ) ) <nl> } ; <nl> - fp_flags = <nl> - ( make_fp_flags <nl> - ~ mutability : ( Some Typing_defs_core . Param_owned_mutable ) <nl> - ~ accept_disposable : false ~ has_default : false <nl> - ~ mode : Typing_defs_core . FPnormal <nl> - ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> - } <nl> - ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | mutable . php line 12 , characters 15 - 47 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | mutable . php line 12 , characters 43 - 46 ) , <nl> - ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Reactive { } ; <nl> - ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : true ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Reactive { } ; <nl> + ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) <nl> + } ; <nl> + fp_flags = <nl> + ( make_fp_flags ~ mutability : None ~ accept_disposable : false <nl> + ~ has_default : false ~ mode : Typing_defs_core . FPnormal <nl> + ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> + } <nl> + ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | mutable . php line 15 , characters 10 - 10 ) , <nl> + ( Tunion [ ] ) ) <nl> } ; <nl> - fp_flags = <nl> - ( make_fp_flags ~ mutability : None ~ accept_disposable : false <nl> - ~ has_default : false ~ mode : Typing_defs_core . FPnormal <nl> - ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> - } <nl> - ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | mutable . php line 12 , characters 10 - 10 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | mutable . php line 12 , characters 55 - 58 ) , <nl> - ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Reactive { } ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - fe_pos = [ 12 : 10 - 11 ] ; fe_php_std_lib = false } ; <nl> - " \ \ i " - > <nl> - { Typing_defs . fe_deprecated = None ; <nl> - fe_type = <nl> - ( Rwitness ( root | mutable . php line 15 , characters 10 - 10 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; <nl> - ft_params = <nl> - [ { fp_pos = [ 15 : 46 - 48 ] ; fp_name = ( Some " $ a " ) ; <nl> - fp_type = <nl> + ft_ret = <nl> { et_enforced = false ; <nl> et_type = <nl> - ( Rhint ( root | mutable . php line 15 , characters 12 - 44 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | mutable . php line 15 , characters 15 - 43 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | mutable . php line 15 , characters 41 - 41 ) , <nl> - ( Tapply ( ( [ 15 : 41 - 42 ] , " \ \ A " ) , [ ] ) ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : true ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Reactive { } ; <nl> - ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) <nl> + ( Rhint ( root | mutable . php line 15 , characters 51 - 54 ) , <nl> + ( Tprim Tvoid ) ) <nl> } ; <nl> - fp_flags = <nl> - ( make_fp_flags ~ mutability : None ~ accept_disposable : false <nl> - ~ has_default : false ~ mode : Typing_defs_core . FPnormal <nl> - ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> - } <nl> - ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | mutable . php line 15 , characters 10 - 10 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | mutable . php line 15 , characters 51 - 54 ) , <nl> - ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Reactive { } ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - fe_pos = [ 15 : 10 - 11 ] ; fe_php_std_lib = false } } ; <nl> - typedefs = { } ; consts = { } ; records = { } } <nl> - <nl> - They matched ! <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Reactive { } ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + fe_pos = [ 15 : 10 - 11 ] ; fe_php_std_lib = false } ) ) <nl> + ] <nl> mmm a / hphp / hack / test / decl / namespace_body_plus_declarations_outside_body . php . exp <nl> ppp b / hphp / hack / test / decl / namespace_body_plus_declarations_outside_body . php . exp <nl> <nl> - Parsed decls : <nl> - <nl> - { classes = { } ; <nl> - funs = <nl> - { " \ \ X \ \ a " - > <nl> - { Typing_defs . fe_deprecated = None ; <nl> - fe_type = <nl> - ( Rwitness ( root | namespace_body_plus_declarations_outside_body . php line 4 , characters 12 - 12 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | namespace_body_plus_declarations_outside_body . php line 4 , characters 12 - 12 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | namespace_body_plus_declarations_outside_body . php line 4 , characters 17 - 20 ) , <nl> - ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - fe_pos = [ 4 : 12 - 13 ] ; fe_php_std_lib = false } ; <nl> - " \ \ b " - > <nl> - { Typing_defs . fe_deprecated = None ; <nl> - fe_type = <nl> - ( Rwitness ( root | namespace_body_plus_declarations_outside_body . php line 9 , characters 10 - 10 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | namespace_body_plus_declarations_outside_body . php line 9 , characters 10 - 10 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | namespace_body_plus_declarations_outside_body . php line 9 , characters 15 - 18 ) , <nl> - ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - fe_pos = [ 9 : 10 - 11 ] ; fe_php_std_lib = false } } ; <nl> - typedefs = { } ; consts = { } ; records = { } } <nl> + [ ( " \ \ X \ \ a " , <nl> + ( Shallow_decl_defs . Fun <nl> + { Typing_defs . fe_deprecated = None ; <nl> + fe_type = <nl> + ( Rwitness ( root | namespace_body_plus_declarations_outside_body . php line 4 , characters 12 - 12 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | namespace_body_plus_declarations_outside_body . php line 4 , characters 12 - 12 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | namespace_body_plus_declarations_outside_body . php line 4 , characters 17 - 20 ) , <nl> + ( Tprim Tvoid ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + fe_pos = [ 4 : 12 - 13 ] ; fe_php_std_lib = false } ) ) ; <nl> + ( " \ \ b " , <nl> + ( Shallow_decl_defs . Fun <nl> + { Typing_defs . fe_deprecated = None ; <nl> + fe_type = <nl> + ( Rwitness ( root | namespace_body_plus_declarations_outside_body . php line 9 , characters 10 - 10 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | namespace_body_plus_declarations_outside_body . php line 9 , characters 10 - 10 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | namespace_body_plus_declarations_outside_body . php line 9 , characters 15 - 18 ) , <nl> + ( Tprim Tvoid ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + fe_pos = [ 9 : 10 - 11 ] ; fe_php_std_lib = false } ) ) <nl> + ] <nl> <nl> They matched ! <nl> mmm a / hphp / hack / test / decl / namespace_elaboration . php . exp <nl> ppp b / hphp / hack / test / decl / namespace_elaboration . php . exp <nl> <nl> - Parsed decls : <nl> - <nl> - { classes = { } ; <nl> - funs = <nl> - { " \ \ braced_id " - > <nl> - { Typing_defs . fe_deprecated = None ; <nl> - fe_type = <nl> - ( Rwitness ( root | namespace_elaboration . php line 39 , characters 10 - 18 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; <nl> - ft_params = <nl> - [ { fp_pos = [ 39 : 33 - 35 ] ; fp_name = ( Some " $ x " ) ; <nl> - fp_type = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | namespace_elaboration . php line 39 , characters 20 - 31 ) , <nl> - ( Tapply ( ( [ 39 : 20 - 32 ] , " \ \ MyNamespace \ \ MyBracedType " ) , [ ] ) ) ) <nl> - } ; <nl> - fp_flags = <nl> - ( make_fp_flags ~ mutability : None ~ accept_disposable : false <nl> - ~ has_default : false ~ mode : Typing_defs_core . FPnormal <nl> - ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> - } <nl> - ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | namespace_elaboration . php line 39 , characters 10 - 18 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | namespace_elaboration . php line 39 , characters 38 - 50 ) , <nl> - ( Tapply ( ( [ 39 : 38 - 51 ] , " \ \ MyNamespace \ \ MyBracedType " ) , [ ] ) ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - fe_pos = [ 39 : 10 - 19 ] ; fe_php_std_lib = false } ; <nl> - " \ \ id " - > <nl> - { Typing_defs . fe_deprecated = None ; <nl> - fe_type = <nl> - ( Rwitness ( root | namespace_elaboration . php line 31 , characters 10 - 11 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; <nl> - ft_params = <nl> - [ { fp_pos = [ 31 : 20 - 22 ] ; fp_name = ( Some " $ x " ) ; <nl> - fp_type = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | namespace_elaboration . php line 31 , characters 13 - 18 ) , <nl> - ( Tapply ( ( [ 31 : 13 - 19 ] , " \ \ MyNamespace \ \ MyType " ) , [ ] ) ) ) <nl> - } ; <nl> - fp_flags = <nl> - ( make_fp_flags ~ mutability : None ~ accept_disposable : false <nl> - ~ has_default : false ~ mode : Typing_defs_core . FPnormal <nl> - ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> - } <nl> - ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | namespace_elaboration . php line 31 , characters 10 - 11 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | namespace_elaboration . php line 31 , characters 25 - 31 ) , <nl> - ( Tapply ( ( [ 31 : 25 - 32 ] , " \ \ MyNamespace \ \ MyType " ) , [ ] ) ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - fe_pos = [ 31 : 10 - 12 ] ; fe_php_std_lib = false } ; <nl> - " \ \ other_id " - > <nl> - { Typing_defs . fe_deprecated = None ; <nl> - fe_type = <nl> - ( Rwitness ( root | namespace_elaboration . php line 35 , characters 10 - 17 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; <nl> - ft_params = <nl> - [ { fp_pos = [ 35 : 31 - 33 ] ; fp_name = ( Some " $ x " ) ; <nl> - fp_type = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | namespace_elaboration . php line 35 , characters 19 - 29 ) , <nl> - ( Tapply ( ( [ 35 : 19 - 30 ] , " \ \ MyNamespace \ \ MyOtherType " ) , [ ] ) ) ) <nl> - } ; <nl> - fp_flags = <nl> - ( make_fp_flags ~ mutability : None ~ accept_disposable : false <nl> - ~ has_default : false ~ mode : Typing_defs_core . FPnormal <nl> - ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> - } <nl> - ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | namespace_elaboration . php line 35 , characters 10 - 17 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | namespace_elaboration . php line 35 , characters 36 - 47 ) , <nl> - ( Tapply ( ( [ 35 : 36 - 48 ] , " \ \ MyNamespace \ \ MyOtherType " ) , [ ] ) ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - fe_pos = [ 35 : 10 - 18 ] ; fe_php_std_lib = false } } ; <nl> - typedefs = { } ; consts = { } ; records = { } } <nl> + [ ( " \ \ id " , <nl> + ( Shallow_decl_defs . Fun <nl> + { Typing_defs . fe_deprecated = None ; <nl> + fe_type = <nl> + ( Rwitness ( root | namespace_elaboration . php line 31 , characters 10 - 11 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; <nl> + ft_params = <nl> + [ { fp_pos = [ 31 : 20 - 22 ] ; fp_name = ( Some " $ x " ) ; <nl> + fp_type = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | namespace_elaboration . php line 31 , characters 13 - 18 ) , <nl> + ( Tapply ( ( [ 31 : 13 - 19 ] , " \ \ MyNamespace \ \ MyType " ) , [ ] ) ) ) <nl> + } ; <nl> + fp_flags = <nl> + ( make_fp_flags ~ mutability : None ~ accept_disposable : false <nl> + ~ has_default : false ~ mode : Typing_defs_core . FPnormal <nl> + ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> + } <nl> + ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | namespace_elaboration . php line 31 , characters 10 - 11 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | namespace_elaboration . php line 31 , characters 25 - 31 ) , <nl> + ( Tapply ( ( [ 31 : 25 - 32 ] , " \ \ MyNamespace \ \ MyType " ) , [ ] ) ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + fe_pos = [ 31 : 10 - 12 ] ; fe_php_std_lib = false } ) ) ; <nl> + ( " \ \ other_id " , <nl> + ( Shallow_decl_defs . Fun <nl> + { Typing_defs . fe_deprecated = None ; <nl> + fe_type = <nl> + ( Rwitness ( root | namespace_elaboration . php line 35 , characters 10 - 17 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; <nl> + ft_params = <nl> + [ { fp_pos = [ 35 : 31 - 33 ] ; fp_name = ( Some " $ x " ) ; <nl> + fp_type = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | namespace_elaboration . php line 35 , characters 19 - 29 ) , <nl> + ( Tapply ( ( [ 35 : 19 - 30 ] , " \ \ MyNamespace \ \ MyOtherType " ) , [ ] ) ) ) <nl> + } ; <nl> + fp_flags = <nl> + ( make_fp_flags ~ mutability : None ~ accept_disposable : false <nl> + ~ has_default : false ~ mode : Typing_defs_core . FPnormal <nl> + ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> + } <nl> + ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | namespace_elaboration . php line 35 , characters 10 - 17 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | namespace_elaboration . php line 35 , characters 36 - 47 ) , <nl> + ( Tapply ( ( [ 35 : 36 - 48 ] , " \ \ MyNamespace \ \ MyOtherType " ) , [ ] ) ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + fe_pos = [ 35 : 10 - 18 ] ; fe_php_std_lib = false } ) ) ; <nl> + ( " \ \ braced_id " , <nl> + ( Shallow_decl_defs . Fun <nl> + { Typing_defs . fe_deprecated = None ; <nl> + fe_type = <nl> + ( Rwitness ( root | namespace_elaboration . php line 39 , characters 10 - 18 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; <nl> + ft_params = <nl> + [ { fp_pos = [ 39 : 33 - 35 ] ; fp_name = ( Some " $ x " ) ; <nl> + fp_type = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | namespace_elaboration . php line 39 , characters 20 - 31 ) , <nl> + ( Tapply ( ( [ 39 : 20 - 32 ] , " \ \ MyNamespace \ \ MyBracedType " ) , <nl> + [ ] ) ) ) <nl> + } ; <nl> + fp_flags = <nl> + ( make_fp_flags ~ mutability : None ~ accept_disposable : false <nl> + ~ has_default : false ~ mode : Typing_defs_core . FPnormal <nl> + ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> + } <nl> + ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | namespace_elaboration . php line 39 , characters 10 - 18 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | namespace_elaboration . php line 39 , characters 38 - 50 ) , <nl> + ( Tapply ( ( [ 39 : 38 - 51 ] , " \ \ MyNamespace \ \ MyBracedType " ) , [ ] ) ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + fe_pos = [ 39 : 10 - 19 ] ; fe_php_std_lib = false } ) ) <nl> + ] <nl> <nl> They matched ! <nl> mmm a / hphp / hack / test / decl / namespace_global_body_plus_declarations_outside_body . php . exp <nl> ppp b / hphp / hack / test / decl / namespace_global_body_plus_declarations_outside_body . php . exp <nl> <nl> - Parsed decls : <nl> - <nl> - { classes = { } ; <nl> - funs = <nl> - { " \ \ a " - > <nl> - { Typing_defs . fe_deprecated = None ; <nl> - fe_type = <nl> - ( Rwitness ( root | namespace_global_body_plus_declarations_outside_body . php line 4 , characters 12 - 12 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | namespace_global_body_plus_declarations_outside_body . php line 4 , characters 12 - 12 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | namespace_global_body_plus_declarations_outside_body . php line 4 , characters 17 - 20 ) , <nl> - ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - fe_pos = [ 4 : 12 - 13 ] ; fe_php_std_lib = false } ; <nl> - " \ \ b " - > <nl> - { Typing_defs . fe_deprecated = None ; <nl> - fe_type = <nl> - ( Rwitness ( root | namespace_global_body_plus_declarations_outside_body . php line 9 , characters 10 - 10 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | namespace_global_body_plus_declarations_outside_body . php line 9 , characters 10 - 10 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | namespace_global_body_plus_declarations_outside_body . php line 9 , characters 15 - 18 ) , <nl> - ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - fe_pos = [ 9 : 10 - 11 ] ; fe_php_std_lib = false } } ; <nl> - typedefs = { } ; consts = { } ; records = { } } <nl> + [ ( " \ \ a " , <nl> + ( Shallow_decl_defs . Fun <nl> + { Typing_defs . fe_deprecated = None ; <nl> + fe_type = <nl> + ( Rwitness ( root | namespace_global_body_plus_declarations_outside_body . php line 4 , characters 12 - 12 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | namespace_global_body_plus_declarations_outside_body . php line 4 , characters 12 - 12 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | namespace_global_body_plus_declarations_outside_body . php line 4 , characters 17 - 20 ) , <nl> + ( Tprim Tvoid ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + fe_pos = [ 4 : 12 - 13 ] ; fe_php_std_lib = false } ) ) ; <nl> + ( " \ \ b " , <nl> + ( Shallow_decl_defs . Fun <nl> + { Typing_defs . fe_deprecated = None ; <nl> + fe_type = <nl> + ( Rwitness ( root | namespace_global_body_plus_declarations_outside_body . php line 9 , characters 10 - 10 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | namespace_global_body_plus_declarations_outside_body . php line 9 , characters 10 - 10 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | namespace_global_body_plus_declarations_outside_body . php line 9 , characters 15 - 18 ) , <nl> + ( Tprim Tvoid ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + fe_pos = [ 9 : 10 - 11 ] ; fe_php_std_lib = false } ) ) <nl> + ] <nl> <nl> They matched ! <nl> mmm a / hphp / hack / test / decl / namespace_unscoped . php . exp <nl> ppp b / hphp / hack / test / decl / namespace_unscoped . php . exp <nl> <nl> - Parsed decls : <nl> - <nl> - { classes = { } ; <nl> - funs = <nl> - { " \ \ NS1 \ \ f " - > <nl> - { Typing_defs . fe_deprecated = None ; <nl> - fe_type = <nl> - ( Rwitness ( root | namespace_unscoped . php line 5 , characters 10 - 10 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | namespace_unscoped . php line 5 , characters 10 - 10 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | namespace_unscoped . php line 5 , characters 15 - 18 ) , <nl> - ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - fe_pos = [ 5 : 10 - 11 ] ; fe_php_std_lib = false } ; <nl> - " \ \ NS2 \ \ f " - > <nl> - { Typing_defs . fe_deprecated = None ; <nl> - fe_type = <nl> - ( Rwitness ( root | namespace_unscoped . php line 9 , characters 10 - 10 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | namespace_unscoped . php line 9 , characters 10 - 10 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | namespace_unscoped . php line 9 , characters 15 - 18 ) , <nl> - ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - fe_pos = [ 9 : 10 - 11 ] ; fe_php_std_lib = false } } ; <nl> - typedefs = { } ; consts = { } ; records = { } } <nl> + [ ( " \ \ NS1 \ \ f " , <nl> + ( Shallow_decl_defs . Fun <nl> + { Typing_defs . fe_deprecated = None ; <nl> + fe_type = <nl> + ( Rwitness ( root | namespace_unscoped . php line 5 , characters 10 - 10 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | namespace_unscoped . php line 5 , characters 10 - 10 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | namespace_unscoped . php line 5 , characters 15 - 18 ) , <nl> + ( Tprim Tvoid ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + fe_pos = [ 5 : 10 - 11 ] ; fe_php_std_lib = false } ) ) ; <nl> + ( " \ \ NS2 \ \ f " , <nl> + ( Shallow_decl_defs . Fun <nl> + { Typing_defs . fe_deprecated = None ; <nl> + fe_type = <nl> + ( Rwitness ( root | namespace_unscoped . php line 9 , characters 10 - 10 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | namespace_unscoped . php line 9 , characters 10 - 10 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | namespace_unscoped . php line 9 , characters 15 - 18 ) , <nl> + ( Tprim Tvoid ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + fe_pos = [ 9 : 10 - 11 ] ; fe_php_std_lib = false } ) ) <nl> + ] <nl> <nl> They matched ! <nl> mmm a / hphp / hack / test / decl / namespaces1 . php . exp <nl> ppp b / hphp / hack / test / decl / namespaces1 . php . exp <nl> <nl> - Parsed decls : <nl> - <nl> - { classes = <nl> - { " \ \ MyClass " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> - sc_name = ( [ 5 : 9 - 16 ] , " \ \ MyClass " ) ; sc_tparams = [ ] ; <nl> - sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> - sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> - sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; <nl> - sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; sc_constructor = None ; <nl> - sc_static_methods = [ ] ; sc_methods = [ ] ; sc_user_attributes = [ ] ; <nl> - sc_enum_type = None } ; <nl> - " \ \ MyNamespace \ \ MyClass " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> - sc_name = ( [ 10 : 9 - 16 ] , " \ \ MyNamespace \ \ MyClass " ) ; sc_tparams = [ ] ; <nl> - sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> - sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> - sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; <nl> - sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; sc_constructor = None ; <nl> - sc_static_methods = [ ] ; sc_methods = [ ] ; sc_user_attributes = [ ] ; <nl> - sc_enum_type = None } } ; <nl> - funs = { } ; <nl> - typedefs = <nl> - { " \ \ MyAnonymousNamespaceType " - > <nl> - { Typing_defs . td_pos = [ 4 : 8 - 32 ] ; td_vis = Transparent ; td_tparams = [ ] ; <nl> - td_constraint = None ; <nl> - td_type = <nl> - ( Rhint ( root | namespaces1 . php line 4 , characters 35 - 40 ) , ( Tprim Tstring ) ) <nl> - } ; <nl> - " \ \ MyNamespace \ \ MyNamespaceType " - > <nl> - { Typing_defs . td_pos = [ 9 : 8 - 23 ] ; td_vis = Transparent ; td_tparams = [ ] ; <nl> - td_constraint = None ; <nl> - td_type = <nl> - ( Rhint ( root | namespaces1 . php line 9 , characters 26 - 31 ) , ( Tprim Tstring ) ) <nl> - } } ; <nl> - consts = { } ; records = { } } <nl> + [ ( " \ \ MyAnonymousNamespaceType " , <nl> + ( Shallow_decl_defs . Typedef <nl> + { Typing_defs . td_pos = [ 4 : 8 - 32 ] ; td_vis = Transparent ; td_tparams = [ ] ; <nl> + td_constraint = None ; <nl> + td_type = <nl> + ( Rhint ( root | namespaces1 . php line 4 , characters 35 - 40 ) , <nl> + ( Tprim Tstring ) ) <nl> + } ) ) ; <nl> + ( " \ \ MyClass " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> + sc_name = ( [ 5 : 9 - 16 ] , " \ \ MyClass " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> + sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> + sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; <nl> + sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> + sc_constructor = None ; sc_static_methods = [ ] ; sc_methods = [ ] ; <nl> + sc_user_attributes = [ ] ; sc_enum_type = None } ) ) ; <nl> + ( " \ \ MyNamespace \ \ MyNamespaceType " , <nl> + ( Shallow_decl_defs . Typedef <nl> + { Typing_defs . td_pos = [ 9 : 8 - 23 ] ; td_vis = Transparent ; td_tparams = [ ] ; <nl> + td_constraint = None ; <nl> + td_type = <nl> + ( Rhint ( root | namespaces1 . php line 9 , characters 26 - 31 ) , <nl> + ( Tprim Tstring ) ) <nl> + } ) ) ; <nl> + ( " \ \ MyNamespace \ \ MyClass " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> + sc_name = ( [ 10 : 9 - 16 ] , " \ \ MyNamespace \ \ MyClass " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> + sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> + sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; <nl> + sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> + sc_constructor = None ; sc_static_methods = [ ] ; sc_methods = [ ] ; <nl> + sc_user_attributes = [ ] ; sc_enum_type = None } ) ) <nl> + ] <nl> <nl> They matched ! <nl> mmm a / hphp / hack / test / decl / namespaces2 . php . exp <nl> ppp b / hphp / hack / test / decl / namespaces2 . php . exp <nl> <nl> - Parsed decls : <nl> - <nl> - { classes = <nl> - { " \ \ MyFileNamespace \ \ MyClass " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> - sc_name = ( [ 6 : 7 - 14 ] , " \ \ MyFileNamespace \ \ MyClass " ) ; sc_tparams = [ ] ; <nl> - sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> - sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> - sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; <nl> - sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; sc_constructor = None ; <nl> - sc_static_methods = [ ] ; sc_methods = [ ] ; sc_user_attributes = [ ] ; <nl> - sc_enum_type = None } } ; <nl> - funs = { } ; <nl> - typedefs = <nl> - { " \ \ MyFileNamespace \ \ MyFileNamespaceType " - > <nl> - { Typing_defs . td_pos = [ 5 : 6 - 25 ] ; td_vis = Transparent ; td_tparams = [ ] ; <nl> - td_constraint = None ; <nl> - td_type = <nl> - ( Rhint ( root | namespaces2 . php line 5 , characters 28 - 33 ) , ( Tprim Tstring ) ) <nl> - } } ; <nl> - consts = { } ; records = { } } <nl> + [ ( " \ \ MyFileNamespace \ \ MyFileNamespaceType " , <nl> + ( Shallow_decl_defs . Typedef <nl> + { Typing_defs . td_pos = [ 5 : 6 - 25 ] ; td_vis = Transparent ; td_tparams = [ ] ; <nl> + td_constraint = None ; <nl> + td_type = <nl> + ( Rhint ( root | namespaces2 . php line 5 , characters 28 - 33 ) , <nl> + ( Tprim Tstring ) ) <nl> + } ) ) ; <nl> + ( " \ \ MyFileNamespace \ \ MyClass " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> + sc_name = ( [ 6 : 7 - 14 ] , " \ \ MyFileNamespace \ \ MyClass " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> + sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> + sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; <nl> + sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> + sc_constructor = None ; sc_static_methods = [ ] ; sc_methods = [ ] ; <nl> + sc_user_attributes = [ ] ; sc_enum_type = None } ) ) <nl> + ] <nl> <nl> They matched ! <nl> mmm a / hphp / hack / test / decl / nested_namespaces . php . exp <nl> ppp b / hphp / hack / test / decl / nested_namespaces . php . exp <nl> <nl> - Parsed decls : <nl> - <nl> - { classes = <nl> - { " \ \ MyNamespace \ \ Very \ \ Inner \ \ Namespace \ \ MyClass " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> - sc_name = <nl> - ( [ 20 : 11 - 18 ] , " \ \ MyNamespace \ \ Very \ \ Inner \ \ Namespace \ \ MyClass " ) ; <nl> - sc_tparams = [ ] ; sc_where_constraints = [ ] ; sc_extends = [ ] ; <nl> - sc_uses = [ ] ; sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; <nl> - sc_req_implements = [ ] ; sc_implements = [ ] ; sc_consts = [ ] ; <nl> - sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> - sc_constructor = None ; sc_static_methods = [ ] ; sc_methods = [ ] ; <nl> - sc_user_attributes = [ ] ; sc_enum_type = None } } ; <nl> - funs = { } ; <nl> - typedefs = <nl> - { " \ \ MyNamespace \ \ InnerNamespace \ \ MyDoubleNamespacedType " - > <nl> - { Typing_defs . td_pos = [ 15 : 10 - 32 ] ; td_vis = Transparent ; td_tparams = [ ] ; <nl> - td_constraint = None ; <nl> - td_type = <nl> - ( Rhint ( root | nested_namespaces . php line 15 , characters 35 - 63 ) , <nl> - ( Tapply ( ( [ 15 : 35 - 64 ] , " \ \ MyNamespace \ \ MyNamespacedType " ) , [ ] ) ) ) <nl> - } ; <nl> - " \ \ MyNamespace \ \ InnerNamespace \ \ MyInnerType " - > <nl> - { Typing_defs . td_pos = [ 14 : 10 - 21 ] ; td_vis = Transparent ; td_tparams = [ ] ; <nl> - td_constraint = None ; <nl> - td_type = <nl> - ( Rhint ( root | nested_namespaces . php line 14 , characters 24 - 29 ) , <nl> - ( Tprim Tstring ) ) <nl> - } ; <nl> - " \ \ MyNamespace \ \ MyBool " - > <nl> - { Typing_defs . td_pos = [ 9 : 8 - 14 ] ; td_vis = Transparent ; td_tparams = [ ] ; <nl> - td_constraint = None ; <nl> - td_type = <nl> - ( Rhint ( root | nested_namespaces . php line 9 , characters 17 - 20 ) , <nl> - ( Tprim Tbool ) ) <nl> - } ; <nl> - " \ \ MyNamespace \ \ MyFloat " - > <nl> - { Typing_defs . td_pos = [ 7 : 8 - 15 ] ; td_vis = Transparent ; td_tparams = [ ] ; <nl> - td_constraint = None ; <nl> - td_type = <nl> - ( Rhint ( root | nested_namespaces . php line 7 , characters 18 - 22 ) , <nl> - ( Tprim Tfloat ) ) <nl> - } ; <nl> - " \ \ MyNamespace \ \ MyInt " - > <nl> - { Typing_defs . td_pos = [ 6 : 8 - 13 ] ; td_vis = Transparent ; td_tparams = [ ] ; <nl> - td_constraint = None ; <nl> - td_type = <nl> - ( Rhint ( root | nested_namespaces . php line 6 , characters 16 - 18 ) , <nl> - ( Tprim Tint ) ) <nl> - } ; <nl> - " \ \ MyNamespace \ \ MyNamespacedType " - > <nl> - { Typing_defs . td_pos = [ 11 : 8 - 24 ] ; td_vis = Transparent ; td_tparams = [ ] ; <nl> - td_constraint = None ; <nl> - td_type = <nl> - ( Rhint ( root | nested_namespaces . php line 11 , characters 27 - 47 ) , <nl> - ( Tapply ( ( [ 11 : 27 - 48 ] , " \ \ MyNamespace \ \ MyString " ) , [ ] ) ) ) <nl> - } ; <nl> - " \ \ MyNamespace \ \ MyNum " - > <nl> - { Typing_defs . td_pos = [ 8 : 8 - 13 ] ; td_vis = Transparent ; td_tparams = [ ] ; <nl> - td_constraint = None ; <nl> - td_type = <nl> - ( Rhint ( root | nested_namespaces . php line 8 , characters 16 - 18 ) , <nl> - ( Tprim Tnum ) ) <nl> - } ; <nl> - " \ \ MyNamespace \ \ MyString " - > <nl> - { Typing_defs . td_pos = [ 5 : 8 - 16 ] ; td_vis = Transparent ; td_tparams = [ ] ; <nl> - td_constraint = None ; <nl> - td_type = <nl> - ( Rhint ( root | nested_namespaces . php line 5 , characters 19 - 24 ) , <nl> - ( Tprim Tstring ) ) <nl> - } ; <nl> - " \ \ MyNamespace \ \ MyVeryInnerNamespaceType " - > <nl> - { Typing_defs . td_pos = [ 23 : 8 - 32 ] ; td_vis = Transparent ; td_tparams = [ ] ; <nl> - td_constraint = None ; <nl> - td_type = <nl> - ( Rhint ( root | nested_namespaces . php line 23 , characters 35 - 79 ) , <nl> - ( Tapply ( <nl> - ( [ 23 : 35 - 80 ] , <nl> - " \ \ MyNamespace \ \ Very \ \ Inner \ \ Namespace \ \ MyVeryInnerNamespaceType " ) , <nl> - [ ] ) ) ) <nl> - } ; <nl> - " \ \ MyNamespace \ \ Very \ \ Inner \ \ Namespace \ \ MyVeryInnerNamespaceType " - > <nl> - { Typing_defs . td_pos = [ 19 : 10 - 34 ] ; td_vis = Transparent ; td_tparams = [ ] ; <nl> - td_constraint = None ; <nl> - td_type = <nl> - ( Rhint ( root | nested_namespaces . php line 19 , characters 37 - 42 ) , <nl> - ( Tprim Tstring ) ) <nl> - } } ; <nl> - consts = <nl> - { " \ \ MyNamespace \ \ hello " - > <nl> - { Typing_defs . cd_pos = [ 24 : 34 - 39 ] ; <nl> - cd_type = <nl> - ( Rhint ( root | nested_namespaces . php line 24 , characters 9 - 32 ) , <nl> - ( Tapply ( ( [ 24 : 9 - 33 ] , " \ \ MyNamespace \ \ MyVeryInnerNamespaceType " ) , [ ] ) ) ) <nl> - } } ; <nl> - records = { } } <nl> + [ ( " \ \ MyNamespace \ \ MyString " , <nl> + ( Shallow_decl_defs . Typedef <nl> + { Typing_defs . td_pos = [ 5 : 8 - 16 ] ; td_vis = Transparent ; td_tparams = [ ] ; <nl> + td_constraint = None ; <nl> + td_type = <nl> + ( Rhint ( root | nested_namespaces . php line 5 , characters 19 - 24 ) , <nl> + ( Tprim Tstring ) ) <nl> + } ) ) ; <nl> + ( " \ \ MyNamespace \ \ MyInt " , <nl> + ( Shallow_decl_defs . Typedef <nl> + { Typing_defs . td_pos = [ 6 : 8 - 13 ] ; td_vis = Transparent ; td_tparams = [ ] ; <nl> + td_constraint = None ; <nl> + td_type = <nl> + ( Rhint ( root | nested_namespaces . php line 6 , characters 16 - 18 ) , <nl> + ( Tprim Tint ) ) <nl> + } ) ) ; <nl> + ( " \ \ MyNamespace \ \ MyFloat " , <nl> + ( Shallow_decl_defs . Typedef <nl> + { Typing_defs . td_pos = [ 7 : 8 - 15 ] ; td_vis = Transparent ; td_tparams = [ ] ; <nl> + td_constraint = None ; <nl> + td_type = <nl> + ( Rhint ( root | nested_namespaces . php line 7 , characters 18 - 22 ) , <nl> + ( Tprim Tfloat ) ) <nl> + } ) ) ; <nl> + ( " \ \ MyNamespace \ \ MyNum " , <nl> + ( Shallow_decl_defs . Typedef <nl> + { Typing_defs . td_pos = [ 8 : 8 - 13 ] ; td_vis = Transparent ; td_tparams = [ ] ; <nl> + td_constraint = None ; <nl> + td_type = <nl> + ( Rhint ( root | nested_namespaces . php line 8 , characters 16 - 18 ) , <nl> + ( Tprim Tnum ) ) <nl> + } ) ) ; <nl> + ( " \ \ MyNamespace \ \ MyBool " , <nl> + ( Shallow_decl_defs . Typedef <nl> + { Typing_defs . td_pos = [ 9 : 8 - 14 ] ; td_vis = Transparent ; td_tparams = [ ] ; <nl> + td_constraint = None ; <nl> + td_type = <nl> + ( Rhint ( root | nested_namespaces . php line 9 , characters 17 - 20 ) , <nl> + ( Tprim Tbool ) ) <nl> + } ) ) ; <nl> + ( " \ \ MyNamespace \ \ MyNamespacedType " , <nl> + ( Shallow_decl_defs . Typedef <nl> + { Typing_defs . td_pos = [ 11 : 8 - 24 ] ; td_vis = Transparent ; <nl> + td_tparams = [ ] ; td_constraint = None ; <nl> + td_type = <nl> + ( Rhint ( root | nested_namespaces . php line 11 , characters 27 - 47 ) , <nl> + ( Tapply ( ( [ 11 : 27 - 48 ] , " \ \ MyNamespace \ \ MyString " ) , [ ] ) ) ) <nl> + } ) ) ; <nl> + ( " \ \ MyNamespace \ \ InnerNamespace \ \ MyInnerType " , <nl> + ( Shallow_decl_defs . Typedef <nl> + { Typing_defs . td_pos = [ 14 : 10 - 21 ] ; td_vis = Transparent ; <nl> + td_tparams = [ ] ; td_constraint = None ; <nl> + td_type = <nl> + ( Rhint ( root | nested_namespaces . php line 14 , characters 24 - 29 ) , <nl> + ( Tprim Tstring ) ) <nl> + } ) ) ; <nl> + ( " \ \ MyNamespace \ \ InnerNamespace \ \ MyDoubleNamespacedType " , <nl> + ( Shallow_decl_defs . Typedef <nl> + { Typing_defs . td_pos = [ 15 : 10 - 32 ] ; td_vis = Transparent ; <nl> + td_tparams = [ ] ; td_constraint = None ; <nl> + td_type = <nl> + ( Rhint ( root | nested_namespaces . php line 15 , characters 35 - 63 ) , <nl> + ( Tapply ( ( [ 15 : 35 - 64 ] , " \ \ MyNamespace \ \ MyNamespacedType " ) , [ ] ) ) ) <nl> + } ) ) ; <nl> + ( " \ \ MyNamespace \ \ Very \ \ Inner \ \ Namespace \ \ MyVeryInnerNamespaceType " , <nl> + ( Shallow_decl_defs . Typedef <nl> + { Typing_defs . td_pos = [ 19 : 10 - 34 ] ; td_vis = Transparent ; <nl> + td_tparams = [ ] ; td_constraint = None ; <nl> + td_type = <nl> + ( Rhint ( root | nested_namespaces . php line 19 , characters 37 - 42 ) , <nl> + ( Tprim Tstring ) ) <nl> + } ) ) ; <nl> + ( " \ \ MyNamespace \ \ Very \ \ Inner \ \ Namespace \ \ MyClass " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> + sc_name = <nl> + ( [ 20 : 11 - 18 ] , " \ \ MyNamespace \ \ Very \ \ Inner \ \ Namespace \ \ MyClass " ) ; <nl> + sc_tparams = [ ] ; sc_where_constraints = [ ] ; sc_extends = [ ] ; <nl> + sc_uses = [ ] ; sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; <nl> + sc_req_implements = [ ] ; sc_implements = [ ] ; sc_consts = [ ] ; <nl> + sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> + sc_constructor = None ; sc_static_methods = [ ] ; sc_methods = [ ] ; <nl> + sc_user_attributes = [ ] ; sc_enum_type = None } ) ) ; <nl> + ( " \ \ MyNamespace \ \ MyVeryInnerNamespaceType " , <nl> + ( Shallow_decl_defs . Typedef <nl> + { Typing_defs . td_pos = [ 23 : 8 - 32 ] ; td_vis = Transparent ; <nl> + td_tparams = [ ] ; td_constraint = None ; <nl> + td_type = <nl> + ( Rhint ( root | nested_namespaces . php line 23 , characters 35 - 79 ) , <nl> + ( Tapply ( <nl> + ( [ 23 : 35 - 80 ] , <nl> + " \ \ MyNamespace \ \ Very \ \ Inner \ \ Namespace \ \ MyVeryInnerNamespaceType " ) , <nl> + [ ] ) ) ) <nl> + } ) ) ; <nl> + ( " \ \ MyNamespace \ \ hello " , <nl> + ( Shallow_decl_defs . Const <nl> + { Typing_defs . cd_pos = [ 24 : 34 - 39 ] ; <nl> + cd_type = <nl> + ( Rhint ( root | nested_namespaces . php line 24 , characters 9 - 32 ) , <nl> + ( Tapply ( ( [ 24 : 9 - 33 ] , " \ \ MyNamespace \ \ MyVeryInnerNamespaceType " ) , <nl> + [ ] ) ) ) <nl> + } ) ) <nl> + ] <nl> <nl> They matched ! <nl> mmm a / hphp / hack / test / decl / nullable_xhp_typehint . php . exp <nl> ppp b / hphp / hack / test / decl / nullable_xhp_typehint . php . exp <nl> <nl> - Parsed decls : <nl> - <nl> - { classes = { } ; funs = { } ; <nl> - typedefs = <nl> - { " \ \ MaybeDiv " - > <nl> - { Typing_defs . td_pos = [ 3 : 6 - 14 ] ; td_vis = Transparent ; td_tparams = [ ] ; <nl> - td_constraint = None ; <nl> - td_type = <nl> - ( Rhint ( root | nullable_xhp_typehint . php line 3 , characters 17 - 21 ) , <nl> - ( Toption <nl> - ( Rhint ( root | nullable_xhp_typehint . php line 3 , characters 18 - 21 ) , <nl> - ( Tapply ( ( [ 3 : 18 - 22 ] , " \ \ : div " ) , [ ] ) ) ) ) ) <nl> - } } ; <nl> - consts = { } ; records = { } } <nl> + [ ( " \ \ MaybeDiv " , <nl> + ( Shallow_decl_defs . Typedef <nl> + { Typing_defs . td_pos = [ 3 : 6 - 14 ] ; td_vis = Transparent ; td_tparams = [ ] ; <nl> + td_constraint = None ; <nl> + td_type = <nl> + ( Rhint ( root | nullable_xhp_typehint . php line 3 , characters 17 - 21 ) , <nl> + ( Toption <nl> + ( Rhint ( root | nullable_xhp_typehint . php line 3 , characters 18 - 21 ) , <nl> + ( Tapply ( ( [ 3 : 18 - 22 ] , " \ \ : div " ) , [ ] ) ) ) ) ) <nl> + } ) ) <nl> + ] <nl> <nl> They matched ! <nl> mmm a / hphp / hack / test / decl / only_rx_if_impl_method . php . exp <nl> ppp b / hphp / hack / test / decl / only_rx_if_impl_method . php . exp <nl> <nl> - Parsed decls : <nl> - <nl> - { classes = <nl> - { " \ \ C " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> - sc_name = ( [ 5 : 7 - 8 ] , " \ \ C " ) ; sc_tparams = [ ] ; sc_where_constraints = [ ] ; <nl> - sc_extends = [ ] ; sc_uses = [ ] ; sc_xhp_attr_uses = [ ] ; <nl> - sc_req_extends = [ ] ; sc_req_implements = [ ] ; sc_implements = [ ] ; <nl> - sc_consts = [ ] ; sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; sc_props = [ ] ; <nl> - sc_sprops = [ ] ; sc_constructor = None ; sc_static_methods = [ ] ; <nl> - sc_methods = <nl> - [ { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> - sm_memoizelsb = false ; sm_name = ( [ 7 : 19 - 20 ] , " f " ) ; <nl> - sm_override = false ; sm_dynamicallycallable = false ; <nl> - sm_reactivity = ( Some ( Decl_defs . Method_reactive ( Some " \ \ IRx " ) ) ) ; <nl> - sm_type = <nl> - ( Rwitness ( root | only_rx_if_impl_method . php line 7 , characters 19 - 19 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | only_rx_if_impl_method . php line 7 , characters 19 - 19 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | only_rx_if_impl_method . php line 7 , characters 24 - 27 ) , <nl> - ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = <nl> - Reactive { ( Rhint ( root | only_rx_if_impl_method . php line 6 , characters 26 - 28 ) , <nl> - ( Tapply ( ( [ 6 : 26 - 29 ] , " \ \ IRx " ) , [ ] ) ) ) } ; <nl> - ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - sm_visibility = Public ; sm_deprecated = None } <nl> - ] ; <nl> - sc_user_attributes = [ ] ; sc_enum_type = None } ; <nl> - " \ \ IRx " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cinterface ; <nl> - sc_name = ( [ 3 : 11 - 14 ] , " \ \ IRx " ) ; sc_tparams = [ ] ; <nl> - sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> - sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> - sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; <nl> - sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; sc_constructor = None ; <nl> - sc_static_methods = [ ] ; sc_methods = [ ] ; sc_user_attributes = [ ] ; <nl> - sc_enum_type = None } } ; <nl> - funs = { } ; typedefs = { } ; consts = { } ; records = { } } <nl> - <nl> - They matched ! <nl> + mmm legacy <nl> ppp + direct decl <nl> + <nl> + [ ( " \ \ IRx " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cinterface ; <nl> + sc_name = ( [ 3 : 11 - 14 ] , " \ \ IRx " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> + sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> + sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; <nl> + sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> + sc_constructor = None ; sc_static_methods = [ ] ; sc_methods = [ ] ; <nl> + sc_user_attributes = [ ] ; sc_enum_type = None } ) ) ; <nl> + ( " \ \ C " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> + sc_name = ( [ 5 : 7 - 8 ] , " \ \ C " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> + sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> + sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; <nl> + sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> + sc_constructor = None ; sc_static_methods = [ ] ; <nl> + sc_methods = <nl> + [ { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> + sm_memoizelsb = false ; sm_name = ( [ 7 : 19 - 20 ] , " f " ) ; <nl> + sm_override = false ; sm_dynamicallycallable = false ; <nl> + sm_reactivity = ( Some ( Decl_defs . Method_reactive ( Some " \ \ IRx " ) ) ) ; <nl> + sm_type = <nl> + ( Rwitness ( root | only_rx_if_impl_method . php line 7 , characters 19 - 19 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | only_rx_if_impl_method . php line 7 , characters 19 - 19 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | only_rx_if_impl_method . php line 7 , characters 24 - 27 ) , <nl> + ( Tprim Tvoid ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = <nl> + - Reactive { ( Rhint ( root | only_rx_if_impl_method . php line 6 , characters 26 - 35 ) , <nl> + + Reactive { ( Rhint ( root | only_rx_if_impl_method . php line 6 , characters 26 - 28 ) , <nl> + ( Tapply ( ( [ 6 : 26 - 29 ] , " \ \ IRx " ) , [ ] ) ) ) } ; <nl> + ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + sm_visibility = Public ; sm_deprecated = None } <nl> + ] ; <nl> + sc_user_attributes = [ ] ; sc_enum_type = None } ) ) <nl> + ] <nl> mmm a / hphp / hack / test / decl / override_attribute . php . exp <nl> ppp b / hphp / hack / test / decl / override_attribute . php . exp <nl> <nl> - Parsed decls : <nl> - <nl> - { classes = <nl> - { " \ \ B " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> - sc_name = ( [ 3 : 7 - 8 ] , " \ \ B " ) ; sc_tparams = [ ] ; sc_where_constraints = [ ] ; <nl> - sc_extends = [ ] ; sc_uses = [ ] ; sc_xhp_attr_uses = [ ] ; <nl> - sc_req_extends = [ ] ; sc_req_implements = [ ] ; sc_implements = [ ] ; <nl> - sc_consts = [ ] ; sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; sc_props = [ ] ; <nl> - sc_sprops = [ ] ; sc_constructor = None ; sc_static_methods = [ ] ; <nl> - sc_methods = <nl> - [ { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> - sm_memoizelsb = false ; sm_name = ( [ 4 : 19 - 20 ] , " f " ) ; <nl> - sm_override = false ; sm_dynamicallycallable = false ; <nl> - sm_reactivity = None ; <nl> - sm_type = <nl> - ( Rwitness ( root | override_attribute . php line 4 , characters 19 - 19 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | override_attribute . php line 4 , characters 19 - 19 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | override_attribute . php line 4 , characters 24 - 27 ) , <nl> - ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } <nl> - } ) ) ; <nl> - sm_visibility = Public ; sm_deprecated = None } <nl> - ] ; <nl> - sc_user_attributes = [ ] ; sc_enum_type = None } ; <nl> - " \ \ C " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> - sc_name = ( [ 7 : 7 - 8 ] , " \ \ C " ) ; sc_tparams = [ ] ; sc_where_constraints = [ ] ; <nl> - sc_extends = <nl> - [ ( Rhint ( root | override_attribute . php line 7 , characters 17 - 17 ) , <nl> - ( Tapply ( ( [ 7 : 17 - 18 ] , " \ \ B " ) , [ ] ) ) ) ] ; <nl> - sc_uses = [ ] ; sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; <nl> - sc_req_implements = [ ] ; sc_implements = [ ] ; sc_consts = [ ] ; <nl> - sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> - sc_constructor = None ; sc_static_methods = [ ] ; <nl> - sc_methods = <nl> - [ { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> - sm_memoizelsb = false ; sm_name = ( [ 9 : 19 - 20 ] , " f " ) ; <nl> - sm_override = true ; sm_dynamicallycallable = false ; <nl> - sm_reactivity = None ; <nl> - sm_type = <nl> - ( Rwitness ( root | override_attribute . php line 9 , characters 19 - 19 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | override_attribute . php line 9 , characters 19 - 19 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | override_attribute . php line 9 , characters 24 - 27 ) , <nl> - ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } <nl> - } ) ) ; <nl> - sm_visibility = Public ; sm_deprecated = None } <nl> - ] ; <nl> - sc_user_attributes = [ ] ; sc_enum_type = None } } ; <nl> - funs = { } ; typedefs = { } ; consts = { } ; records = { } } <nl> + [ ( " \ \ B " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> + sc_name = ( [ 3 : 7 - 8 ] , " \ \ B " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> + sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> + sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; <nl> + sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> + sc_constructor = None ; sc_static_methods = [ ] ; <nl> + sc_methods = <nl> + [ { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> + sm_memoizelsb = false ; sm_name = ( [ 4 : 19 - 20 ] , " f " ) ; <nl> + sm_override = false ; sm_dynamicallycallable = false ; <nl> + sm_reactivity = None ; <nl> + sm_type = <nl> + ( Rwitness ( root | override_attribute . php line 4 , characters 19 - 19 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | override_attribute . php line 4 , characters 19 - 19 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | override_attribute . php line 4 , characters 24 - 27 ) , <nl> + ( Tprim Tvoid ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } <nl> + } ) ) ; <nl> + sm_visibility = Public ; sm_deprecated = None } <nl> + ] ; <nl> + sc_user_attributes = [ ] ; sc_enum_type = None } ) ) ; <nl> + ( " \ \ C " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> + sc_name = ( [ 7 : 7 - 8 ] , " \ \ C " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = [ ] ; <nl> + sc_extends = <nl> + [ ( Rhint ( root | override_attribute . php line 7 , characters 17 - 17 ) , <nl> + ( Tapply ( ( [ 7 : 17 - 18 ] , " \ \ B " ) , [ ] ) ) ) ] ; <nl> + sc_uses = [ ] ; sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; <nl> + sc_req_implements = [ ] ; sc_implements = [ ] ; sc_consts = [ ] ; <nl> + sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> + sc_constructor = None ; sc_static_methods = [ ] ; <nl> + sc_methods = <nl> + [ { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> + sm_memoizelsb = false ; sm_name = ( [ 9 : 19 - 20 ] , " f " ) ; <nl> + sm_override = true ; sm_dynamicallycallable = false ; <nl> + sm_reactivity = None ; <nl> + sm_type = <nl> + ( Rwitness ( root | override_attribute . php line 9 , characters 19 - 19 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | override_attribute . php line 9 , characters 19 - 19 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | override_attribute . php line 9 , characters 24 - 27 ) , <nl> + ( Tprim Tvoid ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; <nl> + ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + sm_visibility = Public ; sm_deprecated = None } <nl> + ] ; <nl> + sc_user_attributes = [ ] ; sc_enum_type = None } ) ) <nl> + ] <nl> <nl> They matched ! <nl> mmm a / hphp / hack / test / decl / partially_abstract_type_const . php . exp <nl> ppp b / hphp / hack / test / decl / partially_abstract_type_const . php . exp <nl> <nl> - Parsed decls : <nl> - <nl> - { classes = <nl> - { " \ \ C " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cabstract ; <nl> - sc_name = ( [ 3 : 16 - 17 ] , " \ \ C " ) ; sc_tparams = [ ] ; <nl> - sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> - sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> - sc_implements = [ ] ; sc_consts = [ ] ; <nl> - sc_typeconsts = <nl> - [ { Shallow_decl_defs . stc_abstract = Typing_defs . TCPartiallyAbstract ; <nl> - stc_constraint = <nl> - ( Some ( Rhint ( root | partially_abstract_type_const . php line 4 , characters 19 - 23 ) , <nl> - Tmixed ) ) ; <nl> - stc_name = ( [ 4 : 14 - 15 ] , " T " ) ; <nl> - stc_type = <nl> - ( Some ( Rhint ( root | partially_abstract_type_const . php line 4 , characters 27 - 29 ) , <nl> - ( Tprim Tnum ) ) ) ; <nl> - stc_enforceable = ( [ Pos . none ] , false ) ; stc_reifiable = None } <nl> - ] ; <nl> - sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; sc_constructor = None ; <nl> - sc_static_methods = [ ] ; sc_methods = [ ] ; sc_user_attributes = [ ] ; <nl> - sc_enum_type = None } } ; <nl> - funs = { } ; typedefs = { } ; consts = { } ; records = { } } <nl> + [ ( " \ \ C " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cabstract ; <nl> + sc_name = ( [ 3 : 16 - 17 ] , " \ \ C " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> + sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> + sc_implements = [ ] ; sc_consts = [ ] ; <nl> + sc_typeconsts = <nl> + [ { Shallow_decl_defs . stc_abstract = Typing_defs . TCPartiallyAbstract ; <nl> + stc_constraint = <nl> + ( Some ( Rhint ( root | partially_abstract_type_const . php line 4 , characters 19 - 23 ) , <nl> + Tmixed ) ) ; <nl> + stc_name = ( [ 4 : 14 - 15 ] , " T " ) ; <nl> + stc_type = <nl> + ( Some ( Rhint ( root | partially_abstract_type_const . php line 4 , characters 27 - 29 ) , <nl> + ( Tprim Tnum ) ) ) ; <nl> + stc_enforceable = ( [ Pos . none ] , false ) ; stc_reifiable = None } <nl> + ] ; <nl> + sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> + sc_constructor = None ; sc_static_methods = [ ] ; sc_methods = [ ] ; <nl> + sc_user_attributes = [ ] ; sc_enum_type = None } ) ) <nl> + ] <nl> <nl> They matched ! <nl> mmm a / hphp / hack / test / decl / prop_without_visibility_modifier . php . exp <nl> ppp b / hphp / hack / test / decl / prop_without_visibility_modifier . php . exp <nl> <nl> - Parsed decls : <nl> - <nl> - { classes = <nl> - { " \ \ C " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> - sc_name = ( [ 3 : 7 - 8 ] , " \ \ C " ) ; sc_tparams = [ ] ; sc_where_constraints = [ ] ; <nl> - sc_extends = [ ] ; sc_uses = [ ] ; sc_xhp_attr_uses = [ ] ; <nl> - sc_req_extends = [ ] ; sc_req_implements = [ ] ; sc_implements = [ ] ; <nl> - sc_consts = [ ] ; sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; sc_props = [ ] ; <nl> - sc_sprops = <nl> - [ { Shallow_decl_defs . sp_const = false ; sp_xhp_attr = None ; <nl> - sp_lateinit = false ; sp_lsb = false ; sp_name = ( [ 4 : 16 - 18 ] , " $ b " ) ; <nl> - sp_needs_init = true ; <nl> - sp_type = <nl> - ( Some ( Rhint ( root | prop_without_visibility_modifier . php line 4 , characters 10 - 14 ) , <nl> - ( Toption <nl> - ( Rhint ( root | prop_without_visibility_modifier . php line 4 , characters 11 - 14 ) , <nl> - ( Tprim Tbool ) ) ) ) ) ; <nl> - sp_abstract = false ; sp_visibility = Public } <nl> - ] ; <nl> - sc_constructor = None ; sc_static_methods = [ ] ; sc_methods = [ ] ; <nl> - sc_user_attributes = [ ] ; sc_enum_type = None } } ; <nl> - funs = { } ; typedefs = { } ; consts = { } ; records = { } } <nl> + [ ( " \ \ C " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> + sc_name = ( [ 3 : 7 - 8 ] , " \ \ C " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> + sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> + sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; <nl> + sc_pu_enums = [ ] ; sc_props = [ ] ; <nl> + sc_sprops = <nl> + [ { Shallow_decl_defs . sp_const = false ; sp_xhp_attr = None ; <nl> + sp_lateinit = false ; sp_lsb = false ; sp_name = ( [ 4 : 16 - 18 ] , " $ b " ) ; <nl> + sp_needs_init = true ; <nl> + sp_type = <nl> + ( Some ( Rhint ( root | prop_without_visibility_modifier . php line 4 , characters 10 - 14 ) , <nl> + ( Toption <nl> + ( Rhint ( root | prop_without_visibility_modifier . php line 4 , characters 11 - 14 ) , <nl> + ( Tprim Tbool ) ) ) ) ) ; <nl> + sp_abstract = false ; sp_visibility = Public } <nl> + ] ; <nl> + sc_constructor = None ; sc_static_methods = [ ] ; sc_methods = [ ] ; <nl> + sc_user_attributes = [ ] ; sc_enum_type = None } ) ) <nl> + ] <nl> <nl> They matched ! <nl> mmm a / hphp / hack / test / decl / property_declarations . php . exp <nl> ppp b / hphp / hack / test / decl / property_declarations . php . exp <nl> <nl> - Parsed decls : <nl> - <nl> - { classes = <nl> - { " \ \ C " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> - sc_name = ( [ 3 : 7 - 8 ] , " \ \ C " ) ; sc_tparams = [ ] ; sc_where_constraints = [ ] ; <nl> - sc_extends = [ ] ; sc_uses = [ ] ; sc_xhp_attr_uses = [ ] ; <nl> - sc_req_extends = [ ] ; sc_req_implements = [ ] ; sc_implements = [ ] ; <nl> - sc_consts = [ ] ; sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; <nl> - sc_props = <nl> - [ { Shallow_decl_defs . sp_const = false ; sp_xhp_attr = None ; <nl> - sp_lateinit = false ; sp_lsb = false ; sp_name = ( [ 5 : 5 - 9 ] , " map " ) ; <nl> - sp_needs_init = false ; <nl> - sp_type = <nl> - ( Some ( Rhint ( root | property_declarations . php line 4 , characters 11 - 23 ) , <nl> - ( Tapply ( ( [ 4 : 11 - 14 ] , " \ \ HH \ \ Map " ) , <nl> - [ ( Rhint ( root | property_declarations . php line 4 , characters 15 - 17 ) , <nl> - ( Tprim Tint ) ) ; <nl> - ( Rhint ( root | property_declarations . php line 4 , characters 20 - 22 ) , <nl> - ( Tprim Tint ) ) <nl> - ] <nl> - ) ) ) ) ; <nl> - sp_abstract = false ; sp_visibility = Private } ; <nl> - { Shallow_decl_defs . sp_const = false ; sp_xhp_attr = None ; <nl> - sp_lateinit = false ; sp_lsb = false ; <nl> - sp_name = ( [ 6 : 5 - 12 ] , " uninit " ) ; sp_needs_init = true ; <nl> + [ ( " \ \ C " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> + sc_name = ( [ 3 : 7 - 8 ] , " \ \ C " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> + sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> + sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; <nl> + sc_pu_enums = [ ] ; <nl> + sc_props = <nl> + [ { Shallow_decl_defs . sp_const = false ; sp_xhp_attr = None ; <nl> + sp_lateinit = false ; sp_lsb = false ; sp_name = ( [ 5 : 5 - 9 ] , " map " ) ; <nl> + sp_needs_init = false ; <nl> sp_type = <nl> ( Some ( Rhint ( root | property_declarations . php line 4 , characters 11 - 23 ) , <nl> ( Tapply ( ( [ 4 : 11 - 14 ] , " \ \ HH \ \ Map " ) , <nl> Parsed decls : <nl> ( Tprim Tint ) ) <nl> ] <nl> ) ) ) ) ; <nl> - sp_abstract = false ; sp_visibility = Private } <nl> - ] ; <nl> - sc_sprops = [ ] ; <nl> - sc_constructor = <nl> - ( Some { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> - sm_memoizelsb = false ; sm_name = ( [ 8 : 19 - 30 ] , " __construct " ) ; <nl> - sm_override = false ; sm_dynamicallycallable = false ; <nl> - sm_reactivity = None ; <nl> - sm_type = <nl> - ( Rwitness ( root | property_declarations . php line 8 , characters 19 - 29 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | property_declarations . php line 8 , characters 19 - 29 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rwitness ( root | property_declarations . php line 8 , characters 19 - 29 ) , <nl> - ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; <nl> - ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - sm_visibility = Public ; sm_deprecated = None } ) ; <nl> - sc_static_methods = [ ] ; sc_methods = [ ] ; sc_user_attributes = [ ] ; <nl> - sc_enum_type = None } } ; <nl> - funs = { } ; typedefs = { } ; consts = { } ; records = { } } <nl> + sp_abstract = false ; sp_visibility = Private } ; <nl> + { Shallow_decl_defs . sp_const = false ; sp_xhp_attr = None ; <nl> + sp_lateinit = false ; sp_lsb = false ; <nl> + sp_name = ( [ 6 : 5 - 12 ] , " uninit " ) ; sp_needs_init = true ; <nl> + sp_type = <nl> + ( Some ( Rhint ( root | property_declarations . php line 4 , characters 11 - 23 ) , <nl> + ( Tapply ( ( [ 4 : 11 - 14 ] , " \ \ HH \ \ Map " ) , <nl> + [ ( Rhint ( root | property_declarations . php line 4 , characters 15 - 17 ) , <nl> + ( Tprim Tint ) ) ; <nl> + ( Rhint ( root | property_declarations . php line 4 , characters 20 - 22 ) , <nl> + ( Tprim Tint ) ) <nl> + ] <nl> + ) ) ) ) ; <nl> + sp_abstract = false ; sp_visibility = Private } <nl> + ] ; <nl> + sc_sprops = [ ] ; <nl> + sc_constructor = <nl> + ( Some { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> + sm_memoizelsb = false ; sm_name = ( [ 8 : 19 - 30 ] , " __construct " ) ; <nl> + sm_override = false ; sm_dynamicallycallable = false ; <nl> + sm_reactivity = None ; <nl> + sm_type = <nl> + ( Rwitness ( root | property_declarations . php line 8 , characters 19 - 29 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | property_declarations . php line 8 , characters 19 - 29 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rwitness ( root | property_declarations . php line 8 , characters 19 - 29 ) , <nl> + ( Tprim Tvoid ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; <nl> + ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + sm_visibility = Public ; sm_deprecated = None } ) ; <nl> + sc_static_methods = [ ] ; sc_methods = [ ] ; sc_user_attributes = [ ] ; <nl> + sc_enum_type = None } ) ) <nl> + ] <nl> <nl> They matched ! <nl> mmm a / hphp / hack / test / decl / pure . php . exp <nl> ppp b / hphp / hack / test / decl / pure . php . exp <nl> <nl> - Parsed decls : <nl> - <nl> - { classes = <nl> - { " \ \ C " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> - sc_name = ( [ 6 : 7 - 8 ] , " \ \ C " ) ; sc_tparams = [ ] ; sc_where_constraints = [ ] ; <nl> - sc_extends = [ ] ; sc_uses = [ ] ; sc_xhp_attr_uses = [ ] ; <nl> - sc_req_extends = [ ] ; sc_req_implements = [ ] ; sc_implements = [ ] ; <nl> - sc_consts = [ ] ; sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; sc_props = [ ] ; <nl> - sc_sprops = [ ] ; sc_constructor = None ; sc_static_methods = [ ] ; <nl> - sc_methods = <nl> - [ { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> - sm_memoizelsb = false ; sm_name = ( [ 8 : 19 - 20 ] , " f " ) ; <nl> - sm_override = false ; sm_dynamicallycallable = false ; <nl> - sm_reactivity = ( Some ( Decl_defs . Method_pure None ) ) ; <nl> - sm_type = <nl> - ( Rwitness ( root | pure . php line 8 , characters 19 - 19 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | pure . php line 8 , characters 19 - 19 ) , ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | pure . php line 8 , characters 24 - 27 ) , <nl> - ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Pure { } ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - sm_visibility = Public ; sm_deprecated = None } <nl> - ] ; <nl> - sc_user_attributes = [ ] ; sc_enum_type = None } } ; <nl> - funs = <nl> - { " \ \ pure " - > <nl> - { Typing_defs . fe_deprecated = None ; <nl> - fe_type = <nl> - ( Rwitness ( root | pure . php line 4 , characters 10 - 13 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | pure . php line 4 , characters 10 - 13 ) , ( Tunion [ ] ) ) } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | pure . php line 4 , characters 18 - 21 ) , ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Pure { } ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - fe_pos = [ 4 : 10 - 14 ] ; fe_php_std_lib = false } } ; <nl> - typedefs = { } ; consts = { } ; records = { } } <nl> + [ ( " \ \ pure " , <nl> + ( Shallow_decl_defs . Fun <nl> + { Typing_defs . fe_deprecated = None ; <nl> + fe_type = <nl> + ( Rwitness ( root | pure . php line 4 , characters 10 - 13 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | pure . php line 4 , characters 10 - 13 ) , ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | pure . php line 4 , characters 18 - 21 ) , ( Tprim Tvoid ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Pure { } ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + fe_pos = [ 4 : 10 - 14 ] ; fe_php_std_lib = false } ) ) ; <nl> + ( " \ \ C " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> + sc_name = ( [ 6 : 7 - 8 ] , " \ \ C " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> + sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> + sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; <nl> + sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> + sc_constructor = None ; sc_static_methods = [ ] ; <nl> + sc_methods = <nl> + [ { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> + sm_memoizelsb = false ; sm_name = ( [ 8 : 19 - 20 ] , " f " ) ; <nl> + sm_override = false ; sm_dynamicallycallable = false ; <nl> + sm_reactivity = ( Some ( Decl_defs . Method_pure None ) ) ; <nl> + sm_type = <nl> + ( Rwitness ( root | pure . php line 8 , characters 19 - 19 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | pure . php line 8 , characters 19 - 19 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | pure . php line 8 , characters 24 - 27 ) , <nl> + ( Tprim Tvoid ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Pure { } ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + sm_visibility = Public ; sm_deprecated = None } <nl> + ] ; <nl> + sc_user_attributes = [ ] ; sc_enum_type = None } ) ) <nl> + ] <nl> <nl> They matched ! <nl> mmm a / hphp / hack / test / decl / qualified_name_in_attribute_arg . php . exp <nl> ppp b / hphp / hack / test / decl / qualified_name_in_attribute_arg . php . exp <nl> <nl> - Parsed decls : <nl> - <nl> - { classes = { } ; <nl> - funs = <nl> - { " \ \ f " - > <nl> - { Typing_defs . fe_deprecated = None ; <nl> - fe_type = <nl> - ( Rwitness ( root | qualified_name_in_attribute_arg . php line 4 , characters 10 - 10 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | qualified_name_in_attribute_arg . php line 4 , characters 10 - 10 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | qualified_name_in_attribute_arg . php line 4 , characters 15 - 18 ) , <nl> - ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - fe_pos = [ 4 : 10 - 11 ] ; fe_php_std_lib = false } } ; <nl> - typedefs = { } ; consts = { } ; records = { } } <nl> + [ ( " \ \ f " , <nl> + ( Shallow_decl_defs . Fun <nl> + { Typing_defs . fe_deprecated = None ; <nl> + fe_type = <nl> + ( Rwitness ( root | qualified_name_in_attribute_arg . php line 4 , characters 10 - 10 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | qualified_name_in_attribute_arg . php line 4 , characters 10 - 10 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | qualified_name_in_attribute_arg . php line 4 , characters 15 - 18 ) , <nl> + ( Tprim Tvoid ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + fe_pos = [ 4 : 10 - 11 ] ; fe_php_std_lib = false } ) ) <nl> + ] <nl> <nl> They matched ! <nl> mmm a / hphp / hack / test / decl / record_decl_good . php . exp <nl> ppp b / hphp / hack / test / decl / record_decl_good . php . exp <nl> <nl> - Parsed decls : <nl> - <nl> - { classes = { } ; funs = { } ; typedefs = { } ; consts = { } ; <nl> - records = <nl> - { " \ \ A " - > <nl> - { Typing_defs . rdt_name = ( [ 3 : 8 - 9 ] , " \ \ A " ) ; rdt_extends = None ; <nl> - rdt_fields = <nl> - [ ( ( [ 4 : 7 - 8 ] , " x " ) , Typing_defs . ValueRequired ) ; <nl> - ( ( [ 5 : 7 - 8 ] , " y " ) , Typing_defs . HasDefaultValue ) ] ; <nl> - rdt_abstract = false ; rdt_pos = [ Pos . none ] } } <nl> - } <nl> - <nl> - They matched ! <nl> + mmm legacy <nl> ppp + direct decl <nl> + <nl> + [ ( " \ \ A " , <nl> + ( Shallow_decl_defs . Record <nl> + { Typing_defs . rdt_name = ( [ 3 : 8 - 9 ] , " \ \ A " ) ; rdt_extends = None ; <nl> + rdt_fields = <nl> + [ ( ( [ 4 : 7 - 8 ] , " x " ) , Typing_defs . ValueRequired ) ; <nl> + ( ( [ 5 : 7 - 8 ] , " y " ) , Typing_defs . HasDefaultValue ) ] ; <nl> + - rdt_abstract = false ; rdt_pos = [ 3 : 1 - 6 : 2 ] } ) ) <nl> + + rdt_abstract = false ; rdt_pos = [ Pos . none ] } ) ) <nl> + ] <nl> mmm a / hphp / hack / test / decl / ret_from_kind . php . exp <nl> ppp b / hphp / hack / test / decl / ret_from_kind . php . exp <nl> <nl> - Parsed decls : <nl> - <nl> - { classes = { } ; <nl> - funs = <nl> - { " \ \ no_hint_async " - > <nl> - { Typing_defs . fe_deprecated = None ; <nl> - fe_type = <nl> - ( Rwitness ( root | ret_from_kind . php line 3 , characters 16 - 28 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | ret_from_kind . php line 3 , characters 16 - 28 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rret_fun_kind ( root | ret_from_kind . php line 3 , characters 16 - 28 ) , <nl> - ( Tapply ( ( [ 3 : 16 - 29 ] , " \ \ HH \ \ Awaitable " ) , <nl> - [ ( Rwitness ( root | ret_from_kind . php line 3 , characters 16 - 28 ) , <nl> - Tany ) ] <nl> - ) ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FAsync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - fe_pos = [ 3 : 16 - 29 ] ; fe_php_std_lib = false } ; <nl> - " \ \ no_hint_async_generator " - > <nl> - { Typing_defs . fe_deprecated = None ; <nl> - fe_type = <nl> - ( Rwitness ( root | ret_from_kind . php line 9 , characters 16 - 38 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | ret_from_kind . php line 9 , characters 16 - 38 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rret_fun_kind ( root | ret_from_kind . php line 9 , characters 16 - 38 ) , <nl> - ( Tapply ( ( [ 9 : 16 - 39 ] , " \ \ HH \ \ AsyncGenerator " ) , <nl> - [ ( Rwitness ( root | ret_from_kind . php line 9 , characters 16 - 38 ) , <nl> - Tany ) ; <nl> - ( Rwitness ( root | ret_from_kind . php line 9 , characters 16 - 38 ) , <nl> - Tany ) ; <nl> - ( Rwitness ( root | ret_from_kind . php line 9 , characters 16 - 38 ) , <nl> - Tany ) <nl> - ] <nl> - ) ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FAsyncGenerator None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - fe_pos = [ 9 : 16 - 39 ] ; fe_php_std_lib = false } ; <nl> - " \ \ no_hint_generator " - > <nl> - { Typing_defs . fe_deprecated = None ; <nl> - fe_type = <nl> - ( Rwitness ( root | ret_from_kind . php line 5 , characters 10 - 26 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | ret_from_kind . php line 5 , characters 10 - 26 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rret_fun_kind ( root | ret_from_kind . php line 5 , characters 10 - 26 ) , <nl> - ( Tapply ( ( [ 5 : 10 - 27 ] , " \ \ Generator " ) , <nl> - [ ( Rwitness ( root | ret_from_kind . php line 5 , characters 10 - 26 ) , <nl> - Tany ) ; <nl> - ( Rwitness ( root | ret_from_kind . php line 5 , characters 10 - 26 ) , <nl> - Tany ) ; <nl> - ( Rwitness ( root | ret_from_kind . php line 5 , characters 10 - 26 ) , <nl> - Tany ) <nl> - ] <nl> - ) ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FGenerator None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - fe_pos = [ 5 : 10 - 27 ] ; fe_php_std_lib = false } } ; <nl> - typedefs = { } ; consts = { } ; records = { } } <nl> + [ ( " \ \ no_hint_async " , <nl> + ( Shallow_decl_defs . Fun <nl> + { Typing_defs . fe_deprecated = None ; <nl> + fe_type = <nl> + ( Rwitness ( root | ret_from_kind . php line 3 , characters 16 - 28 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | ret_from_kind . php line 3 , characters 16 - 28 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rret_fun_kind ( root | ret_from_kind . php line 3 , characters 16 - 28 ) , <nl> + ( Tapply ( ( [ 3 : 16 - 29 ] , " \ \ HH \ \ Awaitable " ) , <nl> + [ ( Rwitness ( root | ret_from_kind . php line 3 , characters 16 - 28 ) , <nl> + Tany ) ] <nl> + ) ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FAsync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + fe_pos = [ 3 : 16 - 29 ] ; fe_php_std_lib = false } ) ) ; <nl> + ( " \ \ no_hint_generator " , <nl> + ( Shallow_decl_defs . Fun <nl> + { Typing_defs . fe_deprecated = None ; <nl> + fe_type = <nl> + ( Rwitness ( root | ret_from_kind . php line 5 , characters 10 - 26 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | ret_from_kind . php line 5 , characters 10 - 26 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rret_fun_kind ( root | ret_from_kind . php line 5 , characters 10 - 26 ) , <nl> + ( Tapply ( ( [ 5 : 10 - 27 ] , " \ \ Generator " ) , <nl> + [ ( Rwitness ( root | ret_from_kind . php line 5 , characters 10 - 26 ) , <nl> + Tany ) ; <nl> + ( Rwitness ( root | ret_from_kind . php line 5 , characters 10 - 26 ) , <nl> + Tany ) ; <nl> + ( Rwitness ( root | ret_from_kind . php line 5 , characters 10 - 26 ) , <nl> + Tany ) <nl> + ] <nl> + ) ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FGenerator None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + fe_pos = [ 5 : 10 - 27 ] ; fe_php_std_lib = false } ) ) ; <nl> + ( " \ \ no_hint_async_generator " , <nl> + ( Shallow_decl_defs . Fun <nl> + { Typing_defs . fe_deprecated = None ; <nl> + fe_type = <nl> + ( Rwitness ( root | ret_from_kind . php line 9 , characters 16 - 38 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | ret_from_kind . php line 9 , characters 16 - 38 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rret_fun_kind ( root | ret_from_kind . php line 9 , characters 16 - 38 ) , <nl> + ( Tapply ( ( [ 9 : 16 - 39 ] , " \ \ HH \ \ AsyncGenerator " ) , <nl> + [ ( Rwitness ( root | ret_from_kind . php line 9 , characters 16 - 38 ) , <nl> + Tany ) ; <nl> + ( Rwitness ( root | ret_from_kind . php line 9 , characters 16 - 38 ) , <nl> + Tany ) ; <nl> + ( Rwitness ( root | ret_from_kind . php line 9 , characters 16 - 38 ) , <nl> + Tany ) <nl> + ] <nl> + ) ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FAsyncGenerator None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + fe_pos = [ 9 : 16 - 39 ] ; fe_php_std_lib = false } ) ) <nl> + ] <nl> <nl> They matched ! <nl> mmm a / hphp / hack / test / decl / return_disposable . php . exp <nl> ppp b / hphp / hack / test / decl / return_disposable . php . exp <nl> <nl> - Parsed decls : <nl> - <nl> - { classes = <nl> - { " \ \ Bar " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = true ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> - sc_name = ( [ 3 : 13 - 16 ] , " \ \ Bar " ) ; sc_tparams = [ ] ; <nl> - sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> - sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> - sc_implements = <nl> - [ ( Rhint ( root | return_disposable . php line 3 , characters 28 - 38 ) , <nl> - ( Tapply ( ( [ 3 : 28 - 39 ] , " \ \ IDisposable " ) , [ ] ) ) ) ] ; <nl> - sc_consts = [ ] ; sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; sc_props = [ ] ; <nl> - sc_sprops = [ ] ; sc_constructor = None ; sc_static_methods = [ ] ; <nl> - sc_methods = <nl> - [ { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> - sm_memoizelsb = false ; sm_name = ( [ 4 : 19 - 28 ] , " __dispose " ) ; <nl> - sm_override = false ; sm_dynamicallycallable = false ; <nl> - sm_reactivity = None ; <nl> - sm_type = <nl> - ( Rwitness ( root | return_disposable . php line 4 , characters 19 - 27 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | return_disposable . php line 4 , characters 19 - 27 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | return_disposable . php line 4 , characters 32 - 35 ) , <nl> - ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } <nl> - } ) ) ; <nl> - sm_visibility = Public ; sm_deprecated = None } <nl> - ] ; <nl> - sc_user_attributes = [ ] ; sc_enum_type = None } } ; <nl> - funs = <nl> - { " \ \ gen " - > <nl> - { Typing_defs . fe_deprecated = None ; <nl> - fe_type = <nl> - ( Rwitness ( root | return_disposable . php line 8 , characters 16 - 18 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | return_disposable . php line 8 , characters 16 - 18 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | return_disposable . php line 8 , characters 23 - 36 ) , <nl> - ( Tapply ( ( [ 8 : 23 - 32 ] , " \ \ HH \ \ Awaitable " ) , <nl> - [ ( Rhint ( root | return_disposable . php line 8 , characters 33 - 35 ) , <nl> - ( Tapply ( ( [ 8 : 33 - 36 ] , " \ \ Bar " ) , [ ] ) ) ) ] <nl> - ) ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FAsync None ~ return_disposable : true <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - fe_pos = [ 8 : 16 - 19 ] ; fe_php_std_lib = false } } ; <nl> - typedefs = { } ; consts = { } ; records = { } } <nl> + [ ( " \ \ Bar " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = true ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> + sc_name = ( [ 3 : 13 - 16 ] , " \ \ Bar " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> + sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> + sc_implements = <nl> + [ ( Rhint ( root | return_disposable . php line 3 , characters 28 - 38 ) , <nl> + ( Tapply ( ( [ 3 : 28 - 39 ] , " \ \ IDisposable " ) , [ ] ) ) ) ] ; <nl> + sc_consts = [ ] ; sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; sc_props = [ ] ; <nl> + sc_sprops = [ ] ; sc_constructor = None ; sc_static_methods = [ ] ; <nl> + sc_methods = <nl> + [ { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> + sm_memoizelsb = false ; sm_name = ( [ 4 : 19 - 28 ] , " __dispose " ) ; <nl> + sm_override = false ; sm_dynamicallycallable = false ; <nl> + sm_reactivity = None ; <nl> + sm_type = <nl> + ( Rwitness ( root | return_disposable . php line 4 , characters 19 - 27 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | return_disposable . php line 4 , characters 19 - 27 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | return_disposable . php line 4 , characters 32 - 35 ) , <nl> + ( Tprim Tvoid ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } <nl> + } ) ) ; <nl> + sm_visibility = Public ; sm_deprecated = None } <nl> + ] ; <nl> + sc_user_attributes = [ ] ; sc_enum_type = None } ) ) ; <nl> + ( " \ \ gen " , <nl> + ( Shallow_decl_defs . Fun <nl> + { Typing_defs . fe_deprecated = None ; <nl> + fe_type = <nl> + ( Rwitness ( root | return_disposable . php line 8 , characters 16 - 18 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | return_disposable . php line 8 , characters 16 - 18 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | return_disposable . php line 8 , characters 23 - 36 ) , <nl> + ( Tapply ( ( [ 8 : 23 - 32 ] , " \ \ HH \ \ Awaitable " ) , <nl> + [ ( Rhint ( root | return_disposable . php line 8 , characters 33 - 35 ) , <nl> + ( Tapply ( ( [ 8 : 33 - 36 ] , " \ \ Bar " ) , [ ] ) ) ) ] <nl> + ) ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FAsync None ~ return_disposable : true <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + fe_pos = [ 8 : 16 - 19 ] ; fe_php_std_lib = false } ) ) <nl> + ] <nl> <nl> They matched ! <nl> mmm a / hphp / hack / test / decl / returns_void_to_rx . php . exp <nl> ppp b / hphp / hack / test / decl / returns_void_to_rx . php . exp <nl> <nl> - Parsed decls : <nl> - <nl> - { classes = { } ; <nl> - funs = <nl> - { " \ \ f " - > <nl> - { Typing_defs . fe_deprecated = None ; <nl> - fe_type = <nl> - ( Rwitness ( root | returns_void_to_rx . php line 4 , characters 10 - 10 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | returns_void_to_rx . php line 4 , characters 10 - 10 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | returns_void_to_rx . php line 4 , characters 15 - 18 ) , <nl> - ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : true ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - fe_pos = [ 4 : 10 - 11 ] ; fe_php_std_lib = false } } ; <nl> - typedefs = { } ; consts = { } ; records = { } } <nl> + [ ( " \ \ f " , <nl> + ( Shallow_decl_defs . Fun <nl> + { Typing_defs . fe_deprecated = None ; <nl> + fe_type = <nl> + ( Rwitness ( root | returns_void_to_rx . php line 4 , characters 10 - 10 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | returns_void_to_rx . php line 4 , characters 10 - 10 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | returns_void_to_rx . php line 4 , characters 15 - 18 ) , <nl> + ( Tprim Tvoid ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : true ) ; <nl> + ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + fe_pos = [ 4 : 10 - 11 ] ; fe_php_std_lib = false } ) ) <nl> + ] <nl> <nl> They matched ! <nl> mmm a / hphp / hack / test / decl / rx . php . exp <nl> ppp b / hphp / hack / test / decl / rx . php . exp <nl> <nl> - Parsed decls : <nl> - <nl> - { classes = <nl> - { " \ \ C " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> - sc_name = ( [ 3 : 7 - 8 ] , " \ \ C " ) ; sc_tparams = [ ] ; sc_where_constraints = [ ] ; <nl> - sc_extends = [ ] ; sc_uses = [ ] ; sc_xhp_attr_uses = [ ] ; <nl> - sc_req_extends = [ ] ; sc_req_implements = [ ] ; sc_implements = [ ] ; <nl> - sc_consts = [ ] ; sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; sc_props = [ ] ; <nl> - sc_sprops = [ ] ; sc_constructor = None ; sc_static_methods = [ ] ; <nl> - sc_methods = <nl> - [ { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> - sm_memoizelsb = false ; sm_name = ( [ 5 : 19 - 21 ] , " f1 " ) ; <nl> - sm_override = false ; sm_dynamicallycallable = false ; <nl> - sm_reactivity = ( Some ( Decl_defs . Method_reactive None ) ) ; <nl> - sm_type = <nl> - ( Rwitness ( root | rx . php line 5 , characters 19 - 20 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; <nl> - ft_params = <nl> - [ { fp_pos = [ 5 : 46 - 48 ] ; fp_name = ( Some " $ f " ) ; <nl> - fp_type = <nl> + mmm legacy <nl> ppp + direct decl <nl> + <nl> + [ ( " \ \ C " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> + sc_name = ( [ 3 : 7 - 8 ] , " \ \ C " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> + sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> + sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; <nl> + sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> + sc_constructor = None ; sc_static_methods = [ ] ; <nl> + sc_methods = <nl> + [ { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> + sm_memoizelsb = false ; sm_name = ( [ 5 : 19 - 21 ] , " f1 " ) ; <nl> + sm_override = false ; sm_dynamicallycallable = false ; <nl> + sm_reactivity = ( Some ( Decl_defs . Method_reactive None ) ) ; <nl> + sm_type = <nl> + ( Rwitness ( root | rx . php line 5 , characters 19 - 20 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; <nl> + ft_params = <nl> + [ { fp_pos = [ 5 : 46 - 48 ] ; fp_name = ( Some " $ f " ) ; <nl> + fp_type = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | rx . php line 5 , characters 22 - 44 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + - ( Rhint ( root | rx . php line 5 , characters 22 - 44 ) , <nl> + + ( Rhint ( root | rx . php line 5 , characters 27 - 43 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | rx . php line 5 , characters 40 - 42 ) , <nl> + ( Tprim Tint ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false <nl> + ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Pure { } ; <nl> + ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) <nl> + } ; <nl> + fp_flags = <nl> + ( make_fp_flags ~ mutability : None ~ accept_disposable : false <nl> + ~ has_default : false ~ mode : Typing_defs_core . FPnormal <nl> + ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> + } <nl> + ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | rx . php line 5 , characters 19 - 20 ) , ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | rx . php line 5 , characters 51 - 54 ) , <nl> + ( Tprim Tvoid ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Reactive { } ; ft_ifc_decl = FDPolicied { # PUBLIC } <nl> + } ) ) ; <nl> + sm_visibility = Public ; sm_deprecated = None } ; <nl> + { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> + sm_memoizelsb = false ; sm_name = ( [ 7 : 19 - 21 ] , " f2 " ) ; <nl> + sm_override = false ; sm_dynamicallycallable = false ; <nl> + sm_reactivity = ( Some ( Decl_defs . Method_reactive None ) ) ; <nl> + sm_type = <nl> + ( Rwitness ( root | rx . php line 7 , characters 19 - 20 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; <nl> + ft_params = <nl> + [ { fp_pos = [ 7 : 44 - 46 ] ; fp_name = ( Some " $ f " ) ; <nl> + fp_type = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | rx . php line 7 , characters 22 - 42 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + - ( Rhint ( root | rx . php line 7 , characters 22 - 42 ) , <nl> + + ( Rhint ( root | rx . php line 7 , characters 25 - 41 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | rx . php line 7 , characters 38 - 40 ) , <nl> + ( Tprim Tint ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None <nl> + ~ return_disposable : false ~ returns_mutable : false <nl> + ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Reactive { } ; <nl> + ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) <nl> + } ; <nl> + fp_flags = <nl> + ( make_fp_flags ~ mutability : None ~ accept_disposable : false <nl> + ~ has_default : false ~ mode : Typing_defs_core . FPnormal <nl> + ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> + } <nl> + ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | rx . php line 7 , characters 19 - 20 ) , ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | rx . php line 7 , characters 49 - 52 ) , <nl> + ( Tprim Tvoid ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Reactive { } ; <nl> + ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + sm_visibility = Public ; sm_deprecated = None } ; <nl> + { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> + sm_memoizelsb = false ; sm_name = ( [ 9 : 19 - 21 ] , " f3 " ) ; <nl> + sm_override = false ; sm_dynamicallycallable = false ; <nl> + sm_reactivity = ( Some ( Decl_defs . Method_reactive None ) ) ; <nl> + sm_type = <nl> + ( Rwitness ( root | rx . php line 9 , characters 19 - 20 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; <nl> + ft_params = <nl> + [ { fp_pos = [ 9 : 51 - 53 ] ; fp_name = ( Some " $ f " ) ; <nl> + fp_type = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | rx . php line 9 , characters 22 - 49 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + - ( Rhint ( root | rx . php line 9 , characters 22 - 49 ) , <nl> + + ( Rhint ( root | rx . php line 9 , characters 32 - 48 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | rx . php line 9 , characters 45 - 47 ) , <nl> + ( Tprim Tint ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None <nl> + ~ return_disposable : false ~ returns_mutable : false <nl> + ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Shallow { } ; <nl> + ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) <nl> + } ; <nl> + fp_flags = <nl> + ( make_fp_flags ~ mutability : None ~ accept_disposable : false <nl> + ~ has_default : false ~ mode : Typing_defs_core . FPnormal <nl> + ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> + } <nl> + ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | rx . php line 9 , characters 19 - 20 ) , ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | rx . php line 9 , characters 56 - 59 ) , <nl> + ( Tprim Tvoid ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Reactive { } ; <nl> + ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + sm_visibility = Public ; sm_deprecated = None } ; <nl> + { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> + sm_memoizelsb = false ; sm_name = ( [ 11 : 19 - 21 ] , " f4 " ) ; <nl> + sm_override = false ; sm_dynamicallycallable = false ; <nl> + sm_reactivity = ( Some ( Decl_defs . Method_reactive None ) ) ; <nl> + sm_type = <nl> + ( Rwitness ( root | rx . php line 11 , characters 19 - 20 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; <nl> + ft_params = <nl> + [ { fp_pos = [ 11 : 49 - 51 ] ; fp_name = ( Some " $ f " ) ; <nl> + fp_type = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | rx . php line 11 , characters 22 - 47 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + - ( Rhint ( root | rx . php line 11 , characters 22 - 47 ) , <nl> + + ( Rhint ( root | rx . php line 11 , characters 30 - 46 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | rx . php line 11 , characters 43 - 45 ) , <nl> + ( Tprim Tint ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None <nl> + ~ return_disposable : false ~ returns_mutable : false <nl> + ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Local { } ; <nl> + ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) <nl> + } ; <nl> + fp_flags = <nl> + ( make_fp_flags ~ mutability : None ~ accept_disposable : false <nl> + ~ has_default : false ~ mode : Typing_defs_core . FPnormal <nl> + ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> + } <nl> + ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | rx . php line 11 , characters 19 - 20 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> { et_enforced = false ; <nl> et_type = <nl> - ( Rhint ( root | rx . php line 5 , characters 22 - 44 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | rx . php line 5 , characters 27 - 43 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | rx . php line 5 , characters 40 - 42 ) , <nl> - ( Tprim Tint ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Pure { } ; <nl> - ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) <nl> + ( Rhint ( root | rx . php line 11 , characters 54 - 57 ) , <nl> + ( Tprim Tvoid ) ) <nl> } ; <nl> - fp_flags = <nl> - ( make_fp_flags ~ mutability : None ~ accept_disposable : false <nl> - ~ has_default : false ~ mode : Typing_defs_core . FPnormal <nl> - ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> - } <nl> - ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | rx . php line 5 , characters 19 - 20 ) , ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | rx . php line 5 , characters 51 - 54 ) , ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Reactive { } ; ft_ifc_decl = FDPolicied { # PUBLIC } <nl> - } ) ) ; <nl> - sm_visibility = Public ; sm_deprecated = None } ; <nl> - { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> - sm_memoizelsb = false ; sm_name = ( [ 7 : 19 - 21 ] , " f2 " ) ; <nl> - sm_override = false ; sm_dynamicallycallable = false ; <nl> - sm_reactivity = ( Some ( Decl_defs . Method_reactive None ) ) ; <nl> - sm_type = <nl> - ( Rwitness ( root | rx . php line 7 , characters 19 - 20 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; <nl> - ft_params = <nl> - [ { fp_pos = [ 7 : 44 - 46 ] ; fp_name = ( Some " $ f " ) ; <nl> - fp_type = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | rx . php line 7 , characters 22 - 42 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | rx . php line 7 , characters 25 - 41 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | rx . php line 7 , characters 38 - 40 ) , <nl> - ( Tprim Tint ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false <nl> - ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Reactive { } ; <nl> - ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) <nl> - } ; <nl> - fp_flags = <nl> - ( make_fp_flags ~ mutability : None ~ accept_disposable : false <nl> - ~ has_default : false ~ mode : Typing_defs_core . FPnormal <nl> - ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> - } <nl> - ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | rx . php line 7 , characters 19 - 20 ) , ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | rx . php line 7 , characters 49 - 52 ) , <nl> - ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Reactive { } ; ft_ifc_decl = FDPolicied { # PUBLIC } <nl> - } ) ) ; <nl> - sm_visibility = Public ; sm_deprecated = None } ; <nl> - { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> - sm_memoizelsb = false ; sm_name = ( [ 9 : 19 - 21 ] , " f3 " ) ; <nl> - sm_override = false ; sm_dynamicallycallable = false ; <nl> - sm_reactivity = ( Some ( Decl_defs . Method_reactive None ) ) ; <nl> - sm_type = <nl> - ( Rwitness ( root | rx . php line 9 , characters 19 - 20 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; <nl> - ft_params = <nl> - [ { fp_pos = [ 9 : 51 - 53 ] ; fp_name = ( Some " $ f " ) ; <nl> - fp_type = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | rx . php line 9 , characters 22 - 49 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | rx . php line 9 , characters 32 - 48 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | rx . php line 9 , characters 45 - 47 ) , <nl> - ( Tprim Tint ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false <nl> - ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Shallow { } ; <nl> - ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) <nl> - } ; <nl> - fp_flags = <nl> - ( make_fp_flags ~ mutability : None ~ accept_disposable : false <nl> - ~ has_default : false ~ mode : Typing_defs_core . FPnormal <nl> - ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> - } <nl> - ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | rx . php line 9 , characters 19 - 20 ) , ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | rx . php line 9 , characters 56 - 59 ) , <nl> - ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Reactive { } ; ft_ifc_decl = FDPolicied { # PUBLIC } <nl> - } ) ) ; <nl> - sm_visibility = Public ; sm_deprecated = None } ; <nl> - { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> - sm_memoizelsb = false ; sm_name = ( [ 11 : 19 - 21 ] , " f4 " ) ; <nl> - sm_override = false ; sm_dynamicallycallable = false ; <nl> - sm_reactivity = ( Some ( Decl_defs . Method_reactive None ) ) ; <nl> - sm_type = <nl> - ( Rwitness ( root | rx . php line 11 , characters 19 - 20 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; <nl> - ft_params = <nl> - [ { fp_pos = [ 11 : 49 - 51 ] ; fp_name = ( Some " $ f " ) ; <nl> - fp_type = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | rx . php line 11 , characters 22 - 47 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | rx . php line 11 , characters 30 - 46 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | rx . php line 11 , characters 43 - 45 ) , <nl> - ( Tprim Tint ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false <nl> - ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Local { } ; <nl> - ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) <nl> - } ; <nl> - fp_flags = <nl> - ( make_fp_flags ~ mutability : None ~ accept_disposable : false <nl> - ~ has_default : false ~ mode : Typing_defs_core . FPnormal <nl> - ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> - } <nl> - ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | rx . php line 11 , characters 19 - 20 ) , ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | rx . php line 11 , characters 54 - 57 ) , <nl> - ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Reactive { } ; ft_ifc_decl = FDPolicied { # PUBLIC } <nl> - } ) ) ; <nl> - sm_visibility = Public ; sm_deprecated = None } <nl> - ] ; <nl> - sc_user_attributes = [ ] ; sc_enum_type = None } } ; <nl> - funs = { } ; typedefs = { } ; consts = { } ; records = { } } <nl> - <nl> - They matched ! <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Reactive { } ; <nl> + ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + sm_visibility = Public ; sm_deprecated = None } <nl> + ] ; <nl> + sc_user_attributes = [ ] ; sc_enum_type = None } ) ) <nl> + ] <nl> mmm a / hphp / hack / test / decl / self_in_type_constant . php . exp <nl> ppp b / hphp / hack / test / decl / self_in_type_constant . php . exp <nl> <nl> - Parsed decls : <nl> - <nl> - { classes = <nl> - { " \ \ C " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> - sc_name = ( [ 3 : 7 - 8 ] , " \ \ C " ) ; sc_tparams = [ ] ; sc_where_constraints = [ ] ; <nl> - sc_extends = [ ] ; sc_uses = [ ] ; sc_xhp_attr_uses = [ ] ; <nl> - sc_req_extends = [ ] ; sc_req_implements = [ ] ; sc_implements = [ ] ; <nl> - sc_consts = [ ] ; <nl> - sc_typeconsts = <nl> - [ { Shallow_decl_defs . stc_abstract = Typing_defs . TCConcrete ; <nl> - stc_constraint = None ; stc_name = ( [ 4 : 14 - 15 ] , " T " ) ; <nl> - stc_type = <nl> - ( Some ( Rhint ( root | self_in_type_constant . php line 4 , characters 18 - 20 ) , <nl> - ( Tprim Tint ) ) ) ; <nl> - stc_enforceable = ( [ Pos . none ] , false ) ; stc_reifiable = None } ; <nl> - { Shallow_decl_defs . stc_abstract = Typing_defs . TCConcrete ; <nl> - stc_constraint = None ; stc_name = ( [ 5 : 14 - 15 ] , " U " ) ; <nl> - stc_type = <nl> - ( Some ( Rhint ( root | self_in_type_constant . php line 5 , characters 18 - 24 ) , <nl> - ( Taccess <nl> - ( ( Rhint ( root | self_in_type_constant . php line 5 , characters 18 - 21 ) , <nl> - ( Tapply ( ( [ 3 : 7 - 8 ] , " \ \ C " ) , [ ] ) ) ) , <nl> - [ ( [ 5 : 24 - 25 ] , " T " ) ] ) ) ) ) ; <nl> - stc_enforceable = ( [ Pos . none ] , false ) ; stc_reifiable = None } <nl> - ] ; <nl> - sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; sc_constructor = None ; <nl> - sc_static_methods = [ ] ; sc_methods = [ ] ; sc_user_attributes = [ ] ; <nl> - sc_enum_type = None } ; <nl> - " \ \ I " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cinterface ; <nl> - sc_name = ( [ 8 : 11 - 12 ] , " \ \ I " ) ; sc_tparams = [ ] ; <nl> - sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> - sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> - sc_implements = [ ] ; sc_consts = [ ] ; <nl> - sc_typeconsts = <nl> - [ { Shallow_decl_defs . stc_abstract = Typing_defs . TCConcrete ; <nl> - stc_constraint = None ; stc_name = ( [ 9 : 14 - 15 ] , " V " ) ; <nl> - stc_type = <nl> - ( Some ( Rhint ( root | self_in_type_constant . php line 9 , characters 18 - 20 ) , <nl> - ( Tprim Tint ) ) ) ; <nl> - stc_enforceable = ( [ Pos . none ] , false ) ; stc_reifiable = None } ; <nl> - { Shallow_decl_defs . stc_abstract = Typing_defs . TCConcrete ; <nl> - stc_constraint = None ; stc_name = ( [ 10 : 14 - 15 ] , " W " ) ; <nl> + [ ( " \ \ C " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> + sc_name = ( [ 3 : 7 - 8 ] , " \ \ C " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> + sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> + sc_implements = [ ] ; sc_consts = [ ] ; <nl> + sc_typeconsts = <nl> + [ { Shallow_decl_defs . stc_abstract = Typing_defs . TCConcrete ; <nl> + stc_constraint = None ; stc_name = ( [ 4 : 14 - 15 ] , " T " ) ; <nl> stc_type = <nl> - ( Some ( Rhint ( root | self_in_type_constant . php line 10 , characters 18 - 24 ) , <nl> - ( Taccess <nl> - ( ( Rhint ( root | self_in_type_constant . php line 10 , characters 18 - 21 ) , <nl> - ( Tapply ( ( [ 8 : 11 - 12 ] , " \ \ I " ) , [ ] ) ) ) , <nl> - [ ( [ 10 : 24 - 25 ] , " V " ) ] ) ) ) ) ; <nl> - stc_enforceable = ( [ Pos . none ] , false ) ; stc_reifiable = None } <nl> - ] ; <nl> - sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; sc_constructor = None ; <nl> - sc_static_methods = [ ] ; sc_methods = [ ] ; sc_user_attributes = [ ] ; <nl> - sc_enum_type = None } ; <nl> - " \ \ T " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Ctrait ; <nl> - sc_name = ( [ 13 : 7 - 8 ] , " \ \ T " ) ; sc_tparams = [ ] ; <nl> - sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> - sc_xhp_attr_uses = [ ] ; <nl> - sc_req_extends = <nl> - [ ( Rhint ( root | self_in_type_constant . php line 14 , characters 19 - 19 ) , <nl> - ( Tapply ( ( [ 14 : 19 - 20 ] , " \ \ C " ) , [ ] ) ) ) ] ; <nl> - sc_req_implements = [ ] ; sc_implements = [ ] ; sc_consts = [ ] ; <nl> - sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> - sc_constructor = None ; sc_static_methods = [ ] ; <nl> - sc_methods = <nl> - [ { Shallow_decl_defs . sm_abstract = true ; sm_final = false ; <nl> - sm_memoizelsb = false ; sm_name = ( [ 15 : 28 - 29 ] , " f " ) ; <nl> - sm_override = false ; sm_dynamicallycallable = false ; <nl> - sm_reactivity = None ; <nl> - sm_type = <nl> - ( Rwitness ( root | self_in_type_constant . php line 15 , characters 28 - 28 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | self_in_type_constant . php line 15 , characters 28 - 28 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | self_in_type_constant . php line 15 , characters 33 - 39 ) , <nl> + ( Some ( Rhint ( root | self_in_type_constant . php line 4 , characters 18 - 20 ) , <nl> + ( Tprim Tint ) ) ) ; <nl> + stc_enforceable = ( [ Pos . none ] , false ) ; stc_reifiable = None } ; <nl> + { Shallow_decl_defs . stc_abstract = Typing_defs . TCConcrete ; <nl> + stc_constraint = None ; stc_name = ( [ 5 : 14 - 15 ] , " U " ) ; <nl> + stc_type = <nl> + ( Some ( Rhint ( root | self_in_type_constant . php line 5 , characters 18 - 24 ) , <nl> ( Taccess <nl> - ( ( Rhint ( root | self_in_type_constant . php line 15 , characters 33 - 36 ) , <nl> - ( Tapply ( ( [ 13 : 7 - 8 ] , " \ \ T " ) , [ ] ) ) ) , <nl> - [ ( [ 15 : 39 - 40 ] , " U " ) ] ) ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } <nl> - } ) ) ; <nl> - sm_visibility = Public ; sm_deprecated = None } <nl> - ] ; <nl> - sc_user_attributes = [ ] ; sc_enum_type = None } } ; <nl> - funs = { } ; typedefs = { } ; consts = { } ; records = { } } <nl> + ( ( Rhint ( root | self_in_type_constant . php line 5 , characters 18 - 21 ) , <nl> + ( Tapply ( ( [ 3 : 7 - 8 ] , " \ \ C " ) , [ ] ) ) ) , <nl> + [ ( [ 5 : 24 - 25 ] , " T " ) ] ) ) ) ) ; <nl> + stc_enforceable = ( [ Pos . none ] , false ) ; stc_reifiable = None } <nl> + ] ; <nl> + sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> + sc_constructor = None ; sc_static_methods = [ ] ; sc_methods = [ ] ; <nl> + sc_user_attributes = [ ] ; sc_enum_type = None } ) ) ; <nl> + ( " \ \ I " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cinterface ; <nl> + sc_name = ( [ 8 : 11 - 12 ] , " \ \ I " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> + sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> + sc_implements = [ ] ; sc_consts = [ ] ; <nl> + sc_typeconsts = <nl> + [ { Shallow_decl_defs . stc_abstract = Typing_defs . TCConcrete ; <nl> + stc_constraint = None ; stc_name = ( [ 9 : 14 - 15 ] , " V " ) ; <nl> + stc_type = <nl> + ( Some ( Rhint ( root | self_in_type_constant . php line 9 , characters 18 - 20 ) , <nl> + ( Tprim Tint ) ) ) ; <nl> + stc_enforceable = ( [ Pos . none ] , false ) ; stc_reifiable = None } ; <nl> + { Shallow_decl_defs . stc_abstract = Typing_defs . TCConcrete ; <nl> + stc_constraint = None ; stc_name = ( [ 10 : 14 - 15 ] , " W " ) ; <nl> + stc_type = <nl> + ( Some ( Rhint ( root | self_in_type_constant . php line 10 , characters 18 - 24 ) , <nl> + ( Taccess <nl> + ( ( Rhint ( root | self_in_type_constant . php line 10 , characters 18 - 21 ) , <nl> + ( Tapply ( ( [ 8 : 11 - 12 ] , " \ \ I " ) , [ ] ) ) ) , <nl> + [ ( [ 10 : 24 - 25 ] , " V " ) ] ) ) ) ) ; <nl> + stc_enforceable = ( [ Pos . none ] , false ) ; stc_reifiable = None } <nl> + ] ; <nl> + sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> + sc_constructor = None ; sc_static_methods = [ ] ; sc_methods = [ ] ; <nl> + sc_user_attributes = [ ] ; sc_enum_type = None } ) ) ; <nl> + ( " \ \ T " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Ctrait ; <nl> + sc_name = ( [ 13 : 7 - 8 ] , " \ \ T " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> + sc_xhp_attr_uses = [ ] ; <nl> + sc_req_extends = <nl> + [ ( Rhint ( root | self_in_type_constant . php line 14 , characters 19 - 19 ) , <nl> + ( Tapply ( ( [ 14 : 19 - 20 ] , " \ \ C " ) , [ ] ) ) ) ] ; <nl> + sc_req_implements = [ ] ; sc_implements = [ ] ; sc_consts = [ ] ; <nl> + sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> + sc_constructor = None ; sc_static_methods = [ ] ; <nl> + sc_methods = <nl> + [ { Shallow_decl_defs . sm_abstract = true ; sm_final = false ; <nl> + sm_memoizelsb = false ; sm_name = ( [ 15 : 28 - 29 ] , " f " ) ; <nl> + sm_override = false ; sm_dynamicallycallable = false ; <nl> + sm_reactivity = None ; <nl> + sm_type = <nl> + ( Rwitness ( root | self_in_type_constant . php line 15 , characters 28 - 28 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | self_in_type_constant . php line 15 , characters 28 - 28 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | self_in_type_constant . php line 15 , characters 33 - 39 ) , <nl> + ( Taccess <nl> + ( ( Rhint ( root | self_in_type_constant . php line 15 , characters 33 - 36 ) , <nl> + ( Tapply ( ( [ 13 : 7 - 8 ] , " \ \ T " ) , [ ] ) ) ) , <nl> + [ ( [ 15 : 39 - 40 ] , " U " ) ] ) ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; <nl> + ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + sm_visibility = Public ; sm_deprecated = None } <nl> + ] ; <nl> + sc_user_attributes = [ ] ; sc_enum_type = None } ) ) <nl> + ] <nl> <nl> They matched ! <nl> mmm a / hphp / hack / test / decl / self_param_mutability . php . exp <nl> ppp b / hphp / hack / test / decl / self_param_mutability . php . exp <nl> <nl> - Parsed decls : <nl> - <nl> - { classes = <nl> - { " \ \ C " - > <nl> - { Shallow_decl_defs . sc_mode = Mpartial ; sc_final = false ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> - sc_name = ( [ 3 : 7 - 8 ] , " \ \ C " ) ; sc_tparams = [ ] ; sc_where_constraints = [ ] ; <nl> - sc_extends = [ ] ; sc_uses = [ ] ; sc_xhp_attr_uses = [ ] ; <nl> - sc_req_extends = [ ] ; sc_req_implements = [ ] ; sc_implements = [ ] ; <nl> - sc_consts = [ ] ; sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; sc_props = [ ] ; <nl> - sc_sprops = [ ] ; sc_constructor = None ; sc_static_methods = [ ] ; <nl> - sc_methods = <nl> - [ { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> - sm_memoizelsb = false ; sm_name = ( [ 5 : 19 - 20 ] , " a " ) ; <nl> - sm_override = false ; sm_dynamicallycallable = false ; <nl> - sm_reactivity = ( Some ( Decl_defs . Method_reactive None ) ) ; <nl> - sm_type = <nl> - ( Rwitness ( root | self_param_mutability . php line 5 , characters 19 - 19 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | self_param_mutability . php line 5 , characters 19 - 19 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | self_param_mutability . php line 5 , characters 24 - 27 ) , <nl> - ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync <nl> - ( Some Typing_defs_core . Param_borrowed_mutable ) <nl> - ~ return_disposable : false ~ returns_mutable : false <nl> - ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Reactive { } ; ft_ifc_decl = FDPolicied { # PUBLIC } <nl> - } ) ) ; <nl> - sm_visibility = Public ; sm_deprecated = None } ; <nl> - { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> - sm_memoizelsb = false ; sm_name = ( [ 8 : 19 - 20 ] , " b " ) ; <nl> + [ ( " \ \ C " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mpartial ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> + sc_name = ( [ 3 : 7 - 8 ] , " \ \ C " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> + sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> + sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; <nl> + sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> + sc_constructor = None ; sc_static_methods = [ ] ; <nl> + sc_methods = <nl> + [ { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> + sm_memoizelsb = false ; sm_name = ( [ 5 : 19 - 20 ] , " a " ) ; <nl> sm_override = false ; sm_dynamicallycallable = false ; <nl> sm_reactivity = ( Some ( Decl_defs . Method_reactive None ) ) ; <nl> sm_type = <nl> - ( Rwitness ( root | self_param_mutability . php line 8 , characters 19 - 19 ) , <nl> + ( Rwitness ( root | self_param_mutability . php line 5 , characters 19 - 19 ) , <nl> ( Tfun <nl> { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> ft_implicit_params = <nl> { capability = <nl> - ( Rhint ( root | self_param_mutability . php line 8 , characters 19 - 19 ) , <nl> + ( Rhint ( root | self_param_mutability . php line 5 , characters 19 - 19 ) , <nl> ( Tunion [ ] ) ) <nl> } ; <nl> ft_ret = <nl> { et_enforced = false ; <nl> et_type = <nl> - ( Rhint ( root | self_param_mutability . php line 8 , characters 24 - 27 ) , <nl> + ( Rhint ( root | self_param_mutability . php line 5 , characters 24 - 27 ) , <nl> ( Tprim Tvoid ) ) <nl> } ; <nl> ft_flags = <nl> ( make_ft_flags FSync <nl> - ( Some Typing_defs_core . Param_maybe_mutable ) <nl> + ( Some Typing_defs_core . Param_borrowed_mutable ) <nl> ~ return_disposable : false ~ returns_mutable : false <nl> ~ returns_void_to_rx : false ) ; <nl> ft_reactive = Reactive { } ; ft_ifc_decl = FDPolicied { # PUBLIC } <nl> } ) ) ; <nl> - sm_visibility = Public ; sm_deprecated = None } <nl> - ] ; <nl> - sc_user_attributes = [ ] ; sc_enum_type = None } } ; <nl> - funs = { } ; typedefs = { } ; consts = { } ; records = { } } <nl> + sm_visibility = Public ; sm_deprecated = None } ; <nl> + { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> + sm_memoizelsb = false ; sm_name = ( [ 8 : 19 - 20 ] , " b " ) ; <nl> + sm_override = false ; sm_dynamicallycallable = false ; <nl> + sm_reactivity = ( Some ( Decl_defs . Method_reactive None ) ) ; <nl> + sm_type = <nl> + ( Rwitness ( root | self_param_mutability . php line 8 , characters 19 - 19 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | self_param_mutability . php line 8 , characters 19 - 19 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | self_param_mutability . php line 8 , characters 24 - 27 ) , <nl> + ( Tprim Tvoid ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync <nl> + ( Some Typing_defs_core . Param_maybe_mutable ) <nl> + ~ return_disposable : false ~ returns_mutable : false <nl> + ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Reactive { } ; <nl> + ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + sm_visibility = Public ; sm_deprecated = None } <nl> + ] ; <nl> + sc_user_attributes = [ ] ; sc_enum_type = None } ) ) <nl> + ] <nl> <nl> They matched ! <nl> mmm a / hphp / hack / test / decl / shape_expression_key_types . php . exp <nl> ppp b / hphp / hack / test / decl / shape_expression_key_types . php . exp <nl> <nl> - Parsed decls : <nl> - <nl> - { classes = <nl> - { " \ \ C " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> - sc_name = ( [ 3 : 7 - 8 ] , " \ \ C " ) ; sc_tparams = [ ] ; sc_where_constraints = [ ] ; <nl> - sc_extends = [ ] ; sc_uses = [ ] ; sc_xhp_attr_uses = [ ] ; <nl> - sc_req_extends = [ ] ; sc_req_implements = [ ] ; sc_implements = [ ] ; <nl> - sc_consts = <nl> - [ { Shallow_decl_defs . scc_abstract = false ; <nl> - scc_name = ( [ 4 : 16 - 19 ] , " KEY " ) ; <nl> - scc_type = <nl> - ( Rhint ( root | shape_expression_key_types . php line 4 , characters 9 - 14 ) , <nl> - ( Tprim Tstring ) ) <nl> - } ; <nl> - { Shallow_decl_defs . scc_abstract = false ; <nl> - scc_name = ( [ 6 : 15 - 16 ] , " X " ) ; <nl> + [ ( " \ \ C " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> + sc_name = ( [ 3 : 7 - 8 ] , " \ \ C " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> + sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> + sc_implements = [ ] ; <nl> + sc_consts = <nl> + [ { Shallow_decl_defs . scc_abstract = false ; <nl> + scc_name = ( [ 4 : 16 - 19 ] , " KEY " ) ; <nl> scc_type = <nl> - ( Rhint ( root | shape_expression_key_types . php line 6 , characters 9 - 13 ) , <nl> - Tmixed ) <nl> - } <nl> - ] ; <nl> - sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> - sc_constructor = None ; sc_static_methods = [ ] ; sc_methods = [ ] ; <nl> - sc_user_attributes = [ ] ; sc_enum_type = None } } ; <nl> - funs = { } ; typedefs = { } ; consts = { } ; records = { } } <nl> + ( Rhint ( root | shape_expression_key_types . php line 4 , characters 9 - 14 ) , <nl> + ( Tprim Tstring ) ) <nl> + } ; <nl> + { Shallow_decl_defs . scc_abstract = false ; <nl> + scc_name = ( [ 6 : 15 - 16 ] , " X " ) ; <nl> + scc_type = <nl> + ( Rhint ( root | shape_expression_key_types . php line 6 , characters 9 - 13 ) , <nl> + Tmixed ) <nl> + } <nl> + ] ; <nl> + sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> + sc_constructor = None ; sc_static_methods = [ ] ; sc_methods = [ ] ; <nl> + sc_user_attributes = [ ] ; sc_enum_type = None } ) ) <nl> + ] <nl> <nl> They matched ! <nl> mmm a / hphp / hack / test / decl / shape_self . php . exp <nl> ppp b / hphp / hack / test / decl / shape_self . php . exp <nl> <nl> - Parsed decls : <nl> - <nl> - { classes = <nl> - { " \ \ TestClass " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> - sc_name = ( [ 3 : 7 - 16 ] , " \ \ TestClass " ) ; sc_tparams = [ ] ; <nl> - sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> - sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> - sc_implements = [ ] ; <nl> - sc_consts = <nl> - [ { Shallow_decl_defs . scc_abstract = false ; <nl> - scc_name = ( [ 4 : 16 - 19 ] , " KEY " ) ; <nl> - scc_type = <nl> - ( Rhint ( root | shape_self . php line 4 , characters 9 - 14 ) , <nl> - ( Tprim Tstring ) ) <nl> - } <nl> - ] ; <nl> - sc_typeconsts = <nl> - [ { Shallow_decl_defs . stc_abstract = Typing_defs . TCConcrete ; <nl> - stc_constraint = None ; stc_name = ( [ 6 : 14 - 24 ] , " TClassType " ) ; <nl> - stc_type = <nl> - ( Some ( Rhint ( root | shape_self . php line 6 , characters 27 - 58 ) , <nl> - ( Tshape ( Typing_defs_core . Closed_shape , <nl> - { ( SFclass_const ( ( [ 7 : 5 - 9 ] , " \ \ TestClass " ) , <nl> - ( [ 7 : 11 - 14 ] , " KEY " ) ) ) - > <nl> - { sft_optional = false ; <nl> - sft_ty = <nl> - ( Rhint ( root | shape_self . php line 7 , characters 18 - 20 ) , <nl> - ( Tprim Tint ) ) <nl> - } } <nl> - ) ) ) ) ; <nl> - stc_enforceable = ( [ Pos . none ] , false ) ; stc_reifiable = None } <nl> - ] ; <nl> - sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; sc_constructor = None ; <nl> - sc_static_methods = [ ] ; sc_methods = [ ] ; sc_user_attributes = [ ] ; <nl> - sc_enum_type = None } } ; <nl> - funs = { } ; typedefs = { } ; consts = { } ; records = { } } <nl> + [ ( " \ \ TestClass " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> + sc_name = ( [ 3 : 7 - 16 ] , " \ \ TestClass " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> + sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> + sc_implements = [ ] ; <nl> + sc_consts = <nl> + [ { Shallow_decl_defs . scc_abstract = false ; <nl> + scc_name = ( [ 4 : 16 - 19 ] , " KEY " ) ; <nl> + scc_type = <nl> + ( Rhint ( root | shape_self . php line 4 , characters 9 - 14 ) , <nl> + ( Tprim Tstring ) ) <nl> + } <nl> + ] ; <nl> + sc_typeconsts = <nl> + [ { Shallow_decl_defs . stc_abstract = Typing_defs . TCConcrete ; <nl> + stc_constraint = None ; stc_name = ( [ 6 : 14 - 24 ] , " TClassType " ) ; <nl> + stc_type = <nl> + ( Some ( Rhint ( root | shape_self . php line 6 , characters 27 - 58 ) , <nl> + ( Tshape ( Typing_defs_core . Closed_shape , <nl> + { ( SFclass_const ( ( [ 7 : 5 - 9 ] , " \ \ TestClass " ) , <nl> + ( [ 7 : 11 - 14 ] , " KEY " ) ) ) - > <nl> + { sft_optional = false ; <nl> + sft_ty = <nl> + ( Rhint ( root | shape_self . php line 7 , characters 18 - 20 ) , <nl> + ( Tprim Tint ) ) <nl> + } } <nl> + ) ) ) ) ; <nl> + stc_enforceable = ( [ Pos . none ] , false ) ; stc_reifiable = None } <nl> + ] ; <nl> + sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> + sc_constructor = None ; sc_static_methods = [ ] ; sc_methods = [ ] ; <nl> + sc_user_attributes = [ ] ; sc_enum_type = None } ) ) <nl> + ] <nl> <nl> They matched ! <nl> mmm a / hphp / hack / test / decl / shape_type_key_types . php . exp <nl> ppp b / hphp / hack / test / decl / shape_type_key_types . php . exp <nl> <nl> - Parsed decls : <nl> - <nl> - { classes = { } ; funs = { } ; <nl> - typedefs = <nl> - { " \ \ Shape " - > <nl> - { Typing_defs . td_pos = [ 3 : 6 - 11 ] ; td_vis = Transparent ; td_tparams = [ ] ; <nl> - td_constraint = None ; <nl> - td_type = <nl> - ( Rhint ( root | shape_type_key_types . php line 3 , characters 14 - 98 ) , <nl> - ( Tshape ( Typing_defs_core . Closed_shape , <nl> - { ( SFlit_str ( [ 4 : 3 - 4 ] , " 0 " ) ) - > <nl> - { sft_optional = false ; <nl> - sft_ty = <nl> - ( Rhint ( root | shape_type_key_types . php line 4 , characters 8 - 10 ) , <nl> - ( Tprim Tint ) ) <nl> - } ; <nl> - ( SFlit_str ( [ 5 : 3 - 6 ] , " s " ) ) - > <nl> - { sft_optional = false ; <nl> - sft_ty = <nl> - ( Rhint ( root | shape_type_key_types . php line 5 , characters 10 - 15 ) , <nl> - ( Tprim Tstring ) ) <nl> - } ; <nl> - ( SFclass_const ( ( [ 7 : 3 - 4 ] , " \ \ C " ) , ( [ 7 : 6 - 9 ] , " KEY " ) ) ) - > <nl> - { sft_optional = false ; <nl> - sft_ty = <nl> - ( Rhint ( root | shape_type_key_types . php line 7 , characters 13 - 18 ) , <nl> - ( Tprim Tstring ) ) <nl> - } ; <nl> - ( SFclass_const ( ( [ 6 : 3 - 4 ] , " \ \ C " ) , ( [ 6 : 6 - 11 ] , " class " ) ) ) - > <nl> - { sft_optional = false ; <nl> - sft_ty = <nl> - ( Rhint ( root | shape_type_key_types . php line 6 , characters 15 - 26 ) , <nl> - ( Tapply ( ( [ 6 : 15 - 24 ] , " \ \ HH \ \ classname " ) , <nl> - [ ( Rhint ( root | shape_type_key_types . php line 6 , characters 25 - 25 ) , <nl> - ( Tapply ( ( [ 6 : 25 - 26 ] , " \ \ C " ) , [ ] ) ) ) ] <nl> - ) ) ) <nl> - } } <nl> - ) ) ) <nl> - } } ; <nl> - consts = { } ; records = { } } <nl> + [ ( " \ \ Shape " , <nl> + ( Shallow_decl_defs . Typedef <nl> + { Typing_defs . td_pos = [ 3 : 6 - 11 ] ; td_vis = Transparent ; td_tparams = [ ] ; <nl> + td_constraint = None ; <nl> + td_type = <nl> + ( Rhint ( root | shape_type_key_types . php line 3 , characters 14 - 98 ) , <nl> + ( Tshape ( Typing_defs_core . Closed_shape , <nl> + { ( SFlit_str ( [ 4 : 3 - 4 ] , " 0 " ) ) - > <nl> + { sft_optional = false ; <nl> + sft_ty = <nl> + ( Rhint ( root | shape_type_key_types . php line 4 , characters 8 - 10 ) , <nl> + ( Tprim Tint ) ) <nl> + } ; <nl> + ( SFlit_str ( [ 5 : 3 - 6 ] , " s " ) ) - > <nl> + { sft_optional = false ; <nl> + sft_ty = <nl> + ( Rhint ( root | shape_type_key_types . php line 5 , characters 10 - 15 ) , <nl> + ( Tprim Tstring ) ) <nl> + } ; <nl> + ( SFclass_const ( ( [ 7 : 3 - 4 ] , " \ \ C " ) , ( [ 7 : 6 - 9 ] , " KEY " ) ) ) - > <nl> + { sft_optional = false ; <nl> + sft_ty = <nl> + ( Rhint ( root | shape_type_key_types . php line 7 , characters 13 - 18 ) , <nl> + ( Tprim Tstring ) ) <nl> + } ; <nl> + ( SFclass_const ( ( [ 6 : 3 - 4 ] , " \ \ C " ) , ( [ 6 : 6 - 11 ] , " class " ) ) ) - > <nl> + { sft_optional = false ; <nl> + sft_ty = <nl> + ( Rhint ( root | shape_type_key_types . php line 6 , characters 15 - 26 ) , <nl> + ( Tapply ( ( [ 6 : 15 - 24 ] , " \ \ HH \ \ classname " ) , <nl> + [ ( Rhint ( root | shape_type_key_types . php line 6 , characters 25 - 25 ) , <nl> + ( Tapply ( ( [ 6 : 25 - 26 ] , " \ \ C " ) , [ ] ) ) ) ] <nl> + ) ) ) <nl> + } } <nl> + ) ) ) <nl> + } ) ) <nl> + ] <nl> <nl> They matched ! <nl> mmm a / hphp / hack / test / decl / shapes . php . exp <nl> ppp b / hphp / hack / test / decl / shapes . php . exp <nl> <nl> - Parsed decls : <nl> - <nl> - { classes = { } ; <nl> - funs = <nl> - { " \ \ generic_shape " - > <nl> - { Typing_defs . fe_deprecated = None ; <nl> - fe_type = <nl> - ( Rwitness ( root | shapes . php line 15 , characters 10 - 22 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; <nl> - ft_tparams = <nl> - [ { Typing_defs_core . tp_variance = Invariant ; <nl> - tp_name = ( [ 15 : 24 - 25 ] , " T " ) ; tp_tparams = [ ] ; <nl> - tp_constraints = [ ] ; tp_reified = Erased ; <nl> - tp_user_attributes = [ ] } <nl> - ] ; <nl> - ft_where_constraints = [ ] ; <nl> - ft_params = <nl> - [ { fp_pos = [ 15 : 34 - 39 ] ; fp_name = ( Some " $ arg1 " ) ; <nl> - fp_type = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | shapes . php line 15 , characters 27 - 32 ) , <nl> - ( Ttuple <nl> - [ ( Rhint ( root | shapes . php line 15 , characters 28 - 28 ) , <nl> - ( Tgeneric ( " T " , [ ] ) ) ) ; <nl> - ( Rhint ( root | shapes . php line 15 , characters 31 - 31 ) , <nl> - ( Tgeneric ( " T " , [ ] ) ) ) <nl> - ] ) ) <nl> + [ ( " \ \ Coordinate " , <nl> + ( Shallow_decl_defs . Typedef <nl> + { Typing_defs . td_pos = [ 3 : 6 - 16 ] ; td_vis = Transparent ; td_tparams = [ ] ; <nl> + td_constraint = None ; <nl> + td_type = <nl> + ( Rhint ( root | shapes . php line 3 , characters 19 - 56 ) , <nl> + ( Tshape ( Typing_defs_core . Open_shape , <nl> + { ( SFlit_str ( [ 3 : 25 - 28 ] , " x " ) ) - > <nl> + { sft_optional = false ; <nl> + sft_ty = <nl> + ( Rhint ( root | shapes . php line 3 , characters 32 - 36 ) , <nl> + ( Tprim Tfloat ) ) <nl> } ; <nl> - fp_flags = <nl> - ( make_fp_flags ~ mutability : None ~ accept_disposable : false <nl> - ~ has_default : false ~ mode : Typing_defs_core . FPnormal <nl> - ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> - } ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | shapes . php line 15 , characters 10 - 22 ) , ( Tunion [ ] ) ) } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | shapes . php line 15 , characters 42 - 47 ) , <nl> - ( Ttuple <nl> - [ ( Rhint ( root | shapes . php line 15 , characters 43 - 43 ) , <nl> - ( Tgeneric ( " T " , [ ] ) ) ) ; <nl> - ( Rhint ( root | shapes . php line 15 , characters 46 - 46 ) , <nl> - ( Tgeneric ( " T " , [ ] ) ) ) <nl> - ] ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - fe_pos = [ 15 : 10 - 23 ] ; fe_php_std_lib = false } ; <nl> - " \ \ returns_shape " - > <nl> - { Typing_defs . fe_deprecated = None ; <nl> - fe_type = <nl> - ( Rwitness ( root | shapes . php line 9 , characters 10 - 22 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; <nl> - ft_params = <nl> - [ { fp_pos = [ 10 : 14 - 19 ] ; fp_name = ( Some " $ arg1 " ) ; <nl> - fp_type = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | shapes . php line 10 , characters 3 - 12 ) , <nl> - ( Tapply ( ( [ 10 : 3 - 13 ] , " \ \ Coordinate " ) , [ ] ) ) ) <nl> - } ; <nl> - fp_flags = <nl> - ( make_fp_flags ~ mutability : None ~ accept_disposable : false <nl> - ~ has_default : false ~ mode : Typing_defs_core . FPnormal <nl> - ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> - } <nl> - ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | shapes . php line 9 , characters 10 - 22 ) , ( Tunion [ ] ) ) } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | shapes . php line 11 , characters 4 - 41 ) , <nl> - ( Tshape ( Typing_defs_core . Open_shape , <nl> - { ( SFlit_str ( [ 11 : 10 - 13 ] , " x " ) ) - > <nl> - { sft_optional = false ; <nl> - sft_ty = <nl> - ( Rhint ( root | shapes . php line 11 , characters 17 - 21 ) , <nl> - ( Tprim Tfloat ) ) <nl> - } ; <nl> - ( SFlit_str ( [ 11 : 24 - 27 ] , " y " ) ) - > <nl> - { sft_optional = false ; <nl> - sft_ty = <nl> - ( Rhint ( root | shapes . php line 11 , characters 31 - 35 ) , <nl> - ( Tprim Tfloat ) ) <nl> - } } <nl> - ) ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - fe_pos = [ 9 : 10 - 23 ] ; fe_php_std_lib = false } ; <nl> - " \ \ takes_shape " - > <nl> - { Typing_defs . fe_deprecated = None ; <nl> - fe_type = <nl> - ( Rwitness ( root | shapes . php line 5 , characters 10 - 20 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; <nl> - ft_params = <nl> - [ { fp_pos = [ 5 : 56 - 61 ] ; fp_name = ( Some " $ arg1 " ) ; <nl> - fp_type = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | shapes . php line 5 , characters 22 - 54 ) , <nl> - ( Tshape ( Typing_defs_core . Closed_shape , <nl> - { ( SFlit_str ( [ 5 : 28 - 31 ] , " x " ) ) - > <nl> - { sft_optional = false ; <nl> - sft_ty = <nl> - ( Rhint ( root | shapes . php line 5 , characters 35 - 39 ) , <nl> - ( Tprim Tfloat ) ) <nl> - } ; <nl> - ( SFlit_str ( [ 5 : 42 - 45 ] , " y " ) ) - > <nl> - { sft_optional = false ; <nl> - sft_ty = <nl> - ( Rhint ( root | shapes . php line 5 , characters 49 - 53 ) , <nl> - ( Tprim Tfloat ) ) <nl> - } } <nl> - ) ) ) <nl> - } ; <nl> - fp_flags = <nl> - ( make_fp_flags ~ mutability : None ~ accept_disposable : false <nl> - ~ has_default : false ~ mode : Typing_defs_core . FPnormal <nl> - ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> - } <nl> - ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | shapes . php line 5 , characters 10 - 20 ) , ( Tunion [ ] ) ) } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | shapes . php line 5 , characters 64 - 73 ) , <nl> - ( Tapply ( ( [ 5 : 64 - 74 ] , " \ \ Coordinate " ) , [ ] ) ) ) <nl> - } ; <nl> + ( SFlit_str ( [ 3 : 39 - 42 ] , " y " ) ) - > <nl> + { sft_optional = false ; <nl> + sft_ty = <nl> + ( Rhint ( root | shapes . php line 3 , characters 46 - 50 ) , <nl> + ( Tprim Tfloat ) ) <nl> + } } <nl> + ) ) ) <nl> + } ) ) ; <nl> + ( " \ \ takes_shape " , <nl> + ( Shallow_decl_defs . Fun <nl> + { Typing_defs . fe_deprecated = None ; <nl> + fe_type = <nl> + ( Rwitness ( root | shapes . php line 5 , characters 10 - 20 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; <nl> + ft_params = <nl> + [ { fp_pos = [ 5 : 56 - 61 ] ; fp_name = ( Some " $ arg1 " ) ; <nl> + fp_type = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | shapes . php line 5 , characters 22 - 54 ) , <nl> + ( Tshape ( Typing_defs_core . Closed_shape , <nl> + { ( SFlit_str ( [ 5 : 28 - 31 ] , " x " ) ) - > <nl> + { sft_optional = false ; <nl> + sft_ty = <nl> + ( Rhint ( root | shapes . php line 5 , characters 35 - 39 ) , <nl> + ( Tprim Tfloat ) ) <nl> + } ; <nl> + ( SFlit_str ( [ 5 : 42 - 45 ] , " y " ) ) - > <nl> + { sft_optional = false ; <nl> + sft_ty = <nl> + ( Rhint ( root | shapes . php line 5 , characters 49 - 53 ) , <nl> + ( Tprim Tfloat ) ) <nl> + } } <nl> + ) ) ) <nl> + } ; <nl> + fp_flags = <nl> + ( make_fp_flags ~ mutability : None ~ accept_disposable : false <nl> + ~ has_default : false ~ mode : Typing_defs_core . FPnormal <nl> + ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> + } <nl> + ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | shapes . php line 5 , characters 10 - 20 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | shapes . php line 5 , characters 64 - 73 ) , <nl> + ( Tapply ( ( [ 5 : 64 - 74 ] , " \ \ Coordinate " ) , [ ] ) ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + fe_pos = [ 5 : 10 - 21 ] ; fe_php_std_lib = false } ) ) ; <nl> + ( " \ \ returns_shape " , <nl> + ( Shallow_decl_defs . Fun <nl> + { Typing_defs . fe_deprecated = None ; <nl> + fe_type = <nl> + ( Rwitness ( root | shapes . php line 9 , characters 10 - 22 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; <nl> + ft_params = <nl> + [ { fp_pos = [ 10 : 14 - 19 ] ; fp_name = ( Some " $ arg1 " ) ; <nl> + fp_type = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | shapes . php line 10 , characters 3 - 12 ) , <nl> + ( Tapply ( ( [ 10 : 3 - 13 ] , " \ \ Coordinate " ) , [ ] ) ) ) <nl> + } ; <nl> + fp_flags = <nl> + ( make_fp_flags ~ mutability : None ~ accept_disposable : false <nl> + ~ has_default : false ~ mode : Typing_defs_core . FPnormal <nl> + ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> + } <nl> + ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | shapes . php line 9 , characters 10 - 22 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | shapes . php line 11 , characters 4 - 41 ) , <nl> + ( Tshape ( Typing_defs_core . Open_shape , <nl> + { ( SFlit_str ( [ 11 : 10 - 13 ] , " x " ) ) - > <nl> + { sft_optional = false ; <nl> + sft_ty = <nl> + ( Rhint ( root | shapes . php line 11 , characters 17 - 21 ) , <nl> + ( Tprim Tfloat ) ) <nl> + } ; <nl> + ( SFlit_str ( [ 11 : 24 - 27 ] , " y " ) ) - > <nl> + { sft_optional = false ; <nl> + sft_ty = <nl> + ( Rhint ( root | shapes . php line 11 , characters 31 - 35 ) , <nl> + ( Tprim Tfloat ) ) <nl> + } } <nl> + ) ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + fe_pos = [ 9 : 10 - 23 ] ; fe_php_std_lib = false } ) ) ; <nl> + ( " \ \ generic_shape " , <nl> + ( Shallow_decl_defs . Fun <nl> + { Typing_defs . fe_deprecated = None ; <nl> + fe_type = <nl> + ( Rwitness ( root | shapes . php line 15 , characters 10 - 22 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; <nl> + ft_tparams = <nl> + [ { Typing_defs_core . tp_variance = Invariant ; <nl> + tp_name = ( [ 15 : 24 - 25 ] , " T " ) ; tp_tparams = [ ] ; <nl> + tp_constraints = [ ] ; tp_reified = Erased ; <nl> + tp_user_attributes = [ ] } <nl> + ] ; <nl> + ft_where_constraints = [ ] ; <nl> + ft_params = <nl> + [ { fp_pos = [ 15 : 34 - 39 ] ; fp_name = ( Some " $ arg1 " ) ; <nl> + fp_type = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | shapes . php line 15 , characters 27 - 32 ) , <nl> + ( Ttuple <nl> + [ ( Rhint ( root | shapes . php line 15 , characters 28 - 28 ) , <nl> + ( Tgeneric ( " T " , [ ] ) ) ) ; <nl> + ( Rhint ( root | shapes . php line 15 , characters 31 - 31 ) , <nl> + ( Tgeneric ( " T " , [ ] ) ) ) <nl> + ] ) ) <nl> + } ; <nl> + fp_flags = <nl> + ( make_fp_flags ~ mutability : None ~ accept_disposable : false <nl> + ~ has_default : false ~ mode : Typing_defs_core . FPnormal <nl> + ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> + } ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | shapes . php line 15 , characters 10 - 22 ) , ( Tunion [ ] ) ) } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | shapes . php line 15 , characters 42 - 47 ) , <nl> + ( Ttuple <nl> + [ ( Rhint ( root | shapes . php line 15 , characters 43 - 43 ) , <nl> + ( Tgeneric ( " T " , [ ] ) ) ) ; <nl> + ( Rhint ( root | shapes . php line 15 , characters 46 - 46 ) , <nl> + ( Tgeneric ( " T " , [ ] ) ) ) <nl> + ] ) ) <nl> + } ; <nl> ft_flags = <nl> ( make_ft_flags FSync None ~ return_disposable : false <nl> ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - fe_pos = [ 5 : 10 - 21 ] ; fe_php_std_lib = false } } ; <nl> - typedefs = <nl> - { " \ \ Coordinate " - > <nl> - { Typing_defs . td_pos = [ 3 : 6 - 16 ] ; td_vis = Transparent ; td_tparams = [ ] ; <nl> - td_constraint = None ; <nl> - td_type = <nl> - ( Rhint ( root | shapes . php line 3 , characters 19 - 56 ) , <nl> - ( Tshape ( Typing_defs_core . Open_shape , <nl> - { ( SFlit_str ( [ 3 : 25 - 28 ] , " x " ) ) - > <nl> - { sft_optional = false ; <nl> - sft_ty = <nl> - ( Rhint ( root | shapes . php line 3 , characters 32 - 36 ) , ( Tprim Tfloat ) ) <nl> - } ; <nl> - ( SFlit_str ( [ 3 : 39 - 42 ] , " y " ) ) - > <nl> - { sft_optional = false ; <nl> - sft_ty = <nl> - ( Rhint ( root | shapes . php line 3 , characters 46 - 50 ) , ( Tprim Tfloat ) ) <nl> - } } <nl> - ) ) ) <nl> - } ; <nl> - " \ \ TaggedCoordinate " - > <nl> - { Typing_defs . td_pos = [ 19 : 6 - 22 ] ; td_vis = Transparent ; td_tparams = [ ] ; <nl> - td_constraint = None ; <nl> - td_type = <nl> - ( Rhint ( root | shapes . php line 20 , characters 3 - 71 ) , <nl> - ( Tshape ( Typing_defs_core . Closed_shape , <nl> - { ( SFlit_str ( [ 20 : 27 - 34 ] , " coord " ) ) - > <nl> - { sft_optional = false ; <nl> - sft_ty = <nl> - ( Rhint ( root | shapes . php line 20 , characters 38 - 70 ) , <nl> - ( Tshape ( Typing_defs_core . Closed_shape , <nl> - { ( SFlit_str ( [ 20 : 44 - 47 ] , " x " ) ) - > <nl> - { sft_optional = false ; <nl> - sft_ty = <nl> - ( Rhint ( root | shapes . php line 20 , characters 51 - 55 ) , <nl> - ( Tprim Tfloat ) ) <nl> - } ; <nl> - ( SFlit_str ( [ 20 : 58 - 61 ] , " y " ) ) - > <nl> - { sft_optional = false ; <nl> - sft_ty = <nl> - ( Rhint ( root | shapes . php line 20 , characters 65 - 69 ) , <nl> - ( Tprim Tfloat ) ) <nl> - } } <nl> - ) ) ) <nl> - } ; <nl> - ( SFlit_str ( [ 20 : 10 - 15 ] , " tag " ) ) - > <nl> - { sft_optional = true ; <nl> - sft_ty = <nl> - ( Rhint ( root | shapes . php line 20 , characters 19 - 24 ) , <nl> - ( Tprim Tstring ) ) <nl> - } } <nl> - ) ) ) <nl> - } } ; consts = { } ; records = { } <nl> - } <nl> + fe_pos = [ 15 : 10 - 23 ] ; fe_php_std_lib = false } ) ) ; <nl> + ( " \ \ TaggedCoordinate " , <nl> + ( Shallow_decl_defs . Typedef <nl> + { Typing_defs . td_pos = [ 19 : 6 - 22 ] ; td_vis = Transparent ; td_tparams = [ ] ; <nl> + td_constraint = None ; <nl> + td_type = <nl> + ( Rhint ( root | shapes . php line 20 , characters 3 - 71 ) , <nl> + ( Tshape ( Typing_defs_core . Closed_shape , <nl> + { ( SFlit_str ( [ 20 : 27 - 34 ] , " coord " ) ) - > <nl> + { sft_optional = false ; <nl> + sft_ty = <nl> + ( Rhint ( root | shapes . php line 20 , characters 38 - 70 ) , <nl> + ( Tshape ( Typing_defs_core . Closed_shape , <nl> + { ( SFlit_str ( [ 20 : 44 - 47 ] , " x " ) ) - > <nl> + { sft_optional = false ; <nl> + sft_ty = <nl> + ( Rhint ( root | shapes . php line 20 , characters 51 - 55 ) , <nl> + ( Tprim Tfloat ) ) <nl> + } ; <nl> + ( SFlit_str ( [ 20 : 58 - 61 ] , " y " ) ) - > <nl> + { sft_optional = false ; <nl> + sft_ty = <nl> + ( Rhint ( root | shapes . php line 20 , characters 65 - 69 ) , <nl> + ( Tprim Tfloat ) ) <nl> + } } <nl> + ) ) ) <nl> + } ; <nl> + ( SFlit_str ( [ 20 : 10 - 15 ] , " tag " ) ) - > <nl> + { sft_optional = true ; <nl> + sft_ty = <nl> + ( Rhint ( root | shapes . php line 20 , characters 19 - 24 ) , <nl> + ( Tprim Tstring ) ) <nl> + } } <nl> + ) ) ) <nl> + } ) ) <nl> + ] <nl> <nl> They matched ! <nl> mmm a / hphp / hack / test / decl / soft_type_hint . php . exp <nl> ppp b / hphp / hack / test / decl / soft_type_hint . php . exp <nl> <nl> - Parsed decls : <nl> - <nl> - { classes = { } ; <nl> - funs = <nl> - { " \ \ f " - > <nl> - { Typing_defs . fe_deprecated = None ; <nl> - fe_type = <nl> - ( Rwitness ( root | soft_type_hint . php line 3 , characters 10 - 10 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; <nl> - ft_params = <nl> - [ { fp_pos = [ 3 : 27 - 29 ] ; fp_name = ( Some " $ x " ) ; <nl> - fp_type = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | soft_type_hint . php line 3 , characters 23 - 25 ) , <nl> - ( Tprim Tint ) ) <nl> - } ; <nl> - fp_flags = <nl> - ( make_fp_flags ~ mutability : None ~ accept_disposable : false <nl> - ~ has_default : false ~ mode : Typing_defs_core . FPnormal <nl> - ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> - } <nl> - ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | soft_type_hint . php line 3 , characters 10 - 10 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | soft_type_hint . php line 3 , characters 32 - 45 ) , <nl> - ( Tprim Tint ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - fe_pos = [ 3 : 10 - 11 ] ; fe_php_std_lib = false } } ; <nl> - typedefs = { } ; consts = { } ; records = { } } <nl> + [ ( " \ \ f " , <nl> + ( Shallow_decl_defs . Fun <nl> + { Typing_defs . fe_deprecated = None ; <nl> + fe_type = <nl> + ( Rwitness ( root | soft_type_hint . php line 3 , characters 10 - 10 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; <nl> + ft_params = <nl> + [ { fp_pos = [ 3 : 27 - 29 ] ; fp_name = ( Some " $ x " ) ; <nl> + fp_type = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | soft_type_hint . php line 3 , characters 23 - 25 ) , <nl> + ( Tprim Tint ) ) <nl> + } ; <nl> + fp_flags = <nl> + ( make_fp_flags ~ mutability : None ~ accept_disposable : false <nl> + ~ has_default : false ~ mode : Typing_defs_core . FPnormal <nl> + ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> + } <nl> + ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | soft_type_hint . php line 3 , characters 10 - 10 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | soft_type_hint . php line 3 , characters 32 - 45 ) , <nl> + ( Tprim Tint ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + fe_pos = [ 3 : 10 - 11 ] ; fe_php_std_lib = false } ) ) <nl> + ] <nl> <nl> They matched ! <nl> mmm a / hphp / hack / test / decl / tparams_on_class_and_method . php . exp <nl> ppp b / hphp / hack / test / decl / tparams_on_class_and_method . php . exp <nl> <nl> - Parsed decls : <nl> - <nl> - { classes = <nl> - { " \ \ C " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> - sc_name = ( [ 3 : 7 - 8 ] , " \ \ C " ) ; <nl> - sc_tparams = <nl> - [ { Typing_defs_core . tp_variance = Invariant ; <nl> - tp_name = ( [ 3 : 9 - 11 ] , " Ta " ) ; tp_tparams = [ ] ; tp_constraints = [ ] ; <nl> - tp_reified = Erased ; tp_user_attributes = [ ] } ; <nl> - { Typing_defs_core . tp_variance = Invariant ; <nl> - tp_name = ( [ 3 : 13 - 15 ] , " Tb " ) ; tp_tparams = [ ] ; tp_constraints = [ ] ; <nl> - tp_reified = Erased ; tp_user_attributes = [ ] } <nl> - ] ; <nl> - sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> - sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> - sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; <nl> - sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; sc_constructor = None ; <nl> - sc_static_methods = [ ] ; <nl> - sc_methods = <nl> - [ { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> - sm_memoizelsb = false ; sm_name = ( [ 4 : 19 - 20 ] , " f " ) ; <nl> - sm_override = false ; sm_dynamicallycallable = false ; <nl> - sm_reactivity = None ; <nl> - sm_type = <nl> - ( Rwitness ( root | tparams_on_class_and_method . php line 4 , characters 19 - 19 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; <nl> - ft_tparams = <nl> - [ { Typing_defs_core . tp_variance = Invariant ; <nl> - tp_name = ( [ 4 : 21 - 23 ] , " Tc " ) ; tp_tparams = [ ] ; <nl> - tp_constraints = [ ] ; tp_reified = Erased ; <nl> - tp_user_attributes = [ ] } <nl> - ] ; <nl> - ft_where_constraints = [ ] ; <nl> - ft_params = <nl> - [ { fp_pos = [ 4 : 28 - 30 ] ; fp_name = ( Some " $ a " ) ; <nl> + [ ( " \ \ C " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> + sc_name = ( [ 3 : 7 - 8 ] , " \ \ C " ) ; <nl> + sc_tparams = <nl> + [ { Typing_defs_core . tp_variance = Invariant ; <nl> + tp_name = ( [ 3 : 9 - 11 ] , " Ta " ) ; tp_tparams = [ ] ; tp_constraints = [ ] ; <nl> + tp_reified = Erased ; tp_user_attributes = [ ] } ; <nl> + { Typing_defs_core . tp_variance = Invariant ; <nl> + tp_name = ( [ 3 : 13 - 15 ] , " Tb " ) ; tp_tparams = [ ] ; tp_constraints = [ ] ; <nl> + tp_reified = Erased ; tp_user_attributes = [ ] } <nl> + ] ; <nl> + sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> + sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> + sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; <nl> + sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> + sc_constructor = None ; sc_static_methods = [ ] ; <nl> + sc_methods = <nl> + [ { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> + sm_memoizelsb = false ; sm_name = ( [ 4 : 19 - 20 ] , " f " ) ; <nl> + sm_override = false ; sm_dynamicallycallable = false ; <nl> + sm_reactivity = None ; <nl> + sm_type = <nl> + ( Rwitness ( root | tparams_on_class_and_method . php line 4 , characters 19 - 19 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; <nl> + ft_tparams = <nl> + [ { Typing_defs_core . tp_variance = Invariant ; <nl> + tp_name = ( [ 4 : 21 - 23 ] , " Tc " ) ; tp_tparams = [ ] ; <nl> + tp_constraints = [ ] ; tp_reified = Erased ; <nl> + tp_user_attributes = [ ] } <nl> + ] ; <nl> + ft_where_constraints = [ ] ; <nl> + ft_params = <nl> + [ { fp_pos = [ 4 : 28 - 30 ] ; fp_name = ( Some " $ a " ) ; <nl> + fp_type = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | tparams_on_class_and_method . php line 4 , characters 25 - 26 ) , <nl> + ( Tgeneric ( " Ta " , [ ] ) ) ) <nl> + } ; <nl> + fp_flags = <nl> + ( make_fp_flags ~ mutability : None ~ accept_disposable : false <nl> + ~ has_default : false ~ mode : Typing_defs_core . FPnormal <nl> + ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> + } ; <nl> + { fp_pos = [ 4 : 35 - 37 ] ; fp_name = ( Some " $ c " ) ; <nl> fp_type = <nl> { et_enforced = false ; <nl> et_type = <nl> - ( Rhint ( root | tparams_on_class_and_method . php line 4 , characters 25 - 26 ) , <nl> - ( Tgeneric ( " Ta " , [ ] ) ) ) <nl> - } ; <nl> - fp_flags = <nl> - ( make_fp_flags ~ mutability : None ~ accept_disposable : false <nl> - ~ has_default : false ~ mode : Typing_defs_core . FPnormal <nl> - ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> + ( Rhint ( root | tparams_on_class_and_method . php line 4 , characters 32 - 33 ) , <nl> + ( Tgeneric ( " Tc " , [ ] ) ) ) <nl> } ; <nl> - { fp_pos = [ 4 : 35 - 37 ] ; fp_name = ( Some " $ c " ) ; <nl> - fp_type = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | tparams_on_class_and_method . php line 4 , characters 32 - 33 ) , <nl> - ( Tgeneric ( " Tc " , [ ] ) ) ) <nl> - } ; <nl> - fp_flags = <nl> - ( make_fp_flags ~ mutability : None ~ accept_disposable : false <nl> - ~ has_default : false ~ mode : Typing_defs_core . FPnormal <nl> - ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> - } ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | tparams_on_class_and_method . php line 4 , characters 19 - 19 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | tparams_on_class_and_method . php line 4 , characters 40 - 47 ) , <nl> - ( Ttuple <nl> - [ ( Rhint ( root | tparams_on_class_and_method . php line 4 , characters 41 - 42 ) , <nl> - ( Tgeneric ( " Ta " , [ ] ) ) ) ; <nl> - ( Rhint ( root | tparams_on_class_and_method . php line 4 , characters 45 - 46 ) , <nl> - ( Tgeneric ( " Tc " , [ ] ) ) ) <nl> - ] ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - sm_visibility = Public ; sm_deprecated = None } ; <nl> - { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> - sm_memoizelsb = false ; sm_name = ( [ 8 : 19 - 20 ] , " g " ) ; sm_override = false ; <nl> - sm_dynamicallycallable = false ; sm_reactivity = None ; <nl> - sm_type = <nl> - ( Rwitness ( root | tparams_on_class_and_method . php line 8 , characters 19 - 19 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; <nl> - ft_tparams = <nl> - [ { Typing_defs_core . tp_variance = Invariant ; <nl> - tp_name = ( [ 8 : 21 - 23 ] , " Td " ) ; tp_tparams = [ ] ; <nl> - tp_constraints = [ ] ; tp_reified = Erased ; <nl> - tp_user_attributes = [ ] } <nl> - ] ; <nl> - ft_where_constraints = [ ] ; <nl> - ft_params = <nl> - [ { fp_pos = [ 8 : 28 - 30 ] ; fp_name = ( Some " $ b " ) ; <nl> - fp_type = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | tparams_on_class_and_method . php line 8 , characters 25 - 26 ) , <nl> - ( Tgeneric ( " Tb " , [ ] ) ) ) <nl> - } ; <nl> - fp_flags = <nl> - ( make_fp_flags ~ mutability : None ~ accept_disposable : false <nl> - ~ has_default : false ~ mode : Typing_defs_core . FPnormal <nl> - ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> - } ; <nl> - { fp_pos = [ 8 : 35 - 37 ] ; fp_name = ( Some " $ d " ) ; <nl> - fp_type = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | tparams_on_class_and_method . php line 8 , characters 32 - 33 ) , <nl> - ( Tgeneric ( " Td " , [ ] ) ) ) <nl> - } ; <nl> + fp_flags = <nl> + ( make_fp_flags ~ mutability : None ~ accept_disposable : false <nl> + ~ has_default : false ~ mode : Typing_defs_core . FPnormal <nl> + ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> + } ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | tparams_on_class_and_method . php line 4 , characters 19 - 19 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | tparams_on_class_and_method . php line 4 , characters 40 - 47 ) , <nl> + ( Ttuple <nl> + [ ( Rhint ( root | tparams_on_class_and_method . php line 4 , characters 41 - 42 ) , <nl> + ( Tgeneric ( " Ta " , [ ] ) ) ) ; <nl> + ( Rhint ( root | tparams_on_class_and_method . php line 4 , characters 45 - 46 ) , <nl> + ( Tgeneric ( " Tc " , [ ] ) ) ) <nl> + ] ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + sm_visibility = Public ; sm_deprecated = None } ; <nl> + { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> + sm_memoizelsb = false ; sm_name = ( [ 8 : 19 - 20 ] , " g " ) ; sm_override = false ; <nl> + sm_dynamicallycallable = false ; sm_reactivity = None ; <nl> + sm_type = <nl> + ( Rwitness ( root | tparams_on_class_and_method . php line 8 , characters 19 - 19 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; <nl> + ft_tparams = <nl> + [ { Typing_defs_core . tp_variance = Invariant ; <nl> + tp_name = ( [ 8 : 21 - 23 ] , " Td " ) ; tp_tparams = [ ] ; <nl> + tp_constraints = [ ] ; tp_reified = Erased ; <nl> + tp_user_attributes = [ ] } <nl> + ] ; <nl> + ft_where_constraints = [ ] ; <nl> + ft_params = <nl> + [ { fp_pos = [ 8 : 28 - 30 ] ; fp_name = ( Some " $ b " ) ; <nl> + fp_type = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | tparams_on_class_and_method . php line 8 , characters 25 - 26 ) , <nl> + ( Tgeneric ( " Tb " , [ ] ) ) ) <nl> + } ; <nl> fp_flags = <nl> ( make_fp_flags ~ mutability : None ~ accept_disposable : false <nl> ~ has_default : false ~ mode : Typing_defs_core . FPnormal <nl> ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> - } ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | tparams_on_class_and_method . php line 8 , characters 19 - 19 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | tparams_on_class_and_method . php line 8 , characters 40 - 47 ) , <nl> - ( Ttuple <nl> - [ ( Rhint ( root | tparams_on_class_and_method . php line 8 , characters 41 - 42 ) , <nl> - ( Tgeneric ( " Tb " , [ ] ) ) ) ; <nl> - ( Rhint ( root | tparams_on_class_and_method . php line 8 , characters 45 - 46 ) , <nl> - ( Tgeneric ( " Td " , [ ] ) ) ) <nl> - ] ) ) <nl> + } ; <nl> + { fp_pos = [ 8 : 35 - 37 ] ; fp_name = ( Some " $ d " ) ; <nl> + fp_type = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | tparams_on_class_and_method . php line 8 , characters 32 - 33 ) , <nl> + ( Tgeneric ( " Td " , [ ] ) ) ) <nl> + } ; <nl> + fp_flags = <nl> + ( make_fp_flags ~ mutability : None ~ accept_disposable : false <nl> + ~ has_default : false ~ mode : Typing_defs_core . FPnormal <nl> + ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> + } ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | tparams_on_class_and_method . php line 8 , characters 19 - 19 ) , <nl> + ( Tunion [ ] ) ) <nl> } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | tparams_on_class_and_method . php line 8 , characters 40 - 47 ) , <nl> + ( Ttuple <nl> + [ ( Rhint ( root | tparams_on_class_and_method . php line 8 , characters 41 - 42 ) , <nl> + ( Tgeneric ( " Tb " , [ ] ) ) ) ; <nl> + ( Rhint ( root | tparams_on_class_and_method . php line 8 , characters 45 - 46 ) , <nl> + ( Tgeneric ( " Td " , [ ] ) ) ) <nl> + ] ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false ~ returns_mutable : false <nl> + ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> sm_visibility = Public ; sm_deprecated = None } ] ; sc_user_attributes = [ ] ; <nl> - sc_enum_type = None } } ; funs = { } ; typedefs = { } ; consts = { } ; records = { } <nl> - } <nl> + sc_enum_type = None } ) ) <nl> + ] <nl> <nl> They matched ! <nl> mmm a / hphp / hack / test / decl / traits . php . exp <nl> ppp b / hphp / hack / test / decl / traits . php . exp <nl> <nl> - Parsed decls : <nl> - <nl> - { classes = <nl> - { " \ \ MyTraitUsingClass " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> - sc_name = ( [ 17 : 7 - 24 ] , " \ \ MyTraitUsingClass " ) ; sc_tparams = [ ] ; <nl> - sc_where_constraints = [ ] ; sc_extends = [ ] ; <nl> - sc_uses = <nl> - [ ( Rhint ( root | traits . php line 18 , characters 7 - 15 ) , <nl> - ( Tapply ( ( [ 18 : 7 - 16 ] , " \ \ TMyTrait2 " ) , [ ] ) ) ) ; <nl> - ( Rhint ( root | traits . php line 19 , characters 7 - 15 ) , <nl> - ( Tapply ( ( [ 19 : 7 - 16 ] , " \ \ TMyTrait3 " ) , [ ] ) ) ) <nl> - ] ; <nl> - sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> - sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; <nl> - sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; sc_constructor = None ; <nl> - sc_static_methods = [ ] ; sc_methods = [ ] ; sc_user_attributes = [ ] ; <nl> - sc_enum_type = None } ; <nl> - " \ \ TMyTrait " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Ctrait ; <nl> - sc_name = ( [ 3 : 7 - 15 ] , " \ \ TMyTrait " ) ; sc_tparams = [ ] ; <nl> - sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> - sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> - sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; <nl> - sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; sc_constructor = None ; <nl> - sc_static_methods = [ ] ; <nl> - sc_methods = <nl> - [ { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> - sm_memoizelsb = false ; sm_name = ( [ 4 : 19 - 28 ] , " doNothing " ) ; <nl> - sm_override = false ; sm_dynamicallycallable = false ; <nl> - sm_reactivity = None ; <nl> - sm_type = <nl> - ( Rwitness ( root | traits . php line 4 , characters 19 - 27 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | traits . php line 4 , characters 19 - 27 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | traits . php line 4 , characters 32 - 35 ) , <nl> - ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } <nl> - } ) ) ; <nl> - sm_visibility = Public ; sm_deprecated = None } <nl> - ] ; <nl> - sc_user_attributes = [ ] ; sc_enum_type = None } ; <nl> - " \ \ TMyTrait2 " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Ctrait ; <nl> - sc_name = ( [ 7 : 7 - 16 ] , " \ \ TMyTrait2 " ) ; sc_tparams = [ ] ; <nl> - sc_where_constraints = [ ] ; sc_extends = [ ] ; <nl> - sc_uses = <nl> - [ ( Rhint ( root | traits . php line 8 , characters 7 - 14 ) , <nl> - ( Tapply ( ( [ 8 : 7 - 15 ] , " \ \ TMyTrait " ) , [ ] ) ) ) ] ; <nl> - sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> - sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; <nl> - sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; sc_constructor = None ; <nl> - sc_static_methods = [ ] ; <nl> - sc_methods = <nl> - [ { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> - sm_memoizelsb = false ; sm_name = ( [ 10 : 19 - 32 ] , " doMoreNothing " ) ; <nl> - sm_override = false ; sm_dynamicallycallable = false ; <nl> - sm_reactivity = None ; <nl> - sm_type = <nl> - ( Rwitness ( root | traits . php line 10 , characters 19 - 31 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | traits . php line 10 , characters 19 - 31 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | traits . php line 10 , characters 36 - 39 ) , <nl> - ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } <nl> - } ) ) ; <nl> - sm_visibility = Public ; sm_deprecated = None } <nl> - ] ; <nl> - sc_user_attributes = [ ] ; sc_enum_type = None } ; <nl> - " \ \ TMyTrait3 " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Ctrait ; <nl> - sc_name = ( [ 13 : 7 - 16 ] , " \ \ TMyTrait3 " ) ; sc_tparams = [ ] ; <nl> - sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> - sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> - sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; <nl> - sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; sc_constructor = None ; <nl> - sc_static_methods = [ ] ; <nl> - sc_methods = <nl> - [ { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> - sm_memoizelsb = false ; sm_name = ( [ 14 : 19 - 35 ] , " doYetMoreNothing " ) ; <nl> - sm_override = false ; sm_dynamicallycallable = false ; <nl> - sm_reactivity = None ; <nl> - sm_type = <nl> - ( Rwitness ( root | traits . php line 14 , characters 19 - 34 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | traits . php line 14 , characters 19 - 34 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | traits . php line 14 , characters 39 - 42 ) , <nl> - ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } <nl> - } ) ) ; <nl> - sm_visibility = Public ; sm_deprecated = None } <nl> - ] ; <nl> - sc_user_attributes = [ ] ; sc_enum_type = None } } ; <nl> - funs = { } ; typedefs = { } ; consts = { } ; records = { } } <nl> + [ ( " \ \ TMyTrait " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Ctrait ; <nl> + sc_name = ( [ 3 : 7 - 15 ] , " \ \ TMyTrait " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> + sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> + sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; <nl> + sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> + sc_constructor = None ; sc_static_methods = [ ] ; <nl> + sc_methods = <nl> + [ { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> + sm_memoizelsb = false ; sm_name = ( [ 4 : 19 - 28 ] , " doNothing " ) ; <nl> + sm_override = false ; sm_dynamicallycallable = false ; <nl> + sm_reactivity = None ; <nl> + sm_type = <nl> + ( Rwitness ( root | traits . php line 4 , characters 19 - 27 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | traits . php line 4 , characters 19 - 27 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | traits . php line 4 , characters 32 - 35 ) , <nl> + ( Tprim Tvoid ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } <nl> + } ) ) ; <nl> + sm_visibility = Public ; sm_deprecated = None } <nl> + ] ; <nl> + sc_user_attributes = [ ] ; sc_enum_type = None } ) ) ; <nl> + ( " \ \ TMyTrait2 " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Ctrait ; <nl> + sc_name = ( [ 7 : 7 - 16 ] , " \ \ TMyTrait2 " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = [ ] ; sc_extends = [ ] ; <nl> + sc_uses = <nl> + [ ( Rhint ( root | traits . php line 8 , characters 7 - 14 ) , <nl> + ( Tapply ( ( [ 8 : 7 - 15 ] , " \ \ TMyTrait " ) , [ ] ) ) ) ] ; <nl> + sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> + sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; <nl> + sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> + sc_constructor = None ; sc_static_methods = [ ] ; <nl> + sc_methods = <nl> + [ { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> + sm_memoizelsb = false ; sm_name = ( [ 10 : 19 - 32 ] , " doMoreNothing " ) ; <nl> + sm_override = false ; sm_dynamicallycallable = false ; <nl> + sm_reactivity = None ; <nl> + sm_type = <nl> + ( Rwitness ( root | traits . php line 10 , characters 19 - 31 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | traits . php line 10 , characters 19 - 31 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | traits . php line 10 , characters 36 - 39 ) , <nl> + ( Tprim Tvoid ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; <nl> + ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + sm_visibility = Public ; sm_deprecated = None } <nl> + ] ; <nl> + sc_user_attributes = [ ] ; sc_enum_type = None } ) ) ; <nl> + ( " \ \ TMyTrait3 " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Ctrait ; <nl> + sc_name = ( [ 13 : 7 - 16 ] , " \ \ TMyTrait3 " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> + sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> + sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; <nl> + sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> + sc_constructor = None ; sc_static_methods = [ ] ; <nl> + sc_methods = <nl> + [ { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> + sm_memoizelsb = false ; sm_name = ( [ 14 : 19 - 35 ] , " doYetMoreNothing " ) ; <nl> + sm_override = false ; sm_dynamicallycallable = false ; <nl> + sm_reactivity = None ; <nl> + sm_type = <nl> + ( Rwitness ( root | traits . php line 14 , characters 19 - 34 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | traits . php line 14 , characters 19 - 34 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | traits . php line 14 , characters 39 - 42 ) , <nl> + ( Tprim Tvoid ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; <nl> + ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + sm_visibility = Public ; sm_deprecated = None } <nl> + ] ; <nl> + sc_user_attributes = [ ] ; sc_enum_type = None } ) ) ; <nl> + ( " \ \ MyTraitUsingClass " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> + sc_name = ( [ 17 : 7 - 24 ] , " \ \ MyTraitUsingClass " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = [ ] ; sc_extends = [ ] ; <nl> + sc_uses = <nl> + [ ( Rhint ( root | traits . php line 18 , characters 7 - 15 ) , <nl> + ( Tapply ( ( [ 18 : 7 - 16 ] , " \ \ TMyTrait2 " ) , [ ] ) ) ) ; <nl> + ( Rhint ( root | traits . php line 19 , characters 7 - 15 ) , <nl> + ( Tapply ( ( [ 19 : 7 - 16 ] , " \ \ TMyTrait3 " ) , [ ] ) ) ) <nl> + ] ; <nl> + sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> + sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; <nl> + sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> + sc_constructor = None ; sc_static_methods = [ ] ; sc_methods = [ ] ; <nl> + sc_user_attributes = [ ] ; sc_enum_type = None } ) ) <nl> + ] <nl> <nl> They matched ! <nl> mmm a / hphp / hack / test / decl / tuples . php . exp <nl> ppp b / hphp / hack / test / decl / tuples . php . exp <nl> <nl> - Parsed decls : <nl> - <nl> - { classes = { } ; <nl> - funs = <nl> - { " \ \ generic_tuple " - > <nl> - { Typing_defs . fe_deprecated = None ; <nl> - fe_type = <nl> - ( Rwitness ( root | tuples . php line 13 , characters 10 - 22 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; <nl> - ft_tparams = <nl> - [ { Typing_defs_core . tp_variance = Invariant ; <nl> - tp_name = ( [ 13 : 24 - 25 ] , " T " ) ; tp_tparams = [ ] ; <nl> - tp_constraints = [ ] ; tp_reified = Erased ; <nl> - tp_user_attributes = [ ] } <nl> - ] ; <nl> - ft_where_constraints = [ ] ; <nl> - ft_params = <nl> - [ { fp_pos = [ 13 : 34 - 39 ] ; fp_name = ( Some " $ arg1 " ) ; <nl> - fp_type = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | tuples . php line 13 , characters 27 - 32 ) , <nl> - ( Ttuple <nl> - [ ( Rhint ( root | tuples . php line 13 , characters 28 - 28 ) , <nl> - ( Tgeneric ( " T " , [ ] ) ) ) ; <nl> - ( Rhint ( root | tuples . php line 13 , characters 31 - 31 ) , <nl> - ( Tgeneric ( " T " , [ ] ) ) ) <nl> - ] ) ) <nl> - } ; <nl> - fp_flags = <nl> - ( make_fp_flags ~ mutability : None ~ accept_disposable : false <nl> - ~ has_default : false ~ mode : Typing_defs_core . FPnormal <nl> - ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> - } ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | tuples . php line 13 , characters 10 - 22 ) , ( Tunion [ ] ) ) } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | tuples . php line 13 , characters 42 - 47 ) , <nl> - ( Ttuple <nl> - [ ( Rhint ( root | tuples . php line 13 , characters 43 - 43 ) , <nl> - ( Tgeneric ( " T " , [ ] ) ) ) ; <nl> - ( Rhint ( root | tuples . php line 13 , characters 46 - 46 ) , <nl> - ( Tgeneric ( " T " , [ ] ) ) ) <nl> - ] ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - fe_pos = [ 13 : 10 - 23 ] ; fe_php_std_lib = false } ; <nl> - " \ \ returns_tuple " - > <nl> - { Typing_defs . fe_deprecated = None ; <nl> - fe_type = <nl> - ( Rwitness ( root | tuples . php line 9 , characters 10 - 22 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; <nl> - ft_params = <nl> - [ { fp_pos = [ 9 : 35 - 40 ] ; fp_name = ( Some " $ arg1 " ) ; <nl> - fp_type = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | tuples . php line 9 , characters 24 - 33 ) , <nl> - ( Tapply ( ( [ 9 : 24 - 34 ] , " \ \ Coordinate " ) , [ ] ) ) ) <nl> - } ; <nl> - fp_flags = <nl> - ( make_fp_flags ~ mutability : None ~ accept_disposable : false <nl> - ~ has_default : false ~ mode : Typing_defs_core . FPnormal <nl> - ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> - } <nl> - ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | tuples . php line 9 , characters 10 - 22 ) , ( Tunion [ ] ) ) } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | tuples . php line 9 , characters 43 - 56 ) , <nl> - ( Ttuple <nl> - [ ( Rhint ( root | tuples . php line 9 , characters 44 - 48 ) , <nl> - ( Tprim Tfloat ) ) ; <nl> - ( Rhint ( root | tuples . php line 9 , characters 51 - 55 ) , <nl> - ( Tprim Tfloat ) ) <nl> - ] ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - fe_pos = [ 9 : 10 - 23 ] ; fe_php_std_lib = false } ; <nl> - " \ \ takes_tuple " - > <nl> - { Typing_defs . fe_deprecated = None ; <nl> - fe_type = <nl> - ( Rwitness ( root | tuples . php line 5 , characters 10 - 20 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; <nl> - ft_params = <nl> - [ { fp_pos = [ 5 : 37 - 42 ] ; fp_name = ( Some " $ arg1 " ) ; <nl> - fp_type = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | tuples . php line 5 , characters 22 - 35 ) , <nl> - ( Ttuple <nl> - [ ( Rhint ( root | tuples . php line 5 , characters 23 - 27 ) , <nl> - ( Tprim Tfloat ) ) ; <nl> - ( Rhint ( root | tuples . php line 5 , characters 30 - 34 ) , <nl> - ( Tprim Tfloat ) ) <nl> - ] ) ) <nl> - } ; <nl> - fp_flags = <nl> - ( make_fp_flags ~ mutability : None ~ accept_disposable : false <nl> - ~ has_default : false ~ mode : Typing_defs_core . FPnormal <nl> - ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> - } <nl> - ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | tuples . php line 5 , characters 10 - 20 ) , ( Tunion [ ] ) ) } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | tuples . php line 5 , characters 45 - 54 ) , <nl> - ( Tapply ( ( [ 5 : 45 - 55 ] , " \ \ Coordinate " ) , [ ] ) ) ) <nl> - } ; <nl> + [ ( " \ \ Coordinate " , <nl> + ( Shallow_decl_defs . Typedef <nl> + { Typing_defs . td_pos = [ 3 : 6 - 16 ] ; td_vis = Transparent ; td_tparams = [ ] ; <nl> + td_constraint = None ; <nl> + td_type = <nl> + ( Rhint ( root | tuples . php line 3 , characters 19 - 32 ) , <nl> + ( Ttuple <nl> + [ ( Rhint ( root | tuples . php line 3 , characters 20 - 24 ) , ( Tprim Tfloat ) ) ; <nl> + ( Rhint ( root | tuples . php line 3 , characters 27 - 31 ) , <nl> + ( Tprim Tfloat ) ) <nl> + ] ) ) <nl> + } ) ) ; <nl> + ( " \ \ takes_tuple " , <nl> + ( Shallow_decl_defs . Fun <nl> + { Typing_defs . fe_deprecated = None ; <nl> + fe_type = <nl> + ( Rwitness ( root | tuples . php line 5 , characters 10 - 20 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; <nl> + ft_params = <nl> + [ { fp_pos = [ 5 : 37 - 42 ] ; fp_name = ( Some " $ arg1 " ) ; <nl> + fp_type = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | tuples . php line 5 , characters 22 - 35 ) , <nl> + ( Ttuple <nl> + [ ( Rhint ( root | tuples . php line 5 , characters 23 - 27 ) , <nl> + ( Tprim Tfloat ) ) ; <nl> + ( Rhint ( root | tuples . php line 5 , characters 30 - 34 ) , <nl> + ( Tprim Tfloat ) ) <nl> + ] ) ) <nl> + } ; <nl> + fp_flags = <nl> + ( make_fp_flags ~ mutability : None ~ accept_disposable : false <nl> + ~ has_default : false ~ mode : Typing_defs_core . FPnormal <nl> + ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> + } <nl> + ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | tuples . php line 5 , characters 10 - 20 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | tuples . php line 5 , characters 45 - 54 ) , <nl> + ( Tapply ( ( [ 5 : 45 - 55 ] , " \ \ Coordinate " ) , [ ] ) ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + fe_pos = [ 5 : 10 - 21 ] ; fe_php_std_lib = false } ) ) ; <nl> + ( " \ \ returns_tuple " , <nl> + ( Shallow_decl_defs . Fun <nl> + { Typing_defs . fe_deprecated = None ; <nl> + fe_type = <nl> + ( Rwitness ( root | tuples . php line 9 , characters 10 - 22 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; <nl> + ft_params = <nl> + [ { fp_pos = [ 9 : 35 - 40 ] ; fp_name = ( Some " $ arg1 " ) ; <nl> + fp_type = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | tuples . php line 9 , characters 24 - 33 ) , <nl> + ( Tapply ( ( [ 9 : 24 - 34 ] , " \ \ Coordinate " ) , [ ] ) ) ) <nl> + } ; <nl> + fp_flags = <nl> + ( make_fp_flags ~ mutability : None ~ accept_disposable : false <nl> + ~ has_default : false ~ mode : Typing_defs_core . FPnormal <nl> + ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> + } <nl> + ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | tuples . php line 9 , characters 10 - 22 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | tuples . php line 9 , characters 43 - 56 ) , <nl> + ( Ttuple <nl> + [ ( Rhint ( root | tuples . php line 9 , characters 44 - 48 ) , <nl> + ( Tprim Tfloat ) ) ; <nl> + ( Rhint ( root | tuples . php line 9 , characters 51 - 55 ) , <nl> + ( Tprim Tfloat ) ) <nl> + ] ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + fe_pos = [ 9 : 10 - 23 ] ; fe_php_std_lib = false } ) ) ; <nl> + ( " \ \ generic_tuple " , <nl> + ( Shallow_decl_defs . Fun <nl> + { Typing_defs . fe_deprecated = None ; <nl> + fe_type = <nl> + ( Rwitness ( root | tuples . php line 13 , characters 10 - 22 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; <nl> + ft_tparams = <nl> + [ { Typing_defs_core . tp_variance = Invariant ; <nl> + tp_name = ( [ 13 : 24 - 25 ] , " T " ) ; tp_tparams = [ ] ; <nl> + tp_constraints = [ ] ; tp_reified = Erased ; <nl> + tp_user_attributes = [ ] } <nl> + ] ; <nl> + ft_where_constraints = [ ] ; <nl> + ft_params = <nl> + [ { fp_pos = [ 13 : 34 - 39 ] ; fp_name = ( Some " $ arg1 " ) ; <nl> + fp_type = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | tuples . php line 13 , characters 27 - 32 ) , <nl> + ( Ttuple <nl> + [ ( Rhint ( root | tuples . php line 13 , characters 28 - 28 ) , <nl> + ( Tgeneric ( " T " , [ ] ) ) ) ; <nl> + ( Rhint ( root | tuples . php line 13 , characters 31 - 31 ) , <nl> + ( Tgeneric ( " T " , [ ] ) ) ) <nl> + ] ) ) <nl> + } ; <nl> + fp_flags = <nl> + ( make_fp_flags ~ mutability : None ~ accept_disposable : false <nl> + ~ has_default : false ~ mode : Typing_defs_core . FPnormal <nl> + ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> + } ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | tuples . php line 13 , characters 10 - 22 ) , ( Tunion [ ] ) ) } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | tuples . php line 13 , characters 42 - 47 ) , <nl> + ( Ttuple <nl> + [ ( Rhint ( root | tuples . php line 13 , characters 43 - 43 ) , <nl> + ( Tgeneric ( " T " , [ ] ) ) ) ; <nl> + ( Rhint ( root | tuples . php line 13 , characters 46 - 46 ) , <nl> + ( Tgeneric ( " T " , [ ] ) ) ) <nl> + ] ) ) <nl> + } ; <nl> ft_flags = <nl> ( make_ft_flags FSync None ~ return_disposable : false <nl> ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - fe_pos = [ 5 : 10 - 21 ] ; fe_php_std_lib = false } } ; <nl> - typedefs = <nl> - { " \ \ Coordinate " - > <nl> - { Typing_defs . td_pos = [ 3 : 6 - 16 ] ; td_vis = Transparent ; td_tparams = [ ] ; <nl> - td_constraint = None ; <nl> - td_type = <nl> - ( Rhint ( root | tuples . php line 3 , characters 19 - 32 ) , <nl> - ( Ttuple <nl> - [ ( Rhint ( root | tuples . php line 3 , characters 20 - 24 ) , ( Tprim Tfloat ) ) ; <nl> - ( Rhint ( root | tuples . php line 3 , characters 27 - 31 ) , ( Tprim Tfloat ) ) ] ) ) <nl> - } } ; consts = { } ; records = { } <nl> - } <nl> + fe_pos = [ 13 : 10 - 23 ] ; fe_php_std_lib = false } ) ) <nl> + ] <nl> <nl> They matched ! <nl> mmm a / hphp / hack / test / decl / type_param_attrs . php . exp <nl> ppp b / hphp / hack / test / decl / type_param_attrs . php . exp <nl> <nl> - Parsed decls : <nl> - <nl> - { classes = <nl> - { " \ \ A " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> - sc_name = ( [ 3 : 7 - 8 ] , " \ \ A " ) ; sc_tparams = [ ] ; sc_where_constraints = [ ] ; <nl> - sc_extends = [ ] ; sc_uses = [ ] ; sc_xhp_attr_uses = [ ] ; <nl> - sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> - sc_implements = <nl> - [ ( Rhint ( root | type_param_attrs . php line 3 , characters 20 - 44 ) , <nl> - ( Tapply ( ( [ 3 : 20 - 45 ] , " \ \ HH \ \ TypeParameterAttribute " ) , [ ] ) ) ) ] ; <nl> - sc_consts = [ ] ; sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; sc_props = [ ] ; <nl> - sc_sprops = [ ] ; <nl> - sc_constructor = <nl> - ( Some { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> - sm_memoizelsb = false ; sm_name = ( [ 4 : 19 - 30 ] , " __construct " ) ; <nl> - sm_override = false ; sm_dynamicallycallable = false ; <nl> - sm_reactivity = None ; <nl> - sm_type = <nl> - ( Rwitness ( root | type_param_attrs . php line 4 , characters 19 - 29 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | type_param_attrs . php line 4 , characters 19 - 29 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rwitness ( root | type_param_attrs . php line 4 , characters 19 - 29 ) , <nl> - ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; <nl> - ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - sm_visibility = Public ; sm_deprecated = None } ) ; <nl> - sc_static_methods = [ ] ; sc_methods = [ ] ; sc_user_attributes = [ ] ; <nl> - sc_enum_type = None } ; <nl> - " \ \ C " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> - sc_name = ( [ 7 : 7 - 8 ] , " \ \ C " ) ; <nl> - sc_tparams = <nl> - [ { Typing_defs_core . tp_variance = Invariant ; <nl> - tp_name = ( [ 7 : 36 - 38 ] , " T1 " ) ; tp_tparams = [ ] ; tp_constraints = [ ] ; <nl> - tp_reified = Reified ; <nl> - tp_user_attributes = <nl> - [ { Typing_defs_core . ua_name = ( [ 7 : 26 - 27 ] , " \ \ A " ) ; <nl> - ua_classname_params = [ ] } ; <nl> - { Typing_defs_core . ua_name = ( [ 7 : 11 - 24 ] , " __Enforceable " ) ; <nl> - ua_classname_params = [ ] } <nl> - ] <nl> - } <nl> - ] ; <nl> - sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> - sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> - sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; <nl> - sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; sc_constructor = None ; <nl> - sc_static_methods = [ ] ; sc_methods = [ ] ; sc_user_attributes = [ ] ; <nl> - sc_enum_type = None } } ; <nl> - funs = { } ; typedefs = { } ; consts = { } ; records = { } } <nl> + [ ( " \ \ A " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> + sc_name = ( [ 3 : 7 - 8 ] , " \ \ A " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> + sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> + sc_implements = <nl> + [ ( Rhint ( root | type_param_attrs . php line 3 , characters 20 - 44 ) , <nl> + ( Tapply ( ( [ 3 : 20 - 45 ] , " \ \ HH \ \ TypeParameterAttribute " ) , [ ] ) ) ) ] ; <nl> + sc_consts = [ ] ; sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; sc_props = [ ] ; <nl> + sc_sprops = [ ] ; <nl> + sc_constructor = <nl> + ( Some { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> + sm_memoizelsb = false ; sm_name = ( [ 4 : 19 - 30 ] , " __construct " ) ; <nl> + sm_override = false ; sm_dynamicallycallable = false ; <nl> + sm_reactivity = None ; <nl> + sm_type = <nl> + ( Rwitness ( root | type_param_attrs . php line 4 , characters 19 - 29 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | type_param_attrs . php line 4 , characters 19 - 29 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rwitness ( root | type_param_attrs . php line 4 , characters 19 - 29 ) , <nl> + ( Tprim Tvoid ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; <nl> + ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + sm_visibility = Public ; sm_deprecated = None } ) ; <nl> + sc_static_methods = [ ] ; sc_methods = [ ] ; sc_user_attributes = [ ] ; <nl> + sc_enum_type = None } ) ) ; <nl> + ( " \ \ C " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> + sc_name = ( [ 7 : 7 - 8 ] , " \ \ C " ) ; <nl> + sc_tparams = <nl> + [ { Typing_defs_core . tp_variance = Invariant ; <nl> + tp_name = ( [ 7 : 36 - 38 ] , " T1 " ) ; tp_tparams = [ ] ; tp_constraints = [ ] ; <nl> + tp_reified = Reified ; <nl> + tp_user_attributes = <nl> + [ { Typing_defs_core . ua_name = ( [ 7 : 26 - 27 ] , " \ \ A " ) ; <nl> + ua_classname_params = [ ] } ; <nl> + { Typing_defs_core . ua_name = ( [ 7 : 11 - 24 ] , " __Enforceable " ) ; <nl> + ua_classname_params = [ ] } <nl> + ] <nl> + } <nl> + ] ; <nl> + sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> + sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> + sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; <nl> + sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> + sc_constructor = None ; sc_static_methods = [ ] ; sc_methods = [ ] ; <nl> + sc_user_attributes = [ ] ; sc_enum_type = None } ) ) <nl> + ] <nl> <nl> They matched ! <nl> mmm a / hphp / hack / test / decl / typeconst_property_promotion . php . exp <nl> ppp b / hphp / hack / test / decl / typeconst_property_promotion . php . exp <nl> <nl> - Parsed decls : <nl> - <nl> - { classes = <nl> - { " \ \ C " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> - sc_name = ( [ 3 : 7 - 8 ] , " \ \ C " ) ; sc_tparams = [ ] ; sc_where_constraints = [ ] ; <nl> - sc_extends = [ ] ; sc_uses = [ ] ; sc_xhp_attr_uses = [ ] ; <nl> - sc_req_extends = [ ] ; sc_req_implements = [ ] ; sc_implements = [ ] ; <nl> - sc_consts = [ ] ; <nl> - sc_typeconsts = <nl> - [ { Shallow_decl_defs . stc_abstract = Typing_defs . TCConcrete ; <nl> - stc_constraint = None ; stc_name = ( [ 4 : 14 - 15 ] , " T " ) ; <nl> - stc_type = <nl> - ( Some ( Rhint ( root | typeconst_property_promotion . php line 4 , characters 18 - 20 ) , <nl> - ( Tprim Tint ) ) ) ; <nl> - stc_enforceable = ( [ Pos . none ] , false ) ; stc_reifiable = None } <nl> - ] ; <nl> - sc_pu_enums = [ ] ; <nl> - sc_props = <nl> - [ { Shallow_decl_defs . sp_const = false ; sp_xhp_attr = None ; <nl> - sp_lateinit = false ; sp_lsb = false ; sp_name = ( [ 6 : 21 - 23 ] , " a " ) ; <nl> - sp_needs_init = true ; <nl> - sp_type = <nl> - ( Some ( Rhint ( root | typeconst_property_promotion . php line 6 , characters 13 - 19 ) , <nl> - ( Taccess <nl> - ( ( Rhint ( root | typeconst_property_promotion . php line 6 , characters 13 - 16 ) , <nl> - Tthis ) , <nl> - [ ( [ 6 : 19 - 20 ] , " T " ) ] ) ) ) ) ; <nl> - sp_abstract = false ; sp_visibility = Private } <nl> - ] ; <nl> - sc_sprops = [ ] ; <nl> - sc_constructor = <nl> - ( Some { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> - sm_memoizelsb = false ; sm_name = ( [ 5 : 19 - 30 ] , " __construct " ) ; <nl> - sm_override = false ; sm_dynamicallycallable = false ; <nl> - sm_reactivity = None ; <nl> - sm_type = <nl> - ( Rwitness ( root | typeconst_property_promotion . php line 5 , characters 19 - 29 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; <nl> - ft_params = <nl> - [ { fp_pos = [ 6 : 21 - 23 ] ; fp_name = ( Some " $ a " ) ; <nl> - fp_type = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | typeconst_property_promotion . php line 6 , characters 13 - 19 ) , <nl> - ( Taccess <nl> - ( ( Rhint ( root | typeconst_property_promotion . php line 6 , characters 13 - 16 ) , <nl> - Tthis ) , <nl> - [ ( [ 6 : 19 - 20 ] , " T " ) ] ) ) ) <nl> - } ; <nl> - fp_flags = <nl> - ( make_fp_flags ~ mutability : None <nl> - ~ accept_disposable : false ~ has_default : false <nl> - ~ mode : Typing_defs_core . FPnormal ~ ifc_external : false <nl> - ~ ifc_can_call : false ) ; <nl> - } <nl> - ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | typeconst_property_promotion . php line 5 , characters 19 - 29 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rwitness ( root | typeconst_property_promotion . php line 5 , characters 19 - 29 ) , <nl> - ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; <nl> - ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - sm_visibility = Public ; sm_deprecated = None } ) ; <nl> - sc_static_methods = [ ] ; sc_methods = [ ] ; sc_user_attributes = [ ] ; <nl> - sc_enum_type = None } } ; <nl> - funs = { } ; typedefs = { } ; consts = { } ; records = { } } <nl> + [ ( " \ \ C " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> + sc_name = ( [ 3 : 7 - 8 ] , " \ \ C " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> + sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> + sc_implements = [ ] ; sc_consts = [ ] ; <nl> + sc_typeconsts = <nl> + [ { Shallow_decl_defs . stc_abstract = Typing_defs . TCConcrete ; <nl> + stc_constraint = None ; stc_name = ( [ 4 : 14 - 15 ] , " T " ) ; <nl> + stc_type = <nl> + ( Some ( Rhint ( root | typeconst_property_promotion . php line 4 , characters 18 - 20 ) , <nl> + ( Tprim Tint ) ) ) ; <nl> + stc_enforceable = ( [ Pos . none ] , false ) ; stc_reifiable = None } <nl> + ] ; <nl> + sc_pu_enums = [ ] ; <nl> + sc_props = <nl> + [ { Shallow_decl_defs . sp_const = false ; sp_xhp_attr = None ; <nl> + sp_lateinit = false ; sp_lsb = false ; sp_name = ( [ 6 : 21 - 23 ] , " a " ) ; <nl> + sp_needs_init = true ; <nl> + sp_type = <nl> + ( Some ( Rhint ( root | typeconst_property_promotion . php line 6 , characters 13 - 19 ) , <nl> + ( Taccess <nl> + ( ( Rhint ( root | typeconst_property_promotion . php line 6 , characters 13 - 16 ) , <nl> + Tthis ) , <nl> + [ ( [ 6 : 19 - 20 ] , " T " ) ] ) ) ) ) ; <nl> + sp_abstract = false ; sp_visibility = Private } <nl> + ] ; <nl> + sc_sprops = [ ] ; <nl> + sc_constructor = <nl> + ( Some { Shallow_decl_defs . sm_abstract = false ; sm_final = false ; <nl> + sm_memoizelsb = false ; sm_name = ( [ 5 : 19 - 30 ] , " __construct " ) ; <nl> + sm_override = false ; sm_dynamicallycallable = false ; <nl> + sm_reactivity = None ; <nl> + sm_type = <nl> + ( Rwitness ( root | typeconst_property_promotion . php line 5 , characters 19 - 29 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; <nl> + ft_params = <nl> + [ { fp_pos = [ 6 : 21 - 23 ] ; fp_name = ( Some " $ a " ) ; <nl> + fp_type = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | typeconst_property_promotion . php line 6 , characters 13 - 19 ) , <nl> + ( Taccess <nl> + ( ( Rhint ( root | typeconst_property_promotion . php line 6 , characters 13 - 16 ) , <nl> + Tthis ) , <nl> + [ ( [ 6 : 19 - 20 ] , " T " ) ] ) ) ) <nl> + } ; <nl> + fp_flags = <nl> + ( make_fp_flags ~ mutability : None <nl> + ~ accept_disposable : false ~ has_default : false <nl> + ~ mode : Typing_defs_core . FPnormal ~ ifc_external : false <nl> + ~ ifc_can_call : false ) ; <nl> + } <nl> + ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | typeconst_property_promotion . php line 5 , characters 19 - 29 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rwitness ( root | typeconst_property_promotion . php line 5 , characters 19 - 29 ) , <nl> + ( Tprim Tvoid ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; <nl> + ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + sm_visibility = Public ; sm_deprecated = None } ) ; <nl> + sc_static_methods = [ ] ; sc_methods = [ ] ; sc_user_attributes = [ ] ; <nl> + sc_enum_type = None } ) ) <nl> + ] <nl> <nl> They matched ! <nl> mmm a / hphp / hack / test / decl / typedefs . php . exp <nl> ppp b / hphp / hack / test / decl / typedefs . php . exp <nl> <nl> - Parsed decls : <nl> - <nl> - { classes = { } ; funs = { } ; <nl> - typedefs = <nl> - { " \ \ MyArray " - > <nl> - { Typing_defs . td_pos = [ 10 : 6 - 13 ] ; td_vis = Transparent ; td_tparams = [ ] ; <nl> - td_constraint = None ; <nl> - td_type = <nl> - ( Rhint ( root | typedefs . php line 10 , characters 16 - 31 ) , <nl> - ( Tvarray_or_darray <nl> - ( Rnone ( | line 0 , characters 0 - 0 ) , ( Tprim Tarraykey ) ) , <nl> - ( Rnone ( | line 0 , characters 0 - 0 ) , Tany ) ) ) <nl> - } ; <nl> - " \ \ MyArray1 " - > <nl> - { Typing_defs . td_pos = [ 11 : 6 - 14 ] ; td_vis = Transparent ; <nl> - td_tparams = <nl> - [ { Typing_defs_core . tp_variance = Invariant ; <nl> - tp_name = ( [ 11 : 15 - 16 ] , " T " ) ; tp_tparams = [ ] ; tp_constraints = [ ] ; <nl> - tp_reified = Erased ; tp_user_attributes = [ ] } <nl> - ] ; <nl> - td_constraint = None ; <nl> - td_type = <nl> - ( Rhint ( root | typedefs . php line 11 , characters 20 - 28 ) , <nl> - ( Tvarray <nl> - ( Rhint ( root | typedefs . php line 11 , characters 27 - 27 ) , <nl> - ( Tgeneric ( " T " , [ ] ) ) ) ) ) <nl> - } ; <nl> - " \ \ MyArray2 " - > <nl> - { Typing_defs . td_pos = [ 12 : 6 - 14 ] ; td_vis = Transparent ; <nl> - td_tparams = <nl> - [ { Typing_defs_core . tp_variance = Invariant ; <nl> - tp_name = ( [ 12 : 15 - 17 ] , " TK " ) ; tp_tparams = [ ] ; tp_constraints = [ ] ; <nl> - tp_reified = Erased ; tp_user_attributes = [ ] } ; <nl> - { Typing_defs_core . tp_variance = Invariant ; <nl> - tp_name = ( [ 12 : 19 - 21 ] , " TV " ) ; tp_tparams = [ ] ; tp_constraints = [ ] ; <nl> - tp_reified = Erased ; tp_user_attributes = [ ] } <nl> - ] ; <nl> - td_constraint = None ; <nl> - td_type = <nl> - ( Rhint ( root | typedefs . php line 12 , characters 25 - 38 ) , <nl> - ( Tdarray ( <nl> - ( Rhint ( root | typedefs . php line 12 , characters 32 - 33 ) , <nl> - ( Tgeneric ( " TK " , [ ] ) ) ) , <nl> - ( Rhint ( root | typedefs . php line 12 , characters 36 - 37 ) , <nl> - ( Tgeneric ( " TV " , [ ] ) ) ) <nl> - ) ) ) <nl> - } ; <nl> - " \ \ MyArrayKey " - > <nl> - { Typing_defs . td_pos = [ 25 : 6 - 16 ] ; td_vis = Transparent ; td_tparams = [ ] ; <nl> - td_constraint = None ; <nl> - td_type = <nl> - ( Rhint ( root | typedefs . php line 25 , characters 19 - 26 ) , ( Tprim Tarraykey ) ) } ; <nl> - " \ \ MyBool " - > <nl> - { Typing_defs . td_pos = [ 20 : 6 - 12 ] ; td_vis = Transparent ; td_tparams = [ ] ; <nl> - td_constraint = None ; <nl> - td_type = <nl> - ( Rhint ( root | typedefs . php line 20 , characters 15 - 18 ) , ( Tprim Tbool ) ) } ; <nl> - " \ \ MyDarray " - > <nl> - { Typing_defs . td_pos = [ 13 : 6 - 14 ] ; td_vis = Transparent ; <nl> - td_tparams = <nl> - [ { Typing_defs_core . tp_variance = Invariant ; tp_name = ( [ 13 : 15 - 17 ] , " TK " ) ; <nl> - tp_tparams = [ ] ; tp_constraints = [ ] ; tp_reified = Erased ; <nl> - tp_user_attributes = [ ] } ; <nl> - { Typing_defs_core . tp_variance = Invariant ; tp_name = ( [ 13 : 19 - 21 ] , " TV " ) ; <nl> - tp_tparams = [ ] ; tp_constraints = [ ] ; tp_reified = Erased ; <nl> - tp_user_attributes = [ ] } <nl> - ] ; <nl> - td_constraint = None ; <nl> - td_type = <nl> - ( Rhint ( root | typedefs . php line 13 , characters 25 - 38 ) , <nl> - ( Tdarray ( <nl> - ( Rhint ( root | typedefs . php line 13 , characters 32 - 33 ) , <nl> - ( Tgeneric ( " TK " , [ ] ) ) ) , <nl> - ( Rhint ( root | typedefs . php line 13 , characters 36 - 37 ) , ( Tgeneric ( " TV " , [ ] ) <nl> - ) ) <nl> - ) ) ) } ; <nl> - " \ \ MyDynamic " - > <nl> - { Typing_defs . td_pos = [ 24 : 6 - 15 ] ; td_vis = Transparent ; td_tparams = [ ] ; <nl> - td_constraint = None ; <nl> - td_type = ( Rhint ( root | typedefs . php line 24 , characters 18 - 24 ) , Tdynamic ) } ; <nl> - " \ \ MyFloat " - > <nl> - { Typing_defs . td_pos = [ 18 : 6 - 13 ] ; td_vis = Transparent ; td_tparams = [ ] ; <nl> - td_constraint = None ; <nl> - td_type = <nl> - ( Rhint ( root | typedefs . php line 18 , characters 16 - 20 ) , ( Tprim Tfloat ) ) } ; <nl> - " \ \ MyInt " - > <nl> - { Typing_defs . td_pos = [ 17 : 6 - 11 ] ; td_vis = Transparent ; td_tparams = [ ] ; <nl> - td_constraint = None ; <nl> - td_type = <nl> - ( Rhint ( root | typedefs . php line 17 , characters 14 - 16 ) , ( Tprim Tint ) ) } ; <nl> - " \ \ MyMixed " - > <nl> - { Typing_defs . td_pos = [ 21 : 6 - 13 ] ; td_vis = Transparent ; td_tparams = [ ] ; <nl> - td_constraint = None ; <nl> - td_type = ( Rhint ( root | typedefs . php line 21 , characters 16 - 20 ) , Tmixed ) } ; <nl> - " \ \ MyNamespace \ \ MyString " - > <nl> - { Typing_defs . td_pos = [ 7 : 8 - 16 ] ; td_vis = Transparent ; td_tparams = [ ] ; <nl> - td_constraint = None ; <nl> - td_type = <nl> - ( Rhint ( root | typedefs . php line 7 , characters 19 - 24 ) , ( Tprim Tstring ) ) } ; <nl> - " \ \ MyNamespacedType " - > <nl> - { Typing_defs . td_pos = [ 27 : 6 - 22 ] ; td_vis = Transparent ; td_tparams = [ ] ; <nl> - td_constraint = None ; <nl> - td_type = <nl> - ( Rhint ( root | typedefs . php line 27 , characters 25 - 45 ) , <nl> - ( Tapply ( ( [ 27 : 25 - 46 ] , " \ \ MyNamespace \ \ MyString " ) , [ ] ) ) ) <nl> - } ; <nl> - " \ \ MyNewtype " - > <nl> - { Typing_defs . td_pos = [ 29 : 9 - 18 ] ; td_vis = Opaque ; td_tparams = [ ] ; <nl> - td_constraint = <nl> - ( Some ( Rhint ( root | typedefs . php line 29 , characters 22 - 24 ) , ( Tprim Tnum ) ) ) ; <nl> - td_type = <nl> - ( Rhint ( root | typedefs . php line 29 , characters 28 - 30 ) , ( Tprim Tint ) ) } ; <nl> - " \ \ MyNewtypeWithoutConstraint " - > <nl> - { Typing_defs . td_pos = [ 30 : 9 - 35 ] ; td_vis = Opaque ; td_tparams = [ ] ; <nl> - td_constraint = None ; <nl> - td_type = <nl> - ( Rhint ( root | typedefs . php line 30 , characters 38 - 40 ) , ( Tprim Tint ) ) } ; <nl> - " \ \ MyNonnull " - > <nl> - { Typing_defs . td_pos = [ 23 : 6 - 15 ] ; td_vis = Transparent ; td_tparams = [ ] ; <nl> - td_constraint = None ; <nl> - td_type = ( Rhint ( root | typedefs . php line 23 , characters 18 - 24 ) , Tnonnull ) } ; <nl> - " \ \ MyNothing " - > <nl> - { Typing_defs . td_pos = [ 22 : 6 - 15 ] ; td_vis = Transparent ; td_tparams = [ ] ; <nl> - td_constraint = None ; <nl> - td_type = <nl> - ( Rhint ( root | typedefs . php line 22 , characters 18 - 24 ) , ( Tunion [ ] ) ) } ; <nl> - " \ \ MyNum " - > <nl> - { Typing_defs . td_pos = [ 19 : 6 - 11 ] ; td_vis = Transparent ; td_tparams = [ ] ; <nl> - td_constraint = None ; <nl> - td_type = <nl> - ( Rhint ( root | typedefs . php line 19 , characters 14 - 16 ) , ( Tprim Tnum ) ) } ; <nl> - " \ \ MyString " - > <nl> - { Typing_defs . td_pos = [ 16 : 6 - 14 ] ; td_vis = Transparent ; td_tparams = [ ] ; <nl> - td_constraint = None ; <nl> - td_type = <nl> - ( Rhint ( root | typedefs . php line 16 , characters 17 - 22 ) , ( Tprim Tstring ) ) } ; <nl> - " \ \ MyVarray " - > <nl> - { Typing_defs . td_pos = [ 14 : 6 - 14 ] ; td_vis = Transparent ; <nl> - td_tparams = <nl> - [ { Typing_defs_core . tp_variance = Invariant ; tp_name = ( [ 14 : 15 - 16 ] , " T " ) ; <nl> - tp_tparams = [ ] ; tp_constraints = [ ] ; tp_reified = Erased ; <nl> - tp_user_attributes = [ ] } <nl> - ] ; <nl> - td_constraint = None ; <nl> - td_type = <nl> - ( Rhint ( root | typedefs . php line 14 , characters 20 - 28 ) , <nl> - ( Tvarray <nl> - ( Rhint ( root | typedefs . php line 14 , characters 27 - 27 ) , <nl> - ( Tgeneric ( " T " , [ ] ) ) ) ) ) <nl> - } ; <nl> - " \ \ MyVarrayOrDarray " - > <nl> - { Typing_defs . td_pos = [ 15 : 6 - 22 ] ; td_vis = Transparent ; <nl> - td_tparams = <nl> - [ { Typing_defs_core . tp_variance = Invariant ; tp_name = ( [ 15 : 23 - 25 ] , " TK " ) ; <nl> - tp_tparams = [ ] ; tp_constraints = [ ] ; tp_reified = Erased ; <nl> - tp_user_attributes = [ ] } ; <nl> - { Typing_defs_core . tp_variance = Invariant ; tp_name = ( [ 15 : 27 - 29 ] , " TV " ) ; <nl> - tp_tparams = [ ] ; tp_constraints = [ ] ; tp_reified = Erased ; <nl> - tp_user_attributes = [ ] } <nl> - ] ; <nl> - td_constraint = None ; <nl> - td_type = <nl> - ( Rhint ( root | typedefs . php line 15 , characters 33 - 56 ) , <nl> - ( Tvarray_or_darray <nl> - ( Rhint ( root | typedefs . php line 15 , characters 50 - 51 ) , <nl> - ( Tgeneric ( " TK " , [ ] ) ) ) , <nl> - ( Rhint ( root | typedefs . php line 15 , characters 54 - 55 ) , ( Tgeneric ( " TV " , [ ] ) <nl> - ) ) ) ) } } ; consts = { } ; records = { } <nl> - } <nl> - <nl> - They matched ! <nl> + mmm legacy <nl> ppp + direct decl <nl> + <nl> + [ ( " \ \ MyNamespace \ \ MyString " , <nl> + ( Shallow_decl_defs . Typedef <nl> + { Typing_defs . td_pos = [ 7 : 8 - 16 ] ; td_vis = Transparent ; td_tparams = [ ] ; <nl> + td_constraint = None ; <nl> + td_type = <nl> + ( Rhint ( root | typedefs . php line 7 , characters 19 - 24 ) , ( Tprim Tstring ) ) <nl> + } ) ) ; <nl> + ( " \ \ MyArray " , <nl> + ( Shallow_decl_defs . Typedef <nl> + { Typing_defs . td_pos = [ 10 : 6 - 13 ] ; td_vis = Transparent ; <nl> + td_tparams = [ ] ; td_constraint = None ; <nl> + td_type = <nl> + ( Rhint ( root | typedefs . php line 10 , characters 16 - 31 ) , <nl> + ( Tvarray_or_darray <nl> + - ( Rvarray_or_darray_key ( root | typedefs . php line 10 , characters 16 - 31 ) , <nl> + - ( Tprim Tarraykey ) ) , <nl> + - ( Rhint ( root | typedefs . php line 10 , characters 16 - 31 ) , Tany ) ) ) <nl> + + ( Rnone ( | line 0 , characters 0 - 0 ) , ( Tprim Tarraykey ) ) , <nl> + + ( Rnone ( | line 0 , characters 0 - 0 ) , Tany ) ) ) <nl> + } ) ) ; <nl> + ( " \ \ MyArray1 " , <nl> + ( Shallow_decl_defs . Typedef <nl> + { Typing_defs . td_pos = [ 11 : 6 - 14 ] ; td_vis = Transparent ; <nl> + td_tparams = <nl> + [ { Typing_defs_core . tp_variance = Invariant ; <nl> + tp_name = ( [ 11 : 15 - 16 ] , " T " ) ; tp_tparams = [ ] ; tp_constraints = [ ] ; <nl> + tp_reified = Erased ; tp_user_attributes = [ ] } <nl> + ] ; <nl> + td_constraint = None ; <nl> + td_type = <nl> + ( Rhint ( root | typedefs . php line 11 , characters 20 - 28 ) , <nl> + ( Tvarray <nl> + ( Rhint ( root | typedefs . php line 11 , characters 27 - 27 ) , <nl> + ( Tgeneric ( " T " , [ ] ) ) ) ) ) <nl> + } ) ) ; <nl> + ( " \ \ MyArray2 " , <nl> + ( Shallow_decl_defs . Typedef <nl> + { Typing_defs . td_pos = [ 12 : 6 - 14 ] ; td_vis = Transparent ; <nl> + td_tparams = <nl> + [ { Typing_defs_core . tp_variance = Invariant ; <nl> + tp_name = ( [ 12 : 15 - 17 ] , " TK " ) ; tp_tparams = [ ] ; tp_constraints = [ ] ; <nl> + tp_reified = Erased ; tp_user_attributes = [ ] } ; <nl> + { Typing_defs_core . tp_variance = Invariant ; <nl> + tp_name = ( [ 12 : 19 - 21 ] , " TV " ) ; tp_tparams = [ ] ; tp_constraints = [ ] ; <nl> + tp_reified = Erased ; tp_user_attributes = [ ] } <nl> + ] ; <nl> + td_constraint = None ; <nl> + td_type = <nl> + ( Rhint ( root | typedefs . php line 12 , characters 25 - 38 ) , <nl> + ( Tdarray ( <nl> + ( Rhint ( root | typedefs . php line 12 , characters 32 - 33 ) , <nl> + ( Tgeneric ( " TK " , [ ] ) ) ) , <nl> + ( Rhint ( root | typedefs . php line 12 , characters 36 - 37 ) , <nl> + ( Tgeneric ( " TV " , [ ] ) ) ) <nl> + ) ) ) <nl> + } ) ) ; <nl> + ( " \ \ MyDarray " , <nl> + ( Shallow_decl_defs . Typedef <nl> + { Typing_defs . td_pos = [ 13 : 6 - 14 ] ; td_vis = Transparent ; <nl> + td_tparams = <nl> + [ { Typing_defs_core . tp_variance = Invariant ; <nl> + tp_name = ( [ 13 : 15 - 17 ] , " TK " ) ; tp_tparams = [ ] ; tp_constraints = [ ] ; <nl> + tp_reified = Erased ; tp_user_attributes = [ ] } ; <nl> + { Typing_defs_core . tp_variance = Invariant ; <nl> + tp_name = ( [ 13 : 19 - 21 ] , " TV " ) ; tp_tparams = [ ] ; tp_constraints = [ ] ; <nl> + tp_reified = Erased ; tp_user_attributes = [ ] } <nl> + ] ; <nl> + td_constraint = None ; <nl> + td_type = <nl> + ( Rhint ( root | typedefs . php line 13 , characters 25 - 38 ) , <nl> + ( Tdarray ( <nl> + ( Rhint ( root | typedefs . php line 13 , characters 32 - 33 ) , <nl> + ( Tgeneric ( " TK " , [ ] ) ) ) , <nl> + ( Rhint ( root | typedefs . php line 13 , characters 36 - 37 ) , <nl> + ( Tgeneric ( " TV " , [ ] ) ) ) <nl> + ) ) ) <nl> + } ) ) ; <nl> + ( " \ \ MyVarray " , <nl> + ( Shallow_decl_defs . Typedef <nl> + { Typing_defs . td_pos = [ 14 : 6 - 14 ] ; td_vis = Transparent ; <nl> + td_tparams = <nl> + [ { Typing_defs_core . tp_variance = Invariant ; <nl> + tp_name = ( [ 14 : 15 - 16 ] , " T " ) ; tp_tparams = [ ] ; tp_constraints = [ ] ; <nl> + tp_reified = Erased ; tp_user_attributes = [ ] } <nl> + ] ; <nl> + td_constraint = None ; <nl> + td_type = <nl> + ( Rhint ( root | typedefs . php line 14 , characters 20 - 28 ) , <nl> + ( Tvarray <nl> + ( Rhint ( root | typedefs . php line 14 , characters 27 - 27 ) , <nl> + ( Tgeneric ( " T " , [ ] ) ) ) ) ) <nl> + } ) ) ; <nl> + ( " \ \ MyVarrayOrDarray " , <nl> + ( Shallow_decl_defs . Typedef <nl> + { Typing_defs . td_pos = [ 15 : 6 - 22 ] ; td_vis = Transparent ; <nl> + td_tparams = <nl> + [ { Typing_defs_core . tp_variance = Invariant ; <nl> + tp_name = ( [ 15 : 23 - 25 ] , " TK " ) ; tp_tparams = [ ] ; tp_constraints = [ ] ; <nl> + tp_reified = Erased ; tp_user_attributes = [ ] } ; <nl> + { Typing_defs_core . tp_variance = Invariant ; <nl> + tp_name = ( [ 15 : 27 - 29 ] , " TV " ) ; tp_tparams = [ ] ; tp_constraints = [ ] ; <nl> + tp_reified = Erased ; tp_user_attributes = [ ] } <nl> + ] ; <nl> + td_constraint = None ; <nl> + td_type = <nl> + ( Rhint ( root | typedefs . php line 15 , characters 33 - 56 ) , <nl> + ( Tvarray_or_darray <nl> + ( Rhint ( root | typedefs . php line 15 , characters 50 - 51 ) , <nl> + ( Tgeneric ( " TK " , [ ] ) ) ) , <nl> + ( Rhint ( root | typedefs . php line 15 , characters 54 - 55 ) , <nl> + ( Tgeneric ( " TV " , [ ] ) ) ) ) ) <nl> + } ) ) ; <nl> + ( " \ \ MyString " , <nl> + ( Shallow_decl_defs . Typedef <nl> + { Typing_defs . td_pos = [ 16 : 6 - 14 ] ; td_vis = Transparent ; td_tparams = [ ] ; <nl> + td_constraint = None ; <nl> + td_type = <nl> + ( Rhint ( root | typedefs . php line 16 , characters 17 - 22 ) , ( Tprim Tstring ) ) <nl> + } ) ) ; <nl> + ( " \ \ MyInt " , <nl> + ( Shallow_decl_defs . Typedef <nl> + { Typing_defs . td_pos = [ 17 : 6 - 11 ] ; td_vis = Transparent ; td_tparams = [ ] ; <nl> + td_constraint = None ; <nl> + td_type = <nl> + ( Rhint ( root | typedefs . php line 17 , characters 14 - 16 ) , ( Tprim Tint ) ) } ) ) ; <nl> + ( " \ \ MyFloat " , <nl> + ( Shallow_decl_defs . Typedef <nl> + { Typing_defs . td_pos = [ 18 : 6 - 13 ] ; td_vis = Transparent ; td_tparams = [ ] ; <nl> + td_constraint = None ; <nl> + td_type = <nl> + ( Rhint ( root | typedefs . php line 18 , characters 16 - 20 ) , ( Tprim Tfloat ) ) } ) ) ; <nl> + ( " \ \ MyNum " , <nl> + ( Shallow_decl_defs . Typedef <nl> + { Typing_defs . td_pos = [ 19 : 6 - 11 ] ; td_vis = Transparent ; td_tparams = [ ] ; <nl> + td_constraint = None ; <nl> + td_type = <nl> + ( Rhint ( root | typedefs . php line 19 , characters 14 - 16 ) , ( Tprim Tnum ) ) } ) ) ; <nl> + ( " \ \ MyBool " , <nl> + ( Shallow_decl_defs . Typedef <nl> + { Typing_defs . td_pos = [ 20 : 6 - 12 ] ; td_vis = Transparent ; td_tparams = [ ] ; <nl> + td_constraint = None ; <nl> + td_type = <nl> + ( Rhint ( root | typedefs . php line 20 , characters 15 - 18 ) , ( Tprim Tbool ) ) } ) ) ; <nl> + ( " \ \ MyMixed " , <nl> + ( Shallow_decl_defs . Typedef <nl> + { Typing_defs . td_pos = [ 21 : 6 - 13 ] ; td_vis = Transparent ; td_tparams = [ ] ; <nl> + td_constraint = None ; <nl> + td_type = ( Rhint ( root | typedefs . php line 21 , characters 16 - 20 ) , Tmixed ) <nl> + } ) ) ; <nl> + ( " \ \ MyNothing " , <nl> + ( Shallow_decl_defs . Typedef <nl> + { Typing_defs . td_pos = [ 22 : 6 - 15 ] ; td_vis = Transparent ; td_tparams = [ ] ; <nl> + td_constraint = None ; <nl> + td_type = <nl> + ( Rhint ( root | typedefs . php line 22 , characters 18 - 24 ) , ( Tunion [ ] ) ) } ) ) ; <nl> + ( " \ \ MyNonnull " , <nl> + ( Shallow_decl_defs . Typedef <nl> + { Typing_defs . td_pos = [ 23 : 6 - 15 ] ; td_vis = Transparent ; td_tparams = [ ] ; <nl> + td_constraint = None ; <nl> + td_type = <nl> + ( Rhint ( root | typedefs . php line 23 , characters 18 - 24 ) , Tnonnull ) } ) ) ; <nl> + ( " \ \ MyDynamic " , <nl> + ( Shallow_decl_defs . Typedef <nl> + { Typing_defs . td_pos = [ 24 : 6 - 15 ] ; td_vis = Transparent ; td_tparams = [ ] ; <nl> + td_constraint = None ; <nl> + td_type = <nl> + ( Rhint ( root | typedefs . php line 24 , characters 18 - 24 ) , Tdynamic ) } ) ) ; <nl> + ( " \ \ MyArrayKey " , <nl> + ( Shallow_decl_defs . Typedef <nl> + { Typing_defs . td_pos = [ 25 : 6 - 16 ] ; td_vis = Transparent ; td_tparams = [ ] ; <nl> + td_constraint = None ; <nl> + td_type = <nl> + ( Rhint ( root | typedefs . php line 25 , characters 19 - 26 ) , ( Tprim Tarraykey ) ) <nl> + } ) ) ; <nl> + ( " \ \ MyNamespacedType " , <nl> + ( Shallow_decl_defs . Typedef <nl> + { Typing_defs . td_pos = [ 27 : 6 - 22 ] ; td_vis = Transparent ; td_tparams = [ ] ; <nl> + td_constraint = None ; <nl> + td_type = <nl> + ( Rhint ( root | typedefs . php line 27 , characters 25 - 45 ) , <nl> + ( Tapply ( ( [ 27 : 25 - 46 ] , " \ \ MyNamespace \ \ MyString " ) , [ ] ) ) ) <nl> + } ) ) ; <nl> + ( " \ \ MyNewtype " , <nl> + ( Shallow_decl_defs . Typedef <nl> + { Typing_defs . td_pos = [ 29 : 9 - 18 ] ; td_vis = Opaque ; td_tparams = [ ] ; <nl> + td_constraint = <nl> + ( Some ( Rhint ( root | typedefs . php line 29 , characters 22 - 24 ) , <nl> + ( Tprim Tnum ) ) ) ; <nl> + td_type = <nl> + ( Rhint ( root | typedefs . php line 29 , characters 28 - 30 ) , ( Tprim Tint ) ) } ) ) ; <nl> + ( " \ \ MyNewtypeWithoutConstraint " , <nl> + ( Shallow_decl_defs . Typedef <nl> + { Typing_defs . td_pos = [ 30 : 9 - 35 ] ; td_vis = Opaque ; td_tparams = [ ] ; <nl> + td_constraint = None ; <nl> + td_type = <nl> + ( Rhint ( root | typedefs . php line 30 , characters 38 - 40 ) , ( Tprim Tint ) ) } ) ) <nl> + ] <nl> mmm a / hphp / hack / test / decl / untyped_prop . php . exp <nl> ppp b / hphp / hack / test / decl / untyped_prop . php . exp <nl> <nl> - Parsed decls : <nl> - <nl> - { classes = <nl> - { " \ \ Y " - > <nl> - { Shallow_decl_defs . sc_mode = Mpartial ; sc_final = false ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> - sc_name = ( [ 12 : 7 - 8 ] , " \ \ Y " ) ; sc_tparams = [ ] ; <nl> - sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> - sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> - sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; <nl> - sc_pu_enums = [ ] ; <nl> - sc_props = <nl> - [ { Shallow_decl_defs . sp_const = false ; sp_xhp_attr = None ; <nl> - sp_lateinit = false ; sp_lsb = false ; sp_name = ( [ 13 : 10 - 12 ] , " x " ) ; <nl> - sp_needs_init = false ; sp_type = None ; sp_abstract = false ; <nl> - sp_visibility = Public } <nl> - ] ; <nl> - sc_sprops = [ ] ; sc_constructor = None ; sc_static_methods = [ ] ; <nl> - sc_methods = [ ] ; sc_user_attributes = [ ] ; sc_enum_type = None } } ; <nl> - funs = { } ; typedefs = { } ; consts = { } ; records = { } } <nl> + [ ( " \ \ Y " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mpartial ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> + sc_name = ( [ 12 : 7 - 8 ] , " \ \ Y " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> + sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> + sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; <nl> + sc_pu_enums = [ ] ; <nl> + sc_props = <nl> + [ { Shallow_decl_defs . sp_const = false ; sp_xhp_attr = None ; <nl> + sp_lateinit = false ; sp_lsb = false ; sp_name = ( [ 13 : 10 - 12 ] , " x " ) ; <nl> + sp_needs_init = false ; sp_type = None ; sp_abstract = false ; <nl> + sp_visibility = Public } <nl> + ] ; <nl> + sc_sprops = [ ] ; sc_constructor = None ; sc_static_methods = [ ] ; <nl> + sc_methods = [ ] ; sc_user_attributes = [ ] ; sc_enum_type = None } ) ) <nl> + ] <nl> <nl> They matched ! <nl> mmm a / hphp / hack / test / decl / user_attributes_in_namespaces . php . exp <nl> ppp b / hphp / hack / test / decl / user_attributes_in_namespaces . php . exp <nl> <nl> - Parsed decls : <nl> - <nl> - { classes = <nl> - { " \ \ X \ \ C " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> - sc_name = ( [ 11 : 9 - 10 ] , " \ \ X \ \ C " ) ; sc_tparams = [ ] ; <nl> - sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> - sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> - sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; <nl> - sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; sc_constructor = None ; <nl> - sc_static_methods = [ ] ; sc_methods = [ ] ; <nl> - sc_user_attributes = <nl> - [ { Typing_defs_core . ua_name = ( [ 10 : 10 - 15 ] , " \ \ X \ \ Y \ \ Bar " ) ; <nl> - ua_classname_params = [ ] } ; <nl> - { Typing_defs_core . ua_name = ( [ 10 : 5 - 8 ] , " \ \ X \ \ Foo " ) ; <nl> - ua_classname_params = [ ] } <nl> - ] ; <nl> - sc_enum_type = None } ; <nl> - " \ \ X \ \ Foo " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> - sc_name = ( [ 4 : 9 - 12 ] , " \ \ X \ \ Foo " ) ; sc_tparams = [ ] ; <nl> - sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> - sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> - sc_implements = <nl> - [ ( Rhint ( root | user_attributes_in_namespaces . php line 4 , characters 24 - 41 ) , <nl> - ( Tapply ( ( [ 4 : 24 - 42 ] , " \ \ HH \ \ ClassAttribute " ) , [ ] ) ) ) ] ; <nl> - sc_consts = [ ] ; sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; sc_props = [ ] ; <nl> - sc_sprops = [ ] ; sc_constructor = None ; sc_static_methods = [ ] ; <nl> - sc_methods = [ ] ; sc_user_attributes = [ ] ; sc_enum_type = None } ; <nl> - " \ \ X \ \ Y \ \ Bar " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> - sc_name = ( [ 7 : 11 - 14 ] , " \ \ X \ \ Y \ \ Bar " ) ; sc_tparams = [ ] ; <nl> - sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> - sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> - sc_implements = <nl> - [ ( Rhint ( root | user_attributes_in_namespaces . php line 7 , characters 26 - 43 ) , <nl> - ( Tapply ( ( [ 7 : 26 - 44 ] , " \ \ HH \ \ ClassAttribute " ) , [ ] ) ) ) ] ; <nl> - sc_consts = [ ] ; sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; sc_props = [ ] ; <nl> - sc_sprops = [ ] ; sc_constructor = None ; sc_static_methods = [ ] ; <nl> - sc_methods = [ ] ; sc_user_attributes = [ ] ; sc_enum_type = None } } ; <nl> - funs = { } ; typedefs = { } ; consts = { } ; records = { } } <nl> + [ ( " \ \ X \ \ Foo " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> + sc_name = ( [ 4 : 9 - 12 ] , " \ \ X \ \ Foo " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> + sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> + sc_implements = <nl> + [ ( Rhint ( root | user_attributes_in_namespaces . php line 4 , characters 24 - 41 ) , <nl> + ( Tapply ( ( [ 4 : 24 - 42 ] , " \ \ HH \ \ ClassAttribute " ) , [ ] ) ) ) ] ; <nl> + sc_consts = [ ] ; sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; sc_props = [ ] ; <nl> + sc_sprops = [ ] ; sc_constructor = None ; sc_static_methods = [ ] ; <nl> + sc_methods = [ ] ; sc_user_attributes = [ ] ; sc_enum_type = None } ) ) ; <nl> + ( " \ \ X \ \ Y \ \ Bar " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> + sc_name = ( [ 7 : 11 - 14 ] , " \ \ X \ \ Y \ \ Bar " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> + sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> + sc_implements = <nl> + [ ( Rhint ( root | user_attributes_in_namespaces . php line 7 , characters 26 - 43 ) , <nl> + ( Tapply ( ( [ 7 : 26 - 44 ] , " \ \ HH \ \ ClassAttribute " ) , [ ] ) ) ) ] ; <nl> + sc_consts = [ ] ; sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; sc_props = [ ] ; <nl> + sc_sprops = [ ] ; sc_constructor = None ; sc_static_methods = [ ] ; <nl> + sc_methods = [ ] ; sc_user_attributes = [ ] ; sc_enum_type = None } ) ) ; <nl> + ( " \ \ X \ \ C " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> + sc_name = ( [ 11 : 9 - 10 ] , " \ \ X \ \ C " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> + sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> + sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; <nl> + sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> + sc_constructor = None ; sc_static_methods = [ ] ; sc_methods = [ ] ; <nl> + sc_user_attributes = <nl> + [ { Typing_defs_core . ua_name = ( [ 10 : 10 - 15 ] , " \ \ X \ \ Y \ \ Bar " ) ; <nl> + ua_classname_params = [ ] } ; <nl> + { Typing_defs_core . ua_name = ( [ 10 : 5 - 8 ] , " \ \ X \ \ Foo " ) ; <nl> + ua_classname_params = [ ] } <nl> + ] ; <nl> + sc_enum_type = None } ) ) <nl> + ] <nl> <nl> They matched ! <nl> mmm a / hphp / hack / test / decl / variadic_parameter . php . exp <nl> ppp b / hphp / hack / test / decl / variadic_parameter . php . exp <nl> <nl> - Parsed decls : <nl> - <nl> - { classes = { } ; <nl> - funs = <nl> - { " \ \ test " - > <nl> - { Typing_defs . fe_deprecated = None ; <nl> - fe_type = <nl> - ( Rwitness ( root | variadic_parameter . php line 3 , characters 10 - 13 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; <nl> - ft_params = <nl> - [ { fp_pos = [ 3 : 42 - 44 ] ; fp_name = ( Some " $ f " ) ; <nl> - fp_type = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | variadic_parameter . php line 3 , characters 15 - 40 ) , <nl> - ( Tfun <nl> - { ft_arity = <nl> - ( Fvariadic ( <nl> - { fp_pos = [ 3 : 25 - 30 ] ; fp_name = None ; <nl> - fp_type = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | variadic_parameter . php line 3 , characters 25 - 29 ) , <nl> - Tmixed ) <nl> - } ; <nl> - fp_flags = <nl> - ( make_fp_flags ~ mutability : None <nl> - ~ accept_disposable : false ~ has_default : false <nl> - ~ mode : Typing_defs_core . FPnormal <nl> - ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> - } <nl> - ) ) ; <nl> - ft_tparams = [ ] ; ft_where_constraints = [ ] ; <nl> - ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | variadic_parameter . php line 3 , characters 15 - 40 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | variadic_parameter . php line 3 , characters 36 - 39 ) , <nl> - ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; <nl> - ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) <nl> - } ; <nl> - fp_flags = <nl> - ( make_fp_flags ~ mutability : None ~ accept_disposable : false <nl> - ~ has_default : false ~ mode : Typing_defs_core . FPnormal <nl> - ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> - } <nl> - ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | variadic_parameter . php line 3 , characters 10 - 13 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | variadic_parameter . php line 3 , characters 47 - 50 ) , <nl> - ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - fe_pos = [ 3 : 10 - 14 ] ; fe_php_std_lib = false } } ; <nl> - typedefs = { } ; consts = { } ; records = { } } <nl> + [ ( " \ \ test " , <nl> + ( Shallow_decl_defs . Fun <nl> + { Typing_defs . fe_deprecated = None ; <nl> + fe_type = <nl> + ( Rwitness ( root | variadic_parameter . php line 3 , characters 10 - 13 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; <nl> + ft_params = <nl> + [ { fp_pos = [ 3 : 42 - 44 ] ; fp_name = ( Some " $ f " ) ; <nl> + fp_type = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | variadic_parameter . php line 3 , characters 15 - 40 ) , <nl> + ( Tfun <nl> + { ft_arity = <nl> + ( Fvariadic ( <nl> + { fp_pos = [ 3 : 25 - 30 ] ; fp_name = None ; <nl> + fp_type = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | variadic_parameter . php line 3 , characters 25 - 29 ) , <nl> + Tmixed ) <nl> + } ; <nl> + fp_flags = <nl> + ( make_fp_flags ~ mutability : None <nl> + ~ accept_disposable : false ~ has_default : false <nl> + ~ mode : Typing_defs_core . FPnormal <nl> + ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> + } <nl> + ) ) ; <nl> + ft_tparams = [ ] ; ft_where_constraints = [ ] ; <nl> + ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | variadic_parameter . php line 3 , characters 15 - 40 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | variadic_parameter . php line 3 , characters 36 - 39 ) , <nl> + ( Tprim Tvoid ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; <nl> + ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) <nl> + } ; <nl> + fp_flags = <nl> + ( make_fp_flags ~ mutability : None ~ accept_disposable : false <nl> + ~ has_default : false ~ mode : Typing_defs_core . FPnormal <nl> + ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> + } <nl> + ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | variadic_parameter . php line 3 , characters 10 - 13 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | variadic_parameter . php line 3 , characters 47 - 50 ) , <nl> + ( Tprim Tvoid ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + fe_pos = [ 3 : 10 - 14 ] ; fe_php_std_lib = false } ) ) <nl> + ] <nl> <nl> They matched ! <nl> mmm a / hphp / hack / test / decl / xhp . php . exp <nl> ppp b / hphp / hack / test / decl / xhp . php . exp <nl> <nl> - Parsed decls : <nl> - <nl> - { classes = <nl> - { " \ \ : foo " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> - sc_is_xhp = true ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> - sc_name = ( [ 4 : 7 - 11 ] , " \ \ : foo " ) ; sc_tparams = [ ] ; <nl> - sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> - sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> - sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; <nl> - sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; sc_constructor = None ; <nl> - sc_static_methods = [ ] ; sc_methods = [ ] ; sc_user_attributes = [ ] ; <nl> - sc_enum_type = None } ; <nl> - " \ \ : foo - baz " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> - sc_is_xhp = true ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> - sc_name = ( [ 6 : 7 - 15 ] , " \ \ : foo - baz " ) ; sc_tparams = [ ] ; <nl> - sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> - sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> - sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; <nl> - sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; sc_constructor = None ; <nl> - sc_static_methods = [ ] ; sc_methods = [ ] ; sc_user_attributes = [ ] ; <nl> - sc_enum_type = None } ; <nl> - " \ \ : foo : bar " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> - sc_is_xhp = true ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> - sc_name = ( [ 5 : 7 - 15 ] , " \ \ : foo : bar " ) ; sc_tparams = [ ] ; <nl> - sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> - sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> - sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; <nl> - sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; sc_constructor = None ; <nl> - sc_static_methods = [ ] ; sc_methods = [ ] ; sc_user_attributes = [ ] ; <nl> - sc_enum_type = None } ; <nl> - " \ \ xhp " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> - sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> - sc_name = ( [ 3 : 7 - 10 ] , " \ \ xhp " ) ; sc_tparams = [ ] ; <nl> - sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> - sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> - sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; <nl> - sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; sc_constructor = None ; <nl> - sc_static_methods = [ ] ; sc_methods = [ ] ; sc_user_attributes = [ ] ; <nl> - sc_enum_type = None } } ; <nl> - funs = <nl> - { " \ \ xhp_is_valid_class_name " - > <nl> - { Typing_defs . fe_deprecated = None ; <nl> - fe_type = <nl> - ( Rwitness ( root | xhp . php line 7 , characters 10 - 32 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; <nl> - ft_params = <nl> - [ { fp_pos = [ 7 : 38 - 40 ] ; fp_name = ( Some " $ x " ) ; <nl> - fp_type = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | xhp . php line 7 , characters 34 - 36 ) , <nl> - ( Tapply ( ( [ 7 : 34 - 37 ] , " \ \ xhp " ) , [ ] ) ) ) <nl> - } ; <nl> - fp_flags = <nl> - ( make_fp_flags ~ mutability : None ~ accept_disposable : false <nl> - ~ has_default : false ~ mode : Typing_defs_core . FPnormal <nl> - ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> - } <nl> - ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | xhp . php line 7 , characters 10 - 32 ) , ( Tunion [ ] ) ) } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | xhp . php line 7 , characters 43 - 46 ) , ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - fe_pos = [ 7 : 10 - 33 ] ; fe_php_std_lib = false } } ; <nl> - typedefs = { } ; consts = { } ; records = { } } <nl> + [ ( " \ \ xhp " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> + sc_is_xhp = false ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> + sc_name = ( [ 3 : 7 - 10 ] , " \ \ xhp " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> + sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> + sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; <nl> + sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> + sc_constructor = None ; sc_static_methods = [ ] ; sc_methods = [ ] ; <nl> + sc_user_attributes = [ ] ; sc_enum_type = None } ) ) ; <nl> + ( " \ \ : foo " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> + sc_is_xhp = true ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> + sc_name = ( [ 4 : 7 - 11 ] , " \ \ : foo " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> + sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> + sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; <nl> + sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> + sc_constructor = None ; sc_static_methods = [ ] ; sc_methods = [ ] ; <nl> + sc_user_attributes = [ ] ; sc_enum_type = None } ) ) ; <nl> + ( " \ \ : foo : bar " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> + sc_is_xhp = true ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> + sc_name = ( [ 5 : 7 - 15 ] , " \ \ : foo : bar " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> + sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> + sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; <nl> + sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> + sc_constructor = None ; sc_static_methods = [ ] ; sc_methods = [ ] ; <nl> + sc_user_attributes = [ ] ; sc_enum_type = None } ) ) ; <nl> + ( " \ \ : foo - baz " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> + sc_is_xhp = true ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> + sc_name = ( [ 6 : 7 - 15 ] , " \ \ : foo - baz " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> + sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> + sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; <nl> + sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> + sc_constructor = None ; sc_static_methods = [ ] ; sc_methods = [ ] ; <nl> + sc_user_attributes = [ ] ; sc_enum_type = None } ) ) ; <nl> + ( " \ \ xhp_is_valid_class_name " , <nl> + ( Shallow_decl_defs . Fun <nl> + { Typing_defs . fe_deprecated = None ; <nl> + fe_type = <nl> + ( Rwitness ( root | xhp . php line 7 , characters 10 - 32 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; <nl> + ft_params = <nl> + [ { fp_pos = [ 7 : 38 - 40 ] ; fp_name = ( Some " $ x " ) ; <nl> + fp_type = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | xhp . php line 7 , characters 34 - 36 ) , <nl> + ( Tapply ( ( [ 7 : 34 - 37 ] , " \ \ xhp " ) , [ ] ) ) ) <nl> + } ; <nl> + fp_flags = <nl> + ( make_fp_flags ~ mutability : None ~ accept_disposable : false <nl> + ~ has_default : false ~ mode : Typing_defs_core . FPnormal <nl> + ~ ifc_external : false ~ ifc_can_call : false ) ; <nl> + } <nl> + ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | xhp . php line 7 , characters 10 - 32 ) , ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | xhp . php line 7 , characters 43 - 46 ) , ( Tprim Tvoid ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + fe_pos = [ 7 : 10 - 33 ] ; fe_php_std_lib = false } ) ) <nl> + ] <nl> <nl> They matched ! <nl> mmm a / hphp / hack / test / decl / xhp_attr . php . exp <nl> ppp b / hphp / hack / test / decl / xhp_attr . php . exp <nl> <nl> - Parsed decls : <nl> - <nl> - { classes = <nl> - { " \ \ : bar " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> - sc_is_xhp = true ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> - sc_name = ( [ 3 : 7 - 11 ] , " \ \ : bar " ) ; sc_tparams = [ ] ; <nl> - sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> - sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> - sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; <nl> - sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; sc_constructor = None ; <nl> - sc_static_methods = [ ] ; sc_methods = [ ] ; sc_user_attributes = [ ] ; <nl> - sc_enum_type = None } ; <nl> - " \ \ : foo " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> - sc_is_xhp = true ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> - sc_name = ( [ 5 : 7 - 11 ] , " \ \ : foo " ) ; sc_tparams = [ ] ; <nl> - sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> - sc_xhp_attr_uses = <nl> - [ ( Rhint ( root | xhp_attr . php line 13 , characters 13 - 16 ) , <nl> - ( Tapply ( ( [ 13 : 13 - 17 ] , " \ \ : bar " ) , [ ] ) ) ) ] ; <nl> - sc_req_extends = [ ] ; sc_req_implements = [ ] ; sc_implements = [ ] ; <nl> - sc_consts = [ ] ; sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; <nl> - sc_props = <nl> - [ { Shallow_decl_defs . sp_const = false ; sp_xhp_attr = None ; <nl> - sp_lateinit = false ; sp_lsb = false ; <nl> - sp_name = ( [ 6 : 18 - 25 ] , " before " ) ; sp_needs_init = true ; <nl> - sp_type = <nl> - ( Some ( Rhint ( root | xhp_attr . php line 6 , characters 10 - 16 ) , <nl> - ( Toption <nl> - ( Rhint ( root | xhp_attr . php line 6 , characters 11 - 16 ) , <nl> - ( Tprim Tstring ) ) ) ) ) ; <nl> - sp_abstract = false ; sp_visibility = Public } ; <nl> - { Shallow_decl_defs . sp_const = false ; sp_xhp_attr = None ; <nl> - sp_lateinit = false ; sp_lsb = false ; <nl> - sp_name = ( [ 14 : 18 - 24 ] , " after " ) ; sp_needs_init = true ; <nl> - sp_type = <nl> - ( Some ( Rhint ( root | xhp_attr . php line 14 , characters 10 - 16 ) , <nl> - ( Toption <nl> - ( Rhint ( root | xhp_attr . php line 14 , characters 11 - 16 ) , <nl> - ( Tprim Tstring ) ) ) ) ) ; <nl> - sp_abstract = false ; sp_visibility = Public } ; <nl> - { Shallow_decl_defs . sp_const = false ; <nl> - sp_xhp_attr = <nl> - ( Some { Typing_defs_core . xa_tag = None ; xa_has_default = true } ) ; <nl> - sp_lateinit = false ; sp_lsb = false ; sp_name = ( [ 7 : 17 - 18 ] , " : a " ) ; <nl> - sp_needs_init = false ; <nl> - sp_type = <nl> - ( Some ( Rhint ( root | xhp_attr . php line 7 , characters 13 - 15 ) , <nl> - ( Tprim Tint ) ) ) ; <nl> - sp_abstract = false ; sp_visibility = Public } ; <nl> - { Shallow_decl_defs . sp_const = false ; <nl> - sp_xhp_attr = <nl> - ( Some { Typing_defs_core . xa_tag = None ; xa_has_default = false } ) ; <nl> - sp_lateinit = false ; sp_lsb = false ; sp_name = ( [ 8 : 17 - 18 ] , " : b " ) ; <nl> - sp_needs_init = true ; <nl> - sp_type = <nl> - ( Some ( Rhint ( root | xhp_attr . php line 8 , characters 13 - 15 ) , <nl> - ( Toption <nl> - ( Rhint ( root | xhp_attr . php line 8 , characters 13 - 15 ) , <nl> - ( Tprim Tint ) ) ) ) ) ; <nl> - sp_abstract = false ; sp_visibility = Public } ; <nl> - { Shallow_decl_defs . sp_const = false ; <nl> - sp_xhp_attr = <nl> - ( Some { Typing_defs_core . xa_tag = ( Some Typing_defs_core . Required ) ; <nl> - xa_has_default = false } ) ; <nl> - sp_lateinit = false ; sp_lsb = false ; sp_name = ( [ 9 : 17 - 18 ] , " : c " ) ; <nl> - sp_needs_init = true ; <nl> - sp_type = <nl> - ( Some ( Rhint ( root | xhp_attr . php line 9 , characters 13 - 15 ) , <nl> - ( Tprim Tint ) ) ) ; <nl> - sp_abstract = false ; sp_visibility = Public } ; <nl> - { Shallow_decl_defs . sp_const = false ; <nl> - sp_xhp_attr = <nl> - ( Some { Typing_defs_core . xa_tag = None ; xa_has_default = true } ) ; <nl> - sp_lateinit = false ; sp_lsb = false ; sp_name = ( [ 10 : 18 - 19 ] , " : d " ) ; <nl> - sp_needs_init = false ; <nl> - sp_type = <nl> - ( Some ( Rhint ( root | xhp_attr . php line 10 , characters 13 - 16 ) , <nl> - ( Toption <nl> - ( Rhint ( root | xhp_attr . php line 10 , characters 14 - 16 ) , <nl> - ( Tprim Tint ) ) ) ) ) ; <nl> - sp_abstract = false ; sp_visibility = Public } ; <nl> - { Shallow_decl_defs . sp_const = false ; <nl> - sp_xhp_attr = <nl> - ( Some { Typing_defs_core . xa_tag = None ; xa_has_default = false } ) ; <nl> - sp_lateinit = false ; sp_lsb = false ; sp_name = ( [ 11 : 29 - 30 ] , " : e " ) ; <nl> - sp_needs_init = true ; <nl> - sp_type = <nl> - ( Some ( Rhint ( root | xhp_attr . php line 11 , characters 19 - 21 ) , <nl> - ( Toption <nl> - ( Rwitness ( root | xhp_attr . php line 11 , characters 19 - 21 ) , <nl> - ( Tprim Tstring ) ) ) ) ) ; <nl> - sp_abstract = false ; sp_visibility = Public } ; <nl> - { Shallow_decl_defs . sp_const = false ; <nl> - sp_xhp_attr = <nl> - ( Some { Typing_defs_core . xa_tag = ( Some Typing_defs_core . Lateinit ) ; <nl> - xa_has_default = false } ) ; <nl> - sp_lateinit = false ; sp_lsb = false ; sp_name = ( [ 12 : 17 - 18 ] , " : f " ) ; <nl> - sp_needs_init = true ; <nl> - sp_type = <nl> - ( Some ( Rhint ( root | xhp_attr . php line 12 , characters 13 - 15 ) , <nl> - ( Tprim Tint ) ) ) ; <nl> - sp_abstract = false ; sp_visibility = Public } <nl> - ] ; <nl> - sc_sprops = [ ] ; sc_constructor = None ; sc_static_methods = [ ] ; <nl> - sc_methods = [ ] ; sc_user_attributes = [ ] ; sc_enum_type = None } } ; <nl> - funs = { } ; typedefs = { } ; consts = { } ; records = { } } <nl> - <nl> - They matched ! <nl> + mmm legacy <nl> ppp + direct decl <nl> + <nl> + [ ( " \ \ : bar " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> + sc_is_xhp = true ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> + sc_name = ( [ 3 : 7 - 11 ] , " \ \ : bar " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> + sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> + sc_implements = [ ] ; sc_consts = [ ] ; sc_typeconsts = [ ] ; <nl> + sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> + sc_constructor = None ; sc_static_methods = [ ] ; sc_methods = [ ] ; <nl> + sc_user_attributes = [ ] ; sc_enum_type = None } ) ) ; <nl> + ( " \ \ : foo " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> + sc_is_xhp = true ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> + sc_name = ( [ 5 : 7 - 11 ] , " \ \ : foo " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> + sc_xhp_attr_uses = <nl> + [ ( Rhint ( root | xhp_attr . php line 13 , characters 13 - 16 ) , <nl> + ( Tapply ( ( [ 13 : 13 - 17 ] , " \ \ : bar " ) , [ ] ) ) ) ] ; <nl> + sc_req_extends = [ ] ; sc_req_implements = [ ] ; sc_implements = [ ] ; <nl> + sc_consts = [ ] ; sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; <nl> + sc_props = <nl> + [ { Shallow_decl_defs . sp_const = false ; sp_xhp_attr = None ; <nl> + sp_lateinit = false ; sp_lsb = false ; <nl> + sp_name = ( [ 6 : 18 - 25 ] , " before " ) ; sp_needs_init = true ; <nl> + sp_type = <nl> + ( Some ( Rhint ( root | xhp_attr . php line 6 , characters 10 - 16 ) , <nl> + ( Toption <nl> + ( Rhint ( root | xhp_attr . php line 6 , characters 11 - 16 ) , <nl> + ( Tprim Tstring ) ) ) ) ) ; <nl> + sp_abstract = false ; sp_visibility = Public } ; <nl> + { Shallow_decl_defs . sp_const = false ; sp_xhp_attr = None ; <nl> + sp_lateinit = false ; sp_lsb = false ; <nl> + sp_name = ( [ 14 : 18 - 24 ] , " after " ) ; sp_needs_init = true ; <nl> + sp_type = <nl> + ( Some ( Rhint ( root | xhp_attr . php line 14 , characters 10 - 16 ) , <nl> + ( Toption <nl> + ( Rhint ( root | xhp_attr . php line 14 , characters 11 - 16 ) , <nl> + ( Tprim Tstring ) ) ) ) ) ; <nl> + sp_abstract = false ; sp_visibility = Public } ; <nl> + { Shallow_decl_defs . sp_const = false ; <nl> + sp_xhp_attr = <nl> + ( Some { Typing_defs_core . xa_tag = None ; xa_has_default = true } ) ; <nl> + sp_lateinit = false ; sp_lsb = false ; sp_name = ( [ 7 : 17 - 18 ] , " : a " ) ; <nl> + sp_needs_init = false ; <nl> + sp_type = <nl> + ( Some ( Rhint ( root | xhp_attr . php line 7 , characters 13 - 15 ) , <nl> + ( Tprim Tint ) ) ) ; <nl> + sp_abstract = false ; sp_visibility = Public } ; <nl> + { Shallow_decl_defs . sp_const = false ; <nl> + sp_xhp_attr = <nl> + ( Some { Typing_defs_core . xa_tag = None ; xa_has_default = false } ) ; <nl> + sp_lateinit = false ; sp_lsb = false ; sp_name = ( [ 8 : 17 - 18 ] , " : b " ) ; <nl> + sp_needs_init = true ; <nl> + sp_type = <nl> + ( Some ( Rhint ( root | xhp_attr . php line 8 , characters 13 - 15 ) , <nl> + ( Toption <nl> + ( Rhint ( root | xhp_attr . php line 8 , characters 13 - 15 ) , <nl> + ( Tprim Tint ) ) ) ) ) ; <nl> + sp_abstract = false ; sp_visibility = Public } ; <nl> + { Shallow_decl_defs . sp_const = false ; <nl> + sp_xhp_attr = <nl> + ( Some { Typing_defs_core . xa_tag = <nl> + ( Some Typing_defs_core . Required ) ; xa_has_default = false <nl> + } ) ; <nl> + sp_lateinit = false ; sp_lsb = false ; sp_name = ( [ 9 : 17 - 18 ] , " : c " ) ; <nl> + sp_needs_init = true ; <nl> + sp_type = <nl> + ( Some ( Rhint ( root | xhp_attr . php line 9 , characters 13 - 15 ) , <nl> + ( Tprim Tint ) ) ) ; <nl> + sp_abstract = false ; sp_visibility = Public } ; <nl> + { Shallow_decl_defs . sp_const = false ; <nl> + sp_xhp_attr = <nl> + ( Some { Typing_defs_core . xa_tag = None ; xa_has_default = true } ) ; <nl> + sp_lateinit = false ; sp_lsb = false ; <nl> + sp_name = ( [ 10 : 18 - 19 ] , " : d " ) ; sp_needs_init = false ; <nl> + sp_type = <nl> + ( Some ( Rhint ( root | xhp_attr . php line 10 , characters 13 - 16 ) , <nl> + ( Toption <nl> + ( Rhint ( root | xhp_attr . php line 10 , characters 14 - 16 ) , <nl> + ( Tprim Tint ) ) ) ) ) ; <nl> + sp_abstract = false ; sp_visibility = Public } ; <nl> + { Shallow_decl_defs . sp_const = false ; <nl> + sp_xhp_attr = <nl> + ( Some { Typing_defs_core . xa_tag = None ; xa_has_default = false } ) ; <nl> + sp_lateinit = false ; sp_lsb = false ; <nl> + sp_name = ( [ 11 : 29 - 30 ] , " : e " ) ; sp_needs_init = true ; <nl> + sp_type = <nl> + - ( Some ( Rhint ( root | xhp_attr . php line 11 , characters 13 - 27 ) , <nl> + + ( Some ( Rhint ( root | xhp_attr . php line 11 , characters 19 - 21 ) , <nl> + ( Toption <nl> + - ( Rhint ( root | xhp_attr . php line 11 , characters 13 - 27 ) , <nl> + + ( Rwitness ( root | xhp_attr . php line 11 , characters 19 - 21 ) , <nl> + ( Tprim Tstring ) ) ) ) ) ; <nl> + sp_abstract = false ; sp_visibility = Public } ; <nl> + { Shallow_decl_defs . sp_const = false ; <nl> + sp_xhp_attr = <nl> + ( Some { Typing_defs_core . xa_tag = <nl> + ( Some Typing_defs_core . Lateinit ) ; xa_has_default = false <nl> + } ) ; <nl> + sp_lateinit = false ; sp_lsb = false ; <nl> + sp_name = ( [ 12 : 17 - 18 ] , " : f " ) ; sp_needs_init = true ; <nl> + sp_type = <nl> + ( Some ( Rhint ( root | xhp_attr . php line 12 , characters 13 - 15 ) , <nl> + ( Tprim Tint ) ) ) ; <nl> + sp_abstract = false ; sp_visibility = Public } <nl> + ] ; <nl> + sc_sprops = [ ] ; sc_constructor = None ; sc_static_methods = [ ] ; <nl> + sc_methods = [ ] ; sc_user_attributes = [ ] ; sc_enum_type = None } ) ) <nl> + ] <nl> mmm a / hphp / hack / test / decl / xhp_class_const . php . exp <nl> ppp b / hphp / hack / test / decl / xhp_class_const . php . exp <nl> <nl> - Parsed decls : <nl> - <nl> - { classes = <nl> - { " \ \ : foo " - > <nl> - { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> - sc_is_xhp = true ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> - sc_name = ( [ 3 : 7 - 11 ] , " \ \ : foo " ) ; sc_tparams = [ ] ; <nl> - sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> - sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> - sc_implements = [ ] ; <nl> - sc_consts = <nl> - [ { Shallow_decl_defs . scc_abstract = false ; scc_name = ( [ 4 : 13 - 14 ] , " X " ) ; <nl> - scc_type = <nl> - ( Rhint ( root | xhp_class_const . php line 4 , characters 9 - 11 ) , <nl> - ( Tprim Tint ) ) <nl> - } <nl> - ] ; <nl> - sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> - sc_constructor = None ; sc_static_methods = [ ] ; sc_methods = [ ] ; <nl> - sc_user_attributes = [ ] ; sc_enum_type = None } } ; <nl> - funs = { } ; typedefs = { } ; consts = { } ; records = { } } <nl> + [ ( " \ \ : foo " , <nl> + ( Shallow_decl_defs . Class <nl> + { Shallow_decl_defs . sc_mode = Mstrict ; sc_final = false ; <nl> + sc_is_xhp = true ; sc_has_xhp_keyword = false ; sc_kind = Cnormal ; <nl> + sc_name = ( [ 3 : 7 - 11 ] , " \ \ : foo " ) ; sc_tparams = [ ] ; <nl> + sc_where_constraints = [ ] ; sc_extends = [ ] ; sc_uses = [ ] ; <nl> + sc_xhp_attr_uses = [ ] ; sc_req_extends = [ ] ; sc_req_implements = [ ] ; <nl> + sc_implements = [ ] ; <nl> + sc_consts = <nl> + [ { Shallow_decl_defs . scc_abstract = false ; <nl> + scc_name = ( [ 4 : 13 - 14 ] , " X " ) ; <nl> + scc_type = <nl> + ( Rhint ( root | xhp_class_const . php line 4 , characters 9 - 11 ) , <nl> + ( Tprim Tint ) ) <nl> + } <nl> + ] ; <nl> + sc_typeconsts = [ ] ; sc_pu_enums = [ ] ; sc_props = [ ] ; sc_sprops = [ ] ; <nl> + sc_constructor = None ; sc_static_methods = [ ] ; sc_methods = [ ] ; <nl> + sc_user_attributes = [ ] ; sc_enum_type = None } ) ) <nl> + ] <nl> <nl> They matched ! <nl> mmm a / hphp / hack / test / decl / yield_deeper . php . exp <nl> ppp b / hphp / hack / test / decl / yield_deeper . php . exp <nl> <nl> - Parsed decls : <nl> - <nl> - { classes = { } ; <nl> - funs = <nl> - { " \ \ f " - > <nl> - { Typing_defs . fe_deprecated = None ; <nl> - fe_type = <nl> - ( Rwitness ( root | yield_deeper . php line 3 , characters 10 - 10 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | yield_deeper . php line 3 , characters 10 - 10 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | yield_deeper . php line 3 , characters 15 - 42 ) , <nl> - ( Tapply ( ( [ 3 : 15 - 24 ] , " \ \ Generator " ) , <nl> - [ ( Rhint ( root | yield_deeper . php line 3 , characters 25 - 28 ) , <nl> - ( Tprim Tbool ) ) ; <nl> - ( Rhint ( root | yield_deeper . php line 3 , characters 31 - 36 ) , <nl> - ( Tprim Tstring ) ) ; <nl> - ( Rhint ( root | yield_deeper . php line 3 , characters 39 - 41 ) , <nl> - ( Tprim Tint ) ) <nl> - ] <nl> - ) ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FGenerator None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - fe_pos = [ 3 : 10 - 11 ] ; fe_php_std_lib = false } ; <nl> - " \ \ g " - > <nl> - { Typing_defs . fe_deprecated = None ; <nl> - fe_type = <nl> - ( Rwitness ( root | yield_deeper . php line 7 , characters 10 - 10 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | yield_deeper . php line 7 , characters 10 - 10 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | yield_deeper . php line 7 , characters 15 - 18 ) , <nl> - ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - fe_pos = [ 7 : 10 - 11 ] ; fe_php_std_lib = false } ; <nl> - " \ \ h " - > <nl> - { Typing_defs . fe_deprecated = None ; <nl> - fe_type = <nl> - ( Rwitness ( root | yield_deeper . php line 13 , characters 10 - 10 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | yield_deeper . php line 13 , characters 10 - 10 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | yield_deeper . php line 13 , characters 15 - 18 ) , <nl> - ( Tprim Tvoid ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FSync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - fe_pos = [ 13 : 10 - 11 ] ; fe_php_std_lib = false } ; <nl> - " \ \ i " - > <nl> - { Typing_defs . fe_deprecated = None ; <nl> - fe_type = <nl> - ( Rwitness ( root | yield_deeper . php line 19 , characters 16 - 16 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | yield_deeper . php line 19 , characters 16 - 16 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | yield_deeper . php line 19 , characters 21 - 35 ) , <nl> - ( Tapply ( ( [ 19 : 21 - 30 ] , " \ \ HH \ \ Awaitable " ) , <nl> - [ ( Rhint ( root | yield_deeper . php line 19 , characters 31 - 34 ) , <nl> - ( Tprim Tvoid ) ) ] <nl> - ) ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FAsync None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - fe_pos = [ 19 : 16 - 17 ] ; fe_php_std_lib = false } ; <nl> - " \ \ j " - > <nl> - { Typing_defs . fe_deprecated = None ; <nl> - fe_type = <nl> - ( Rwitness ( root | yield_deeper . php line 26 , characters 16 - 16 ) , <nl> - ( Tfun <nl> - { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> - ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> - ft_implicit_params = <nl> - { capability = <nl> - ( Rhint ( root | yield_deeper . php line 26 , characters 16 - 16 ) , <nl> - ( Tunion [ ] ) ) <nl> - } ; <nl> - ft_ret = <nl> - { et_enforced = false ; <nl> - et_type = <nl> - ( Rhint ( root | yield_deeper . php line 26 , characters 21 - 51 ) , <nl> - ( Tapply ( ( [ 26 : 21 - 39 ] , " \ \ HH \ \ AsyncKeyedIterator " ) , <nl> - [ ( Rhint ( root | yield_deeper . php line 26 , characters 40 - 45 ) , <nl> - ( Tprim Tstring ) ) ; <nl> - ( Rhint ( root | yield_deeper . php line 26 , characters 48 - 50 ) , <nl> - ( Tprim Tint ) ) <nl> - ] <nl> - ) ) ) <nl> - } ; <nl> - ft_flags = <nl> - ( make_ft_flags FAsyncGenerator None ~ return_disposable : false <nl> - ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> - ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> - fe_pos = [ 26 : 16 - 17 ] ; fe_php_std_lib = false } } ; <nl> - typedefs = { } ; consts = { } ; records = { } } <nl> + [ ( " \ \ f " , <nl> + ( Shallow_decl_defs . Fun <nl> + { Typing_defs . fe_deprecated = None ; <nl> + fe_type = <nl> + ( Rwitness ( root | yield_deeper . php line 3 , characters 10 - 10 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | yield_deeper . php line 3 , characters 10 - 10 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | yield_deeper . php line 3 , characters 15 - 42 ) , <nl> + ( Tapply ( ( [ 3 : 15 - 24 ] , " \ \ Generator " ) , <nl> + [ ( Rhint ( root | yield_deeper . php line 3 , characters 25 - 28 ) , <nl> + ( Tprim Tbool ) ) ; <nl> + ( Rhint ( root | yield_deeper . php line 3 , characters 31 - 36 ) , <nl> + ( Tprim Tstring ) ) ; <nl> + ( Rhint ( root | yield_deeper . php line 3 , characters 39 - 41 ) , <nl> + ( Tprim Tint ) ) <nl> + ] <nl> + ) ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FGenerator None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + fe_pos = [ 3 : 10 - 11 ] ; fe_php_std_lib = false } ) ) ; <nl> + ( " \ \ g " , <nl> + ( Shallow_decl_defs . Fun <nl> + { Typing_defs . fe_deprecated = None ; <nl> + fe_type = <nl> + ( Rwitness ( root | yield_deeper . php line 7 , characters 10 - 10 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | yield_deeper . php line 7 , characters 10 - 10 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | yield_deeper . php line 7 , characters 15 - 18 ) , <nl> + ( Tprim Tvoid ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + fe_pos = [ 7 : 10 - 11 ] ; fe_php_std_lib = false } ) ) ; <nl> + ( " \ \ h " , <nl> + ( Shallow_decl_defs . Fun <nl> + { Typing_defs . fe_deprecated = None ; <nl> + fe_type = <nl> + ( Rwitness ( root | yield_deeper . php line 13 , characters 10 - 10 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | yield_deeper . php line 13 , characters 10 - 10 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | yield_deeper . php line 13 , characters 15 - 18 ) , <nl> + ( Tprim Tvoid ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FSync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + fe_pos = [ 13 : 10 - 11 ] ; fe_php_std_lib = false } ) ) ; <nl> + ( " \ \ i " , <nl> + ( Shallow_decl_defs . Fun <nl> + { Typing_defs . fe_deprecated = None ; <nl> + fe_type = <nl> + ( Rwitness ( root | yield_deeper . php line 19 , characters 16 - 16 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | yield_deeper . php line 19 , characters 16 - 16 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | yield_deeper . php line 19 , characters 21 - 35 ) , <nl> + ( Tapply ( ( [ 19 : 21 - 30 ] , " \ \ HH \ \ Awaitable " ) , <nl> + [ ( Rhint ( root | yield_deeper . php line 19 , characters 31 - 34 ) , <nl> + ( Tprim Tvoid ) ) ] <nl> + ) ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FAsync None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + fe_pos = [ 19 : 16 - 17 ] ; fe_php_std_lib = false } ) ) ; <nl> + ( " \ \ j " , <nl> + ( Shallow_decl_defs . Fun <nl> + { Typing_defs . fe_deprecated = None ; <nl> + fe_type = <nl> + ( Rwitness ( root | yield_deeper . php line 26 , characters 16 - 16 ) , <nl> + ( Tfun <nl> + { ft_arity = ( Fstandard ( ) ) ; ft_tparams = [ ] ; <nl> + ft_where_constraints = [ ] ; ft_params = [ ] ; <nl> + ft_implicit_params = <nl> + { capability = <nl> + ( Rhint ( root | yield_deeper . php line 26 , characters 16 - 16 ) , <nl> + ( Tunion [ ] ) ) <nl> + } ; <nl> + ft_ret = <nl> + { et_enforced = false ; <nl> + et_type = <nl> + ( Rhint ( root | yield_deeper . php line 26 , characters 21 - 51 ) , <nl> + ( Tapply ( ( [ 26 : 21 - 39 ] , " \ \ HH \ \ AsyncKeyedIterator " ) , <nl> + [ ( Rhint ( root | yield_deeper . php line 26 , characters 40 - 45 ) , <nl> + ( Tprim Tstring ) ) ; <nl> + ( Rhint ( root | yield_deeper . php line 26 , characters 48 - 50 ) , <nl> + ( Tprim Tint ) ) <nl> + ] <nl> + ) ) ) <nl> + } ; <nl> + ft_flags = <nl> + ( make_ft_flags FAsyncGenerator None ~ return_disposable : false <nl> + ~ returns_mutable : false ~ returns_void_to_rx : false ) ; <nl> + ft_reactive = Nonreactive ; ft_ifc_decl = FDPolicied { # PUBLIC } } ) ) ; <nl> + fe_pos = [ 26 : 16 - 17 ] ; fe_php_std_lib = false } ) ) <nl> + ] <nl> <nl> They matched ! <nl>
Simplify hh_single_decl
facebook/hhvm
adeb1ab9f9702ae2b65b55c02222d1aac07adf57
2020-10-27T22:55:09Z
mmm a / BUILD . gn <nl> ppp b / BUILD . gn <nl> v8_source_set ( " v8_base " ) { <nl> " src / objects / js - array . h " , <nl> " src / objects / js - collection - inl . h " , <nl> " src / objects / js - collection . h " , <nl> + " src / objects / js - promise - inl . h " , <nl> + " src / objects / js - promise . h " , <nl> " src / objects / js - regexp - inl . h " , <nl> " src / objects / js - regexp . h " , <nl> " src / objects / literal - objects - inl . h " , <nl> v8_source_set ( " v8_base " ) { <nl> " src / objects / name . h " , <nl> " src / objects / object - macros - undef . h " , <nl> " src / objects / object - macros . h " , <nl> + " src / objects / promise - inl . h " , <nl> + " src / objects / promise . h " , <nl> " src / objects / property - descriptor - object - inl . h " , <nl> " src / objects / property - descriptor - object . h " , <nl> " src / objects / regexp - match - info . h " , <nl> mmm a / src / builtins / builtins - promise - gen . h <nl> ppp b / src / builtins / builtins - promise - gen . h <nl> <nl> <nl> # include " src / code - stub - assembler . h " <nl> # include " src / contexts . h " <nl> + # include " src / objects / promise . h " <nl> <nl> namespace v8 { <nl> namespace internal { <nl> mmm a / src / compiler / code - assembler . h <nl> ppp b / src / compiler / code - assembler . h <nl> class JSCollection ; <nl> class JSWeakCollection ; <nl> class JSWeakMap ; <nl> class JSWeakSet ; <nl> + class PromiseCapability ; <nl> + class PromiseFulfillReactionJobTask ; <nl> + class PromiseReaction ; <nl> + class PromiseReactionJobTask ; <nl> + class PromiseRejectReactionJobTask ; <nl> class Factory ; <nl> class Zone ; <nl> <nl> mmm a / src / factory . cc <nl> ppp b / src / factory . cc <nl> <nl> # include " src / objects / debug - objects - inl . h " <nl> # include " src / objects / frame - array - inl . h " <nl> # include " src / objects / module . h " <nl> + # include " src / objects / promise - inl . h " <nl> # include " src / objects / scope - info . h " <nl> # include " src / unicode - cache . h " <nl> # include " src / unicode - decoder . h " <nl> mmm a / src / factory . h <nl> ppp b / src / factory . h <nl> class JSWeakMap ; <nl> class NewFunctionArgs ; <nl> struct SourceRange ; <nl> class PreParsedScopeData ; <nl> + class PromiseResolveThenableJobTask ; <nl> class TemplateObjectDescription ; <nl> <nl> enum FunctionMode { <nl> mmm a / src / isolate . cc <nl> ppp b / src / isolate . cc <nl> <nl> # include " src / log . h " <nl> # include " src / messages . h " <nl> # include " src / objects / frame - array - inl . h " <nl> + # include " src / objects / promise - inl . h " <nl> # include " src / profiler / cpu - profiler . h " <nl> # include " src / prototype . h " <nl> # include " src / regexp / regexp - stack . h " <nl> mmm a / src / objects - debug . cc <nl> ppp b / src / objects - debug . cc <nl> <nl> # include " src / objects / debug - objects - inl . h " <nl> # include " src / objects / literal - objects . h " <nl> # include " src / objects / module . h " <nl> + # include " src / objects / promise - inl . h " <nl> # include " src / ostreams . h " <nl> # include " src / regexp / jsregexp . h " <nl> # include " src / transitions . h " <nl> mmm a / src / objects - inl . h <nl> ppp b / src / objects - inl . h <nl> <nl> # include " src / objects / hash - table . h " <nl> # include " src / objects / js - array - inl . h " <nl> # include " src / objects / js - collection - inl . h " <nl> + # include " src / objects / js - promise - inl . h " <nl> # include " src / objects / js - regexp - inl . h " <nl> # include " src / objects / literal - objects . h " <nl> # include " src / objects / module - inl . h " <nl> TYPE_CHECKER ( JSError , JS_ERROR_TYPE ) <nl> TYPE_CHECKER ( JSFunction , JS_FUNCTION_TYPE ) <nl> TYPE_CHECKER ( JSGlobalObject , JS_GLOBAL_OBJECT_TYPE ) <nl> TYPE_CHECKER ( JSMessageObject , JS_MESSAGE_OBJECT_TYPE ) <nl> - TYPE_CHECKER ( JSPromise , JS_PROMISE_TYPE ) <nl> TYPE_CHECKER ( JSStringIterator , JS_STRING_ITERATOR_TYPE ) <nl> TYPE_CHECKER ( JSValue , JS_VALUE_TYPE ) <nl> TYPE_CHECKER ( MutableHeapNumber , MUTABLE_HEAP_NUMBER_TYPE ) <nl> CAST_ACCESSOR ( JSGlobalObject ) <nl> CAST_ACCESSOR ( JSGlobalProxy ) <nl> CAST_ACCESSOR ( JSMessageObject ) <nl> CAST_ACCESSOR ( JSObject ) <nl> - CAST_ACCESSOR ( JSPromise ) <nl> CAST_ACCESSOR ( JSProxy ) <nl> CAST_ACCESSOR ( JSReceiver ) <nl> CAST_ACCESSOR ( JSStringIterator ) <nl> CAST_ACCESSOR ( ObjectTemplateInfo ) <nl> CAST_ACCESSOR ( Oddball ) <nl> CAST_ACCESSOR ( OrderedHashMap ) <nl> CAST_ACCESSOR ( OrderedHashSet ) <nl> - CAST_ACCESSOR ( PromiseCapability ) <nl> - CAST_ACCESSOR ( PromiseReaction ) <nl> - CAST_ACCESSOR ( PromiseReactionJobTask ) <nl> - CAST_ACCESSOR ( PromiseFulfillReactionJobTask ) <nl> - CAST_ACCESSOR ( PromiseRejectReactionJobTask ) <nl> - CAST_ACCESSOR ( PromiseResolveThenableJobTask ) <nl> CAST_ACCESSOR ( PropertyArray ) <nl> CAST_ACCESSOR ( PropertyCell ) <nl> CAST_ACCESSOR ( PrototypeInfo ) <nl> bool AccessorInfo : : has_getter ( ) { <nl> return result ; <nl> } <nl> <nl> - ACCESSORS ( PromiseReaction , next , Object , kNextOffset ) <nl> - ACCESSORS ( PromiseReaction , reject_handler , HeapObject , kRejectHandlerOffset ) <nl> - ACCESSORS ( PromiseReaction , fulfill_handler , HeapObject , kFulfillHandlerOffset ) <nl> - ACCESSORS ( PromiseReaction , payload , HeapObject , kPayloadOffset ) <nl> - <nl> ACCESSORS ( AsyncGeneratorRequest , next , Object , kNextOffset ) <nl> SMI_ACCESSORS ( AsyncGeneratorRequest , resume_mode , kResumeModeOffset ) <nl> ACCESSORS ( AsyncGeneratorRequest , value , Object , kValueOffset ) <nl> ACCESSORS ( CallableTask , context , Context , kContextOffset ) <nl> ACCESSORS ( CallbackTask , callback , Foreign , kCallbackOffset ) <nl> ACCESSORS ( CallbackTask , data , Foreign , kDataOffset ) <nl> <nl> - ACCESSORS ( PromiseResolveThenableJobTask , context , Context , kContextOffset ) <nl> - ACCESSORS ( PromiseResolveThenableJobTask , promise_to_resolve , JSPromise , <nl> - kPromiseToResolveOffset ) <nl> - ACCESSORS ( PromiseResolveThenableJobTask , then , JSReceiver , kThenOffset ) <nl> - ACCESSORS ( PromiseResolveThenableJobTask , thenable , JSReceiver , kThenableOffset ) <nl> - <nl> - ACCESSORS ( PromiseReactionJobTask , context , Context , kContextOffset ) <nl> - ACCESSORS ( PromiseReactionJobTask , argument , Object , kArgumentOffset ) ; <nl> - ACCESSORS ( PromiseReactionJobTask , handler , HeapObject , kHandlerOffset ) ; <nl> - ACCESSORS ( PromiseReactionJobTask , payload , HeapObject , kPayloadOffset ) ; <nl> - <nl> - ACCESSORS ( PromiseCapability , promise , HeapObject , kPromiseOffset ) <nl> - ACCESSORS ( PromiseCapability , resolve , Object , kResolveOffset ) <nl> - ACCESSORS ( PromiseCapability , reject , Object , kRejectOffset ) <nl> - <nl> - ACCESSORS ( JSPromise , reactions_or_result , Object , kReactionsOrResultOffset ) <nl> - SMI_ACCESSORS ( JSPromise , flags , kFlagsOffset ) <nl> - BOOL_ACCESSORS ( JSPromise , flags , has_handler , kHasHandlerBit ) <nl> - BOOL_ACCESSORS ( JSPromise , flags , handled_hint , kHandledHintBit ) <nl> - <nl> - Object * JSPromise : : result ( ) const { <nl> - DCHECK_NE ( Promise : : kPending , status ( ) ) ; <nl> - return reactions_or_result ( ) ; <nl> - } <nl> - <nl> - Object * JSPromise : : reactions ( ) const { <nl> - DCHECK_EQ ( Promise : : kPending , status ( ) ) ; <nl> - return reactions_or_result ( ) ; <nl> - } <nl> - <nl> ElementsKind JSObject : : GetElementsKind ( ) { <nl> ElementsKind kind = map ( ) - > elements_kind ( ) ; <nl> # if VERIFY_HEAP & & DEBUG <nl> mmm a / src / objects - printer . cc <nl> ppp b / src / objects - printer . cc <nl> <nl> # include " src / interpreter / bytecodes . h " <nl> # include " src / objects - inl . h " <nl> # include " src / objects / debug - objects - inl . h " <nl> + # include " src / objects / promise - inl . h " <nl> # include " src / ostreams . h " <nl> # include " src / regexp / jsregexp . h " <nl> # include " src / transitions - inl . h " <nl> mmm a / src / objects . cc <nl> ppp b / src / objects . cc <nl> <nl> # include " src / objects / frame - array - inl . h " <nl> # include " src / objects / hash - table . h " <nl> # include " src / objects / map . h " <nl> + # include " src / objects / promise - inl . h " <nl> # include " src / parsing / preparsed - scope - data . h " <nl> # include " src / property - descriptor . h " <nl> # include " src / prototype . h " <nl> mmm a / src / objects . h <nl> ppp b / src / objects . h <nl> class CallableTask : public Microtask { <nl> DISALLOW_IMPLICIT_CONSTRUCTORS ( CallableTask ) ; <nl> } ; <nl> <nl> - / / Struct to hold state required for PromiseReactionJob . See the comment on the <nl> - / / PromiseReaction below for details on how this is being managed to reduce the <nl> - / / memory and allocation overhead . This is the base class for the concrete <nl> - / / <nl> - / / - PromiseFulfillReactionJobTask <nl> - / / - PromiseRejectReactionJobTask <nl> - / / <nl> - / / classes , which are used to represent either reactions , and we distinguish <nl> - / / them by their instance types . <nl> - class PromiseReactionJobTask : public Microtask { <nl> - public : <nl> - DECL_ACCESSORS ( argument , Object ) <nl> - DECL_ACCESSORS ( context , Context ) <nl> - / / [ handler ] : This is either a Code object , a Callable or Undefined . <nl> - DECL_ACCESSORS ( handler , HeapObject ) <nl> - / / [ payload ] : Usually a JSPromise or a PromiseCapability . <nl> - DECL_ACCESSORS ( payload , HeapObject ) <nl> - <nl> - static const int kArgumentOffset = Microtask : : kHeaderSize ; <nl> - static const int kContextOffset = kArgumentOffset + kPointerSize ; <nl> - static const int kHandlerOffset = kContextOffset + kPointerSize ; <nl> - static const int kPayloadOffset = kHandlerOffset + kPointerSize ; <nl> - static const int kSize = kPayloadOffset + kPointerSize ; <nl> - <nl> - / / Dispatched behavior . <nl> - DECL_CAST ( PromiseReactionJobTask ) <nl> - DECL_VERIFIER ( PromiseReactionJobTask ) <nl> - <nl> - private : <nl> - DISALLOW_IMPLICIT_CONSTRUCTORS ( PromiseReactionJobTask ) ; <nl> - } ; <nl> - <nl> - / / Struct to hold state required for a PromiseReactionJob of type " Fulfill " . <nl> - class PromiseFulfillReactionJobTask : public PromiseReactionJobTask { <nl> - public : <nl> - / / Dispatched behavior . <nl> - DECL_CAST ( PromiseFulfillReactionJobTask ) <nl> - DECL_PRINTER ( PromiseFulfillReactionJobTask ) <nl> - DECL_VERIFIER ( PromiseFulfillReactionJobTask ) <nl> - <nl> - private : <nl> - DISALLOW_IMPLICIT_CONSTRUCTORS ( PromiseFulfillReactionJobTask ) ; <nl> - } ; <nl> - <nl> - / / Struct to hold state required for a PromiseReactionJob of type " Reject " . <nl> - class PromiseRejectReactionJobTask : public PromiseReactionJobTask { <nl> - public : <nl> - / / Dispatched behavior . <nl> - DECL_CAST ( PromiseRejectReactionJobTask ) <nl> - DECL_PRINTER ( PromiseRejectReactionJobTask ) <nl> - DECL_VERIFIER ( PromiseRejectReactionJobTask ) <nl> - <nl> - private : <nl> - DISALLOW_IMPLICIT_CONSTRUCTORS ( PromiseRejectReactionJobTask ) ; <nl> - } ; <nl> - <nl> - / / A container struct to hold state required for PromiseResolveThenableJob . <nl> - class PromiseResolveThenableJobTask : public Microtask { <nl> - public : <nl> - DECL_ACCESSORS ( context , Context ) <nl> - DECL_ACCESSORS ( promise_to_resolve , JSPromise ) <nl> - DECL_ACCESSORS ( then , JSReceiver ) <nl> - DECL_ACCESSORS ( thenable , JSReceiver ) <nl> - <nl> - static const int kContextOffset = Microtask : : kHeaderSize ; <nl> - static const int kPromiseToResolveOffset = kContextOffset + kPointerSize ; <nl> - static const int kThenOffset = kPromiseToResolveOffset + kPointerSize ; <nl> - static const int kThenableOffset = kThenOffset + kPointerSize ; <nl> - static const int kSize = kThenableOffset + kPointerSize ; <nl> - <nl> - / / Dispatched behavior . <nl> - DECL_CAST ( PromiseResolveThenableJobTask ) <nl> - DECL_PRINTER ( PromiseResolveThenableJobTask ) <nl> - DECL_VERIFIER ( PromiseResolveThenableJobTask ) <nl> - <nl> - private : <nl> - DISALLOW_IMPLICIT_CONSTRUCTORS ( PromiseResolveThenableJobTask ) ; <nl> - } ; <nl> - <nl> - / / Struct to hold the state of a PromiseCapability . <nl> - class PromiseCapability : public Struct { <nl> - public : <nl> - DECL_ACCESSORS ( promise , HeapObject ) <nl> - DECL_ACCESSORS ( resolve , Object ) <nl> - DECL_ACCESSORS ( reject , Object ) <nl> - <nl> - static const int kPromiseOffset = Struct : : kHeaderSize ; <nl> - static const int kResolveOffset = kPromiseOffset + kPointerSize ; <nl> - static const int kRejectOffset = kResolveOffset + kPointerSize ; <nl> - static const int kSize = kRejectOffset + kPointerSize ; <nl> - <nl> - / / Dispatched behavior . <nl> - DECL_CAST ( PromiseCapability ) <nl> - DECL_PRINTER ( PromiseCapability ) <nl> - DECL_VERIFIER ( PromiseCapability ) <nl> - <nl> - private : <nl> - DISALLOW_IMPLICIT_CONSTRUCTORS ( PromiseCapability ) ; <nl> - } ; <nl> - <nl> - / / A representation of promise reaction . This differs from the specification <nl> - / / in that the PromiseReaction here holds both handlers for the fulfill and <nl> - / / the reject case . When a JSPromise is eventually resolved ( either via <nl> - / / fulfilling it or rejecting it ) , we morph this PromiseReaction object in <nl> - / / memory into a proper PromiseReactionJobTask and schedule it on the queue <nl> - / / of microtasks . So the size of PromiseReaction and the size of the <nl> - / / PromiseReactionJobTask has to be same for this to work . <nl> - / / <nl> - / / The PromiseReaction : : payload field usually holds a JSPromise <nl> - / / instance ( in the fast case of a native promise ) or a PromiseCapability <nl> - / / in case of a custom promise . For await we store the JSGeneratorObject <nl> - / / here and use custom Code handlers . <nl> - / / <nl> - / / We need to keep the context in the PromiseReaction so that we can run <nl> - / / the default handlers ( in case they are undefined ) in the proper context . <nl> - / / <nl> - / / The PromiseReaction objects form a singly - linked list , terminated by <nl> - / / Smi 0 . On the JSPromise instance they are linked in reverse order , <nl> - / / and are turned into the proper order again when scheduling them on <nl> - / / the microtask queue . <nl> - class PromiseReaction : public Struct { <nl> - public : <nl> - enum Type { kFulfill , kReject } ; <nl> - <nl> - DECL_ACCESSORS ( next , Object ) <nl> - / / [ reject_handler ] : This is either a Code object , a Callable or Undefined . <nl> - DECL_ACCESSORS ( reject_handler , HeapObject ) <nl> - / / [ fulfill_handler ] : This is either a Code object , a Callable or Undefined . <nl> - DECL_ACCESSORS ( fulfill_handler , HeapObject ) <nl> - / / [ payload ] : Usually a JSPromise or a PromiseCapability . <nl> - DECL_ACCESSORS ( payload , HeapObject ) <nl> - <nl> - static const int kNextOffset = Struct : : kHeaderSize ; <nl> - static const int kRejectHandlerOffset = kNextOffset + kPointerSize ; <nl> - static const int kFulfillHandlerOffset = kRejectHandlerOffset + kPointerSize ; <nl> - static const int kPayloadOffset = kFulfillHandlerOffset + kPointerSize ; <nl> - static const int kSize = kPayloadOffset + kPointerSize ; <nl> - <nl> - / / Dispatched behavior . <nl> - DECL_CAST ( PromiseReaction ) <nl> - DECL_PRINTER ( PromiseReaction ) <nl> - DECL_VERIFIER ( PromiseReaction ) <nl> - <nl> - private : <nl> - DISALLOW_IMPLICIT_CONSTRUCTORS ( PromiseReaction ) ; <nl> - } ; <nl> - <nl> class AsyncGeneratorRequest : public Struct { <nl> public : <nl> / / Holds an AsyncGeneratorRequest , or Undefined . <nl> class JSMessageObject : public JSObject { <nl> typedef BodyDescriptor BodyDescriptorWeak ; <nl> } ; <nl> <nl> - / / Representation of promise objects in the specification . Our layout of <nl> - / / JSPromise differs a bit from the layout in the specification , for example <nl> - / / there ' s only a single list of PromiseReaction objects , instead of separate <nl> - / / lists for fulfill and reject reactions . The PromiseReaction carries both <nl> - / / callbacks from the start , and is eventually morphed into the proper kind of <nl> - / / PromiseReactionJobTask when the JSPromise is settled . <nl> - / / <nl> - / / We also overlay the result and reactions fields on the JSPromise , since <nl> - / / the reactions are only necessary for pending promises , whereas the result <nl> - / / is only meaningful for settled promises . <nl> - class JSPromise : public JSObject { <nl> - public : <nl> - / / [ reactions_or_result ] : Smi 0 terminated list of PromiseReaction objects <nl> - / / in case the JSPromise was not settled yet , otherwise the result . <nl> - DECL_ACCESSORS ( reactions_or_result , Object ) <nl> - <nl> - / / [ result ] : Checks that the promise is settled and returns the result . <nl> - inline Object * result ( ) const ; <nl> - <nl> - / / [ reactions ] : Checks that the promise is pending and returns the reactions . <nl> - inline Object * reactions ( ) const ; <nl> - <nl> - DECL_INT_ACCESSORS ( flags ) <nl> - <nl> - / / [ has_handler ] : Whether this promise has a reject handler or not . <nl> - DECL_BOOLEAN_ACCESSORS ( has_handler ) <nl> - <nl> - / / [ handled_hint ] : Whether this promise will be handled by a catch <nl> - / / block in an async function . <nl> - DECL_BOOLEAN_ACCESSORS ( handled_hint ) <nl> - <nl> - static const char * Status ( Promise : : PromiseState status ) ; <nl> - Promise : : PromiseState status ( ) const ; <nl> - void set_status ( Promise : : PromiseState status ) ; <nl> - <nl> - / / ES section # sec - fulfillpromise <nl> - static Handle < Object > Fulfill ( Handle < JSPromise > promise , <nl> - Handle < Object > value ) ; <nl> - / / ES section # sec - rejectpromise <nl> - static Handle < Object > Reject ( Handle < JSPromise > promise , Handle < Object > reason , <nl> - bool debug_event = true ) ; <nl> - / / ES section # sec - promise - resolve - functions <nl> - MUST_USE_RESULT static MaybeHandle < Object > Resolve ( Handle < JSPromise > promise , <nl> - Handle < Object > resolution ) ; <nl> - <nl> - / / This is a helper that extracts the JSPromise from the input <nl> - / / { object } , which is used as a payload for PromiseReaction and <nl> - / / PromiseReactionJobTask . <nl> - MUST_USE_RESULT static MaybeHandle < JSPromise > From ( Handle < HeapObject > object ) ; <nl> - <nl> - DECL_CAST ( JSPromise ) <nl> - <nl> - / / Dispatched behavior . <nl> - DECL_PRINTER ( JSPromise ) <nl> - DECL_VERIFIER ( JSPromise ) <nl> - <nl> - / / Layout description . <nl> - static const int kReactionsOrResultOffset = JSObject : : kHeaderSize ; <nl> - static const int kFlagsOffset = kReactionsOrResultOffset + kPointerSize ; <nl> - static const int kSize = kFlagsOffset + kPointerSize ; <nl> - static const int kSizeWithEmbedderFields = <nl> - kSize + v8 : : Promise : : kEmbedderFieldCount * kPointerSize ; <nl> - <nl> - / / Flags layout . <nl> - / / The first two bits store the v8 : : Promise : : PromiseState . <nl> - static const int kStatusBits = 2 ; <nl> - static const int kHasHandlerBit = 2 ; <nl> - static const int kHandledHintBit = 3 ; <nl> - <nl> - static const int kStatusShift = 0 ; <nl> - static const int kStatusMask = 0x3 ; <nl> - STATIC_ASSERT ( v8 : : Promise : : kPending = = 0 ) ; <nl> - STATIC_ASSERT ( v8 : : Promise : : kFulfilled = = 1 ) ; <nl> - STATIC_ASSERT ( v8 : : Promise : : kRejected = = 2 ) ; <nl> - <nl> - private : <nl> - / / ES section # sec - triggerpromisereactions <nl> - static Handle < Object > TriggerPromiseReactions ( Isolate * isolate , <nl> - Handle < Object > reactions , <nl> - Handle < Object > argument , <nl> - PromiseReaction : : Type type ) ; <nl> - } ; <nl> - <nl> class AllocationSite : public Struct { <nl> public : <nl> static const uint32_t kMaximumArrayBytesToPretransition = 8 * 1024 ; <nl> new file mode 100644 <nl> index 00000000000 . . afe297b8800 <nl> mmm / dev / null <nl> ppp b / src / objects / js - promise - inl . h <nl> <nl> + / / Copyright 2018 the V8 project authors . All rights reserved . <nl> + / / Use of this source code is governed by a BSD - style license that can be <nl> + / / found in the LICENSE file . <nl> + <nl> + # ifndef V8_OBJECTS_JS_PROMISE_INL_H_ <nl> + # define V8_OBJECTS_JS_PROMISE_INL_H_ <nl> + <nl> + # include " src / objects . h " <nl> + # include " src / objects / js - promise . h " <nl> + <nl> + / / Has to be the last include ( doesn ' t have include guards ) : <nl> + # include " src / objects / object - macros . h " <nl> + <nl> + namespace v8 { <nl> + namespace internal { <nl> + <nl> + TYPE_CHECKER ( JSPromise , JS_PROMISE_TYPE ) <nl> + CAST_ACCESSOR ( JSPromise ) <nl> + <nl> + ACCESSORS ( JSPromise , reactions_or_result , Object , kReactionsOrResultOffset ) <nl> + SMI_ACCESSORS ( JSPromise , flags , kFlagsOffset ) <nl> + BOOL_ACCESSORS ( JSPromise , flags , has_handler , kHasHandlerBit ) <nl> + BOOL_ACCESSORS ( JSPromise , flags , handled_hint , kHandledHintBit ) <nl> + <nl> + Object * JSPromise : : result ( ) const { <nl> + DCHECK_NE ( Promise : : kPending , status ( ) ) ; <nl> + return reactions_or_result ( ) ; <nl> + } <nl> + <nl> + Object * JSPromise : : reactions ( ) const { <nl> + DCHECK_EQ ( Promise : : kPending , status ( ) ) ; <nl> + return reactions_or_result ( ) ; <nl> + } <nl> + <nl> + } / / namespace internal <nl> + } / / namespace v8 <nl> + <nl> + # include " src / objects / object - macros - undef . h " <nl> + <nl> + # endif / / V8_OBJECTS_JS_PROMISE_INL_H_ <nl> new file mode 100644 <nl> index 00000000000 . . b454084b8e4 <nl> mmm / dev / null <nl> ppp b / src / objects / js - promise . h <nl> <nl> + / / Copyright 2018 the V8 project authors . All rights reserved . <nl> + / / Use of this source code is governed by a BSD - style license that can be <nl> + / / found in the LICENSE file . <nl> + <nl> + # ifndef V8_OBJECTS_JS_PROMISE_H_ <nl> + # define V8_OBJECTS_JS_PROMISE_H_ <nl> + <nl> + # include " src / objects . h " <nl> + # include " src / objects / promise . h " <nl> + <nl> + / / Has to be the last include ( doesn ' t have include guards ) : <nl> + # include " src / objects / object - macros . h " <nl> + <nl> + namespace v8 { <nl> + namespace internal { <nl> + <nl> + / / Representation of promise objects in the specification . Our layout of <nl> + / / JSPromise differs a bit from the layout in the specification , for example <nl> + / / there ' s only a single list of PromiseReaction objects , instead of separate <nl> + / / lists for fulfill and reject reactions . The PromiseReaction carries both <nl> + / / callbacks from the start , and is eventually morphed into the proper kind of <nl> + / / PromiseReactionJobTask when the JSPromise is settled . <nl> + / / <nl> + / / We also overlay the result and reactions fields on the JSPromise , since <nl> + / / the reactions are only necessary for pending promises , whereas the result <nl> + / / is only meaningful for settled promises . <nl> + class JSPromise : public JSObject { <nl> + public : <nl> + / / [ reactions_or_result ] : Smi 0 terminated list of PromiseReaction objects <nl> + / / in case the JSPromise was not settled yet , otherwise the result . <nl> + DECL_ACCESSORS ( reactions_or_result , Object ) <nl> + <nl> + / / [ result ] : Checks that the promise is settled and returns the result . <nl> + inline Object * result ( ) const ; <nl> + <nl> + / / [ reactions ] : Checks that the promise is pending and returns the reactions . <nl> + inline Object * reactions ( ) const ; <nl> + <nl> + DECL_INT_ACCESSORS ( flags ) <nl> + <nl> + / / [ has_handler ] : Whether this promise has a reject handler or not . <nl> + DECL_BOOLEAN_ACCESSORS ( has_handler ) <nl> + <nl> + / / [ handled_hint ] : Whether this promise will be handled by a catch <nl> + / / block in an async function . <nl> + DECL_BOOLEAN_ACCESSORS ( handled_hint ) <nl> + <nl> + static const char * Status ( Promise : : PromiseState status ) ; <nl> + Promise : : PromiseState status ( ) const ; <nl> + void set_status ( Promise : : PromiseState status ) ; <nl> + <nl> + / / ES section # sec - fulfillpromise <nl> + static Handle < Object > Fulfill ( Handle < JSPromise > promise , <nl> + Handle < Object > value ) ; <nl> + / / ES section # sec - rejectpromise <nl> + static Handle < Object > Reject ( Handle < JSPromise > promise , Handle < Object > reason , <nl> + bool debug_event = true ) ; <nl> + / / ES section # sec - promise - resolve - functions <nl> + MUST_USE_RESULT static MaybeHandle < Object > Resolve ( Handle < JSPromise > promise , <nl> + Handle < Object > resolution ) ; <nl> + <nl> + / / This is a helper that extracts the JSPromise from the input <nl> + / / { object } , which is used as a payload for PromiseReaction and <nl> + / / PromiseReactionJobTask . <nl> + MUST_USE_RESULT static MaybeHandle < JSPromise > From ( Handle < HeapObject > object ) ; <nl> + <nl> + DECL_CAST ( JSPromise ) <nl> + <nl> + / / Dispatched behavior . <nl> + DECL_PRINTER ( JSPromise ) <nl> + DECL_VERIFIER ( JSPromise ) <nl> + <nl> + / / Layout description . <nl> + static const int kReactionsOrResultOffset = JSObject : : kHeaderSize ; <nl> + static const int kFlagsOffset = kReactionsOrResultOffset + kPointerSize ; <nl> + static const int kSize = kFlagsOffset + kPointerSize ; <nl> + static const int kSizeWithEmbedderFields = <nl> + kSize + v8 : : Promise : : kEmbedderFieldCount * kPointerSize ; <nl> + <nl> + / / Flags layout . <nl> + / / The first two bits store the v8 : : Promise : : PromiseState . <nl> + static const int kStatusBits = 2 ; <nl> + static const int kHasHandlerBit = 2 ; <nl> + static const int kHandledHintBit = 3 ; <nl> + <nl> + static const int kStatusShift = 0 ; <nl> + static const int kStatusMask = 0x3 ; <nl> + STATIC_ASSERT ( v8 : : Promise : : kPending = = 0 ) ; <nl> + STATIC_ASSERT ( v8 : : Promise : : kFulfilled = = 1 ) ; <nl> + STATIC_ASSERT ( v8 : : Promise : : kRejected = = 2 ) ; <nl> + <nl> + private : <nl> + / / ES section # sec - triggerpromisereactions <nl> + static Handle < Object > TriggerPromiseReactions ( Isolate * isolate , <nl> + Handle < Object > reactions , <nl> + Handle < Object > argument , <nl> + PromiseReaction : : Type type ) ; <nl> + } ; <nl> + <nl> + } / / namespace internal <nl> + } / / namespace v8 <nl> + <nl> + # include " src / objects / object - macros - undef . h " <nl> + <nl> + # endif / / V8_OBJECTS_JS_PROMISE_H_ <nl> new file mode 100644 <nl> index 00000000000 . . 4283f0aa194 <nl> mmm / dev / null <nl> ppp b / src / objects / promise - inl . h <nl> <nl> + / / Copyright 2018 the V8 project authors . All rights reserved . <nl> + / / Use of this source code is governed by a BSD - style license that can be <nl> + / / found in the LICENSE file . <nl> + <nl> + # ifndef V8_OBJECTS_PROMISE_INL_H_ <nl> + # define V8_OBJECTS_PROMISE_INL_H_ <nl> + <nl> + # include " src / objects / promise . h " <nl> + <nl> + / / Has to be the last include ( doesn ' t have include guards ) : <nl> + # include " src / objects / object - macros . h " <nl> + <nl> + namespace v8 { <nl> + namespace internal { <nl> + <nl> + CAST_ACCESSOR ( PromiseCapability ) <nl> + CAST_ACCESSOR ( PromiseReaction ) <nl> + CAST_ACCESSOR ( PromiseReactionJobTask ) <nl> + CAST_ACCESSOR ( PromiseFulfillReactionJobTask ) <nl> + CAST_ACCESSOR ( PromiseRejectReactionJobTask ) <nl> + CAST_ACCESSOR ( PromiseResolveThenableJobTask ) <nl> + <nl> + ACCESSORS ( PromiseReaction , next , Object , kNextOffset ) <nl> + ACCESSORS ( PromiseReaction , reject_handler , HeapObject , kRejectHandlerOffset ) <nl> + ACCESSORS ( PromiseReaction , fulfill_handler , HeapObject , kFulfillHandlerOffset ) <nl> + ACCESSORS ( PromiseReaction , payload , HeapObject , kPayloadOffset ) <nl> + <nl> + ACCESSORS ( PromiseResolveThenableJobTask , context , Context , kContextOffset ) <nl> + ACCESSORS ( PromiseResolveThenableJobTask , promise_to_resolve , JSPromise , <nl> + kPromiseToResolveOffset ) <nl> + ACCESSORS ( PromiseResolveThenableJobTask , then , JSReceiver , kThenOffset ) <nl> + ACCESSORS ( PromiseResolveThenableJobTask , thenable , JSReceiver , kThenableOffset ) <nl> + <nl> + ACCESSORS ( PromiseReactionJobTask , context , Context , kContextOffset ) <nl> + ACCESSORS ( PromiseReactionJobTask , argument , Object , kArgumentOffset ) ; <nl> + ACCESSORS ( PromiseReactionJobTask , handler , HeapObject , kHandlerOffset ) ; <nl> + ACCESSORS ( PromiseReactionJobTask , payload , HeapObject , kPayloadOffset ) ; <nl> + <nl> + ACCESSORS ( PromiseCapability , promise , HeapObject , kPromiseOffset ) <nl> + ACCESSORS ( PromiseCapability , resolve , Object , kResolveOffset ) <nl> + ACCESSORS ( PromiseCapability , reject , Object , kRejectOffset ) <nl> + <nl> + } / / namespace internal <nl> + } / / namespace v8 <nl> + <nl> + # include " src / objects / object - macros - undef . h " <nl> + <nl> + # endif / / V8_OBJECTS_PROMISE_INL_H_ <nl> new file mode 100644 <nl> index 00000000000 . . 0a4c0594343 <nl> mmm / dev / null <nl> ppp b / src / objects / promise . h <nl> <nl> + / / Copyright 2018 the V8 project authors . All rights reserved . <nl> + / / Use of this source code is governed by a BSD - style license that can be <nl> + / / found in the LICENSE file . <nl> + <nl> + # ifndef V8_OBJECTS_PROMISE_H_ <nl> + # define V8_OBJECTS_PROMISE_H_ <nl> + <nl> + # include " src / objects . h " <nl> + <nl> + / / Has to be the last include ( doesn ' t have include guards ) : <nl> + # include " src / objects / object - macros . h " <nl> + <nl> + namespace v8 { <nl> + namespace internal { <nl> + <nl> + / / Struct to hold state required for PromiseReactionJob . See the comment on the <nl> + / / PromiseReaction below for details on how this is being managed to reduce the <nl> + / / memory and allocation overhead . This is the base class for the concrete <nl> + / / <nl> + / / - PromiseFulfillReactionJobTask <nl> + / / - PromiseRejectReactionJobTask <nl> + / / <nl> + / / classes , which are used to represent either reactions , and we distinguish <nl> + / / them by their instance types . <nl> + class PromiseReactionJobTask : public Microtask { <nl> + public : <nl> + DECL_ACCESSORS ( argument , Object ) <nl> + DECL_ACCESSORS ( context , Context ) <nl> + / / [ handler ] : This is either a Code object , a Callable or Undefined . <nl> + DECL_ACCESSORS ( handler , HeapObject ) <nl> + / / [ payload ] : Usually a JSPromise or a PromiseCapability . <nl> + DECL_ACCESSORS ( payload , HeapObject ) <nl> + <nl> + static const int kArgumentOffset = Microtask : : kHeaderSize ; <nl> + static const int kContextOffset = kArgumentOffset + kPointerSize ; <nl> + static const int kHandlerOffset = kContextOffset + kPointerSize ; <nl> + static const int kPayloadOffset = kHandlerOffset + kPointerSize ; <nl> + static const int kSize = kPayloadOffset + kPointerSize ; <nl> + <nl> + / / Dispatched behavior . <nl> + DECL_CAST ( PromiseReactionJobTask ) <nl> + DECL_VERIFIER ( PromiseReactionJobTask ) <nl> + <nl> + private : <nl> + DISALLOW_IMPLICIT_CONSTRUCTORS ( PromiseReactionJobTask ) ; <nl> + } ; <nl> + <nl> + / / Struct to hold state required for a PromiseReactionJob of type " Fulfill " . <nl> + class PromiseFulfillReactionJobTask : public PromiseReactionJobTask { <nl> + public : <nl> + / / Dispatched behavior . <nl> + DECL_CAST ( PromiseFulfillReactionJobTask ) <nl> + DECL_PRINTER ( PromiseFulfillReactionJobTask ) <nl> + DECL_VERIFIER ( PromiseFulfillReactionJobTask ) <nl> + <nl> + private : <nl> + DISALLOW_IMPLICIT_CONSTRUCTORS ( PromiseFulfillReactionJobTask ) ; <nl> + } ; <nl> + <nl> + / / Struct to hold state required for a PromiseReactionJob of type " Reject " . <nl> + class PromiseRejectReactionJobTask : public PromiseReactionJobTask { <nl> + public : <nl> + / / Dispatched behavior . <nl> + DECL_CAST ( PromiseRejectReactionJobTask ) <nl> + DECL_PRINTER ( PromiseRejectReactionJobTask ) <nl> + DECL_VERIFIER ( PromiseRejectReactionJobTask ) <nl> + <nl> + private : <nl> + DISALLOW_IMPLICIT_CONSTRUCTORS ( PromiseRejectReactionJobTask ) ; <nl> + } ; <nl> + <nl> + / / A container struct to hold state required for PromiseResolveThenableJob . <nl> + class PromiseResolveThenableJobTask : public Microtask { <nl> + public : <nl> + DECL_ACCESSORS ( context , Context ) <nl> + DECL_ACCESSORS ( promise_to_resolve , JSPromise ) <nl> + DECL_ACCESSORS ( then , JSReceiver ) <nl> + DECL_ACCESSORS ( thenable , JSReceiver ) <nl> + <nl> + static const int kContextOffset = Microtask : : kHeaderSize ; <nl> + static const int kPromiseToResolveOffset = kContextOffset + kPointerSize ; <nl> + static const int kThenOffset = kPromiseToResolveOffset + kPointerSize ; <nl> + static const int kThenableOffset = kThenOffset + kPointerSize ; <nl> + static const int kSize = kThenableOffset + kPointerSize ; <nl> + <nl> + / / Dispatched behavior . <nl> + DECL_CAST ( PromiseResolveThenableJobTask ) <nl> + DECL_PRINTER ( PromiseResolveThenableJobTask ) <nl> + DECL_VERIFIER ( PromiseResolveThenableJobTask ) <nl> + <nl> + private : <nl> + DISALLOW_IMPLICIT_CONSTRUCTORS ( PromiseResolveThenableJobTask ) ; <nl> + } ; <nl> + <nl> + / / Struct to hold the state of a PromiseCapability . <nl> + class PromiseCapability : public Struct { <nl> + public : <nl> + DECL_ACCESSORS ( promise , HeapObject ) <nl> + DECL_ACCESSORS ( resolve , Object ) <nl> + DECL_ACCESSORS ( reject , Object ) <nl> + <nl> + static const int kPromiseOffset = Struct : : kHeaderSize ; <nl> + static const int kResolveOffset = kPromiseOffset + kPointerSize ; <nl> + static const int kRejectOffset = kResolveOffset + kPointerSize ; <nl> + static const int kSize = kRejectOffset + kPointerSize ; <nl> + <nl> + / / Dispatched behavior . <nl> + DECL_CAST ( PromiseCapability ) <nl> + DECL_PRINTER ( PromiseCapability ) <nl> + DECL_VERIFIER ( PromiseCapability ) <nl> + <nl> + private : <nl> + DISALLOW_IMPLICIT_CONSTRUCTORS ( PromiseCapability ) ; <nl> + } ; <nl> + <nl> + / / A representation of promise reaction . This differs from the specification <nl> + / / in that the PromiseReaction here holds both handlers for the fulfill and <nl> + / / the reject case . When a JSPromise is eventually resolved ( either via <nl> + / / fulfilling it or rejecting it ) , we morph this PromiseReaction object in <nl> + / / memory into a proper PromiseReactionJobTask and schedule it on the queue <nl> + / / of microtasks . So the size of PromiseReaction and the size of the <nl> + / / PromiseReactionJobTask has to be same for this to work . <nl> + / / <nl> + / / The PromiseReaction : : payload field usually holds a JSPromise <nl> + / / instance ( in the fast case of a native promise ) or a PromiseCapability <nl> + / / in case of a custom promise . For await we store the JSGeneratorObject <nl> + / / here and use custom Code handlers . <nl> + / / <nl> + / / We need to keep the context in the PromiseReaction so that we can run <nl> + / / the default handlers ( in case they are undefined ) in the proper context . <nl> + / / <nl> + / / The PromiseReaction objects form a singly - linked list , terminated by <nl> + / / Smi 0 . On the JSPromise instance they are linked in reverse order , <nl> + / / and are turned into the proper order again when scheduling them on <nl> + / / the microtask queue . <nl> + class PromiseReaction : public Struct { <nl> + public : <nl> + enum Type { kFulfill , kReject } ; <nl> + <nl> + DECL_ACCESSORS ( next , Object ) <nl> + / / [ reject_handler ] : This is either a Code object , a Callable or Undefined . <nl> + DECL_ACCESSORS ( reject_handler , HeapObject ) <nl> + / / [ fulfill_handler ] : This is either a Code object , a Callable or Undefined . <nl> + DECL_ACCESSORS ( fulfill_handler , HeapObject ) <nl> + / / [ payload ] : Usually a JSPromise or a PromiseCapability . <nl> + DECL_ACCESSORS ( payload , HeapObject ) <nl> + <nl> + static const int kNextOffset = Struct : : kHeaderSize ; <nl> + static const int kRejectHandlerOffset = kNextOffset + kPointerSize ; <nl> + static const int kFulfillHandlerOffset = kRejectHandlerOffset + kPointerSize ; <nl> + static const int kPayloadOffset = kFulfillHandlerOffset + kPointerSize ; <nl> + static const int kSize = kPayloadOffset + kPointerSize ; <nl> + <nl> + / / Dispatched behavior . <nl> + DECL_CAST ( PromiseReaction ) <nl> + DECL_PRINTER ( PromiseReaction ) <nl> + DECL_VERIFIER ( PromiseReaction ) <nl> + <nl> + private : <nl> + DISALLOW_IMPLICIT_CONSTRUCTORS ( PromiseReaction ) ; <nl> + } ; <nl> + <nl> + } / / namespace internal <nl> + } / / namespace v8 <nl> + <nl> + # include " src / objects / object - macros - undef . h " <nl> + <nl> + # endif / / V8_OBJECTS_PROMISE_H_ <nl> mmm a / test / cctest / test - code - stub - assembler . cc <nl> ppp b / test / cctest / test - code - stub - assembler . cc <nl> <nl> # include " src / debug / debug . h " <nl> # include " src / isolate . h " <nl> # include " src / objects - inl . h " <nl> + # include " src / objects / promise - inl . h " <nl> # include " test / cctest / compiler / code - assembler - tester . h " <nl> # include " test / cctest / compiler / function - tester . h " <nl> <nl>
[ objects . h splitting ] Move Promise - related classes .
v8/v8
dd3c4fca2f0a2761b8b95cd47fcd62836d714890
2018-02-26T13:19:00Z
mmm a / java / CMakeLists . txt <nl> ppp b / java / CMakeLists . txt <nl> set ( NATIVE_JAVA_CLASSES <nl> org . rocksdb . AbstractRocksIterator <nl> org . rocksdb . AbstractSlice <nl> org . rocksdb . AbstractWriteBatch <nl> - org . rocksdb . BackupableDB <nl> org . rocksdb . BackupableDBOptions <nl> org . rocksdb . BackupEngine <nl> org . rocksdb . BackupEngineTest <nl> set ( NATIVE_JAVA_CLASSES <nl> org . rocksdb . RateLimiter <nl> org . rocksdb . ReadOptions <nl> org . rocksdb . RemoveEmptyValueCompactionFilter <nl> - org . rocksdb . RestoreBackupableDB <nl> org . rocksdb . RestoreOptions <nl> org . rocksdb . RocksDB <nl> org . rocksdb . RocksDBExceptionTest <nl> mmm a / java / rocksjni / backupablejni . cc <nl> ppp b / java / rocksjni / backupablejni . cc <nl> <nl> / / of patent rights can be found in the PATENTS file in the same directory . <nl> / / <nl> / / This file implements the " bridge " between Java and C + + and enables <nl> - / / calling c + + rocksdb : : BackupableDB and rocksdb : : BackupableDBOptions methods <nl> + / / calling c + + rocksdb : : BackupEnginge and rocksdb : : BackupableDBOptions methods <nl> / / from Java side . <nl> <nl> # include < stdio . h > <nl> mmm a / java / rocksjni / env_options . cc <nl> ppp b / java / rocksjni / env_options . cc <nl> <nl> / / of patent rights can be found in the PATENTS file in the same directory . <nl> / / <nl> / / This file implements the " bridge " between Java and C + + and enables <nl> - / / calling c + + rocksdb : : BackupableDB and rocksdb : : BackupableDBOptions methods <nl> + / / calling C + + rocksdb : : EnvOptions methods <nl> / / from Java side . <nl> <nl> # include < jni . h > <nl> mmm a / java / rocksjni / external_sst_file_info . cc <nl> ppp b / java / rocksjni / external_sst_file_info . cc <nl> <nl> / / of patent rights can be found in the PATENTS file in the same directory . <nl> / / <nl> / / This file implements the " bridge " between Java and C + + and enables <nl> - / / calling c + + rocksdb : : BackupableDB and rocksdb : : BackupableDBOptions methods <nl> + / / calling C + + rocksdb : : ExternalSstFileInfo methods <nl> / / from Java side . <nl> <nl> # include < jni . h > <nl> mmm a / java / rocksjni / restorejni . cc <nl> ppp b / java / rocksjni / restorejni . cc <nl> <nl> / / of patent rights can be found in the PATENTS file in the same directory . <nl> / / <nl> / / This file implements the " bridge " between Java and C + + and enables <nl> - / / calling c + + rocksdb : : RestoreBackupableDB and rocksdb : : RestoreOptions methods <nl> + / / calling C + + rocksdb : : RestoreOptions methods <nl> / / from Java side . <nl> <nl> # include < stdio . h > <nl> mmm a / java / rocksjni / sst_file_writerjni . cc <nl> ppp b / java / rocksjni / sst_file_writerjni . cc <nl> <nl> / / of patent rights can be found in the PATENTS file in the same directory . <nl> / / <nl> / / This file implements the " bridge " between Java and C + + and enables <nl> - / / calling c + + rocksdb : : BackupableDB and rocksdb : : BackupableDBOptions methods <nl> + / / calling C + + rocksdb : : SstFileWriter methods <nl> / / from Java side . <nl> <nl> # include < jni . h > <nl> mmm a / java / src / main / java / org / rocksdb / BackupInfo . java <nl> ppp b / java / src / main / java / org / rocksdb / BackupInfo . java <nl> <nl> <nl> / * * <nl> * Instances of this class describe a Backup made by <nl> - * { @ link org . rocksdb . BackupableDB } . <nl> + * { @ link org . rocksdb . BackupEngine } . <nl> * / <nl> public class BackupInfo { <nl> <nl> / * * <nl> * Package private constructor used to create instances <nl> - * of BackupInfo by { @ link org . rocksdb . BackupableDB } and <nl> - * { @ link org . rocksdb . RestoreBackupableDB } . <nl> + * of BackupInfo by { @ link org . rocksdb . BackupEngine } <nl> * <nl> * @ param backupId id of backup <nl> * @ param timestamp timestamp of backup <nl> deleted file mode 100644 <nl> index cebd69f674 . . 0000000000 <nl> mmm a / java / src / main / java / org / rocksdb / BackupableDB . java <nl> ppp / dev / null <nl> <nl> - / / Copyright ( c ) 2011 - present , Facebook , Inc . All rights reserved . <nl> - / / This source code is licensed under the BSD - style license found in the <nl> - / / LICENSE file in the root directory of this source tree . An additional grant <nl> - / / of patent rights can be found in the PATENTS file in the same directory . <nl> - <nl> - package org . rocksdb ; <nl> - <nl> - import java . util . List ; <nl> - <nl> - / * * <nl> - * < p > A subclass of RocksDB which supports <nl> - * backup - related operations . < / p > <nl> - * <nl> - * @ see org . rocksdb . BackupableDBOptions <nl> - * / <nl> - public class BackupableDB extends RocksDB { <nl> - / * * <nl> - * < p > Open a { @ code BackupableDB } under the specified path . <nl> - * Note that the backup path should be set properly in the <nl> - * input BackupableDBOptions . < / p > <nl> - * <nl> - * @ param opt { @ link org . rocksdb . Options } to set for the database . <nl> - * @ param bopt { @ link org . rocksdb . BackupableDBOptions } to use . <nl> - * @ param db_path Path to store data to . The path for storing the backup <nl> - * should be specified in the { @ link org . rocksdb . BackupableDBOptions } . <nl> - * <nl> - * @ return { @ link BackupableDB } reference to the opened database . <nl> - * <nl> - * @ throws RocksDBException thrown if error happens in underlying <nl> - * native library . <nl> - * / <nl> - public static BackupableDB open ( <nl> - final Options opt , final BackupableDBOptions bopt , final String db_path ) <nl> - throws RocksDBException { <nl> - <nl> - final RocksDB db = RocksDB . open ( opt , db_path ) ; <nl> - final BackupableDB bdb = new BackupableDB ( open ( db . nativeHandle_ , <nl> - bopt . nativeHandle_ ) ) ; <nl> - <nl> - / / Prevent the RocksDB object from attempting to delete <nl> - / / the underly C + + DB object . <nl> - db . disOwnNativeHandle ( ) ; <nl> - <nl> - return bdb ; <nl> - } <nl> - <nl> - / * * <nl> - * < p > Captures the state of the database in the latest backup . <nl> - * Note that this function is not thread - safe . < / p > <nl> - * <nl> - * @ param flushBeforeBackup if true , then all data will be flushed <nl> - * before creating backup . <nl> - * <nl> - * @ throws RocksDBException thrown if error happens in underlying <nl> - * native library . <nl> - * / <nl> - public void createNewBackup ( final boolean flushBeforeBackup ) <nl> - throws RocksDBException { <nl> - assert ( isOwningHandle ( ) ) ; <nl> - createNewBackup ( nativeHandle_ , flushBeforeBackup ) ; <nl> - } <nl> - <nl> - / * * <nl> - * < p > Deletes old backups , keeping latest numBackupsToKeep alive . < / p > <nl> - * <nl> - * @ param numBackupsToKeep Number of latest backups to keep . <nl> - * <nl> - * @ throws RocksDBException thrown if error happens in underlying <nl> - * native library . <nl> - * / <nl> - public void purgeOldBackups ( final int numBackupsToKeep ) <nl> - throws RocksDBException { <nl> - assert ( isOwningHandle ( ) ) ; <nl> - purgeOldBackups ( nativeHandle_ , numBackupsToKeep ) ; <nl> - } <nl> - <nl> - / * * <nl> - * < p > Deletes a specific backup . < / p > <nl> - * <nl> - * @ param backupId of backup to delete . <nl> - * <nl> - * @ throws RocksDBException thrown if error happens in underlying <nl> - * native library . <nl> - * / <nl> - public void deleteBackup ( final int backupId ) throws RocksDBException { <nl> - assert ( isOwningHandle ( ) ) ; <nl> - deleteBackup0 ( nativeHandle_ , backupId ) ; <nl> - } <nl> - <nl> - / * * <nl> - * < p > Returns a list of { @ link BackupInfo } instances , which describe <nl> - * already made backups . < / p > <nl> - * <nl> - * @ return List of { @ link BackupInfo } instances . <nl> - * / <nl> - public List < BackupInfo > getBackupInfos ( ) { <nl> - assert ( isOwningHandle ( ) ) ; <nl> - return getBackupInfo ( nativeHandle_ ) ; <nl> - } <nl> - <nl> - / * * <nl> - * < p > Returns a list of corrupted backup ids . If there <nl> - * is no corrupted backup the method will return an <nl> - * empty list . < / p > <nl> - * <nl> - * @ return array of backup ids as int ids . <nl> - * / <nl> - public int [ ] getCorruptedBackups ( ) { <nl> - assert ( isOwningHandle ( ) ) ; <nl> - return getCorruptedBackups ( nativeHandle_ ) ; <nl> - } <nl> - <nl> - / * * <nl> - * < p > Will delete all the files we don ' t need anymore . It will <nl> - * do the full scan of the files / directory and delete all the <nl> - * files that are not referenced . < / p > <nl> - * <nl> - * @ throws RocksDBException thrown if error happens in underlying <nl> - * native library . <nl> - * / <nl> - public void garbageCollect ( ) throws RocksDBException { <nl> - assert ( isOwningHandle ( ) ) ; <nl> - garbageCollect ( nativeHandle_ ) ; <nl> - } <nl> - <nl> - / * * <nl> - * < p > Close the BackupableDB instance and release resource . < / p > <nl> - * <nl> - * < p > Internally , { @ link BackupableDB } owns the { @ code rocksdb : : DB } <nl> - * pointer to its associated { @ link org . rocksdb . RocksDB } . <nl> - * The release of that RocksDB pointer is handled in the destructor <nl> - * of the c + + { @ code rocksdb : : BackupableDB } and should be transparent <nl> - * to Java developers . < / p > <nl> - * / <nl> - @ Override public void close ( ) { <nl> - super . close ( ) ; <nl> - } <nl> - <nl> - / * * <nl> - * < p > A protected construction that will be used in the static <nl> - * factory method { @ link # open ( Options , BackupableDBOptions , String ) } . <nl> - * < / p > <nl> - * <nl> - * @ param nativeHandle The native handle of the C + + BackupableDB object <nl> - * / <nl> - protected BackupableDB ( final long nativeHandle ) { <nl> - super ( nativeHandle ) ; <nl> - } <nl> - <nl> - @ Override protected void finalize ( ) throws Throwable { <nl> - close ( ) ; <nl> - super . finalize ( ) ; <nl> - } <nl> - <nl> - protected native static long open ( final long rocksDBHandle , <nl> - final long backupDBOptionsHandle ) ; <nl> - protected native void createNewBackup ( long handle , boolean flag ) <nl> - throws RocksDBException ; <nl> - protected native void purgeOldBackups ( long handle , int numBackupsToKeep ) <nl> - throws RocksDBException ; <nl> - private native void deleteBackup0 ( long nativeHandle , int backupId ) <nl> - throws RocksDBException ; <nl> - protected native List < BackupInfo > getBackupInfo ( long handle ) ; <nl> - private native int [ ] getCorruptedBackups ( long handle ) ; <nl> - private native void garbageCollect ( long handle ) <nl> - throws RocksDBException ; <nl> - } <nl> mmm a / java / src / main / java / org / rocksdb / BackupableDBOptions . java <nl> ppp b / java / src / main / java / org / rocksdb / BackupableDBOptions . java <nl> <nl> <nl> / * * <nl> * < p > BackupableDBOptions to control the behavior of a backupable database . <nl> - * It will be used during the creation of a { @ link org . rocksdb . BackupableDB } . <nl> + * It will be used during the creation of a { @ link org . rocksdb . BackupEngine } . <nl> * < / p > <nl> * < p > Note that dispose ( ) must be called before an Options instance <nl> * become out - of - scope to release the allocated memory in c + + . < / p > <nl> * <nl> - * @ see org . rocksdb . BackupableDB <nl> + * @ see org . rocksdb . BackupEngine <nl> * / <nl> public class BackupableDBOptions extends RocksObject { <nl> <nl> public boolean shareFilesWithChecksum ( ) { <nl> <nl> / * * <nl> * Up to this many background threads will copy files for <nl> - * { @ link BackupableDB # createNewBackup ( boolean ) } and <nl> - * { @ link RestoreBackupableDB # restoreDBFromBackup ( long , String , String , RestoreOptions ) } <nl> + * { @ link BackupEngine # createNewBackup ( RocksDB , boolean ) } and <nl> + * { @ link BackupEngine # restoreDbFromBackup ( int , String , String , RestoreOptions ) } <nl> * <nl> * Default : 1 <nl> * <nl> public BackupableDBOptions setMaxBackgroundOperations ( <nl> <nl> / * * <nl> * Up to this many background threads will copy files for <nl> - * { @ link BackupableDB # createNewBackup ( boolean ) } and <nl> - * { @ link RestoreBackupableDB # restoreDBFromBackup ( long , String , String , RestoreOptions ) } <nl> + * { @ link BackupEngine # createNewBackup ( RocksDB , boolean ) } and <nl> + * { @ link BackupEngine # restoreDbFromBackup ( int , String , String , RestoreOptions ) } <nl> * <nl> * Default : 1 <nl> * <nl> deleted file mode 100644 <nl> index f303b15070 . . 0000000000 <nl> mmm a / java / src / main / java / org / rocksdb / RestoreBackupableDB . java <nl> ppp / dev / null <nl> <nl> - / / Copyright ( c ) 2011 - present , Facebook , Inc . All rights reserved . <nl> - / / This source code is licensed under the BSD - style license found in the <nl> - / / LICENSE file in the root directory of this source tree . An additional grant <nl> - / / of patent rights can be found in the PATENTS file in the same directory . <nl> - <nl> - package org . rocksdb ; <nl> - <nl> - import java . util . List ; <nl> - <nl> - / * * <nl> - * < p > This class is used to access information about backups and <nl> - * restore from them . < / p > <nl> - * <nl> - * < p > Note : { @ code dispose ( ) } must be called before this instance <nl> - * become out - of - scope to release the allocated <nl> - * memory in c + + . < / p > <nl> - * <nl> - * / <nl> - public class RestoreBackupableDB extends RocksObject { <nl> - / * * <nl> - * < p > Construct new estoreBackupableDB instance . < / p > <nl> - * <nl> - * @ param options { @ link org . rocksdb . BackupableDBOptions } instance <nl> - * / <nl> - public RestoreBackupableDB ( final BackupableDBOptions options ) { <nl> - super ( newRestoreBackupableDB ( options . nativeHandle_ ) ) ; <nl> - } <nl> - <nl> - / * * <nl> - * < p > Restore from backup with backup_id . < / p > <nl> - * <nl> - * < p > < strong > Important < / strong > : If options_ . share_table_files = = true <nl> - * and you restore DB from some backup that is not the latest , and you <nl> - * start creating new backups from the new DB , they will probably <nl> - * fail . < / p > <nl> - * <nl> - * < p > < strong > Example < / strong > : Let ' s say you have backups 1 , 2 , 3 , 4 , 5 <nl> - * and you restore 3 . If you add new data to the DB and try creating a new <nl> - * backup now , the database will diverge from backups 4 and 5 and the new <nl> - * backup will fail . If you want to create new backup , you will first have <nl> - * to delete backups 4 and 5 . < / p > <nl> - * <nl> - * @ param backupId id pointing to backup <nl> - * @ param dbDir database directory to restore to <nl> - * @ param walDir directory where wal files are located <nl> - * @ param restoreOptions { @ link org . rocksdb . RestoreOptions } instance . <nl> - * <nl> - * @ throws RocksDBException thrown if error happens in underlying <nl> - * native library . <nl> - * / <nl> - public void restoreDBFromBackup ( final long backupId , final String dbDir , <nl> - final String walDir , final RestoreOptions restoreOptions ) <nl> - throws RocksDBException { <nl> - assert ( isOwningHandle ( ) ) ; <nl> - restoreDBFromBackup0 ( nativeHandle_ , backupId , dbDir , walDir , <nl> - restoreOptions . nativeHandle_ ) ; <nl> - } <nl> - <nl> - / * * <nl> - * < p > Restore from the latest backup . < / p > <nl> - * <nl> - * @ param dbDir database directory to restore to <nl> - * @ param walDir directory where wal files are located <nl> - * @ param restoreOptions { @ link org . rocksdb . RestoreOptions } instance <nl> - * <nl> - * @ throws RocksDBException thrown if error happens in underlying <nl> - * native library . <nl> - * / <nl> - public void restoreDBFromLatestBackup ( final String dbDir , <nl> - final String walDir , final RestoreOptions restoreOptions ) <nl> - throws RocksDBException { <nl> - assert ( isOwningHandle ( ) ) ; <nl> - restoreDBFromLatestBackup0 ( nativeHandle_ , dbDir , walDir , <nl> - restoreOptions . nativeHandle_ ) ; <nl> - } <nl> - <nl> - / * * <nl> - * < p > Deletes old backups , keeping latest numBackupsToKeep alive . < / p > <nl> - * <nl> - * @ param numBackupsToKeep of latest backups to keep <nl> - * <nl> - * @ throws RocksDBException thrown if error happens in underlying <nl> - * native library . <nl> - * / <nl> - public void purgeOldBackups ( final int numBackupsToKeep ) <nl> - throws RocksDBException { <nl> - assert ( isOwningHandle ( ) ) ; <nl> - purgeOldBackups0 ( nativeHandle_ , numBackupsToKeep ) ; <nl> - } <nl> - <nl> - / * * <nl> - * < p > Deletes a specific backup . < / p > <nl> - * <nl> - * @ param backupId of backup to delete . <nl> - * <nl> - * @ throws RocksDBException thrown if error happens in underlying <nl> - * native library . <nl> - * / <nl> - public void deleteBackup ( final int backupId ) <nl> - throws RocksDBException { <nl> - assert ( isOwningHandle ( ) ) ; <nl> - deleteBackup0 ( nativeHandle_ , backupId ) ; <nl> - } <nl> - <nl> - / * * <nl> - * < p > Returns a list of { @ link BackupInfo } instances , which describe <nl> - * already made backups . < / p > <nl> - * <nl> - * @ return List of { @ link BackupInfo } instances . <nl> - * / <nl> - public List < BackupInfo > getBackupInfos ( ) { <nl> - assert ( isOwningHandle ( ) ) ; <nl> - return getBackupInfo ( nativeHandle_ ) ; <nl> - } <nl> - <nl> - / * * <nl> - * < p > Returns a list of corrupted backup ids . If there <nl> - * is no corrupted backup the method will return an <nl> - * empty list . < / p > <nl> - * <nl> - * @ return array of backup ids as int ids . <nl> - * / <nl> - public int [ ] getCorruptedBackups ( ) { <nl> - assert ( isOwningHandle ( ) ) ; <nl> - return getCorruptedBackups ( nativeHandle_ ) ; <nl> - } <nl> - <nl> - / * * <nl> - * < p > Will delete all the files we don ' t need anymore . It will <nl> - * do the full scan of the files / directory and delete all the <nl> - * files that are not referenced . < / p > <nl> - * <nl> - * @ throws RocksDBException thrown if error happens in underlying <nl> - * native library . <nl> - * / <nl> - public void garbageCollect ( ) throws RocksDBException { <nl> - assert ( isOwningHandle ( ) ) ; <nl> - garbageCollect ( nativeHandle_ ) ; <nl> - } <nl> - <nl> - private native static long newRestoreBackupableDB ( final long options ) ; <nl> - private native void restoreDBFromBackup0 ( long nativeHandle , long backupId , <nl> - String dbDir , String walDir , long restoreOptions ) <nl> - throws RocksDBException ; <nl> - private native void restoreDBFromLatestBackup0 ( long nativeHandle , <nl> - String dbDir , String walDir , long restoreOptions ) <nl> - throws RocksDBException ; <nl> - private native void purgeOldBackups0 ( long nativeHandle , int numBackupsToKeep ) <nl> - throws RocksDBException ; <nl> - private native void deleteBackup0 ( long nativeHandle , int backupId ) <nl> - throws RocksDBException ; <nl> - private native List < BackupInfo > getBackupInfo ( long handle ) ; <nl> - private native int [ ] getCorruptedBackups ( long handle ) ; <nl> - private native void garbageCollect ( long handle ) <nl> - throws RocksDBException ; <nl> - @ Override protected final native void disposeInternal ( <nl> - final long nativeHandle ) ; <nl> - } <nl>
Remove orphaned Java classes
facebook/rocksdb
498693cf3e17b89d2f989de15bd22c17865d0977
2017-05-03T04:13:49Z
mmm a / xbmc / addons / interfaces / gui / General . cpp <nl> ppp b / xbmc / addons / interfaces / gui / General . cpp <nl> int Interface_GUIGeneral : : m_iAddonGUILockRef = 0 ; <nl> <nl> void Interface_GUIGeneral : : Init ( AddonGlobalInterface * addonInterface ) <nl> { <nl> - addonInterface - > toKodi - > kodi_gui = <nl> - static_cast < AddonToKodiFuncTable_kodi_gui * > ( malloc ( sizeof ( AddonToKodiFuncTable_kodi_gui ) ) ) ; <nl> + addonInterface - > toKodi - > kodi_gui = new AddonToKodiFuncTable_kodi_gui ( ) ; <nl> <nl> Interface_GUIControlButton : : Init ( addonInterface ) ; <nl> Interface_GUIControlEdit : : Init ( addonInterface ) ; <nl> void Interface_GUIGeneral : : Init ( AddonGlobalInterface * addonInterface ) <nl> Interface_GUIListItem : : Init ( addonInterface ) ; <nl> Interface_GUIWindow : : Init ( addonInterface ) ; <nl> <nl> - addonInterface - > toKodi - > kodi_gui - > general = static_cast < AddonToKodiFuncTable_kodi_gui_general * > ( <nl> - malloc ( sizeof ( AddonToKodiFuncTable_kodi_gui_general ) ) ) ; <nl> + addonInterface - > toKodi - > kodi_gui - > general = new AddonToKodiFuncTable_kodi_gui_general ( ) ; <nl> <nl> addonInterface - > toKodi - > kodi_gui - > general - > lock = lock ; <nl> addonInterface - > toKodi - > kodi_gui - > general - > unlock = unlock ; <nl> void Interface_GUIGeneral : : DeInit ( AddonGlobalInterface * addonInterface ) <nl> Interface_GUIListItem : : DeInit ( addonInterface ) ; <nl> Interface_GUIWindow : : DeInit ( addonInterface ) ; <nl> <nl> - free ( addonInterface - > toKodi - > kodi_gui - > general ) ; <nl> - free ( addonInterface - > toKodi - > kodi_gui ) ; <nl> + delete addonInterface - > toKodi - > kodi_gui - > general ; <nl> + delete addonInterface - > toKodi - > kodi_gui ; <nl> addonInterface - > toKodi - > kodi_gui = nullptr ; <nl> } <nl> } <nl> mmm a / xbmc / addons / interfaces / gui / ListItem . cpp <nl> ppp b / xbmc / addons / interfaces / gui / ListItem . cpp <nl> namespace ADDON <nl> <nl> void Interface_GUIListItem : : Init ( AddonGlobalInterface * addonInterface ) <nl> { <nl> - addonInterface - > toKodi - > kodi_gui - > listItem = static_cast < AddonToKodiFuncTable_kodi_gui_listItem * > ( <nl> - malloc ( sizeof ( AddonToKodiFuncTable_kodi_gui_listItem ) ) ) ; <nl> + addonInterface - > toKodi - > kodi_gui - > listItem = new AddonToKodiFuncTable_kodi_gui_listItem ( ) ; <nl> <nl> addonInterface - > toKodi - > kodi_gui - > listItem - > create = create ; <nl> addonInterface - > toKodi - > kodi_gui - > listItem - > destroy = destroy ; <nl> void Interface_GUIListItem : : Init ( AddonGlobalInterface * addonInterface ) <nl> <nl> void Interface_GUIListItem : : DeInit ( AddonGlobalInterface * addonInterface ) <nl> { <nl> - free ( addonInterface - > toKodi - > kodi_gui - > listItem ) ; <nl> + delete addonInterface - > toKodi - > kodi_gui - > listItem ; <nl> } <nl> <nl> KODI_GUI_LISTITEM_HANDLE Interface_GUIListItem : : create ( KODI_HANDLE kodiBase , <nl> mmm a / xbmc / addons / interfaces / gui / Window . cpp <nl> ppp b / xbmc / addons / interfaces / gui / Window . cpp <nl> namespace ADDON <nl> <nl> void Interface_GUIWindow : : Init ( AddonGlobalInterface * addonInterface ) <nl> { <nl> - addonInterface - > toKodi - > kodi_gui - > window = static_cast < AddonToKodiFuncTable_kodi_gui_window * > ( <nl> - malloc ( sizeof ( AddonToKodiFuncTable_kodi_gui_window ) ) ) ; <nl> + addonInterface - > toKodi - > kodi_gui - > window = new AddonToKodiFuncTable_kodi_gui_window ( ) ; <nl> <nl> / * Window creation functions * / <nl> addonInterface - > toKodi - > kodi_gui - > window - > create = create ; <nl> void Interface_GUIWindow : : Init ( AddonGlobalInterface * addonInterface ) <nl> <nl> void Interface_GUIWindow : : DeInit ( AddonGlobalInterface * addonInterface ) <nl> { <nl> - free ( addonInterface - > toKodi - > kodi_gui - > window ) ; <nl> + delete addonInterface - > toKodi - > kodi_gui - > window ; <nl> } <nl> <nl> / * ! <nl> mmm a / xbmc / addons / interfaces / gui / controls / Button . cpp <nl> ppp b / xbmc / addons / interfaces / gui / controls / Button . cpp <nl> namespace ADDON <nl> void Interface_GUIControlButton : : Init ( AddonGlobalInterface * addonInterface ) <nl> { <nl> addonInterface - > toKodi - > kodi_gui - > control_button = <nl> - static_cast < AddonToKodiFuncTable_kodi_gui_control_button * > ( <nl> - malloc ( sizeof ( AddonToKodiFuncTable_kodi_gui_control_button ) ) ) ; <nl> + new AddonToKodiFuncTable_kodi_gui_control_button ( ) ; <nl> <nl> addonInterface - > toKodi - > kodi_gui - > control_button - > set_visible = set_visible ; <nl> addonInterface - > toKodi - > kodi_gui - > control_button - > set_enabled = set_enabled ; <nl> void Interface_GUIControlButton : : Init ( AddonGlobalInterface * addonInterface ) <nl> <nl> void Interface_GUIControlButton : : DeInit ( AddonGlobalInterface * addonInterface ) <nl> { <nl> - free ( addonInterface - > toKodi - > kodi_gui - > control_button ) ; <nl> + delete addonInterface - > toKodi - > kodi_gui - > control_button ; <nl> } <nl> <nl> void Interface_GUIControlButton : : set_visible ( KODI_HANDLE kodiBase , <nl> mmm a / xbmc / addons / interfaces / gui / controls / Edit . cpp <nl> ppp b / xbmc / addons / interfaces / gui / controls / Edit . cpp <nl> namespace ADDON <nl> <nl> void Interface_GUIControlEdit : : Init ( AddonGlobalInterface * addonInterface ) <nl> { <nl> - addonInterface - > toKodi - > kodi_gui - > control_edit = <nl> - static_cast < AddonToKodiFuncTable_kodi_gui_control_edit * > ( <nl> - malloc ( sizeof ( AddonToKodiFuncTable_kodi_gui_control_edit ) ) ) ; <nl> + addonInterface - > toKodi - > kodi_gui - > control_edit = new AddonToKodiFuncTable_kodi_gui_control_edit ( ) ; <nl> <nl> addonInterface - > toKodi - > kodi_gui - > control_edit - > set_visible = set_visible ; <nl> addonInterface - > toKodi - > kodi_gui - > control_edit - > set_enabled = set_enabled ; <nl> void Interface_GUIControlEdit : : Init ( AddonGlobalInterface * addonInterface ) <nl> <nl> void Interface_GUIControlEdit : : DeInit ( AddonGlobalInterface * addonInterface ) <nl> { <nl> - free ( addonInterface - > toKodi - > kodi_gui - > control_edit ) ; <nl> + delete addonInterface - > toKodi - > kodi_gui - > control_edit ; <nl> } <nl> <nl> void Interface_GUIControlEdit : : set_visible ( KODI_HANDLE kodiBase , <nl> mmm a / xbmc / addons / interfaces / gui / controls / FadeLabel . cpp <nl> ppp b / xbmc / addons / interfaces / gui / controls / FadeLabel . cpp <nl> namespace ADDON <nl> void Interface_GUIControlFadeLabel : : Init ( AddonGlobalInterface * addonInterface ) <nl> { <nl> addonInterface - > toKodi - > kodi_gui - > control_fade_label = <nl> - static_cast < AddonToKodiFuncTable_kodi_gui_control_fade_label * > ( <nl> - malloc ( sizeof ( AddonToKodiFuncTable_kodi_gui_control_fade_label ) ) ) ; <nl> + new AddonToKodiFuncTable_kodi_gui_control_fade_label ( ) ; <nl> <nl> addonInterface - > toKodi - > kodi_gui - > control_fade_label - > set_visible = set_visible ; <nl> addonInterface - > toKodi - > kodi_gui - > control_fade_label - > add_label = add_label ; <nl> void Interface_GUIControlFadeLabel : : Init ( AddonGlobalInterface * addonInterface ) <nl> <nl> void Interface_GUIControlFadeLabel : : DeInit ( AddonGlobalInterface * addonInterface ) <nl> { <nl> - free ( addonInterface - > toKodi - > kodi_gui - > control_fade_label ) ; <nl> + delete addonInterface - > toKodi - > kodi_gui - > control_fade_label ; <nl> } <nl> <nl> void Interface_GUIControlFadeLabel : : set_visible ( KODI_HANDLE kodiBase , <nl> mmm a / xbmc / addons / interfaces / gui / controls / Image . cpp <nl> ppp b / xbmc / addons / interfaces / gui / controls / Image . cpp <nl> namespace ADDON <nl> void Interface_GUIControlImage : : Init ( AddonGlobalInterface * addonInterface ) <nl> { <nl> addonInterface - > toKodi - > kodi_gui - > control_image = <nl> - static_cast < AddonToKodiFuncTable_kodi_gui_control_image * > ( <nl> - malloc ( sizeof ( AddonToKodiFuncTable_kodi_gui_control_image ) ) ) ; <nl> + new AddonToKodiFuncTable_kodi_gui_control_image ( ) ; <nl> <nl> addonInterface - > toKodi - > kodi_gui - > control_image - > set_visible = set_visible ; <nl> addonInterface - > toKodi - > kodi_gui - > control_image - > set_filename = set_filename ; <nl> void Interface_GUIControlImage : : Init ( AddonGlobalInterface * addonInterface ) <nl> <nl> void Interface_GUIControlImage : : DeInit ( AddonGlobalInterface * addonInterface ) <nl> { <nl> - free ( addonInterface - > toKodi - > kodi_gui - > control_image ) ; <nl> + delete addonInterface - > toKodi - > kodi_gui - > control_image ; <nl> } <nl> <nl> void Interface_GUIControlImage : : set_visible ( KODI_HANDLE kodiBase , <nl> mmm a / xbmc / addons / interfaces / gui / controls / Label . cpp <nl> ppp b / xbmc / addons / interfaces / gui / controls / Label . cpp <nl> namespace ADDON <nl> void Interface_GUIControlLabel : : Init ( AddonGlobalInterface * addonInterface ) <nl> { <nl> addonInterface - > toKodi - > kodi_gui - > control_label = <nl> - static_cast < AddonToKodiFuncTable_kodi_gui_control_label * > ( <nl> - malloc ( sizeof ( AddonToKodiFuncTable_kodi_gui_control_label ) ) ) ; <nl> + new AddonToKodiFuncTable_kodi_gui_control_label ( ) ; <nl> <nl> addonInterface - > toKodi - > kodi_gui - > control_label - > set_visible = set_visible ; <nl> addonInterface - > toKodi - > kodi_gui - > control_label - > set_label = set_label ; <nl> void Interface_GUIControlLabel : : Init ( AddonGlobalInterface * addonInterface ) <nl> <nl> void Interface_GUIControlLabel : : DeInit ( AddonGlobalInterface * addonInterface ) <nl> { <nl> - free ( addonInterface - > toKodi - > kodi_gui - > control_label ) ; <nl> + delete addonInterface - > toKodi - > kodi_gui - > control_label ; <nl> } <nl> <nl> void Interface_GUIControlLabel : : set_visible ( KODI_HANDLE kodiBase , <nl> mmm a / xbmc / addons / interfaces / gui / controls / Progress . cpp <nl> ppp b / xbmc / addons / interfaces / gui / controls / Progress . cpp <nl> namespace ADDON <nl> void Interface_GUIControlProgress : : Init ( AddonGlobalInterface * addonInterface ) <nl> { <nl> addonInterface - > toKodi - > kodi_gui - > control_progress = <nl> - static_cast < AddonToKodiFuncTable_kodi_gui_control_progress * > ( <nl> - malloc ( sizeof ( AddonToKodiFuncTable_kodi_gui_control_progress ) ) ) ; <nl> + new AddonToKodiFuncTable_kodi_gui_control_progress ( ) ; <nl> <nl> addonInterface - > toKodi - > kodi_gui - > control_progress - > set_visible = set_visible ; <nl> addonInterface - > toKodi - > kodi_gui - > control_progress - > set_percentage = set_percentage ; <nl> void Interface_GUIControlProgress : : Init ( AddonGlobalInterface * addonInterface ) <nl> <nl> void Interface_GUIControlProgress : : DeInit ( AddonGlobalInterface * addonInterface ) <nl> { <nl> - free ( addonInterface - > toKodi - > kodi_gui - > control_progress ) ; <nl> + delete addonInterface - > toKodi - > kodi_gui - > control_progress ; <nl> } <nl> <nl> void Interface_GUIControlProgress : : set_visible ( KODI_HANDLE kodiBase , <nl> mmm a / xbmc / addons / interfaces / gui / controls / RadioButton . cpp <nl> ppp b / xbmc / addons / interfaces / gui / controls / RadioButton . cpp <nl> namespace ADDON <nl> void Interface_GUIControlRadioButton : : Init ( AddonGlobalInterface * addonInterface ) <nl> { <nl> addonInterface - > toKodi - > kodi_gui - > control_radio_button = <nl> - static_cast < AddonToKodiFuncTable_kodi_gui_control_radio_button * > ( <nl> - malloc ( sizeof ( AddonToKodiFuncTable_kodi_gui_control_radio_button ) ) ) ; <nl> + new AddonToKodiFuncTable_kodi_gui_control_radio_button ( ) ; <nl> <nl> addonInterface - > toKodi - > kodi_gui - > control_radio_button - > set_visible = set_visible ; <nl> addonInterface - > toKodi - > kodi_gui - > control_radio_button - > set_enabled = set_enabled ; <nl> void Interface_GUIControlRadioButton : : Init ( AddonGlobalInterface * addonInterface ) <nl> <nl> void Interface_GUIControlRadioButton : : DeInit ( AddonGlobalInterface * addonInterface ) <nl> { <nl> - free ( addonInterface - > toKodi - > kodi_gui - > control_radio_button ) ; <nl> + delete addonInterface - > toKodi - > kodi_gui - > control_radio_button ; <nl> } <nl> <nl> void Interface_GUIControlRadioButton : : set_visible ( KODI_HANDLE kodiBase , <nl> mmm a / xbmc / addons / interfaces / gui / controls / Rendering . cpp <nl> ppp b / xbmc / addons / interfaces / gui / controls / Rendering . cpp <nl> namespace ADDON <nl> void Interface_GUIControlAddonRendering : : Init ( AddonGlobalInterface * addonInterface ) <nl> { <nl> addonInterface - > toKodi - > kodi_gui - > control_rendering = <nl> - static_cast < AddonToKodiFuncTable_kodi_gui_control_rendering * > ( <nl> - malloc ( sizeof ( AddonToKodiFuncTable_kodi_gui_control_rendering ) ) ) ; <nl> + new AddonToKodiFuncTable_kodi_gui_control_rendering ( ) ; <nl> <nl> addonInterface - > toKodi - > kodi_gui - > control_rendering - > set_callbacks = set_callbacks ; <nl> addonInterface - > toKodi - > kodi_gui - > control_rendering - > destroy = destroy ; <nl> void Interface_GUIControlAddonRendering : : Init ( AddonGlobalInterface * addonInterfa <nl> <nl> void Interface_GUIControlAddonRendering : : DeInit ( AddonGlobalInterface * addonInterface ) <nl> { <nl> - free ( addonInterface - > toKodi - > kodi_gui - > control_rendering ) ; <nl> + delete addonInterface - > toKodi - > kodi_gui - > control_rendering ; <nl> } <nl> <nl> void Interface_GUIControlAddonRendering : : set_callbacks ( <nl> mmm a / xbmc / addons / interfaces / gui / controls / SettingsSlider . cpp <nl> ppp b / xbmc / addons / interfaces / gui / controls / SettingsSlider . cpp <nl> namespace ADDON <nl> void Interface_GUIControlSettingsSlider : : Init ( AddonGlobalInterface * addonInterface ) <nl> { <nl> addonInterface - > toKodi - > kodi_gui - > control_settings_slider = <nl> - static_cast < AddonToKodiFuncTable_kodi_gui_control_settings_slider * > ( <nl> - malloc ( sizeof ( AddonToKodiFuncTable_kodi_gui_control_settings_slider ) ) ) ; <nl> + new AddonToKodiFuncTable_kodi_gui_control_settings_slider ( ) ; <nl> <nl> addonInterface - > toKodi - > kodi_gui - > control_settings_slider - > set_visible = set_visible ; <nl> addonInterface - > toKodi - > kodi_gui - > control_settings_slider - > set_enabled = set_enabled ; <nl> void Interface_GUIControlSettingsSlider : : Init ( AddonGlobalInterface * addonInterfa <nl> <nl> void Interface_GUIControlSettingsSlider : : DeInit ( AddonGlobalInterface * addonInterface ) <nl> { <nl> - free ( addonInterface - > toKodi - > kodi_gui - > control_settings_slider ) ; <nl> + delete addonInterface - > toKodi - > kodi_gui - > control_settings_slider ; <nl> } <nl> <nl> void Interface_GUIControlSettingsSlider : : set_visible ( KODI_HANDLE kodiBase , <nl> mmm a / xbmc / addons / interfaces / gui / controls / Slider . cpp <nl> ppp b / xbmc / addons / interfaces / gui / controls / Slider . cpp <nl> namespace ADDON <nl> void Interface_GUIControlSlider : : Init ( AddonGlobalInterface * addonInterface ) <nl> { <nl> addonInterface - > toKodi - > kodi_gui - > control_slider = <nl> - static_cast < AddonToKodiFuncTable_kodi_gui_control_slider * > ( <nl> - malloc ( sizeof ( AddonToKodiFuncTable_kodi_gui_control_slider ) ) ) ; <nl> + new AddonToKodiFuncTable_kodi_gui_control_slider ( ) ; <nl> <nl> addonInterface - > toKodi - > kodi_gui - > control_slider - > set_visible = set_visible ; <nl> addonInterface - > toKodi - > kodi_gui - > control_slider - > set_enabled = set_enabled ; <nl> void Interface_GUIControlSlider : : Init ( AddonGlobalInterface * addonInterface ) <nl> <nl> void Interface_GUIControlSlider : : DeInit ( AddonGlobalInterface * addonInterface ) <nl> { <nl> - free ( addonInterface - > toKodi - > kodi_gui - > control_slider ) ; <nl> + delete addonInterface - > toKodi - > kodi_gui - > control_slider ; <nl> } <nl> <nl> void Interface_GUIControlSlider : : set_visible ( KODI_HANDLE kodiBase , <nl> mmm a / xbmc / addons / interfaces / gui / controls / Spin . cpp <nl> ppp b / xbmc / addons / interfaces / gui / controls / Spin . cpp <nl> namespace ADDON <nl> <nl> void Interface_GUIControlSpin : : Init ( AddonGlobalInterface * addonInterface ) <nl> { <nl> - addonInterface - > toKodi - > kodi_gui - > control_spin = <nl> - static_cast < AddonToKodiFuncTable_kodi_gui_control_spin * > ( <nl> - malloc ( sizeof ( AddonToKodiFuncTable_kodi_gui_control_spin ) ) ) ; <nl> + addonInterface - > toKodi - > kodi_gui - > control_spin = new AddonToKodiFuncTable_kodi_gui_control_spin ( ) ; <nl> <nl> addonInterface - > toKodi - > kodi_gui - > control_spin - > set_visible = set_visible ; <nl> addonInterface - > toKodi - > kodi_gui - > control_spin - > set_enabled = set_enabled ; <nl> void Interface_GUIControlSpin : : Init ( AddonGlobalInterface * addonInterface ) <nl> <nl> void Interface_GUIControlSpin : : DeInit ( AddonGlobalInterface * addonInterface ) <nl> { <nl> - free ( addonInterface - > toKodi - > kodi_gui - > control_spin ) ; <nl> + delete addonInterface - > toKodi - > kodi_gui - > control_spin ; <nl> } <nl> <nl> void Interface_GUIControlSpin : : set_visible ( KODI_HANDLE kodiBase , <nl> mmm a / xbmc / addons / interfaces / gui / controls / TextBox . cpp <nl> ppp b / xbmc / addons / interfaces / gui / controls / TextBox . cpp <nl> namespace ADDON <nl> void Interface_GUIControlTextBox : : Init ( AddonGlobalInterface * addonInterface ) <nl> { <nl> addonInterface - > toKodi - > kodi_gui - > control_text_box = <nl> - static_cast < AddonToKodiFuncTable_kodi_gui_control_text_box * > ( <nl> - malloc ( sizeof ( AddonToKodiFuncTable_kodi_gui_control_text_box ) ) ) ; <nl> + new AddonToKodiFuncTable_kodi_gui_control_text_box ( ) ; <nl> <nl> addonInterface - > toKodi - > kodi_gui - > control_text_box - > set_visible = set_visible ; <nl> addonInterface - > toKodi - > kodi_gui - > control_text_box - > reset = reset ; <nl> void Interface_GUIControlTextBox : : Init ( AddonGlobalInterface * addonInterface ) <nl> <nl> void Interface_GUIControlTextBox : : DeInit ( AddonGlobalInterface * addonInterface ) <nl> { <nl> - free ( addonInterface - > toKodi - > kodi_gui - > control_text_box ) ; <nl> + delete addonInterface - > toKodi - > kodi_gui - > control_text_box ; <nl> } <nl> <nl> void Interface_GUIControlTextBox : : set_visible ( KODI_HANDLE kodiBase , <nl> mmm a / xbmc / addons / interfaces / gui / dialogs / ContextMenu . cpp <nl> ppp b / xbmc / addons / interfaces / gui / dialogs / ContextMenu . cpp <nl> namespace ADDON <nl> void Interface_GUIDialogContextMenu : : Init ( AddonGlobalInterface * addonInterface ) <nl> { <nl> addonInterface - > toKodi - > kodi_gui - > dialogContextMenu = <nl> - static_cast < AddonToKodiFuncTable_kodi_gui_dialogContextMenu * > ( <nl> - malloc ( sizeof ( AddonToKodiFuncTable_kodi_gui_dialogContextMenu ) ) ) ; <nl> + new AddonToKodiFuncTable_kodi_gui_dialogContextMenu ( ) ; <nl> <nl> addonInterface - > toKodi - > kodi_gui - > dialogContextMenu - > open = open ; <nl> } <nl> <nl> void Interface_GUIDialogContextMenu : : DeInit ( AddonGlobalInterface * addonInterface ) <nl> { <nl> - free ( addonInterface - > toKodi - > kodi_gui - > dialogContextMenu ) ; <nl> + delete addonInterface - > toKodi - > kodi_gui - > dialogContextMenu ; <nl> } <nl> <nl> int Interface_GUIDialogContextMenu : : open ( KODI_HANDLE kodiBase , <nl> mmm a / xbmc / addons / interfaces / gui / dialogs / ExtendedProgressBar . cpp <nl> ppp b / xbmc / addons / interfaces / gui / dialogs / ExtendedProgressBar . cpp <nl> namespace ADDON <nl> void Interface_GUIDialogExtendedProgress : : Init ( AddonGlobalInterface * addonInterface ) <nl> { <nl> addonInterface - > toKodi - > kodi_gui - > dialogExtendedProgress = <nl> - static_cast < AddonToKodiFuncTable_kodi_gui_dialogExtendedProgress * > ( <nl> - malloc ( sizeof ( AddonToKodiFuncTable_kodi_gui_dialogExtendedProgress ) ) ) ; <nl> + new AddonToKodiFuncTable_kodi_gui_dialogExtendedProgress ( ) ; <nl> <nl> addonInterface - > toKodi - > kodi_gui - > dialogExtendedProgress - > new_dialog = new_dialog ; <nl> addonInterface - > toKodi - > kodi_gui - > dialogExtendedProgress - > delete_dialog = delete_dialog ; <nl> void Interface_GUIDialogExtendedProgress : : Init ( AddonGlobalInterface * addonInterf <nl> <nl> void Interface_GUIDialogExtendedProgress : : DeInit ( AddonGlobalInterface * addonInterface ) <nl> { <nl> - free ( addonInterface - > toKodi - > kodi_gui - > dialogExtendedProgress ) ; <nl> + delete addonInterface - > toKodi - > kodi_gui - > dialogExtendedProgress ; <nl> } <nl> <nl> KODI_GUI_HANDLE Interface_GUIDialogExtendedProgress : : new_dialog ( KODI_HANDLE kodiBase , <nl> mmm a / xbmc / addons / interfaces / gui / dialogs / FileBrowser . cpp <nl> ppp b / xbmc / addons / interfaces / gui / dialogs / FileBrowser . cpp <nl> namespace ADDON <nl> void Interface_GUIDialogFileBrowser : : Init ( AddonGlobalInterface * addonInterface ) <nl> { <nl> addonInterface - > toKodi - > kodi_gui - > dialogFileBrowser = <nl> - static_cast < AddonToKodiFuncTable_kodi_gui_dialogFileBrowser * > ( <nl> - malloc ( sizeof ( AddonToKodiFuncTable_kodi_gui_dialogFileBrowser ) ) ) ; <nl> + new AddonToKodiFuncTable_kodi_gui_dialogFileBrowser ( ) ; <nl> <nl> addonInterface - > toKodi - > kodi_gui - > dialogFileBrowser - > show_and_get_directory = <nl> show_and_get_directory ; <nl> void Interface_GUIDialogFileBrowser : : Init ( AddonGlobalInterface * addonInterface ) <nl> <nl> void Interface_GUIDialogFileBrowser : : DeInit ( AddonGlobalInterface * addonInterface ) <nl> { <nl> - free ( addonInterface - > toKodi - > kodi_gui - > dialogFileBrowser ) ; <nl> + delete addonInterface - > toKodi - > kodi_gui - > dialogFileBrowser ; <nl> } <nl> <nl> bool Interface_GUIDialogFileBrowser : : show_and_get_directory ( KODI_HANDLE kodiBase , <nl> mmm a / xbmc / addons / interfaces / gui / dialogs / Keyboard . cpp <nl> ppp b / xbmc / addons / interfaces / gui / dialogs / Keyboard . cpp <nl> namespace ADDON <nl> void Interface_GUIDialogKeyboard : : Init ( AddonGlobalInterface * addonInterface ) <nl> { <nl> addonInterface - > toKodi - > kodi_gui - > dialogKeyboard = <nl> - static_cast < AddonToKodiFuncTable_kodi_gui_dialogKeyboard * > ( <nl> - malloc ( sizeof ( AddonToKodiFuncTable_kodi_gui_dialogKeyboard ) ) ) ; <nl> + new AddonToKodiFuncTable_kodi_gui_dialogKeyboard ( ) ; <nl> <nl> addonInterface - > toKodi - > kodi_gui - > dialogKeyboard - > show_and_get_input_with_head = <nl> show_and_get_input_with_head ; <nl> void Interface_GUIDialogKeyboard : : Init ( AddonGlobalInterface * addonInterface ) <nl> <nl> void Interface_GUIDialogKeyboard : : DeInit ( AddonGlobalInterface * addonInterface ) <nl> { <nl> - free ( addonInterface - > toKodi - > kodi_gui - > dialogKeyboard ) ; <nl> + delete addonInterface - > toKodi - > kodi_gui - > dialogKeyboard ; <nl> } <nl> <nl> bool Interface_GUIDialogKeyboard : : show_and_get_input_with_head ( KODI_HANDLE kodiBase , <nl> mmm a / xbmc / addons / interfaces / gui / dialogs / Numeric . cpp <nl> ppp b / xbmc / addons / interfaces / gui / dialogs / Numeric . cpp <nl> namespace ADDON <nl> void Interface_GUIDialogNumeric : : Init ( AddonGlobalInterface * addonInterface ) <nl> { <nl> addonInterface - > toKodi - > kodi_gui - > dialogNumeric = <nl> - static_cast < AddonToKodiFuncTable_kodi_gui_dialogNumeric * > ( <nl> - malloc ( sizeof ( AddonToKodiFuncTable_kodi_gui_dialogNumeric ) ) ) ; <nl> + new AddonToKodiFuncTable_kodi_gui_dialogNumeric ( ) ; <nl> <nl> addonInterface - > toKodi - > kodi_gui - > dialogNumeric - > show_and_verify_new_password = <nl> show_and_verify_new_password ; <nl> void Interface_GUIDialogNumeric : : Init ( AddonGlobalInterface * addonInterface ) <nl> <nl> void Interface_GUIDialogNumeric : : DeInit ( AddonGlobalInterface * addonInterface ) <nl> { <nl> - free ( addonInterface - > toKodi - > kodi_gui - > dialogNumeric ) ; <nl> + delete addonInterface - > toKodi - > kodi_gui - > dialogNumeric ; <nl> } <nl> <nl> bool Interface_GUIDialogNumeric : : show_and_verify_new_password ( KODI_HANDLE kodiBase , char * * password ) <nl> mmm a / xbmc / addons / interfaces / gui / dialogs / OK . cpp <nl> ppp b / xbmc / addons / interfaces / gui / dialogs / OK . cpp <nl> namespace ADDON <nl> <nl> void Interface_GUIDialogOK : : Init ( AddonGlobalInterface * addonInterface ) <nl> { <nl> - addonInterface - > toKodi - > kodi_gui - > dialogOK = static_cast < AddonToKodiFuncTable_kodi_gui_dialogOK * > ( <nl> - malloc ( sizeof ( AddonToKodiFuncTable_kodi_gui_dialogOK ) ) ) ; <nl> + addonInterface - > toKodi - > kodi_gui - > dialogOK = new AddonToKodiFuncTable_kodi_gui_dialogOK ( ) ; <nl> <nl> addonInterface - > toKodi - > kodi_gui - > dialogOK - > show_and_get_input_single_text = <nl> show_and_get_input_single_text ; <nl> void Interface_GUIDialogOK : : Init ( AddonGlobalInterface * addonInterface ) <nl> <nl> void Interface_GUIDialogOK : : DeInit ( AddonGlobalInterface * addonInterface ) <nl> { <nl> - free ( addonInterface - > toKodi - > kodi_gui - > dialogOK ) ; <nl> + delete addonInterface - > toKodi - > kodi_gui - > dialogOK ; <nl> } <nl> <nl> void Interface_GUIDialogOK : : show_and_get_input_single_text ( KODI_HANDLE kodiBase , <nl> mmm a / xbmc / addons / interfaces / gui / dialogs / Progress . cpp <nl> ppp b / xbmc / addons / interfaces / gui / dialogs / Progress . cpp <nl> namespace ADDON <nl> void Interface_GUIDialogProgress : : Init ( AddonGlobalInterface * addonInterface ) <nl> { <nl> addonInterface - > toKodi - > kodi_gui - > dialogProgress = <nl> - static_cast < AddonToKodiFuncTable_kodi_gui_dialogProgress * > ( <nl> - malloc ( sizeof ( AddonToKodiFuncTable_kodi_gui_dialogProgress ) ) ) ; <nl> + new AddonToKodiFuncTable_kodi_gui_dialogProgress ( ) ; <nl> <nl> addonInterface - > toKodi - > kodi_gui - > dialogProgress - > new_dialog = new_dialog ; <nl> addonInterface - > toKodi - > kodi_gui - > dialogProgress - > delete_dialog = delete_dialog ; <nl> void Interface_GUIDialogProgress : : Init ( AddonGlobalInterface * addonInterface ) <nl> <nl> void Interface_GUIDialogProgress : : DeInit ( AddonGlobalInterface * addonInterface ) <nl> { <nl> - free ( addonInterface - > toKodi - > kodi_gui - > dialogProgress ) ; <nl> + delete addonInterface - > toKodi - > kodi_gui - > dialogProgress ; <nl> } <nl> <nl> KODI_GUI_HANDLE Interface_GUIDialogProgress : : new_dialog ( KODI_HANDLE kodiBase ) <nl> mmm a / xbmc / addons / interfaces / gui / dialogs / Select . cpp <nl> ppp b / xbmc / addons / interfaces / gui / dialogs / Select . cpp <nl> namespace ADDON <nl> <nl> void Interface_GUIDialogSelect : : Init ( AddonGlobalInterface * addonInterface ) <nl> { <nl> - addonInterface - > toKodi - > kodi_gui - > dialogSelect = <nl> - static_cast < AddonToKodiFuncTable_kodi_gui_dialogSelect * > ( <nl> - malloc ( sizeof ( AddonToKodiFuncTable_kodi_gui_dialogSelect ) ) ) ; <nl> + addonInterface - > toKodi - > kodi_gui - > dialogSelect = new AddonToKodiFuncTable_kodi_gui_dialogSelect ( ) ; <nl> <nl> addonInterface - > toKodi - > kodi_gui - > dialogSelect - > open = open ; <nl> addonInterface - > toKodi - > kodi_gui - > dialogSelect - > open_multi_select = open_multi_select ; <nl> void Interface_GUIDialogSelect : : Init ( AddonGlobalInterface * addonInterface ) <nl> <nl> void Interface_GUIDialogSelect : : DeInit ( AddonGlobalInterface * addonInterface ) <nl> { <nl> - free ( addonInterface - > toKodi - > kodi_gui - > dialogSelect ) ; <nl> + delete addonInterface - > toKodi - > kodi_gui - > dialogSelect ; <nl> } <nl> <nl> int Interface_GUIDialogSelect : : open ( KODI_HANDLE kodiBase , <nl> mmm a / xbmc / addons / interfaces / gui / dialogs / TextViewer . cpp <nl> ppp b / xbmc / addons / interfaces / gui / dialogs / TextViewer . cpp <nl> namespace ADDON <nl> void Interface_GUIDialogTextViewer : : Init ( AddonGlobalInterface * addonInterface ) <nl> { <nl> addonInterface - > toKodi - > kodi_gui - > dialogTextViewer = <nl> - static_cast < AddonToKodiFuncTable_kodi_gui_dialogTextViewer * > ( <nl> - malloc ( sizeof ( AddonToKodiFuncTable_kodi_gui_dialogTextViewer ) ) ) ; <nl> + new AddonToKodiFuncTable_kodi_gui_dialogTextViewer ( ) ; <nl> <nl> addonInterface - > toKodi - > kodi_gui - > dialogTextViewer - > open = open ; <nl> } <nl> <nl> void Interface_GUIDialogTextViewer : : DeInit ( AddonGlobalInterface * addonInterface ) <nl> { <nl> - free ( addonInterface - > toKodi - > kodi_gui - > dialogTextViewer ) ; <nl> + delete addonInterface - > toKodi - > kodi_gui - > dialogTextViewer ; <nl> } <nl> <nl> void Interface_GUIDialogTextViewer : : open ( KODI_HANDLE kodiBase , <nl> mmm a / xbmc / addons / interfaces / gui / dialogs / YesNo . cpp <nl> ppp b / xbmc / addons / interfaces / gui / dialogs / YesNo . cpp <nl> namespace ADDON <nl> <nl> void Interface_GUIDialogYesNo : : Init ( AddonGlobalInterface * addonInterface ) <nl> { <nl> - addonInterface - > toKodi - > kodi_gui - > dialogYesNo = <nl> - static_cast < AddonToKodiFuncTable_kodi_gui_dialogYesNo * > ( <nl> - malloc ( sizeof ( AddonToKodiFuncTable_kodi_gui_dialogYesNo ) ) ) ; <nl> + addonInterface - > toKodi - > kodi_gui - > dialogYesNo = new AddonToKodiFuncTable_kodi_gui_dialogYesNo ( ) ; <nl> <nl> addonInterface - > toKodi - > kodi_gui - > dialogYesNo - > show_and_get_input_single_text = <nl> show_and_get_input_single_text ; <nl> void Interface_GUIDialogYesNo : : Init ( AddonGlobalInterface * addonInterface ) <nl> <nl> void Interface_GUIDialogYesNo : : DeInit ( AddonGlobalInterface * addonInterface ) <nl> { <nl> - free ( addonInterface - > toKodi - > kodi_gui - > dialogYesNo ) ; <nl> + delete addonInterface - > toKodi - > kodi_gui - > dialogYesNo ; <nl> } <nl> <nl> bool Interface_GUIDialogYesNo : : show_and_get_input_single_text ( KODI_HANDLE kodiBase , <nl>
[ addons ] [ gui ] use C + + new and delete for " C " struct creation
xbmc/xbmc
3a514cd793e188a8bcfb5975f94e0acf30545d0f
2020-09-12T07:25:17Z
mmm a / test / IRGen / typed_boxes . sil <nl> ppp b / test / IRGen / typed_boxes . sil <nl> entry : <nl> sil @ rc_box_b : $ @ convention ( thin ) ( ) - > ( ) { <nl> entry : <nl> / / TODO : Should reuse metadata <nl> - < < < < < < < HEAD <nl> / / CHECK - 32 : [ [ BOX : % . * ] ] = call noalias % swift . refcounted * @ swift_allocObject ( % swift . type * { { . * } } [ [ NATIVE_RC_METADATA ] ] , { { . * } } [ [ WORD ] ] 16 , [ [ WORD ] ] 3 ) <nl> / / CHECK - 64 : [ [ BOX : % . * ] ] = call noalias % swift . refcounted * @ swift_allocObject ( % swift . type * { { . * } } [ [ NATIVE_RC_METADATA ] ] , { { . * } } [ [ WORD ] ] 24 , [ [ WORD ] ] 7 ) <nl> - = = = = = = = <nl> - / / CHECK - 32 : [ [ BOX : % . * ] ] = call noalias % swift . refcounted * @ swift_allocObject ( % swift . type * { { . * } } [ [ NATIVE_RC_METADATA : @ metadata [ 0 - 9 . ] * ] ] , { { . * } } [ [ WORD ] ] 16 , [ [ WORD ] ] 3 ) <nl> - / / CHECK - 64 : [ [ BOX : % . * ] ] = call noalias % swift . refcounted * @ swift_allocObject ( % swift . type * { { . * } } [ [ NATIVE_RC_METADATA : @ metadata [ 0 - 9 . ] * ] ] , { { . * } } [ [ WORD ] ] 24 , [ [ WORD ] ] 7 ) <nl> - > > > > > > > 40ec298 . . . Adjust tests for the new scheme of name conflict resolution in LLVM <nl> % a = alloc_box $ D <nl> / / CHECK : bitcast % swift . refcounted * * { { % . * } } to % C11typed_boxes1D * * <nl> % b = project_box % a # 0 : $ @ box D <nl> entry : <nl> / / CHECK - LABEL : define void @ unknown_rc_box <nl> sil @ unknown_rc_box : $ @ convention ( thin ) ( ) - > ( ) { <nl> entry : <nl> - < < < < < < < HEAD <nl> - / / CHECK - 32 : [ [ BOX : % . * ] ] = call noalias % swift . refcounted * @ swift_allocObject ( % swift . type * { { . * } } [ [ UNKNOWN_RC_METADATA : @ metadata [ 0 - 9 ] * ] ] , { { . * } } [ [ WORD ] ] 16 , [ [ WORD ] ] 3 ) <nl> - / / CHECK - 64 : [ [ BOX : % . * ] ] = call noalias % swift . refcounted * @ swift_allocObject ( % swift . type * { { . * } } [ [ UNKNOWN_RC_METADATA : @ metadata [ 0 - 9 ] * ] ] , { { . * } } [ [ WORD ] ] 24 , [ [ WORD ] ] 7 ) <nl> - = = = = = = = <nl> - / / CHECK - 32 : [ [ BOX : % . * ] ] = call noalias % swift . refcounted * @ swift_allocObject ( % swift . type * { { . * } } [ [ NATIVE_RC_METADATA : @ metadata [ 0 - 9 . ] * ] ] , { { . * } } [ [ WORD ] ] 16 , [ [ WORD ] ] 3 ) <nl> - / / CHECK - 64 : [ [ BOX : % . * ] ] = call noalias % swift . refcounted * @ swift_allocObject ( % swift . type * { { . * } } [ [ NATIVE_RC_METADATA : @ metadata [ 0 - 9 . ] * ] ] , { { . * } } [ [ WORD ] ] 24 , [ [ WORD ] ] 7 ) <nl> - > > > > > > > 40ec298 . . . Adjust tests for the new scheme of name conflict resolution in LLVM <nl> + / / CHECK - 32 : [ [ BOX : % . * ] ] = call noalias % swift . refcounted * @ swift_allocObject ( % swift . type * { { . * } } [ [ UNKNOWN_RC_METADATA : @ metadata [ 0 - 9 . ] * ] ] , { { . * } } [ [ WORD ] ] 16 , [ [ WORD ] ] 3 ) <nl> + / / CHECK - 64 : [ [ BOX : % . * ] ] = call noalias % swift . refcounted * @ swift_allocObject ( % swift . type * { { . * } } [ [ UNKNOWN_RC_METADATA : @ metadata [ 0 - 9 . ] * ] ] , { { . * } } [ [ WORD ] ] 24 , [ [ WORD ] ] 7 ) <nl> % a = alloc_box $ Builtin . UnknownObject <nl> % b = project_box % a # 0 : $ @ box Builtin . UnknownObject <nl> dealloc_box % a # 0 : $ @ box Builtin . UnknownObject <nl>
Resolve the merge failure of test / IRGen / typed_boxes . sil that I
apple/swift
a327114ea05f7fa74b29cc7c97f8ce1064264383
2015-06-25T23:03:45Z
mmm a / imgui_demo . cpp <nl> ppp b / imgui_demo . cpp <nl> static void ShowExampleAppLongText ( bool * opened ) <nl> ImGui : : TextUnformatted ( log . begin ( ) , log . end ( ) ) ; <nl> break ; <nl> case 1 : <nl> - / / Multiple calls to Text ( ) , manually coarsely clipped - demonstrate how to use the CalcListClipping ( ) helper . <nl> - ImGui : : PushStyleVar ( ImGuiStyleVar_ItemSpacing , ImVec2 ( 0 , 0 ) ) ; <nl> - int display_start , display_end ; <nl> - ImGui : : CalcListClipping ( lines , ImGui : : GetTextLineHeight ( ) , & display_start , & display_end ) ; <nl> - ImGui : : SetCursorPosY ( ImGui : : GetCursorPosY ( ) + ( display_start ) * ImGui : : GetTextLineHeight ( ) ) ; <nl> - for ( int i = display_start ; i < display_end ; i + + ) <nl> - ImGui : : Text ( " % i The quick brown fox jumps over the lazy dog \ n " , i ) ; <nl> - ImGui : : SetCursorPosY ( ImGui : : GetCursorPosY ( ) + ( lines - display_end ) * ImGui : : GetTextLineHeight ( ) ) ; <nl> - ImGui : : PopStyleVar ( ) ; <nl> - break ; <nl> + { <nl> + / / Multiple calls to Text ( ) , manually coarsely clipped - demonstrate how to use the ImGuiListClipper helper . <nl> + ImGui : : PushStyleVar ( ImGuiStyleVar_ItemSpacing , ImVec2 ( 0 , 0 ) ) ; <nl> + ImGuiListClipper clipper ( lines , ImGui : : GetTextLineHeight ( ) ) ; <nl> + for ( int i = clipper . DisplayStart ; i < clipper . DisplayEnd ; i + + ) <nl> + ImGui : : Text ( " % i The quick brown fox jumps over the lazy dog \ n " , i ) ; <nl> + clipper . End ( ) ; <nl> + ImGui : : PopStyleVar ( ) ; <nl> + break ; <nl> + } <nl> case 2 : <nl> / / Multiple calls to Text ( ) , not clipped ( slow ) <nl> ImGui : : PushStyleVar ( ImGuiStyleVar_ItemSpacing , ImVec2 ( 0 , 0 ) ) ; <nl>
Demo : long text example uses ImGuiListClipper
ocornut/imgui
aa35547f949d759f5b2e7207ec1a10b36dac6092
2015-08-29T23:03:08Z
mmm a / modules / ocl / perf / main . cpp <nl> ppp b / modules / ocl / perf / main . cpp <nl> int main ( int argc , const char * argv [ ] ) <nl> cerr < < " no device found \ n " ; <nl> return - 1 ; <nl> } <nl> + / / set this to overwrite binary cache every time the test starts <nl> + ocl : : setBinaryDiskCache ( ocl : : CACHE_UPDATE ) ; <nl> <nl> int devidx = 0 ; <nl> <nl> similarity index 65 % <nl> rename from modules / ocl / test / test_columnsum . cpp <nl> rename to modules / ocl / perf / perf_calib3d . cpp <nl> mmm a / modules / ocl / test / test_columnsum . cpp <nl> ppp b / modules / ocl / perf / perf_calib3d . cpp <nl> <nl> / / Third party copyrights are property of their respective owners . <nl> / / <nl> / / @ Authors <nl> - / / Chunpeng Zhang chunpeng @ multicorewareinc . com <nl> - / / <nl> + / / Fangfang Bai , fangfang @ multicorewareinc . com <nl> + / / Jin Ma , jin @ multicorewareinc . com <nl> / / <nl> / / Redistribution and use in source and binary forms , with or without modification , <nl> / / are permitted provided that the following conditions are met : <nl> <nl> / / * The name of the copyright holders may not be used to endorse or promote products <nl> / / derived from this software without specific prior written permission . <nl> / / <nl> - / / This software is provided by the copyright holders and contributors " as is " and <nl> + / / This software is provided by the copyright holders and contributors as is and <nl> / / any express or implied warranties , including , but not limited to , the implied <nl> / / warranties of merchantability and fitness for a particular purpose are disclaimed . <nl> / / In no event shall the Intel Corporation or contributors be liable for any direct , <nl> <nl> / / M * / <nl> <nl> # include " precomp . hpp " <nl> - # include < iomanip > <nl> + / / / / / / / / / / / / / StereoMatchBM / / / / / / / / / / / / / / / / / / / / / / / / <nl> + PERFTEST ( StereoMatchBM ) <nl> + { <nl> + Mat left_image = imread ( abspath ( " aloeL . jpg " ) , cv : : IMREAD_GRAYSCALE ) ; <nl> + Mat right_image = imread ( abspath ( " aloeR . jpg " ) , cv : : IMREAD_GRAYSCALE ) ; <nl> + Mat disp , dst ; <nl> + ocl : : oclMat d_left , d_right , d_disp ; <nl> + int n_disp = 128 ; <nl> + int winSize = 19 ; <nl> <nl> - # ifdef HAVE_OPENCL <nl> + SUBTEST < < left_image . cols < < ' x ' < < left_image . rows < < " ; aloeL . jpg ; " < < right_image . cols < < ' x ' < < right_image . rows < < " ; aloeR . jpg " ; <nl> <nl> - PARAM_TEST_CASE ( ColumnSum , cv : : Size ) <nl> - { <nl> - cv : : Size size ; <nl> - cv : : Mat src ; <nl> + StereoBM bm ( 0 , n_disp , winSize ) ; <nl> + bm ( left_image , right_image , dst ) ; <nl> <nl> - virtual void SetUp ( ) <nl> - { <nl> - size = GET_PARAM ( 0 ) ; <nl> - } <nl> - } ; <nl> + CPU_ON ; <nl> + bm ( left_image , right_image , dst ) ; <nl> + CPU_OFF ; <nl> <nl> - TEST_P ( ColumnSum , Accuracy ) <nl> - { <nl> - cv : : Mat src = randomMat ( size , CV_32FC1 ) ; <nl> - cv : : ocl : : oclMat d_dst ; <nl> - cv : : ocl : : oclMat d_src ( src ) ; <nl> - <nl> - cv : : ocl : : columnSum ( d_src , d_dst ) ; <nl> - <nl> - cv : : Mat dst ( d_dst ) ; <nl> - <nl> - for ( int j = 0 ; j < src . cols ; + + j ) <nl> - { <nl> - float gold = src . at < float > ( 0 , j ) ; <nl> - float res = dst . at < float > ( 0 , j ) ; <nl> - ASSERT_NEAR ( res , gold , 1e - 5 ) ; <nl> - } <nl> - <nl> - for ( int i = 1 ; i < src . rows ; + + i ) <nl> - { <nl> - for ( int j = 0 ; j < src . cols ; + + j ) <nl> - { <nl> - float gold = src . at < float > ( i , j ) + = src . at < float > ( i - 1 , j ) ; <nl> - float res = dst . at < float > ( i , j ) ; <nl> - ASSERT_NEAR ( res , gold , 1e - 5 ) ; <nl> - } <nl> - } <nl> + d_left . upload ( left_image ) ; <nl> + d_right . upload ( right_image ) ; <nl> + <nl> + ocl : : StereoBM_OCL d_bm ( 0 , n_disp , winSize ) ; <nl> + <nl> + WARMUP_ON ; <nl> + d_bm ( d_left , d_right , d_disp ) ; <nl> + WARMUP_OFF ; <nl> + <nl> + cv : : Mat ocl_mat ; <nl> + d_disp . download ( ocl_mat ) ; <nl> + ocl_mat . convertTo ( ocl_mat , dst . type ( ) ) ; <nl> + <nl> + GPU_ON ; <nl> + d_bm ( d_left , d_right , d_disp ) ; <nl> + GPU_OFF ; <nl> + <nl> + GPU_FULL_ON ; <nl> + d_left . upload ( left_image ) ; <nl> + d_right . upload ( right_image ) ; <nl> + d_bm ( d_left , d_right , d_disp ) ; <nl> + d_disp . download ( disp ) ; <nl> + GPU_FULL_OFF ; <nl> + <nl> + TestSystem : : instance ( ) . setAccurate ( - 1 , 0 . ) ; <nl> } <nl> <nl> - INSTANTIATE_TEST_CASE_P ( OCL_ImgProc , ColumnSum , DIFFERENT_SIZES ) ; <nl> <nl> <nl> - # endif <nl> + <nl> + <nl> + <nl> + <nl> + <nl> + <nl> \ No newline at end of file <nl> mmm a / modules / ocl / perf / perf_filters . cpp <nl> ppp b / modules / ocl / perf / perf_filters . cpp <nl> PERFTEST ( GaussianBlur ) <nl> Mat src , dst , ocl_dst ; <nl> int all_type [ ] = { CV_8UC1 , CV_8UC4 , CV_32FC1 , CV_32FC4 } ; <nl> std : : string type_name [ ] = { " CV_8UC1 " , " CV_8UC4 " , " CV_32FC1 " , " CV_32FC4 " } ; <nl> + const int ksize = 7 ; <nl> <nl> for ( int size = Min_Size ; size < = Max_Size ; size * = Multiple ) <nl> { <nl> PERFTEST ( GaussianBlur ) <nl> { <nl> SUBTEST < < size < < ' x ' < < size < < " ; " < < type_name [ j ] ; <nl> <nl> - gen ( src , size , size , all_type [ j ] , 5 , 16 ) ; <nl> + gen ( src , size , size , all_type [ j ] , 0 , 256 ) ; <nl> <nl> - GaussianBlur ( src , dst , Size ( 9 , 9 ) , 0 ) ; <nl> + GaussianBlur ( src , dst , Size ( ksize , ksize ) , 0 ) ; <nl> <nl> CPU_ON ; <nl> - GaussianBlur ( src , dst , Size ( 9 , 9 ) , 0 ) ; <nl> + GaussianBlur ( src , dst , Size ( ksize , ksize ) , 0 ) ; <nl> CPU_OFF ; <nl> <nl> ocl : : oclMat d_src ( src ) ; <nl> - ocl : : oclMat d_dst ( src . size ( ) , src . type ( ) ) ; <nl> - ocl : : oclMat d_buf ; <nl> + ocl : : oclMat d_dst ; <nl> <nl> WARMUP_ON ; <nl> - ocl : : GaussianBlur ( d_src , d_dst , Size ( 9 , 9 ) , 0 ) ; <nl> + ocl : : GaussianBlur ( d_src , d_dst , Size ( ksize , ksize ) , 0 ) ; <nl> WARMUP_OFF ; <nl> <nl> GPU_ON ; <nl> - ocl : : GaussianBlur ( d_src , d_dst , Size ( 9 , 9 ) , 0 ) ; <nl> + ocl : : GaussianBlur ( d_src , d_dst , Size ( ksize , ksize ) , 0 ) ; <nl> GPU_OFF ; <nl> <nl> GPU_FULL_ON ; <nl> d_src . upload ( src ) ; <nl> - ocl : : GaussianBlur ( d_src , d_dst , Size ( 9 , 9 ) , 0 ) ; <nl> + ocl : : GaussianBlur ( d_src , d_dst , Size ( ksize , ksize ) , 0 ) ; <nl> d_dst . download ( ocl_dst ) ; <nl> GPU_FULL_OFF ; <nl> <nl> mmm a / modules / ocl / perf / perf_hog . cpp <nl> ppp b / modules / ocl / perf / perf_hog . cpp <nl> <nl> # include " precomp . hpp " <nl> <nl> / / / / / / / / / / / / / HOG / / / / / / / / / / / / / / / / / / / / / / / / <nl> - bool match_rect ( cv : : Rect r1 , cv : : Rect r2 , int threshold ) <nl> - { <nl> - return ( ( abs ( r1 . x - r2 . x ) < threshold ) & & ( abs ( r1 . y - r2 . y ) < threshold ) & & <nl> - ( abs ( r1 . width - r2 . width ) < threshold ) & & ( abs ( r1 . height - r2 . height ) < threshold ) ) ; <nl> - } <nl> <nl> PERFTEST ( HOG ) <nl> { <nl> PERFTEST ( HOG ) <nl> throw runtime_error ( " can ' t open road . png " ) ; <nl> } <nl> <nl> - <nl> cv : : HOGDescriptor hog ; <nl> hog . setSVMDetector ( hog . getDefaultPeopleDetector ( ) ) ; <nl> std : : vector < cv : : Rect > found_locations ; <nl> std : : vector < cv : : Rect > d_found_locations ; <nl> <nl> - SUBTEST < < 768 < < ' x ' < < 576 < < " ; road . png " ; <nl> + SUBTEST < < src . cols < < ' x ' < < src . rows < < " ; road . png " ; <nl> <nl> hog . detectMultiScale ( src , found_locations ) ; <nl> <nl> PERFTEST ( HOG ) <nl> ocl_hog . detectMultiScale ( d_src , d_found_locations ) ; <nl> WARMUP_OFF ; <nl> <nl> - / / Ground - truth rectangular people window <nl> - cv : : Rect win1_64x128 ( 231 , 190 , 72 , 144 ) ; <nl> - cv : : Rect win2_64x128 ( 621 , 156 , 97 , 194 ) ; <nl> - cv : : Rect win1_48x96 ( 238 , 198 , 63 , 126 ) ; <nl> - cv : : Rect win2_48x96 ( 619 , 161 , 92 , 185 ) ; <nl> - cv : : Rect win3_48x96 ( 488 , 136 , 56 , 112 ) ; <nl> - <nl> - / / Compare whether ground - truth windows are detected and compare the number of windows detected . <nl> - std : : vector < int > d_comp ( 4 ) ; <nl> - std : : vector < int > comp ( 4 ) ; <nl> - for ( int i = 0 ; i < ( int ) d_comp . size ( ) ; i + + ) <nl> - { <nl> - d_comp [ i ] = 0 ; <nl> - comp [ i ] = 0 ; <nl> - } <nl> - <nl> - int threshold = 10 ; <nl> - int val = 32 ; <nl> - d_comp [ 0 ] = ( int ) d_found_locations . size ( ) ; <nl> - comp [ 0 ] = ( int ) found_locations . size ( ) ; <nl> - <nl> - cv : : Size winSize = hog . winSize ; <nl> - <nl> - if ( winSize = = cv : : Size ( 48 , 96 ) ) <nl> - { <nl> - for ( int i = 0 ; i < ( int ) d_found_locations . size ( ) ; i + + ) <nl> - { <nl> - if ( match_rect ( d_found_locations [ i ] , win1_48x96 , threshold ) ) <nl> - d_comp [ 1 ] = val ; <nl> - if ( match_rect ( d_found_locations [ i ] , win2_48x96 , threshold ) ) <nl> - d_comp [ 2 ] = val ; <nl> - if ( match_rect ( d_found_locations [ i ] , win3_48x96 , threshold ) ) <nl> - d_comp [ 3 ] = val ; <nl> - } <nl> - for ( int i = 0 ; i < ( int ) found_locations . size ( ) ; i + + ) <nl> - { <nl> - if ( match_rect ( found_locations [ i ] , win1_48x96 , threshold ) ) <nl> - comp [ 1 ] = val ; <nl> - if ( match_rect ( found_locations [ i ] , win2_48x96 , threshold ) ) <nl> - comp [ 2 ] = val ; <nl> - if ( match_rect ( found_locations [ i ] , win3_48x96 , threshold ) ) <nl> - comp [ 3 ] = val ; <nl> - } <nl> - } <nl> - else if ( winSize = = cv : : Size ( 64 , 128 ) ) <nl> - { <nl> - for ( int i = 0 ; i < ( int ) d_found_locations . size ( ) ; i + + ) <nl> - { <nl> - if ( match_rect ( d_found_locations [ i ] , win1_64x128 , threshold ) ) <nl> - d_comp [ 1 ] = val ; <nl> - if ( match_rect ( d_found_locations [ i ] , win2_64x128 , threshold ) ) <nl> - d_comp [ 2 ] = val ; <nl> - } <nl> - for ( int i = 0 ; i < ( int ) found_locations . size ( ) ; i + + ) <nl> - { <nl> - if ( match_rect ( found_locations [ i ] , win1_64x128 , threshold ) ) <nl> - comp [ 1 ] = val ; <nl> - if ( match_rect ( found_locations [ i ] , win2_64x128 , threshold ) ) <nl> - comp [ 2 ] = val ; <nl> - } <nl> - } <nl> - <nl> - cv : : Mat gpu_rst ( d_comp ) , cpu_rst ( comp ) ; <nl> - TestSystem : : instance ( ) . ExpectedMatNear ( gpu_rst , cpu_rst , 3 ) ; <nl> + if ( d_found_locations . size ( ) = = found_locations . size ( ) ) <nl> + TestSystem : : instance ( ) . setAccurate ( 1 , 0 ) ; <nl> + else <nl> + TestSystem : : instance ( ) . setAccurate ( 0 , abs ( ( int ) found_locations . size ( ) - ( int ) d_found_locations . size ( ) ) ) ; <nl> <nl> GPU_ON ; <nl> ocl_hog . detectMultiScale ( d_src , found_locations ) ; <nl> mmm a / modules / ocl / perf / perf_imgproc . cpp <nl> ppp b / modules / ocl / perf / perf_imgproc . cpp <nl> PERFTEST ( meanShiftFiltering ) <nl> WARMUP_OFF ; <nl> <nl> GPU_ON ; <nl> - ocl : : meanShiftFiltering ( d_src , d_dst , sp , sr ) ; <nl> + ocl : : meanShiftFiltering ( d_src , d_dst , sp , sr , crit ) ; <nl> GPU_OFF ; <nl> <nl> GPU_FULL_ON ; <nl> d_src . upload ( src ) ; <nl> - ocl : : meanShiftFiltering ( d_src , d_dst , sp , sr ) ; <nl> + ocl : : meanShiftFiltering ( d_src , d_dst , sp , sr , crit ) ; <nl> d_dst . download ( ocl_dst ) ; <nl> GPU_FULL_OFF ; <nl> <nl> PERFTEST ( CLAHE ) <nl> } <nl> } <nl> } <nl> + <nl> + / / / / / / / / / / / / / columnSum / / / / / / / / / / / / / / / / / / / / / / / / <nl> + PERFTEST ( columnSum ) <nl> + { <nl> + Mat src , dst , ocl_dst ; <nl> + ocl : : oclMat d_src , d_dst ; <nl> + <nl> + for ( int size = Min_Size ; size < = Max_Size ; size * = Multiple ) <nl> + { <nl> + SUBTEST < < size < < ' x ' < < size < < " ; CV_32FC1 " ; <nl> + <nl> + gen ( src , size , size , CV_32FC1 , 0 , 256 ) ; <nl> + <nl> + CPU_ON ; <nl> + dst . create ( src . size ( ) , src . type ( ) ) ; <nl> + for ( int j = 0 ; j < src . cols ; j + + ) <nl> + dst . at < float > ( 0 , j ) = src . at < float > ( 0 , j ) ; <nl> + <nl> + for ( int i = 1 ; i < src . rows ; + + i ) <nl> + for ( int j = 0 ; j < src . cols ; + + j ) <nl> + dst . at < float > ( i , j ) = dst . at < float > ( i - 1 , j ) + src . at < float > ( i , j ) ; <nl> + CPU_OFF ; <nl> + <nl> + d_src . upload ( src ) ; <nl> + <nl> + WARMUP_ON ; <nl> + ocl : : columnSum ( d_src , d_dst ) ; <nl> + WARMUP_OFF ; <nl> + <nl> + GPU_ON ; <nl> + ocl : : columnSum ( d_src , d_dst ) ; <nl> + GPU_OFF ; <nl> + <nl> + GPU_FULL_ON ; <nl> + d_src . upload ( src ) ; <nl> + ocl : : columnSum ( d_src , d_dst ) ; <nl> + d_dst . download ( ocl_dst ) ; <nl> + GPU_FULL_OFF ; <nl> + <nl> + TestSystem : : instance ( ) . ExpectedMatNear ( dst , ocl_dst , 5e - 1 ) ; <nl> + } <nl> + } <nl> similarity index 68 % <nl> rename from modules / ocl / perf / perf_columnsum . cpp <nl> rename to modules / ocl / perf / perf_moments . cpp <nl> mmm a / modules / ocl / perf / perf_columnsum . cpp <nl> ppp b / modules / ocl / perf / perf_moments . cpp <nl> <nl> / / <nl> / / M * / <nl> # include " precomp . hpp " <nl> - <nl> - / / / / / / / / / / / / / columnSum / / / / / / / / / / / / / / / / / / / / / / / / <nl> - PERFTEST ( columnSum ) <nl> + / / / / / / / / / / / / / Moments / / / / / / / / / / / / / / / / / / / / / / / / <nl> + PERFTEST ( Moments ) <nl> { <nl> - Mat src , dst , ocl_dst ; <nl> - ocl : : oclMat d_src , d_dst ; <nl> + Mat src ; <nl> + bool binaryImage = 0 ; <nl> + <nl> + int all_type [ ] = { CV_8UC1 , CV_16SC1 , CV_32FC1 , CV_64FC1 } ; <nl> + std : : string type_name [ ] = { " CV_8UC1 " , " CV_16SC1 " , " CV_32FC1 " , " CV_64FC1 " } ; <nl> <nl> for ( int size = Min_Size ; size < = Max_Size ; size * = Multiple ) <nl> { <nl> - SUBTEST < < size < < ' x ' < < size < < " ; CV_32FC1 " ; <nl> + for ( size_t j = 0 ; j < sizeof ( all_type ) / sizeof ( int ) ; j + + ) <nl> + { <nl> + SUBTEST < < size < < ' x ' < < size < < " ; " < < type_name [ j ] ; <nl> + <nl> + gen ( src , size , size , all_type [ j ] , 0 , 256 ) ; <nl> + <nl> + cv : : Moments CvMom = moments ( src , binaryImage ) ; <nl> <nl> - gen ( src , size , size , CV_32FC1 , 0 , 256 ) ; <nl> + CPU_ON ; <nl> + moments ( src , binaryImage ) ; <nl> + CPU_OFF ; <nl> <nl> - CPU_ON ; <nl> - dst . create ( src . size ( ) , src . type ( ) ) ; <nl> - for ( int j = 0 ; j < src . cols ; j + + ) <nl> - dst . at < float > ( 0 , j ) = src . at < float > ( 0 , j ) ; <nl> + cv : : Moments oclMom ; <nl> + WARMUP_ON ; <nl> + oclMom = ocl : : ocl_moments ( src , binaryImage ) ; <nl> + WARMUP_OFF ; <nl> <nl> - for ( int i = 1 ; i < src . rows ; + + i ) <nl> - for ( int j = 0 ; j < src . cols ; + + j ) <nl> - dst . at < float > ( i , j ) = dst . at < float > ( i - 1 , j ) + src . at < float > ( i , j ) ; <nl> - CPU_OFF ; <nl> + Mat gpu_dst , cpu_dst ; <nl> + HuMoments ( CvMom , cpu_dst ) ; <nl> + HuMoments ( oclMom , gpu_dst ) ; <nl> <nl> - d_src . upload ( src ) ; <nl> + GPU_ON ; <nl> + ocl : : ocl_moments ( src , binaryImage ) ; <nl> + GPU_OFF ; <nl> <nl> - WARMUP_ON ; <nl> - ocl : : columnSum ( d_src , d_dst ) ; <nl> - WARMUP_OFF ; <nl> + GPU_FULL_ON ; <nl> + ocl : : ocl_moments ( src , binaryImage ) ; <nl> + GPU_FULL_OFF ; <nl> <nl> - GPU_ON ; <nl> - ocl : : columnSum ( d_src , d_dst ) ; <nl> - GPU_OFF ; <nl> + TestSystem : : instance ( ) . ExpectedMatNear ( gpu_dst , cpu_dst , . 5 ) ; <nl> <nl> - GPU_FULL_ON ; <nl> - d_src . upload ( src ) ; <nl> - ocl : : columnSum ( d_src , d_dst ) ; <nl> - d_dst . download ( ocl_dst ) ; <nl> - GPU_FULL_OFF ; <nl> + } <nl> <nl> - TestSystem : : instance ( ) . ExpectedMatNear ( dst , ocl_dst , 5e - 1 ) ; <nl> } <nl> - } <nl> \ No newline at end of file <nl> + } <nl> mmm a / modules / ocl / perf / precomp . cpp <nl> ppp b / modules / ocl / perf / precomp . cpp <nl> void TestSystem : : printMetrics ( int is_accurate , double cpu_time , double gpu_time , <nl> cout < < setiosflags ( ios_base : : left ) ; <nl> stringstream stream ; <nl> <nl> - # if 0 <nl> - if ( is_accurate = = 1 ) <nl> - stream < < " Pass " ; <nl> - else if ( is_accurate_ = = 0 ) <nl> - stream < < " Fail " ; <nl> - else if ( is_accurate = = - 1 ) <nl> - stream < < " " ; <nl> - else <nl> - { <nl> - std : : cout < < " is_accurate errer : " < < is_accurate < < " \ n " ; <nl> - exit ( - 1 ) ; <nl> - } <nl> - # endif <nl> - <nl> std : : stringstream & cur_subtest_description = getCurSubtestDescription ( ) ; <nl> <nl> # if GTEST_OS_WINDOWS & & ! GTEST_OS_WINDOWS_MOBILE <nl> deleted file mode 100644 <nl> index 52ddbb7c6a9 . . 00000000000 <nl> mmm a / modules / ocl / test / test_haar . cpp <nl> ppp / dev / null <nl> <nl> - / * M / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / <nl> - / / IMPORTANT : READ BEFORE DOWNLOADING , COPYING , INSTALLING OR USING . <nl> - / / <nl> - / / By downloading , copying , installing or using the software you agree to this license . <nl> - / / If you do not agree to this license , do not download , install , <nl> - / / copy or use the software . <nl> - / / <nl> - / / <nl> - / / License Agreement <nl> - / / For Open Source Computer Vision Library <nl> - / / <nl> - / / Copyright ( C ) 2010 - 2012 , Institute Of Software Chinese Academy Of Science , all rights reserved . <nl> - / / Copyright ( C ) 2010 - 2012 , Advanced Micro Devices , Inc . , all rights reserved . <nl> - / / Copyright ( C ) 2010 - 2012 , Multicoreware , Inc . , all rights reserved . <nl> - / / Third party copyrights are property of their respective owners . <nl> - / / <nl> - / / @ Authors <nl> - / / Jia Haipeng , jiahaipeng95 @ gmail . com <nl> - / / Sen Liu , swjutls1987 @ 126 . com <nl> - / / <nl> - / / Redistribution and use in source and binary forms , with or without modification , <nl> - / / are permitted provided that the following conditions are met : <nl> - / / <nl> - / / * Redistribution ' s of source code must retain the above copyright notice , <nl> - / / this list of conditions and the following disclaimer . <nl> - / / <nl> - / / * Redistribution ' s in binary form must reproduce the above copyright notice , <nl> - / / this list of conditions and the following disclaimer in the documentation <nl> - / / and / or other oclMaterials provided with the distribution . <nl> - / / <nl> - / / * The name of the copyright holders may not be used to endorse or promote products <nl> - / / derived from this software without specific prior written permission . <nl> - / / <nl> - / / This software is provided by the copyright holders and contributors " as is " and <nl> - / / any express or implied warranties , including , but not limited to , the implied <nl> - / / warranties of merchantability and fitness for a particular purpose are disclaimed . <nl> - / / In no event shall the Intel Corporation or contributors be liable for any direct , <nl> - / / indirect , incidental , special , exemplary , or consequential damages <nl> - / / ( including , but not limited to , procurement of substitute goods or services ; <nl> - / / loss of use , data , or profits ; or business interruption ) however caused <nl> - / / and on any theory of liability , whether in contract , strict liability , <nl> - / / or tort ( including negligence or otherwise ) arising in any way out of <nl> - / / the use of this software , even if advised of the possibility of such damage . <nl> - / / <nl> - / / M * / <nl> - <nl> - # include " opencv2 / objdetect / objdetect . hpp " <nl> - # include " precomp . hpp " <nl> - <nl> - # ifdef HAVE_OPENCL <nl> - <nl> - using namespace cvtest ; <nl> - using namespace testing ; <nl> - using namespace std ; <nl> - using namespace cv ; <nl> - extern string workdir ; <nl> - <nl> - namespace <nl> - { <nl> - IMPLEMENT_PARAM_CLASS ( CascadeName , std : : string ) ; <nl> - CascadeName cascade_frontalface_alt ( std : : string ( " haarcascade_frontalface_alt . xml " ) ) ; <nl> - CascadeName cascade_frontalface_alt2 ( std : : string ( " haarcascade_frontalface_alt2 . xml " ) ) ; <nl> - struct getRect <nl> - { <nl> - Rect operator ( ) ( const CvAvgComp & e ) const <nl> - { <nl> - return e . rect ; <nl> - } <nl> - } ; <nl> - } <nl> - <nl> - PARAM_TEST_CASE ( Haar , double , int , CascadeName ) <nl> - { <nl> - cv : : ocl : : OclCascadeClassifier cascade , nestedCascade ; <nl> - cv : : CascadeClassifier cpucascade , cpunestedCascade ; <nl> - <nl> - double scale ; <nl> - int flags ; <nl> - std : : string cascadeName ; <nl> - <nl> - virtual void SetUp ( ) <nl> - { <nl> - scale = GET_PARAM ( 0 ) ; <nl> - flags = GET_PARAM ( 1 ) ; <nl> - cascadeName = ( workdir + " . . / . . / data / haarcascades / " ) . append ( GET_PARAM ( 2 ) ) ; <nl> - <nl> - if ( ( ! cascade . load ( cascadeName ) ) | | ( ! cpucascade . load ( cascadeName ) ) ) <nl> - { <nl> - cout < < " ERROR : Could not load classifier cascade " < < endl ; <nl> - return ; <nl> - } <nl> - } <nl> - } ; <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / faceDetect / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - TEST_P ( Haar , FaceDetect ) <nl> - { <nl> - string imgName = workdir + " lena . jpg " ; <nl> - Mat img = imread ( imgName , 1 ) ; <nl> - <nl> - if ( img . empty ( ) ) <nl> - { <nl> - std : : cout < < " Couldn ' t read " < < imgName < < std : : endl ; <nl> - return ; <nl> - } <nl> - <nl> - vector < Rect > faces , oclfaces ; <nl> - <nl> - Mat gray , smallImg ( cvRound ( img . rows / scale ) , cvRound ( img . cols / scale ) , CV_8UC1 ) ; <nl> - MemStorage storage ( cvCreateMemStorage ( 0 ) ) ; <nl> - cvtColor ( img , gray , CV_BGR2GRAY ) ; <nl> - resize ( gray , smallImg , smallImg . size ( ) , 0 , 0 , INTER_LINEAR ) ; <nl> - equalizeHist ( smallImg , smallImg ) ; <nl> - <nl> - cv : : ocl : : oclMat image ; <nl> - CvSeq * _objects ; <nl> - image . upload ( smallImg ) ; <nl> - _objects = cascade . oclHaarDetectObjects ( image , storage , 1 . 1 , <nl> - 3 , flags , Size ( 30 , 30 ) , Size ( 0 , 0 ) ) ; <nl> - vector < CvAvgComp > vecAvgComp ; <nl> - Seq < CvAvgComp > ( _objects ) . copyTo ( vecAvgComp ) ; <nl> - oclfaces . resize ( vecAvgComp . size ( ) ) ; <nl> - std : : transform ( vecAvgComp . begin ( ) , vecAvgComp . end ( ) , oclfaces . begin ( ) , getRect ( ) ) ; <nl> - <nl> - cpucascade . detectMultiScale ( smallImg , faces , 1 . 1 , 3 , <nl> - flags , <nl> - Size ( 30 , 30 ) , Size ( 0 , 0 ) ) ; <nl> - EXPECT_EQ ( faces . size ( ) , oclfaces . size ( ) ) ; <nl> - } <nl> - <nl> - TEST_P ( Haar , FaceDetectUseBuf ) <nl> - { <nl> - string imgName = workdir + " lena . jpg " ; <nl> - Mat img = imread ( imgName , 1 ) ; <nl> - <nl> - if ( img . empty ( ) ) <nl> - { <nl> - std : : cout < < " Couldn ' t read " < < imgName < < std : : endl ; <nl> - return ; <nl> - } <nl> - <nl> - vector < Rect > faces , oclfaces ; <nl> - <nl> - Mat gray , smallImg ( cvRound ( img . rows / scale ) , cvRound ( img . cols / scale ) , CV_8UC1 ) ; <nl> - cvtColor ( img , gray , CV_BGR2GRAY ) ; <nl> - resize ( gray , smallImg , smallImg . size ( ) , 0 , 0 , INTER_LINEAR ) ; <nl> - equalizeHist ( smallImg , smallImg ) ; <nl> - <nl> - cv : : ocl : : oclMat image ; <nl> - image . upload ( smallImg ) ; <nl> - <nl> - cv : : ocl : : OclCascadeClassifierBuf cascadebuf ; <nl> - if ( ! cascadebuf . load ( cascadeName ) ) <nl> - { <nl> - cout < < " ERROR : Could not load classifier cascade for FaceDetectUseBuf ! " < < endl ; <nl> - return ; <nl> - } <nl> - cascadebuf . detectMultiScale ( image , oclfaces , 1 . 1 , 3 , <nl> - flags , <nl> - Size ( 30 , 30 ) , Size ( 0 , 0 ) ) ; <nl> - <nl> - cpucascade . detectMultiScale ( smallImg , faces , 1 . 1 , 3 , <nl> - flags , <nl> - Size ( 30 , 30 ) , Size ( 0 , 0 ) ) ; <nl> - EXPECT_EQ ( faces . size ( ) , oclfaces . size ( ) ) ; <nl> - <nl> - / / intentionally run ocl facedetect again and check if it still works after the first run <nl> - cascadebuf . detectMultiScale ( image , oclfaces , 1 . 1 , 3 , <nl> - flags , <nl> - Size ( 30 , 30 ) ) ; <nl> - cascadebuf . release ( ) ; <nl> - EXPECT_EQ ( faces . size ( ) , oclfaces . size ( ) ) ; <nl> - } <nl> - <nl> - INSTANTIATE_TEST_CASE_P ( FaceDetect , Haar , <nl> - Combine ( Values ( 1 . 0 ) , <nl> - Values ( CV_HAAR_SCALE_IMAGE , 0 ) , Values ( cascade_frontalface_alt , cascade_frontalface_alt2 ) ) ) ; <nl> - <nl> - # endif / / HAVE_OPENCL <nl> mmm a / modules / ocl / test / test_imgproc . cpp <nl> ppp b / modules / ocl / test / test_imgproc . cpp <nl> TEST_P ( Convolve , Mat ) <nl> } <nl> } <nl> <nl> + / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / ColumnSum / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> + PARAM_TEST_CASE ( ColumnSum , cv : : Size ) <nl> + { <nl> + cv : : Size size ; <nl> + cv : : Mat src ; <nl> + <nl> + virtual void SetUp ( ) <nl> + { <nl> + size = GET_PARAM ( 0 ) ; <nl> + } <nl> + } ; <nl> + <nl> + TEST_P ( ColumnSum , Accuracy ) <nl> + { <nl> + cv : : Mat src = randomMat ( size , CV_32FC1 ) ; <nl> + cv : : ocl : : oclMat d_dst ; <nl> + cv : : ocl : : oclMat d_src ( src ) ; <nl> + <nl> + cv : : ocl : : columnSum ( d_src , d_dst ) ; <nl> + <nl> + cv : : Mat dst ( d_dst ) ; <nl> + <nl> + for ( int j = 0 ; j < src . cols ; + + j ) <nl> + { <nl> + float gold = src . at < float > ( 0 , j ) ; <nl> + float res = dst . at < float > ( 0 , j ) ; <nl> + ASSERT_NEAR ( res , gold , 1e - 5 ) ; <nl> + } <nl> + <nl> + for ( int i = 1 ; i < src . rows ; + + i ) <nl> + { <nl> + for ( int j = 0 ; j < src . cols ; + + j ) <nl> + { <nl> + float gold = src . at < float > ( i , j ) + = src . at < float > ( i - 1 , j ) ; <nl> + float res = dst . at < float > ( i , j ) ; <nl> + ASSERT_NEAR ( res , gold , 1e - 5 ) ; <nl> + } <nl> + } <nl> + } <nl> + / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> + <nl> INSTANTIATE_TEST_CASE_P ( ImgprocTestBase , equalizeHist , Combine ( <nl> ONE_TYPE ( CV_8UC1 ) , <nl> NULL_TYPE , <nl> INSTANTIATE_TEST_CASE_P ( ImgProc , CLAHE , Combine ( <nl> Values ( cv : : Size ( 128 , 128 ) , cv : : Size ( 113 , 113 ) , cv : : Size ( 1300 , 1300 ) ) , <nl> Values ( 0 . 0 , 40 . 0 ) ) ) ; <nl> <nl> - / / INSTANTIATE_TEST_CASE_P ( ConvolveTestBase , Convolve , Combine ( <nl> - / / Values ( CV_32FC1 , CV_32FC1 ) , <nl> - / / Values ( false ) ) ) ; / / Values ( false ) is the reserved parameter <nl> + INSTANTIATE_TEST_CASE_P ( OCL_ImgProc , ColumnSum , DIFFERENT_SIZES ) ; <nl> + <nl> # endif / / HAVE_OPENCL <nl> similarity index 51 % <nl> rename from modules / ocl / test / test_hog . cpp <nl> rename to modules / ocl / test / test_objdetect . cpp <nl> mmm a / modules / ocl / test / test_hog . cpp <nl> ppp b / modules / ocl / test / test_objdetect . cpp <nl> <nl> / / Third party copyrights are property of their respective owners . <nl> / / <nl> / / @ Authors <nl> - / / Wenju He , wenju @ multicorewareinc . com <nl> + / / Yao Wang , bitwangyaoyao @ gmail . com <nl> / / <nl> / / Redistribution and use in source and binary forms , with or without modification , <nl> / / are permitted provided that the following conditions are met : <nl> <nl> <nl> # include " precomp . hpp " <nl> # include " opencv2 / core / core . hpp " <nl> - using namespace std ; <nl> + # include " opencv2 / objdetect / objdetect . hpp " <nl> + <nl> + using namespace cv ; <nl> + using namespace testing ; <nl> # ifdef HAVE_OPENCL <nl> <nl> extern string workdir ; <nl> - PARAM_TEST_CASE ( HOG , cv : : Size , int ) <nl> + <nl> + / / / / / / / / / / / / / / / / / / / / / HOG / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> + PARAM_TEST_CASE ( HOG , Size , int ) <nl> { <nl> - cv : : Size winSize ; <nl> + Size winSize ; <nl> int type ; <nl> + Mat img_rgb ; <nl> virtual void SetUp ( ) <nl> { <nl> winSize = GET_PARAM ( 0 ) ; <nl> type = GET_PARAM ( 1 ) ; <nl> + img_rgb = readImage ( workdir + " . . / gpu / road . png " ) ; <nl> + if ( img_rgb . empty ( ) ) <nl> + { <nl> + std : : cout < < " Couldn ' t read road . png " < < std : : endl ; <nl> + } <nl> } <nl> } ; <nl> <nl> TEST_P ( HOG , GetDescriptors ) <nl> { <nl> - / / Load image <nl> - cv : : Mat img_rgb = readImage ( workdir + " lena . jpg " ) ; <nl> - ASSERT_FALSE ( img_rgb . empty ( ) ) ; <nl> - <nl> / / Convert image <nl> - cv : : Mat img ; <nl> + Mat img ; <nl> switch ( type ) <nl> { <nl> case CV_8UC1 : <nl> - cv : : cvtColor ( img_rgb , img , CV_BGR2GRAY ) ; <nl> + cvtColor ( img_rgb , img , CV_BGR2GRAY ) ; <nl> break ; <nl> case CV_8UC4 : <nl> default : <nl> - cv : : cvtColor ( img_rgb , img , CV_BGR2BGRA ) ; <nl> + cvtColor ( img_rgb , img , CV_BGR2BGRA ) ; <nl> break ; <nl> } <nl> - cv : : ocl : : oclMat d_img ( img ) ; <nl> + ocl : : oclMat d_img ( img ) ; <nl> <nl> / / HOGs <nl> - cv : : ocl : : HOGDescriptor ocl_hog ; <nl> + ocl : : HOGDescriptor ocl_hog ; <nl> ocl_hog . gamma_correction = true ; <nl> - cv : : HOGDescriptor hog ; <nl> + HOGDescriptor hog ; <nl> hog . gammaCorrection = true ; <nl> <nl> / / Compute descriptor <nl> - cv : : ocl : : oclMat d_descriptors ; <nl> + ocl : : oclMat d_descriptors ; <nl> ocl_hog . getDescriptors ( d_img , ocl_hog . win_size , d_descriptors , ocl_hog . DESCR_FORMAT_COL_BY_COL ) ; <nl> - cv : : Mat down_descriptors ; <nl> + Mat down_descriptors ; <nl> d_descriptors . download ( down_descriptors ) ; <nl> down_descriptors = down_descriptors . reshape ( 0 , down_descriptors . cols * down_descriptors . rows ) ; <nl> <nl> TEST_P ( HOG , GetDescriptors ) <nl> hog . compute ( img_rgb , descriptors , ocl_hog . win_size ) ; <nl> break ; <nl> } <nl> - cv : : Mat cpu_descriptors ( descriptors ) ; <nl> + Mat cpu_descriptors ( descriptors ) ; <nl> <nl> EXPECT_MAT_SIMILAR ( down_descriptors , cpu_descriptors , 1e - 2 ) ; <nl> } <nl> <nl> - <nl> - bool match_rect ( cv : : Rect r1 , cv : : Rect r2 , int threshold ) <nl> - { <nl> - return ( ( abs ( r1 . x - r2 . x ) < threshold ) & & ( abs ( r1 . y - r2 . y ) < threshold ) & & <nl> - ( abs ( r1 . width - r2 . width ) < threshold ) & & ( abs ( r1 . height - r2 . height ) < threshold ) ) ; <nl> - } <nl> - <nl> TEST_P ( HOG , Detect ) <nl> { <nl> - / / Load image <nl> - cv : : Mat img_rgb = readImage ( workdir + " lena . jpg " ) ; <nl> - ASSERT_FALSE ( img_rgb . empty ( ) ) ; <nl> - <nl> / / Convert image <nl> - cv : : Mat img ; <nl> + Mat img ; <nl> switch ( type ) <nl> { <nl> case CV_8UC1 : <nl> - cv : : cvtColor ( img_rgb , img , CV_BGR2GRAY ) ; <nl> + cvtColor ( img_rgb , img , CV_BGR2GRAY ) ; <nl> break ; <nl> case CV_8UC4 : <nl> default : <nl> - cv : : cvtColor ( img_rgb , img , CV_BGR2BGRA ) ; <nl> + cvtColor ( img_rgb , img , CV_BGR2BGRA ) ; <nl> break ; <nl> } <nl> - cv : : ocl : : oclMat d_img ( img ) ; <nl> + ocl : : oclMat d_img ( img ) ; <nl> <nl> / / HOGs <nl> - if ( ( winSize ! = cv : : Size ( 48 , 96 ) ) & & ( winSize ! = cv : : Size ( 64 , 128 ) ) ) <nl> - winSize = cv : : Size ( 64 , 128 ) ; <nl> - cv : : ocl : : HOGDescriptor ocl_hog ( winSize ) ; <nl> + if ( ( winSize ! = Size ( 48 , 96 ) ) & & ( winSize ! = Size ( 64 , 128 ) ) ) <nl> + winSize = Size ( 64 , 128 ) ; <nl> + ocl : : HOGDescriptor ocl_hog ( winSize ) ; <nl> ocl_hog . gamma_correction = true ; <nl> <nl> - cv : : HOGDescriptor hog ; <nl> + HOGDescriptor hog ; <nl> hog . winSize = winSize ; <nl> hog . gammaCorrection = true ; <nl> <nl> TEST_P ( HOG , Detect ) <nl> } <nl> <nl> / / OpenCL detection <nl> - std : : vector < cv : : Rect > d_found ; <nl> - ocl_hog . detectMultiScale ( d_img , d_found , 0 , cv : : Size ( 8 , 8 ) , cv : : Size ( 0 , 0 ) , 1 . 05 , 2 ) ; <nl> + std : : vector < Rect > d_found ; <nl> + ocl_hog . detectMultiScale ( d_img , d_found , 0 , Size ( 8 , 8 ) , Size ( 0 , 0 ) , 1 . 05 , 6 ) ; <nl> <nl> / / CPU detection <nl> - std : : vector < cv : : Rect > found ; <nl> + std : : vector < Rect > found ; <nl> switch ( type ) <nl> { <nl> case CV_8UC1 : <nl> - hog . detectMultiScale ( img , found , 0 , cv : : Size ( 8 , 8 ) , cv : : Size ( 0 , 0 ) , 1 . 05 , 2 ) ; <nl> + hog . detectMultiScale ( img , found , 0 , Size ( 8 , 8 ) , Size ( 0 , 0 ) , 1 . 05 , 6 ) ; <nl> break ; <nl> case CV_8UC4 : <nl> default : <nl> - hog . detectMultiScale ( img_rgb , found , 0 , cv : : Size ( 8 , 8 ) , cv : : Size ( 0 , 0 ) , 1 . 05 , 2 ) ; <nl> + hog . detectMultiScale ( img_rgb , found , 0 , Size ( 8 , 8 ) , Size ( 0 , 0 ) , 1 . 05 , 6 ) ; <nl> break ; <nl> } <nl> <nl> - / / Ground - truth rectangular people window <nl> - cv : : Rect win1_64x128 ( 231 , 190 , 72 , 144 ) ; <nl> - cv : : Rect win2_64x128 ( 621 , 156 , 97 , 194 ) ; <nl> - cv : : Rect win1_48x96 ( 238 , 198 , 63 , 126 ) ; <nl> - cv : : Rect win2_48x96 ( 619 , 161 , 92 , 185 ) ; <nl> - cv : : Rect win3_48x96 ( 488 , 136 , 56 , 112 ) ; <nl> - <nl> - / / Compare whether ground - truth windows are detected and compare the number of windows detected . <nl> - std : : vector < int > d_comp ( 4 ) ; <nl> - std : : vector < int > comp ( 4 ) ; <nl> - for ( int i = 0 ; i < ( int ) d_comp . size ( ) ; i + + ) <nl> - { <nl> - d_comp [ i ] = 0 ; <nl> - comp [ i ] = 0 ; <nl> - } <nl> + EXPECT_LT ( checkRectSimilarity ( img . size ( ) , found , d_found ) , 1 . 0 ) ; <nl> + } <nl> <nl> - int threshold = 10 ; <nl> - int val = 32 ; <nl> - d_comp [ 0 ] = ( int ) d_found . size ( ) ; <nl> - comp [ 0 ] = ( int ) found . size ( ) ; <nl> - if ( winSize = = cv : : Size ( 48 , 96 ) ) <nl> + <nl> + INSTANTIATE_TEST_CASE_P ( OCL_ObjDetect , HOG , testing : : Combine ( <nl> + testing : : Values ( Size ( 64 , 128 ) , Size ( 48 , 96 ) ) , <nl> + testing : : Values ( MatType ( CV_8UC1 ) , MatType ( CV_8UC4 ) ) ) ) ; <nl> + <nl> + / / / / / / / / / / / / / / / / / / / / / / / / / / / / / Haar / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> + IMPLEMENT_PARAM_CLASS ( CascadeName , std : : string ) ; <nl> + CascadeName cascade_frontalface_alt ( std : : string ( " haarcascade_frontalface_alt . xml " ) ) ; <nl> + CascadeName cascade_frontalface_alt2 ( std : : string ( " haarcascade_frontalface_alt2 . xml " ) ) ; <nl> + struct getRect <nl> + { <nl> + Rect operator ( ) ( const CvAvgComp & e ) const <nl> { <nl> - for ( int i = 0 ; i < ( int ) d_found . size ( ) ; i + + ) <nl> - { <nl> - if ( match_rect ( d_found [ i ] , win1_48x96 , threshold ) ) <nl> - d_comp [ 1 ] = val ; <nl> - if ( match_rect ( d_found [ i ] , win2_48x96 , threshold ) ) <nl> - d_comp [ 2 ] = val ; <nl> - if ( match_rect ( d_found [ i ] , win3_48x96 , threshold ) ) <nl> - d_comp [ 3 ] = val ; <nl> - } <nl> - for ( int i = 0 ; i < ( int ) found . size ( ) ; i + + ) <nl> - { <nl> - if ( match_rect ( found [ i ] , win1_48x96 , threshold ) ) <nl> - comp [ 1 ] = val ; <nl> - if ( match_rect ( found [ i ] , win2_48x96 , threshold ) ) <nl> - comp [ 2 ] = val ; <nl> - if ( match_rect ( found [ i ] , win3_48x96 , threshold ) ) <nl> - comp [ 3 ] = val ; <nl> - } <nl> + return e . rect ; <nl> } <nl> - else if ( winSize = = cv : : Size ( 64 , 128 ) ) <nl> + } ; <nl> + <nl> + PARAM_TEST_CASE ( Haar , int , CascadeName ) <nl> + { <nl> + ocl : : OclCascadeClassifier cascade , nestedCascade ; <nl> + CascadeClassifier cpucascade , cpunestedCascade ; <nl> + <nl> + int flags ; <nl> + std : : string cascadeName ; <nl> + vector < Rect > faces , oclfaces ; <nl> + Mat img ; <nl> + ocl : : oclMat d_img ; <nl> + <nl> + virtual void SetUp ( ) <nl> { <nl> - for ( int i = 0 ; i < ( int ) d_found . size ( ) ; i + + ) <nl> + flags = GET_PARAM ( 0 ) ; <nl> + cascadeName = ( workdir + " . . / . . / data / haarcascades / " ) . append ( GET_PARAM ( 1 ) ) ; <nl> + if ( ( ! cascade . load ( cascadeName ) ) | | ( ! cpucascade . load ( cascadeName ) ) ) <nl> { <nl> - if ( match_rect ( d_found [ i ] , win1_64x128 , threshold ) ) <nl> - d_comp [ 1 ] = val ; <nl> - if ( match_rect ( d_found [ i ] , win2_64x128 , threshold ) ) <nl> - d_comp [ 2 ] = val ; <nl> + std : : cout < < " ERROR : Could not load classifier cascade " < < std : : endl ; <nl> + return ; <nl> } <nl> - for ( int i = 0 ; i < ( int ) found . size ( ) ; i + + ) <nl> + img = readImage ( workdir + " lena . jpg " , IMREAD_GRAYSCALE ) ; <nl> + if ( img . empty ( ) ) <nl> { <nl> - if ( match_rect ( found [ i ] , win1_64x128 , threshold ) ) <nl> - comp [ 1 ] = val ; <nl> - if ( match_rect ( found [ i ] , win2_64x128 , threshold ) ) <nl> - comp [ 2 ] = val ; <nl> + std : : cout < < " Couldn ' t read lena . jpg " < < std : : endl ; <nl> + return ; <nl> } <nl> + equalizeHist ( img , img ) ; <nl> + d_img . upload ( img ) ; <nl> } <nl> + } ; <nl> <nl> - EXPECT_MAT_NEAR ( cv : : Mat ( d_comp ) , cv : : Mat ( comp ) , 3 ) ; <nl> + TEST_P ( Haar , FaceDetect ) <nl> + { <nl> + MemStorage storage ( cvCreateMemStorage ( 0 ) ) ; <nl> + CvSeq * _objects ; <nl> + _objects = cascade . oclHaarDetectObjects ( d_img , storage , 1 . 1 , 3 , <nl> + flags , Size ( 30 , 30 ) , Size ( 0 , 0 ) ) ; <nl> + vector < CvAvgComp > vecAvgComp ; <nl> + Seq < CvAvgComp > ( _objects ) . copyTo ( vecAvgComp ) ; <nl> + oclfaces . resize ( vecAvgComp . size ( ) ) ; <nl> + std : : transform ( vecAvgComp . begin ( ) , vecAvgComp . end ( ) , oclfaces . begin ( ) , getRect ( ) ) ; <nl> + <nl> + cpucascade . detectMultiScale ( img , faces , 1 . 1 , 3 , <nl> + flags , <nl> + Size ( 30 , 30 ) , Size ( 0 , 0 ) ) ; <nl> + <nl> + EXPECT_LT ( checkRectSimilarity ( img . size ( ) , faces , oclfaces ) , 1 . 0 ) ; <nl> } <nl> <nl> + TEST_P ( Haar , FaceDetectUseBuf ) <nl> + { <nl> + ocl : : OclCascadeClassifierBuf cascadebuf ; <nl> + if ( ! cascadebuf . load ( cascadeName ) ) <nl> + { <nl> + std : : cout < < " ERROR : Could not load classifier cascade for FaceDetectUseBuf ! " < < std : : endl ; <nl> + return ; <nl> + } <nl> + cascadebuf . detectMultiScale ( d_img , oclfaces , 1 . 1 , 3 , <nl> + flags , <nl> + Size ( 30 , 30 ) , Size ( 0 , 0 ) ) ; <nl> + cpucascade . detectMultiScale ( img , faces , 1 . 1 , 3 , <nl> + flags , <nl> + Size ( 30 , 30 ) , Size ( 0 , 0 ) ) ; <nl> <nl> - INSTANTIATE_TEST_CASE_P ( OCL_ObjDetect , HOG , testing : : Combine ( <nl> - testing : : Values ( cv : : Size ( 64 , 128 ) , cv : : Size ( 48 , 96 ) ) , <nl> - testing : : Values ( MatType ( CV_8UC1 ) , MatType ( CV_8UC4 ) ) ) ) ; <nl> + / / intentionally run ocl facedetect again and check if it still works after the first run <nl> + cascadebuf . detectMultiScale ( d_img , oclfaces , 1 . 1 , 3 , <nl> + flags , <nl> + Size ( 30 , 30 ) ) ; <nl> + cascadebuf . release ( ) ; <nl> + <nl> + EXPECT_LT ( checkRectSimilarity ( img . size ( ) , faces , oclfaces ) , 1 . 0 ) ; <nl> + } <nl> <nl> + INSTANTIATE_TEST_CASE_P ( OCL_ObjDetect , Haar , <nl> + Combine ( Values ( CV_HAAR_SCALE_IMAGE , 0 ) , <nl> + Values ( cascade_frontalface_alt / * , cascade_frontalface_alt2 * / ) ) ) ; <nl> <nl> - # endif / / HAVE_OPENCL <nl> + # endif / / HAVE_OPENCL <nl> \ No newline at end of file <nl> similarity index 75 % <nl> rename from modules / ocl / test / test_pyrdown . cpp <nl> rename to modules / ocl / test / test_pyramids . cpp <nl> mmm a / modules / ocl / test / test_pyrdown . cpp <nl> ppp b / modules / ocl / test / test_pyramids . cpp <nl> <nl> / / Third party copyrights are property of their respective owners . <nl> / / <nl> / / @ Authors <nl> - / / Dachuan Zhao , dachuan @ multicorewareinc . com <nl> / / Yao Wang yao @ multicorewareinc . com <nl> / / <nl> / / Redistribution and use in source and binary forms , with or without modification , <nl> using namespace cvtest ; <nl> using namespace testing ; <nl> using namespace std ; <nl> <nl> - PARAM_TEST_CASE ( PyrDown , MatType , int ) <nl> + PARAM_TEST_CASE ( PyrBase , MatType , int ) <nl> { <nl> int type ; <nl> int channels ; <nl> - <nl> + Mat dst_cpu ; <nl> + oclMat gdst ; <nl> virtual void SetUp ( ) <nl> { <nl> type = GET_PARAM ( 0 ) ; <nl> PARAM_TEST_CASE ( PyrDown , MatType , int ) <nl> <nl> } ; <nl> <nl> + / / / / / / / / / / / / / / / / / / / / / / / PyrDown / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> + struct PyrDown : PyrBase { } ; <nl> <nl> TEST_P ( PyrDown , Mat ) <nl> { <nl> for ( int j = 0 ; j < LOOP_TIMES ; j + + ) <nl> { <nl> - cv : : Size size ( MWIDTH , MHEIGHT ) ; <nl> - cv : : RNG & rng = TS : : ptr ( ) - > get_rng ( ) ; <nl> - cv : : Mat src = randomMat ( rng , size , CV_MAKETYPE ( type , channels ) , 0 , 100 , false ) ; <nl> - <nl> - cv : : ocl : : oclMat gsrc ( src ) , gdst ; <nl> - cv : : Mat dst_cpu ; <nl> - cv : : pyrDown ( src , dst_cpu ) ; <nl> - cv : : ocl : : pyrDown ( gsrc , gdst ) ; <nl> + Size size ( MWIDTH , MHEIGHT ) ; <nl> + Mat src = randomMat ( size , CV_MAKETYPE ( type , channels ) ) ; <nl> + oclMat gsrc ( src ) ; <nl> + <nl> + pyrDown ( src , dst_cpu ) ; <nl> + pyrDown ( gsrc , gdst ) ; <nl> <nl> EXPECT_MAT_NEAR ( dst_cpu , Mat ( gdst ) , type = = CV_32F ? 1e - 4f : 1 . 0f ) ; <nl> } <nl> TEST_P ( PyrDown , Mat ) <nl> INSTANTIATE_TEST_CASE_P ( OCL_ImgProc , PyrDown , Combine ( <nl> Values ( CV_8U , CV_32F ) , Values ( 1 , 3 , 4 ) ) ) ; <nl> <nl> + / / / / / / / / / / / / / / / / / / / / / / / PyrUp / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> + <nl> + struct PyrUp : PyrBase { } ; <nl> + <nl> + TEST_P ( PyrUp , Accuracy ) <nl> + { <nl> + for ( int j = 0 ; j < LOOP_TIMES ; j + + ) <nl> + { <nl> + Size size ( MWIDTH , MHEIGHT ) ; <nl> + Mat src = randomMat ( size , CV_MAKETYPE ( type , channels ) ) ; <nl> + oclMat gsrc ( src ) ; <nl> + <nl> + pyrUp ( src , dst_cpu ) ; <nl> + pyrUp ( gsrc , gdst ) ; <nl> + <nl> + EXPECT_MAT_NEAR ( dst_cpu , Mat ( gdst ) , ( type = = CV_32F ? 1e - 4f : 1 . 0 ) ) ; <nl> + } <nl> <nl> + } <nl> + <nl> + <nl> + INSTANTIATE_TEST_CASE_P ( OCL_ImgProc , PyrUp , testing : : Combine ( <nl> + Values ( CV_8U , CV_32F ) , Values ( 1 , 3 , 4 ) ) ) ; <nl> # endif / / HAVE_OPENCL <nl> deleted file mode 100644 <nl> index afd3e8b1b80 . . 00000000000 <nl> mmm a / modules / ocl / test / test_pyrup . cpp <nl> ppp / dev / null <nl> <nl> - / * M / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / <nl> - / / IMPORTANT : READ BEFORE DOWNLOADING , COPYING , INSTALLING OR USING . <nl> - / / <nl> - / / By downloading , copying , installing or using the software you agree to this license . <nl> - / / If you do not agree to this license , do not download , install , <nl> - / / copy or use the software . <nl> - / / <nl> - / / <nl> - / / License Agreement <nl> - / / For Open Source Computer Vision Library <nl> - / / <nl> - / / Copyright ( C ) 2010 - 2012 , Multicoreware , Inc . , all rights reserved . <nl> - / / Copyright ( C ) 2010 - 2012 , Advanced Micro Devices , Inc . , all rights reserved . <nl> - / / Third party copyrights are property of their respective owners . <nl> - / / <nl> - / / @ Authors <nl> - / / Zhang Chunpeng chunpeng @ multicorewareinc . com <nl> - / / Yao Wang yao @ multicorewareinc . com <nl> - / / <nl> - / / Redistribution and use in source and binary forms , with or without modification , <nl> - / / are permitted provided that the following conditions are met : <nl> - / / <nl> - / / * Redistribution ' s of source code must retain the above copyright notice , <nl> - / / this list of conditions and the following disclaimer . <nl> - / / <nl> - / / * Redistribution ' s in binary form must reproduce the above copyright notice , <nl> - / / this list of conditions and the following disclaimer in the documentation <nl> - / / and / or other oclMaterials provided with the distribution . <nl> - / / <nl> - / / * The name of the copyright holders may not be used to endorse or promote products <nl> - / / derived from this software without specific prior written permission . <nl> - / / <nl> - / / This software is provided by the copyright holders and contributors " as is " and <nl> - / / any express or implied warranties , including , but not limited to , the implied <nl> - / / warranties of merchantability and fitness for a particular purpose are disclaimed . <nl> - / / In no event shall the Intel Corporation or contributors be liable for any direct , <nl> - / / indirect , incidental , special , exemplary , or consequential damages <nl> - / / ( including , but not limited to , procurement of substitute goods or services ; <nl> - / / loss of use , data , or profits ; or business interruption ) however caused <nl> - / / and on any theory of liability , whether in contract , strict liability , <nl> - / / or tort ( including negligence or otherwise ) arising in any way out of <nl> - / / the use of this software , even if advised of the possibility of such damage . <nl> - / / <nl> - / / M * / <nl> - <nl> - # include " precomp . hpp " <nl> - # include " opencv2 / core / core . hpp " <nl> - <nl> - # ifdef HAVE_OPENCL <nl> - <nl> - using namespace cv ; <nl> - using namespace cvtest ; <nl> - using namespace testing ; <nl> - using namespace std ; <nl> - <nl> - PARAM_TEST_CASE ( PyrUp , MatType , int ) <nl> - { <nl> - int type ; <nl> - int channels ; <nl> - <nl> - virtual void SetUp ( ) <nl> - { <nl> - type = GET_PARAM ( 0 ) ; <nl> - channels = GET_PARAM ( 1 ) ; <nl> - } <nl> - } ; <nl> - <nl> - TEST_P ( PyrUp , Accuracy ) <nl> - { <nl> - for ( int j = 0 ; j < LOOP_TIMES ; j + + ) <nl> - { <nl> - Size size ( MWIDTH , MHEIGHT ) ; <nl> - Mat src = randomMat ( size , CV_MAKETYPE ( type , channels ) ) ; <nl> - Mat dst_gold ; <nl> - pyrUp ( src , dst_gold ) ; <nl> - ocl : : oclMat dst ; <nl> - ocl : : oclMat srcMat ( src ) ; <nl> - ocl : : pyrUp ( srcMat , dst ) ; <nl> - <nl> - EXPECT_MAT_NEAR ( dst_gold , Mat ( dst ) , ( type = = CV_32F ? 1e - 4f : 1 . 0 ) ) ; <nl> - } <nl> - <nl> - } <nl> - <nl> - <nl> - INSTANTIATE_TEST_CASE_P ( OCL_ImgProc , PyrUp , testing : : Combine ( <nl> - Values ( CV_8U , CV_32F ) , Values ( 1 , 3 , 4 ) ) ) ; <nl> - <nl> - <nl> - # endif / / HAVE_OPENCL <nl> \ No newline at end of file <nl> mmm a / modules / ocl / test / utility . cpp <nl> ppp b / modules / ocl / test / utility . cpp <nl> Mat randomMat ( Size size , int type , double minVal , double maxVal ) <nl> return randomMat ( TS : : ptr ( ) - > get_rng ( ) , size , type , minVal , maxVal , false ) ; <nl> } <nl> <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> / * <nl> void showDiff ( InputArray gold_ , InputArray actual_ , double eps ) <nl> { <nl> void showDiff ( InputArray gold_ , InputArray actual_ , double eps ) <nl> } <nl> * / <nl> <nl> - / * <nl> - bool supportFeature ( const DeviceInfo & info , FeatureSet feature ) <nl> - { <nl> - return TargetArchs : : builtWith ( feature ) & & info . supports ( feature ) ; <nl> - } <nl> - <nl> - const vector < DeviceInfo > & devices ( ) <nl> - { <nl> - static vector < DeviceInfo > devs ; <nl> - static bool first = true ; <nl> - <nl> - if ( first ) <nl> - { <nl> - int deviceCount = getCudaEnabledDeviceCount ( ) ; <nl> - <nl> - devs . reserve ( deviceCount ) ; <nl> - <nl> - for ( int i = 0 ; i < deviceCount ; + + i ) <nl> - { <nl> - DeviceInfo info ( i ) ; <nl> - if ( info . isCompatible ( ) ) <nl> - devs . push_back ( info ) ; <nl> - } <nl> - <nl> - first = false ; <nl> - } <nl> - <nl> - return devs ; <nl> - } <nl> <nl> - vector < DeviceInfo > devices ( FeatureSet feature ) <nl> - { <nl> - const vector < DeviceInfo > & d = devices ( ) ; <nl> - <nl> - vector < DeviceInfo > devs_filtered ; <nl> - <nl> - if ( TargetArchs : : builtWith ( feature ) ) <nl> - { <nl> - devs_filtered . reserve ( d . size ( ) ) ; <nl> - <nl> - for ( size_t i = 0 , size = d . size ( ) ; i < size ; + + i ) <nl> - { <nl> - const DeviceInfo & info = d [ i ] ; <nl> - <nl> - if ( info . supports ( feature ) ) <nl> - devs_filtered . push_back ( info ) ; <nl> - } <nl> - } <nl> - <nl> - return devs_filtered ; <nl> - } <nl> - * / <nl> <nl> vector < MatType > types ( int depth_start , int depth_end , int cn_start , int cn_end ) <nl> { <nl> void PrintTo ( const Inverse & inverse , std : : ostream * os ) <nl> ( * os ) < < " direct " ; <nl> } <nl> <nl> + double checkRectSimilarity ( Size sz , std : : vector < Rect > & ob1 , std : : vector < Rect > & ob2 ) <nl> + { <nl> + double final_test_result = 0 . 0 ; <nl> + size_t sz1 = ob1 . size ( ) ; <nl> + size_t sz2 = ob2 . size ( ) ; <nl> + <nl> + if ( sz1 ! = sz2 ) <nl> + { <nl> + return sz1 > sz2 ? ( double ) ( sz1 - sz2 ) : ( double ) ( sz2 - sz1 ) ; <nl> + } <nl> + else <nl> + { <nl> + if ( sz1 = = 0 & & sz2 = = 0 ) <nl> + return 0 ; <nl> + cv : : Mat cpu_result ( sz , CV_8UC1 ) ; <nl> + cpu_result . setTo ( 0 ) ; <nl> + <nl> + for ( vector < Rect > : : const_iterator r = ob1 . begin ( ) ; r ! = ob1 . end ( ) ; r + + ) <nl> + { <nl> + cv : : Mat cpu_result_roi ( cpu_result , * r ) ; <nl> + cpu_result_roi . setTo ( 1 ) ; <nl> + cpu_result . copyTo ( cpu_result ) ; <nl> + } <nl> + int cpu_area = cv : : countNonZero ( cpu_result > 0 ) ; <nl> + <nl> + cv : : Mat gpu_result ( sz , CV_8UC1 ) ; <nl> + gpu_result . setTo ( 0 ) ; <nl> + for ( vector < Rect > : : const_iterator r2 = ob2 . begin ( ) ; r2 ! = ob2 . end ( ) ; r2 + + ) <nl> + { <nl> + cv : : Mat gpu_result_roi ( gpu_result , * r2 ) ; <nl> + gpu_result_roi . setTo ( 1 ) ; <nl> + gpu_result . copyTo ( gpu_result ) ; <nl> + } <nl> + <nl> + cv : : Mat result_ ; <nl> + multiply ( cpu_result , gpu_result , result_ ) ; <nl> + int result = cv : : countNonZero ( result_ > 0 ) ; <nl> + if ( cpu_area ! = 0 & & result ! = 0 ) <nl> + final_test_result = 1 . 0 - ( double ) result / ( double ) cpu_area ; <nl> + else if ( cpu_area = = 0 & & result ! = 0 ) <nl> + final_test_result = - 1 ; <nl> + } <nl> + return final_test_result ; <nl> + } <nl> + <nl> mmm a / modules / ocl / test / utility . hpp <nl> ppp b / modules / ocl / test / utility . hpp <nl> cv : : Mat randomMat ( cv : : Size size , int type , double minVal = 0 . 0 , double maxVal = <nl> <nl> void showDiff ( cv : : InputArray gold , cv : : InputArray actual , double eps ) ; <nl> <nl> - / / ! return true if device supports specified feature and gpu module was built with support the feature . <nl> - / / bool supportFeature ( const cv : : gpu : : DeviceInfo & info , cv : : gpu : : FeatureSet feature ) ; <nl> + / / This function test if gpu_rst matches cpu_rst . <nl> + / / If the two vectors are not equal , it will return the difference in vector size <nl> + / / Else it will return ( total diff of each cpu and gpu rects covered pixels ) / ( total cpu rects covered pixels ) <nl> + / / The smaller , the better matched <nl> + double checkRectSimilarity ( cv : : Size sz , std : : vector < cv : : Rect > & ob1 , std : : vector < cv : : Rect > & ob2 ) ; <nl> <nl> - / / ! return all devices compatible with current gpu module build . <nl> - / / const std : : vector < cv : : ocl : : DeviceInfo > & devices ( ) ; <nl> - / / ! return all devices compatible with current gpu module build which support specified feature . <nl> - / / std : : vector < cv : : ocl : : DeviceInfo > devices ( cv : : gpu : : FeatureSet feature ) ; <nl> <nl> / / ! read image from testdata folder . <nl> cv : : Mat readImage ( const std : : string & fileName , int flags = cv : : IMREAD_COLOR ) ; <nl> mmm a / samples / ocl / facedetect . cpp <nl> ppp b / samples / ocl / facedetect . cpp <nl> <nl> <nl> using namespace std ; <nl> using namespace cv ; <nl> - # define LOOP_NUM 10 <nl> + # define LOOP_NUM 10 <nl> <nl> const static Scalar colors [ ] = { CV_RGB ( 0 , 0 , 255 ) , <nl> - CV_RGB ( 0 , 128 , 255 ) , <nl> - CV_RGB ( 0 , 255 , 255 ) , <nl> - CV_RGB ( 0 , 255 , 0 ) , <nl> - CV_RGB ( 255 , 128 , 0 ) , <nl> - CV_RGB ( 255 , 255 , 0 ) , <nl> - CV_RGB ( 255 , 0 , 0 ) , <nl> - CV_RGB ( 255 , 0 , 255 ) } ; <nl> + CV_RGB ( 0 , 128 , 255 ) , <nl> + CV_RGB ( 0 , 255 , 255 ) , <nl> + CV_RGB ( 0 , 255 , 0 ) , <nl> + CV_RGB ( 255 , 128 , 0 ) , <nl> + CV_RGB ( 255 , 255 , 0 ) , <nl> + CV_RGB ( 255 , 0 , 0 ) , <nl> + CV_RGB ( 255 , 0 , 255 ) <nl> + } ; <nl> + <nl> <nl> int64 work_begin = 0 ; <nl> int64 work_end = 0 ; <nl> + string outputName ; <nl> <nl> - static void workBegin ( ) <nl> - { <nl> + static void workBegin ( ) <nl> + { <nl> work_begin = getTickCount ( ) ; <nl> } <nl> static void workEnd ( ) <nl> { <nl> work_end + = ( getTickCount ( ) - work_begin ) ; <nl> } <nl> - static double getTime ( ) { <nl> + static double getTime ( ) <nl> + { <nl> return work_end / ( ( double ) cvGetTickFrequency ( ) * 1000 . ) ; <nl> } <nl> <nl> - void detect ( Mat & img , vector < Rect > & faces , <nl> - cv : : ocl : : OclCascadeClassifierBuf & cascade , <nl> - double scale , bool calTime ) ; <nl> <nl> - void detectCPU ( Mat & img , vector < Rect > & faces , <nl> - CascadeClassifier & cascade , <nl> - double scale , bool calTime ) ; <nl> + void detect ( Mat & img , vector < Rect > & faces , <nl> + ocl : : OclCascadeClassifierBuf & cascade , <nl> + double scale , bool calTime ) ; <nl> + <nl> + <nl> + void detectCPU ( Mat & img , vector < Rect > & faces , <nl> + CascadeClassifier & cascade , <nl> + double scale , bool calTime ) ; <nl> + <nl> <nl> void Draw ( Mat & img , vector < Rect > & faces , double scale ) ; <nl> <nl> + <nl> / / This function test if gpu_rst matches cpu_rst . <nl> / / If the two vectors are not equal , it will return the difference in vector size <nl> / / Else if will return ( total diff of each cpu and gpu rects covered pixels ) / ( total cpu rects covered pixels ) <nl> - double checkRectSimilarity ( Size sz , std : : vector < Rect > & cpu_rst , std : : vector < Rect > & gpu_rst ) ; <nl> + double checkRectSimilarity ( Size sz , vector < Rect > & cpu_rst , vector < Rect > & gpu_rst ) ; <nl> + <nl> <nl> int main ( int argc , const char * * argv ) <nl> { <nl> const char * keys = <nl> " { h | help | false | print help message } " <nl> " { i | input | | specify input image } " <nl> - " { t | template | . . / . . / . . / data / haarcascades / haarcascade_frontalface_alt . xml | specify template file } " <nl> + " { t | template | haarcascade_frontalface_alt . xml | " <nl> + " specify template file path } " <nl> " { c | scale | 1 . 0 | scale image } " <nl> - " { s | use_cpu | false | use cpu or gpu to process the image } " ; <nl> + " { s | use_cpu | false | use cpu or gpu to process the image } " <nl> + " { o | output | facedetect_output . jpg | " <nl> + " specify output image save path ( only works when input is images ) } " ; <nl> <nl> CommandLineParser cmd ( argc , argv , keys ) ; <nl> if ( cmd . get < bool > ( " help " ) ) <nl> int main ( int argc , const char * * argv ) <nl> <nl> bool useCPU = cmd . get < bool > ( " s " ) ; <nl> string inputName = cmd . get < string > ( " i " ) ; <nl> + outputName = cmd . get < string > ( " o " ) ; <nl> string cascadeName = cmd . get < string > ( " t " ) ; <nl> double scale = cmd . get < double > ( " c " ) ; <nl> - cv : : ocl : : OclCascadeClassifierBuf cascade ; <nl> + ocl : : OclCascadeClassifierBuf cascade ; <nl> CascadeClassifier cpu_cascade ; <nl> <nl> if ( ! cascade . load ( cascadeName ) | | ! cpu_cascade . load ( cascadeName ) ) <nl> int main ( int argc , const char * * argv ) <nl> if ( inputName . empty ( ) ) <nl> { <nl> capture = cvCaptureFromCAM ( 0 ) ; <nl> - if ( ! capture ) <nl> + if ( ! capture ) <nl> cout < < " Capture from CAM 0 didn ' t work " < < endl ; <nl> } <nl> else if ( inputName . size ( ) ) <nl> int main ( int argc , const char * * argv ) <nl> if ( image . empty ( ) ) <nl> { <nl> capture = cvCaptureFromAVI ( inputName . c_str ( ) ) ; <nl> - if ( ! capture ) <nl> + if ( ! capture ) <nl> cout < < " Capture from AVI didn ' t work " < < endl ; <nl> return - 1 ; <nl> } <nl> int main ( int argc , const char * * argv ) <nl> else <nl> { <nl> image = imread ( " lena . jpg " , 1 ) ; <nl> - if ( image . empty ( ) ) <nl> + if ( image . empty ( ) ) <nl> cout < < " Couldn ' t read lena . jpg " < < endl ; <nl> return - 1 ; <nl> } <nl> <nl> + <nl> cvNamedWindow ( " result " , 1 ) ; <nl> - std : : vector < cv : : ocl : : Info > oclinfo ; <nl> - int devnums = cv : : ocl : : getDevice ( oclinfo ) ; <nl> + vector < ocl : : Info > oclinfo ; <nl> + int devnums = ocl : : getDevice ( oclinfo ) ; <nl> if ( devnums < 1 ) <nl> { <nl> std : : cout < < " no device found \ n " ; <nl> int main ( int argc , const char * * argv ) <nl> frame . copyTo ( frameCopy ) ; <nl> else <nl> flip ( frame , frameCopy , 0 ) ; <nl> - if ( useCPU ) { <nl> + if ( useCPU ) <nl> + { <nl> detectCPU ( frameCopy , faces , cpu_cascade , scale , false ) ; <nl> } <nl> - else { <nl> - detect ( frameCopy , faces , cascade , scale , false ) ; <nl> + else <nl> + { <nl> + detect ( frameCopy , faces , cascade , scale , false ) ; <nl> } <nl> Draw ( frameCopy , faces , scale ) ; <nl> if ( waitKey ( 10 ) > = 0 ) <nl> goto _cleanup_ ; <nl> } <nl> <nl> + <nl> waitKey ( 0 ) ; <nl> <nl> + <nl> _cleanup_ : <nl> cvReleaseCapture ( & capture ) ; <nl> } <nl> int main ( int argc , const char * * argv ) <nl> vector < Rect > faces ; <nl> vector < Rect > ref_rst ; <nl> double accuracy = 0 . ; <nl> - for ( int i = 0 ; i < = LOOP_NUM ; i + + ) <nl> + for ( int i = 0 ; i < = LOOP_NUM ; i + + ) <nl> { <nl> cout < < " loop " < < i < < endl ; <nl> - if ( useCPU ) { <nl> - detectCPU ( image , faces , cpu_cascade , scale , i = = 0 ? false : true ) ; <nl> + if ( useCPU ) <nl> + { <nl> + detectCPU ( image , faces , cpu_cascade , scale , i = = 0 ? false : true ) ; <nl> } <nl> - else { <nl> + else <nl> + { <nl> detect ( image , faces , cascade , scale , i = = 0 ? false : true ) ; <nl> - if ( i = = 0 ) { <nl> + if ( i = = 0 ) <nl> + { <nl> detectCPU ( image , ref_rst , cpu_cascade , scale , false ) ; <nl> accuracy = checkRectSimilarity ( image . size ( ) , ref_rst , faces ) ; <nl> - } <nl> + } <nl> } <nl> if ( i = = LOOP_NUM ) <nl> { <nl> int main ( int argc , const char * * argv ) <nl> } <nl> <nl> cvDestroyWindow ( " result " ) ; <nl> - <nl> return 0 ; <nl> } <nl> <nl> - void detect ( Mat & img , vector < Rect > & faces , <nl> - cv : : ocl : : OclCascadeClassifierBuf & cascade , <nl> - double scale , bool calTime ) <nl> + void detect ( Mat & img , vector < Rect > & faces , <nl> + ocl : : OclCascadeClassifierBuf & cascade , <nl> + double scale , bool calTime ) <nl> { <nl> - cv : : ocl : : oclMat image ( img ) ; <nl> - cv : : ocl : : oclMat gray , smallImg ( cvRound ( img . rows / scale ) , cvRound ( img . cols / scale ) , CV_8UC1 ) ; <nl> + ocl : : oclMat image ( img ) ; <nl> + ocl : : oclMat gray , smallImg ( cvRound ( img . rows / scale ) , cvRound ( img . cols / scale ) , CV_8UC1 ) ; <nl> if ( calTime ) workBegin ( ) ; <nl> - cv : : ocl : : cvtColor ( image , gray , CV_BGR2GRAY ) ; <nl> - cv : : ocl : : resize ( gray , smallImg , smallImg . size ( ) , 0 , 0 , INTER_LINEAR ) ; <nl> - cv : : ocl : : equalizeHist ( smallImg , smallImg ) ; <nl> + ocl : : cvtColor ( image , gray , CV_BGR2GRAY ) ; <nl> + ocl : : resize ( gray , smallImg , smallImg . size ( ) , 0 , 0 , INTER_LINEAR ) ; <nl> + ocl : : equalizeHist ( smallImg , smallImg ) ; <nl> <nl> cascade . detectMultiScale ( smallImg , faces , 1 . 1 , <nl> - 3 , 0 <nl> - | CV_HAAR_SCALE_IMAGE <nl> - , Size ( 30 , 30 ) , Size ( 0 , 0 ) ) ; <nl> + 3 , 0 <nl> + | CV_HAAR_SCALE_IMAGE <nl> + , Size ( 30 , 30 ) , Size ( 0 , 0 ) ) ; <nl> if ( calTime ) workEnd ( ) ; <nl> } <nl> <nl> - void detectCPU ( Mat & img , vector < Rect > & faces , <nl> - CascadeClassifier & cascade , <nl> - double scale , bool calTime ) <nl> + <nl> + void detectCPU ( Mat & img , vector < Rect > & faces , <nl> + CascadeClassifier & cascade , <nl> + double scale , bool calTime ) <nl> { <nl> if ( calTime ) workBegin ( ) ; <nl> Mat cpu_gray , cpu_smallImg ( cvRound ( img . rows / scale ) , cvRound ( img . cols / scale ) , CV_8UC1 ) ; <nl> void detectCPU ( Mat & img , vector < Rect > & faces , <nl> resize ( cpu_gray , cpu_smallImg , cpu_smallImg . size ( ) , 0 , 0 , INTER_LINEAR ) ; <nl> equalizeHist ( cpu_smallImg , cpu_smallImg ) ; <nl> cascade . detectMultiScale ( cpu_smallImg , faces , 1 . 1 , <nl> - 3 , 0 | CV_HAAR_SCALE_IMAGE , <nl> - Size ( 30 , 30 ) , Size ( 0 , 0 ) ) ; <nl> - if ( calTime ) workEnd ( ) ; <nl> + 3 , 0 | CV_HAAR_SCALE_IMAGE , <nl> + Size ( 30 , 30 ) , Size ( 0 , 0 ) ) ; <nl> + if ( calTime ) workEnd ( ) ; <nl> } <nl> <nl> + <nl> void Draw ( Mat & img , vector < Rect > & faces , double scale ) <nl> { <nl> int i = 0 ; <nl> void Draw ( Mat & img , vector < Rect > & faces , double scale ) <nl> radius = cvRound ( ( r - > width + r - > height ) * 0 . 25 * scale ) ; <nl> circle ( img , center , radius , color , 3 , 8 , 0 ) ; <nl> } <nl> - cv : : imshow ( " result " , img ) ; <nl> + imshow ( " result " , img ) ; <nl> + imwrite ( outputName , img ) ; <nl> } <nl> <nl> - double checkRectSimilarity ( Size sz , std : : vector < Rect > & ob1 , std : : vector < Rect > & ob2 ) <nl> + <nl> + double checkRectSimilarity ( Size sz , vector < Rect > & ob1 , vector < Rect > & ob2 ) <nl> { <nl> double final_test_result = 0 . 0 ; <nl> size_t sz1 = ob1 . size ( ) ; <nl> size_t sz2 = ob2 . size ( ) ; <nl> <nl> if ( sz1 ! = sz2 ) <nl> + { <nl> return sz1 > sz2 ? ( double ) ( sz1 - sz2 ) : ( double ) ( sz2 - sz1 ) ; <nl> + } <nl> else <nl> { <nl> - cv : : Mat cpu_result ( sz , CV_8UC1 ) ; <nl> + if ( sz1 = = 0 & & sz2 = = 0 ) <nl> + return 0 ; <nl> + Mat cpu_result ( sz , CV_8UC1 ) ; <nl> cpu_result . setTo ( 0 ) ; <nl> <nl> for ( vector < Rect > : : const_iterator r = ob1 . begin ( ) ; r ! = ob1 . end ( ) ; r + + ) <nl> - { <nl> - cv : : Mat cpu_result_roi ( cpu_result , * r ) ; <nl> + { <nl> + Mat cpu_result_roi ( cpu_result , * r ) ; <nl> cpu_result_roi . setTo ( 1 ) ; <nl> cpu_result . copyTo ( cpu_result ) ; <nl> } <nl> - int cpu_area = cv : : countNonZero ( cpu_result > 0 ) ; <nl> + int cpu_area = countNonZero ( cpu_result > 0 ) ; <nl> + <nl> <nl> - cv : : Mat gpu_result ( sz , CV_8UC1 ) ; <nl> + Mat gpu_result ( sz , CV_8UC1 ) ; <nl> gpu_result . setTo ( 0 ) ; <nl> for ( vector < Rect > : : const_iterator r2 = ob2 . begin ( ) ; r2 ! = ob2 . end ( ) ; r2 + + ) <nl> { <nl> double checkRectSimilarity ( Size sz , std : : vector < Rect > & ob1 , std : : vector < Rect > & o <nl> gpu_result . copyTo ( gpu_result ) ; <nl> } <nl> <nl> - cv : : Mat result_ ; <nl> + Mat result_ ; <nl> multiply ( cpu_result , gpu_result , result_ ) ; <nl> - int result = cv : : countNonZero ( result_ > 0 ) ; <nl> - <nl> - final_test_result = 1 . 0 - ( double ) result / ( double ) cpu_area ; <nl> + int result = countNonZero ( result_ > 0 ) ; <nl> + if ( cpu_area ! = 0 & & result ! = 0 ) <nl> + final_test_result = 1 . 0 - ( double ) result / ( double ) cpu_area ; <nl> + else if ( cpu_area = = 0 & & result ! = 0 ) <nl> + final_test_result = - 1 ; <nl> } <nl> return final_test_result ; <nl> } <nl> mmm a / samples / ocl / hog . cpp <nl> ppp b / samples / ocl / hog . cpp <nl> <nl> using namespace std ; <nl> using namespace cv ; <nl> <nl> - bool help_showed = false ; <nl> - <nl> - class Args <nl> - { <nl> - public : <nl> - Args ( ) ; <nl> - static Args read ( int argc , char * * argv ) ; <nl> - <nl> - string src ; <nl> - bool src_is_video ; <nl> - bool src_is_camera ; <nl> - int camera_id ; <nl> - <nl> - bool write_video ; <nl> - string dst_video ; <nl> - double dst_video_fps ; <nl> - <nl> - bool make_gray ; <nl> - <nl> - bool resize_src ; <nl> - int width , height ; <nl> - <nl> - double scale ; <nl> - int nlevels ; <nl> - int gr_threshold ; <nl> - <nl> - double hit_threshold ; <nl> - bool hit_threshold_auto ; <nl> - <nl> - int win_width ; <nl> - int win_stride_width , win_stride_height ; <nl> - <nl> - bool gamma_corr ; <nl> - } ; <nl> - <nl> class App <nl> { <nl> public : <nl> - App ( const Args & s ) ; <nl> + App ( CommandLineParser & cmd ) ; <nl> void run ( ) ; <nl> - <nl> void handleKey ( char key ) ; <nl> - <nl> void hogWorkBegin ( ) ; <nl> void hogWorkEnd ( ) ; <nl> string hogWorkFps ( ) const ; <nl> - <nl> void workBegin ( ) ; <nl> void workEnd ( ) ; <nl> string workFps ( ) const ; <nl> - <nl> string message ( ) const ; <nl> <nl> + <nl> / / This function test if gpu_rst matches cpu_rst . <nl> / / If the two vectors are not equal , it will return the difference in vector size <nl> - / / Else if will return <nl> + / / Else if will return <nl> / / ( total diff of each cpu and gpu rects covered pixels ) / ( total cpu rects covered pixels ) <nl> - double checkRectSimilarity ( Size sz , <nl> - std : : vector < Rect > & cpu_rst , <nl> + double checkRectSimilarity ( Size sz , <nl> + std : : vector < Rect > & cpu_rst , <nl> std : : vector < Rect > & gpu_rst ) ; <nl> private : <nl> App operator = ( App & ) ; <nl> <nl> - Args args ; <nl> + / / Args args ; <nl> bool running ; <nl> - <nl> bool use_gpu ; <nl> bool make_gray ; <nl> double scale ; <nl> + double resize_scale ; <nl> + int win_width ; <nl> + int win_stride_width , win_stride_height ; <nl> int gr_threshold ; <nl> int nlevels ; <nl> double hit_threshold ; <nl> class App <nl> <nl> int64 hog_work_begin ; <nl> double hog_work_fps ; <nl> - <nl> int64 work_begin ; <nl> double work_fps ; <nl> - } ; <nl> <nl> - static void printHelp ( ) <nl> - { <nl> - cout < < " Histogram of Oriented Gradients descriptor and detector sample . \ n " <nl> - < < " \ nUsage : hog_gpu \ n " <nl> - < < " ( < image > | - - video < vide > | - - camera < camera_id > ) # frames source \ n " <nl> - < < " [ - - make_gray < true / false > ] # convert image to gray one or not \ n " <nl> - < < " [ - - resize_src < true / false > ] # do resize of the source image or not \ n " <nl> - < < " [ - - width < int > ] # resized image width \ n " <nl> - < < " [ - - height < int > ] # resized image height \ n " <nl> - < < " [ - - hit_threshold < double > ] # classifying plane distance threshold ( 0 . 0 usually ) \ n " <nl> - < < " [ - - scale < double > ] # HOG window scale factor \ n " <nl> - < < " [ - - nlevels < int > ] # max number of HOG window scales \ n " <nl> - < < " [ - - win_width < int > ] # width of the window ( 48 or 64 ) \ n " <nl> - < < " [ - - win_stride_width < int > ] # distance by OX axis between neighbour wins \ n " <nl> - < < " [ - - win_stride_height < int > ] # distance by OY axis between neighbour wins \ n " <nl> - < < " [ - - gr_threshold < int > ] # merging similar rects constant \ n " <nl> - < < " [ - - gamma_correct < int > ] # do gamma correction or not \ n " <nl> - < < " [ - - write_video < bool > ] # write video or not \ n " <nl> - < < " [ - - dst_video < path > ] # output video path \ n " <nl> - < < " [ - - dst_video_fps < double > ] # output video fps \ n " ; <nl> - help_showed = true ; <nl> - } <nl> + string img_source ; <nl> + string vdo_source ; <nl> + string output ; <nl> + int camera_id ; <nl> + } ; <nl> <nl> int main ( int argc , char * * argv ) <nl> { <nl> + const char * keys = <nl> + " { h | help | false | print help message } " <nl> + " { i | input | | specify input image } " <nl> + " { c | camera | - 1 | enable camera capturing } " <nl> + " { v | video | | use video as input } " <nl> + " { g | gray | false | convert image to gray one or not } " <nl> + " { s | scale | 1 . 0 | resize the image before detect } " <nl> + " { l | larger_win | false | use 64x128 window } " <nl> + " { o | output | | specify output path when input is images } " ; <nl> + CommandLineParser cmd ( argc , argv , keys ) ; <nl> + App app ( cmd ) ; <nl> try <nl> { <nl> - if ( argc < 2 ) <nl> - printHelp ( ) ; <nl> - Args args = Args : : read ( argc , argv ) ; <nl> - if ( help_showed ) <nl> - return - 1 ; <nl> - App app ( args ) ; <nl> app . run ( ) ; <nl> } <nl> - catch ( const Exception & e ) { return cout < < " error : " < < e . what ( ) < < endl , 1 ; } <nl> - catch ( const exception & e ) { return cout < < " error : " < < e . what ( ) < < endl , 1 ; } <nl> - catch ( . . . ) { return cout < < " unknown exception " < < endl , 1 ; } <nl> - return 0 ; <nl> - } <nl> - <nl> - <nl> - Args : : Args ( ) <nl> - { <nl> - src_is_video = false ; <nl> - src_is_camera = false ; <nl> - camera_id = 0 ; <nl> - <nl> - write_video = false ; <nl> - dst_video_fps = 24 . ; <nl> - <nl> - make_gray = false ; <nl> - <nl> - resize_src = false ; <nl> - width = 640 ; <nl> - height = 480 ; <nl> - <nl> - scale = 1 . 05 ; <nl> - nlevels = 13 ; <nl> - gr_threshold = 8 ; <nl> - hit_threshold = 1 . 4 ; <nl> - hit_threshold_auto = true ; <nl> - <nl> - win_width = 48 ; <nl> - win_stride_width = 8 ; <nl> - win_stride_height = 8 ; <nl> - <nl> - gamma_corr = true ; <nl> - } <nl> - <nl> - <nl> - Args Args : : read ( int argc , char * * argv ) <nl> - { <nl> - Args args ; <nl> - for ( int i = 1 ; i < argc ; i + + ) <nl> + catch ( const Exception & e ) <nl> { <nl> - if ( string ( argv [ i ] ) = = " - - make_gray " ) args . make_gray = ( string ( argv [ + + i ] ) = = " true " ) ; <nl> - else if ( string ( argv [ i ] ) = = " - - resize_src " ) args . resize_src = ( string ( argv [ + + i ] ) = = " true " ) ; <nl> - else if ( string ( argv [ i ] ) = = " - - width " ) args . width = atoi ( argv [ + + i ] ) ; <nl> - else if ( string ( argv [ i ] ) = = " - - height " ) args . height = atoi ( argv [ + + i ] ) ; <nl> - else if ( string ( argv [ i ] ) = = " - - hit_threshold " ) <nl> - { <nl> - args . hit_threshold = atof ( argv [ + + i ] ) ; <nl> - args . hit_threshold_auto = false ; <nl> - } <nl> - else if ( string ( argv [ i ] ) = = " - - scale " ) args . scale = atof ( argv [ + + i ] ) ; <nl> - else if ( string ( argv [ i ] ) = = " - - nlevels " ) args . nlevels = atoi ( argv [ + + i ] ) ; <nl> - else if ( string ( argv [ i ] ) = = " - - win_width " ) args . win_width = atoi ( argv [ + + i ] ) ; <nl> - else if ( string ( argv [ i ] ) = = " - - win_stride_width " ) args . win_stride_width = atoi ( argv [ + + i ] ) ; <nl> - else if ( string ( argv [ i ] ) = = " - - win_stride_height " ) args . win_stride_height = atoi ( argv [ + + i ] ) ; <nl> - else if ( string ( argv [ i ] ) = = " - - gr_threshold " ) args . gr_threshold = atoi ( argv [ + + i ] ) ; <nl> - else if ( string ( argv [ i ] ) = = " - - gamma_correct " ) args . gamma_corr = ( string ( argv [ + + i ] ) = = " true " ) ; <nl> - else if ( string ( argv [ i ] ) = = " - - write_video " ) args . write_video = ( string ( argv [ + + i ] ) = = " true " ) ; <nl> - else if ( string ( argv [ i ] ) = = " - - dst_video " ) args . dst_video = argv [ + + i ] ; <nl> - else if ( string ( argv [ i ] ) = = " - - dst_video_fps " ) args . dst_video_fps = atof ( argv [ + + i ] ) ; <nl> - else if ( string ( argv [ i ] ) = = " - - help " ) printHelp ( ) ; <nl> - else if ( string ( argv [ i ] ) = = " - - video " ) { args . src = argv [ + + i ] ; args . src_is_video = true ; } <nl> - else if ( string ( argv [ i ] ) = = " - - camera " ) { args . camera_id = atoi ( argv [ + + i ] ) ; args . src_is_camera = true ; } <nl> - else if ( args . src . empty ( ) ) args . src = argv [ i ] ; <nl> - else throw runtime_error ( ( string ( " unknown key : " ) + argv [ i ] ) ) ; <nl> + return cout < < " error : " < < e . what ( ) < < endl , 1 ; <nl> + } <nl> + catch ( const exception & e ) <nl> + { <nl> + return cout < < " error : " < < e . what ( ) < < endl , 1 ; <nl> } <nl> - return args ; <nl> + catch ( . . . ) <nl> + { <nl> + return cout < < " unknown exception " < < endl , 1 ; <nl> + } <nl> + return 0 ; <nl> } <nl> <nl> - <nl> - App : : App ( const Args & s ) <nl> + App : : App ( CommandLineParser & cmd ) <nl> { <nl> - args = s ; <nl> cout < < " \ nControls : \ n " <nl> < < " \ tESC - exit \ n " <nl> < < " \ tm - change mode GPU < - > CPU \ n " <nl> App : : App ( const Args & s ) <nl> < < " \ t4 / r - increase / decrease hit threshold \ n " <nl> < < endl ; <nl> <nl> - use_gpu = true ; <nl> - make_gray = args . make_gray ; <nl> - scale = args . scale ; <nl> - gr_threshold = args . gr_threshold ; <nl> - nlevels = args . nlevels ; <nl> - <nl> - if ( args . hit_threshold_auto ) <nl> - args . hit_threshold = args . win_width = = 48 ? 1 . 4 : 0 . ; <nl> - hit_threshold = args . hit_threshold ; <nl> <nl> - gamma_corr = args . gamma_corr ; <nl> + use_gpu = true ; <nl> + make_gray = cmd . get < bool > ( " g " ) ; <nl> + resize_scale = cmd . get < double > ( " s " ) ; <nl> + win_width = cmd . get < bool > ( " l " ) = = true ? 64 : 48 ; <nl> + vdo_source = cmd . get < string > ( " v " ) ; <nl> + img_source = cmd . get < string > ( " i " ) ; <nl> + output = cmd . get < string > ( " o " ) ; <nl> + camera_id = cmd . get < int > ( " c " ) ; <nl> <nl> - if ( args . win_width ! = 64 & & args . win_width ! = 48 ) <nl> - args . win_width = 64 ; <nl> + win_stride_width = 8 ; <nl> + win_stride_height = 8 ; <nl> + gr_threshold = 8 ; <nl> + nlevels = 13 ; <nl> + hit_threshold = win_width = = 48 ? 1 . 4 : 0 . ; <nl> + scale = 1 . 05 ; <nl> + gamma_corr = true ; <nl> <nl> - cout < < " Scale : " < < scale < < endl ; <nl> - if ( args . resize_src ) <nl> - cout < < " Resized source : ( " < < args . width < < " , " < < args . height < < " ) \ n " ; <nl> cout < < " Group threshold : " < < gr_threshold < < endl ; <nl> cout < < " Levels number : " < < nlevels < < endl ; <nl> - cout < < " Win width : " < < args . win_width < < endl ; <nl> - cout < < " Win stride : ( " < < args . win_stride_width < < " , " < < args . win_stride_height < < " ) \ n " ; <nl> + cout < < " Win width : " < < win_width < < endl ; <nl> + cout < < " Win stride : ( " < < win_stride_width < < " , " < < win_stride_height < < " ) \ n " ; <nl> cout < < " Hit threshold : " < < hit_threshold < < endl ; <nl> cout < < " Gamma correction : " < < gamma_corr < < endl ; <nl> cout < < endl ; <nl> } <nl> <nl> - <nl> void App : : run ( ) <nl> { <nl> - std : : vector < ocl : : Info > oclinfo ; <nl> + vector < ocl : : Info > oclinfo ; <nl> ocl : : getDevice ( oclinfo ) ; <nl> running = true ; <nl> - cv : : VideoWriter video_writer ; <nl> + VideoWriter video_writer ; <nl> <nl> - Size win_size ( args . win_width , args . win_width * 2 ) ; / / ( 64 , 128 ) or ( 48 , 96 ) <nl> - Size win_stride ( args . win_stride_width , args . win_stride_height ) ; <nl> + Size win_size ( win_width , win_width * 2 ) ; <nl> + Size win_stride ( win_stride_width , win_stride_height ) ; <nl> <nl> / / Create HOG descriptors and detectors here <nl> vector < float > detector ; <nl> if ( win_size = = Size ( 64 , 128 ) ) <nl> - detector = cv : : ocl : : HOGDescriptor : : getPeopleDetector64x128 ( ) ; <nl> + detector = ocl : : HOGDescriptor : : getPeopleDetector64x128 ( ) ; <nl> else <nl> - detector = cv : : ocl : : HOGDescriptor : : getPeopleDetector48x96 ( ) ; <nl> + detector = ocl : : HOGDescriptor : : getPeopleDetector48x96 ( ) ; <nl> + <nl> <nl> - cv : : ocl : : HOGDescriptor gpu_hog ( win_size , Size ( 16 , 16 ) , Size ( 8 , 8 ) , Size ( 8 , 8 ) , 9 , <nl> - cv : : ocl : : HOGDescriptor : : DEFAULT_WIN_SIGMA , 0 . 2 , gamma_corr , <nl> - cv : : ocl : : HOGDescriptor : : DEFAULT_NLEVELS ) ; <nl> - cv : : HOGDescriptor cpu_hog ( win_size , Size ( 16 , 16 ) , Size ( 8 , 8 ) , Size ( 8 , 8 ) , 9 , 1 , - 1 , <nl> - HOGDescriptor : : L2Hys , 0 . 2 , gamma_corr , cv : : HOGDescriptor : : DEFAULT_NLEVELS ) ; <nl> + ocl : : HOGDescriptor gpu_hog ( win_size , Size ( 16 , 16 ) , Size ( 8 , 8 ) , Size ( 8 , 8 ) , 9 , <nl> + ocl : : HOGDescriptor : : DEFAULT_WIN_SIGMA , 0 . 2 , gamma_corr , <nl> + ocl : : HOGDescriptor : : DEFAULT_NLEVELS ) ; <nl> + HOGDescriptor cpu_hog ( win_size , Size ( 16 , 16 ) , Size ( 8 , 8 ) , Size ( 8 , 8 ) , 9 , 1 , - 1 , <nl> + HOGDescriptor : : L2Hys , 0 . 2 , gamma_corr , cv : : HOGDescriptor : : DEFAULT_NLEVELS ) ; <nl> gpu_hog . setSVMDetector ( detector ) ; <nl> cpu_hog . setSVMDetector ( detector ) ; <nl> <nl> void App : : run ( ) <nl> VideoCapture vc ; <nl> Mat frame ; <nl> <nl> - if ( args . src_is_video ) <nl> + if ( vdo_source ! = " " ) <nl> { <nl> - vc . open ( args . src . c_str ( ) ) ; <nl> + vc . open ( vdo_source . c_str ( ) ) ; <nl> if ( ! vc . isOpened ( ) ) <nl> - throw runtime_error ( string ( " can ' t open video file : " + args . src ) ) ; <nl> + throw runtime_error ( string ( " can ' t open video file : " + vdo_source ) ) ; <nl> vc > > frame ; <nl> } <nl> - else if ( args . src_is_camera ) <nl> + else if ( camera_id ! = - 1 ) <nl> { <nl> - vc . open ( args . camera_id ) ; <nl> + vc . open ( camera_id ) ; <nl> if ( ! vc . isOpened ( ) ) <nl> { <nl> stringstream msg ; <nl> - msg < < " can ' t open camera : " < < args . camera_id ; <nl> + msg < < " can ' t open camera : " < < camera_id ; <nl> throw runtime_error ( msg . str ( ) ) ; <nl> } <nl> vc > > frame ; <nl> } <nl> else <nl> { <nl> - frame = imread ( args . src ) ; <nl> + frame = imread ( img_source ) ; <nl> if ( frame . empty ( ) ) <nl> - throw runtime_error ( string ( " can ' t open image file : " + args . src ) ) ; <nl> + throw runtime_error ( string ( " can ' t open image file : " + img_source ) ) ; <nl> } <nl> <nl> Mat img_aux , img , img_to_show ; <nl> void App : : run ( ) <nl> else frame . copyTo ( img_aux ) ; <nl> <nl> / / Resize image <nl> - if ( args . resize_src ) resize ( img_aux , img , Size ( args . width , args . height ) ) ; <nl> + if ( abs ( scale - 1 . 0 ) > 0 . 001 ) <nl> + { <nl> + Size sz ( ( int ) ( ( double ) img_aux . cols / resize_scale ) , ( int ) ( ( double ) img_aux . rows / resize_scale ) ) ; <nl> + resize ( img_aux , img , sz ) ; <nl> + } <nl> else img = img_aux ; <nl> img_to_show = img ; <nl> - <nl> gpu_hog . nlevels = nlevels ; <nl> cpu_hog . nlevels = nlevels ; <nl> - <nl> vector < Rect > found ; <nl> <nl> / / Perform HOG classification <nl> void App : : run ( ) <nl> vector < Rect > ref_rst ; <nl> cvtColor ( img , img , CV_BGRA2BGR ) ; <nl> cpu_hog . detectMultiScale ( img , ref_rst , hit_threshold , win_stride , <nl> - Size ( 0 , 0 ) , scale , gr_threshold - 2 ) ; <nl> + Size ( 0 , 0 ) , scale , gr_threshold - 2 ) ; <nl> double accuracy = checkRectSimilarity ( img . size ( ) , ref_rst , found ) ; <nl> - cout < < " \ naccuracy value : " < < accuracy < < endl ; <nl> - } <nl> - } <nl> + cout < < " \ naccuracy value : " < < accuracy < < endl ; <nl> + } <nl> + } <nl> else cpu_hog . detectMultiScale ( img , found , hit_threshold , win_stride , <nl> - Size ( 0 , 0 ) , scale , gr_threshold ) ; <nl> + Size ( 0 , 0 ) , scale , gr_threshold ) ; <nl> hogWorkEnd ( ) ; <nl> <nl> + <nl> / / Draw positive classified windows <nl> for ( size_t i = 0 ; i < found . size ( ) ; i + + ) <nl> { <nl> void App : : run ( ) <nl> putText ( img_to_show , " FPS ( HOG only ) : " + hogWorkFps ( ) , Point ( 5 , 65 ) , FONT_HERSHEY_SIMPLEX , 1 . , Scalar ( 255 , 100 , 0 ) , 2 ) ; <nl> putText ( img_to_show , " FPS ( total ) : " + workFps ( ) , Point ( 5 , 105 ) , FONT_HERSHEY_SIMPLEX , 1 . , Scalar ( 255 , 100 , 0 ) , 2 ) ; <nl> imshow ( " opencv_gpu_hog " , img_to_show ) ; <nl> - <nl> - if ( args . src_is_video | | args . src_is_camera ) vc > > frame ; <nl> + if ( vdo_source ! = " " | | camera_id ! = - 1 ) vc > > frame ; <nl> <nl> workEnd ( ) ; <nl> <nl> - if ( args . write_video ) <nl> + if ( output ! = " " ) <nl> { <nl> - if ( ! video_writer . isOpened ( ) ) <nl> + if ( img_source ! = " " ) / / wirte image <nl> { <nl> - video_writer . open ( args . dst_video , CV_FOURCC ( ' x ' , ' v ' , ' i ' , ' d ' ) , args . dst_video_fps , <nl> - img_to_show . size ( ) , true ) ; <nl> - if ( ! video_writer . isOpened ( ) ) <nl> - throw std : : runtime_error ( " can ' t create video writer " ) ; <nl> + imwrite ( output , img_to_show ) ; <nl> } <nl> + else / / write video <nl> + { <nl> + if ( ! video_writer . isOpened ( ) ) <nl> + { <nl> + video_writer . open ( output , CV_FOURCC ( ' x ' , ' v ' , ' i ' , ' d ' ) , 24 , <nl> + img_to_show . size ( ) , true ) ; <nl> + if ( ! video_writer . isOpened ( ) ) <nl> + throw std : : runtime_error ( " can ' t create video writer " ) ; <nl> + } <nl> <nl> - if ( make_gray ) cvtColor ( img_to_show , img , CV_GRAY2BGR ) ; <nl> - else cvtColor ( img_to_show , img , CV_BGRA2BGR ) ; <nl> + if ( make_gray ) cvtColor ( img_to_show , img , CV_GRAY2BGR ) ; <nl> + else cvtColor ( img_to_show , img , CV_BGRA2BGR ) ; <nl> <nl> - video_writer < < img ; <nl> + video_writer < < img ; <nl> + } <nl> } <nl> <nl> handleKey ( ( char ) waitKey ( 3 ) ) ; <nl> void App : : run ( ) <nl> } <nl> } <nl> <nl> - <nl> void App : : handleKey ( char key ) <nl> { <nl> switch ( key ) <nl> void App : : handleKey ( char key ) <nl> } <nl> <nl> <nl> - inline void App : : hogWorkBegin ( ) { hog_work_begin = getTickCount ( ) ; } <nl> + inline void App : : hogWorkBegin ( ) <nl> + { <nl> + hog_work_begin = getTickCount ( ) ; <nl> + } <nl> <nl> inline void App : : hogWorkEnd ( ) <nl> { <nl> inline string App : : hogWorkFps ( ) const <nl> return ss . str ( ) ; <nl> } <nl> <nl> - <nl> - inline void App : : workBegin ( ) { work_begin = getTickCount ( ) ; } <nl> + inline void App : : workBegin ( ) <nl> + { <nl> + work_begin = getTickCount ( ) ; <nl> + } <nl> <nl> inline void App : : workEnd ( ) <nl> { <nl> inline string App : : workFps ( ) const <nl> return ss . str ( ) ; <nl> } <nl> <nl> - double App : : checkRectSimilarity ( Size sz , <nl> - std : : vector < Rect > & ob1 , <nl> + <nl> + double App : : checkRectSimilarity ( Size sz , <nl> + std : : vector < Rect > & ob1 , <nl> std : : vector < Rect > & ob2 ) <nl> { <nl> double final_test_result = 0 . 0 ; <nl> double App : : checkRectSimilarity ( Size sz , <nl> size_t sz2 = ob2 . size ( ) ; <nl> <nl> if ( sz1 ! = sz2 ) <nl> + { <nl> return sz1 > sz2 ? ( double ) ( sz1 - sz2 ) : ( double ) ( sz2 - sz1 ) ; <nl> + } <nl> else <nl> { <nl> + if ( sz1 = = 0 & & sz2 = = 0 ) <nl> + return 0 ; <nl> cv : : Mat cpu_result ( sz , CV_8UC1 ) ; <nl> cpu_result . setTo ( 0 ) ; <nl> <nl> + <nl> for ( vector < Rect > : : const_iterator r = ob1 . begin ( ) ; r ! = ob1 . end ( ) ; r + + ) <nl> - { <nl> + { <nl> cv : : Mat cpu_result_roi ( cpu_result , * r ) ; <nl> cpu_result_roi . setTo ( 1 ) ; <nl> cpu_result . copyTo ( cpu_result ) ; <nl> } <nl> int cpu_area = cv : : countNonZero ( cpu_result > 0 ) ; <nl> <nl> + <nl> cv : : Mat gpu_result ( sz , CV_8UC1 ) ; <nl> gpu_result . setTo ( 0 ) ; <nl> for ( vector < Rect > : : const_iterator r2 = ob2 . begin ( ) ; r2 ! = ob2 . end ( ) ; r2 + + ) <nl> double App : : checkRectSimilarity ( Size sz , <nl> cv : : Mat result_ ; <nl> multiply ( cpu_result , gpu_result , result_ ) ; <nl> int result = cv : : countNonZero ( result_ > 0 ) ; <nl> - <nl> - final_test_result = 1 . 0 - ( double ) result / ( double ) cpu_area ; <nl> + if ( cpu_area ! = 0 & & result ! = 0 ) <nl> + final_test_result = 1 . 0 - ( double ) result / ( double ) cpu_area ; <nl> + else if ( cpu_area = = 0 & & result ! = 0 ) <nl> + final_test_result = - 1 ; <nl> } <nl> return final_test_result ; <nl> - <nl> } <nl> <nl> mmm a / samples / ocl / pyrlk_optical_flow . cpp <nl> ppp b / samples / ocl / pyrlk_optical_flow . cpp <nl> using namespace cv ; <nl> using namespace cv : : ocl ; <nl> <nl> typedef unsigned char uchar ; <nl> - # define LOOP_NUM 10 <nl> + # define LOOP_NUM 10 <nl> int64 work_begin = 0 ; <nl> int64 work_end = 0 ; <nl> <nl> - static void workBegin ( ) <nl> - { <nl> + static void workBegin ( ) <nl> + { <nl> work_begin = getTickCount ( ) ; <nl> } <nl> static void workEnd ( ) <nl> { <nl> work_end + = ( getTickCount ( ) - work_begin ) ; <nl> } <nl> - static double getTime ( ) { <nl> + static double getTime ( ) <nl> + { <nl> return work_end * 1000 . / getTickFrequency ( ) ; <nl> } <nl> <nl> int main ( int argc , const char * argv [ ] ) <nl> / / set this to save kernel compile time from second time you run <nl> ocl : : setBinpath ( " . / " ) ; <nl> const char * keys = <nl> - " { h | help | false | print help message } " <nl> - " { l | left | | specify left image } " <nl> - " { r | right | | specify right image } " <nl> - " { c | camera | 0 | enable camera capturing } " <nl> - " { s | use_cpu | false | use cpu or gpu to process the image } " <nl> - " { v | video | | use video as input } " <nl> - " { points | points | 1000 | specify points count [ GoodFeatureToTrack ] } " <nl> - " { min_dist | min_dist | 0 | specify minimal distance between points [ GoodFeatureToTrack ] } " ; <nl> + " { h | help | false | print help message } " <nl> + " { l | left | | specify left image } " <nl> + " { r | right | | specify right image } " <nl> + " { c | camera | 0 | specify camera id } " <nl> + " { s | use_cpu | false | use cpu or gpu to process the image } " <nl> + " { v | video | | use video as input } " <nl> + " { o | output | pyrlk_output . jpg | specify output save path when input is images } " <nl> + " { p | points | 1000 | specify points count [ GoodFeatureToTrack ] } " <nl> + " { m | min_dist | 0 | specify minimal distance between points [ GoodFeatureToTrack ] } " ; <nl> <nl> CommandLineParser cmd ( argc , argv , keys ) ; <nl> <nl> int main ( int argc , const char * argv [ ] ) <nl> } <nl> <nl> bool defaultPicturesFail = false ; <nl> - string fname0 = cmd . get < string > ( " left " ) ; <nl> - string fname1 = cmd . get < string > ( " right " ) ; <nl> - string vdofile = cmd . get < string > ( " video " ) ; <nl> - int points = cmd . get < int > ( " points " ) ; <nl> - double minDist = cmd . get < double > ( " min_dist " ) ; <nl> + string fname0 = cmd . get < string > ( " l " ) ; <nl> + string fname1 = cmd . get < string > ( " r " ) ; <nl> + string vdofile = cmd . get < string > ( " v " ) ; <nl> + string outfile = cmd . get < string > ( " o " ) ; <nl> + int points = cmd . get < int > ( " p " ) ; <nl> + double minDist = cmd . get < double > ( " m " ) ; <nl> bool useCPU = cmd . get < bool > ( " s " ) ; <nl> - bool useCamera = cmd . get < bool > ( " c " ) ; <nl> int inputName = cmd . get < int > ( " c " ) ; <nl> <nl> oclMat d_nextPts , d_status ; <nl> int main ( int argc , const char * argv [ ] ) <nl> vector < unsigned char > status ( points ) ; <nl> vector < float > err ; <nl> <nl> - if ( frame0 . empty ( ) | | frame1 . empty ( ) ) <nl> - { <nl> - useCamera = true ; <nl> - defaultPicturesFail = true ; <nl> - CvCapture * capture = 0 ; <nl> - capture = cvCaptureFromCAM ( inputName ) ; <nl> - if ( ! capture ) <nl> - { <nl> - cout < < " Can ' t load input images " < < endl ; <nl> - return - 1 ; <nl> - } <nl> - } <nl> - <nl> cout < < " Points count : " < < points < < endl < < endl ; <nl> <nl> - if ( useCamera ) <nl> + if ( frame0 . empty ( ) | | frame1 . empty ( ) ) <nl> { <nl> CvCapture * capture = 0 ; <nl> Mat frame , frameCopy ; <nl> int main ( int argc , const char * argv [ ] ) <nl> else <nl> { <nl> nocamera : <nl> - for ( int i = 0 ; i < = LOOP_NUM ; i + + ) <nl> + for ( int i = 0 ; i < = LOOP_NUM ; i + + ) <nl> { <nl> cout < < " loop " < < i < < endl ; <nl> - if ( i > 0 ) workBegin ( ) ; <nl> + if ( i > 0 ) workBegin ( ) ; <nl> <nl> if ( useCPU ) <nl> { <nl> int main ( int argc , const char * argv [ ] ) <nl> cout < < getTime ( ) / LOOP_NUM < < " ms " < < endl ; <nl> <nl> drawArrows ( frame0 , pts , nextPts , status , Scalar ( 255 , 0 , 0 ) ) ; <nl> - <nl> imshow ( " PyrLK [ Sparse ] " , frame0 ) ; <nl> + imwrite ( outfile , frame0 ) ; <nl> } <nl> } <nl> } <nl> mmm a / samples / ocl / squares . cpp <nl> ppp b / samples / ocl / squares . cpp <nl> <nl> # include " opencv2 / imgproc / imgproc . hpp " <nl> # include " opencv2 / highgui / highgui . hpp " <nl> # include " opencv2 / ocl / ocl . hpp " <nl> - <nl> # include < iostream > <nl> # include < math . h > <nl> # include < string . h > <nl> <nl> using namespace cv ; <nl> using namespace std ; <nl> <nl> - static void help ( ) <nl> + # define ACCURACY_CHECK 1 <nl> + <nl> + # if ACCURACY_CHECK <nl> + / / check if two vectors of vector of points are near or not <nl> + / / prior assumption is that they are in correct order <nl> + static bool checkPoints ( <nl> + vector < vector < Point > > set1 , <nl> + vector < vector < Point > > set2 , <nl> + int maxDiff = 5 ) <nl> { <nl> - cout < < <nl> - " \ nA program using OCL module pyramid scaling , Canny , dilate functions , threshold , split ; cpu contours , contour simpification and \ n " <nl> - " memory storage ( it ' s got it all folks ) to find \ n " <nl> - " squares in a list of images pic1 - 6 . png \ n " <nl> - " Returns sequence of squares detected on the image . \ n " <nl> - " the sequence is stored in the specified memory storage \ n " <nl> - " Call : \ n " <nl> - " . / squares \ n " <nl> - " Using OpenCV version % s \ n " < < CV_VERSION < < " \ n " < < endl ; <nl> - } <nl> + if ( set1 . size ( ) ! = set2 . size ( ) ) <nl> + { <nl> + return false ; <nl> + } <nl> + <nl> + for ( vector < vector < Point > > : : iterator it1 = set1 . begin ( ) , it2 = set2 . begin ( ) ; <nl> + it1 < set1 . end ( ) & & it2 < set2 . end ( ) ; it1 + + , it2 + + ) <nl> + { <nl> + vector < Point > pts1 = * it1 ; <nl> + vector < Point > pts2 = * it2 ; <nl> <nl> <nl> + if ( pts1 . size ( ) ! = pts2 . size ( ) ) <nl> + { <nl> + return false ; <nl> + } <nl> + for ( size_t i = 0 ; i < pts1 . size ( ) ; i + + ) <nl> + { <nl> + Point pt1 = pts1 [ i ] , pt2 = pts2 [ i ] ; <nl> + if ( std : : abs ( pt1 . x - pt2 . x ) > maxDiff | | <nl> + std : : abs ( pt1 . y - pt2 . y ) > maxDiff ) <nl> + { <nl> + return false ; <nl> + } <nl> + } <nl> + } <nl> + return true ; <nl> + } <nl> + # endif <nl> + <nl> int thresh = 50 , N = 11 ; <nl> const char * wndname = " OpenCL Square Detection Demo " ; <nl> <nl> + <nl> / / helper function : <nl> / / finds a cosine of angle between vectors <nl> / / from pt0 - > pt1 and from pt0 - > pt2 <nl> static double angle ( Point pt1 , Point pt2 , Point pt0 ) <nl> return ( dx1 * dx2 + dy1 * dy2 ) / sqrt ( ( dx1 * dx1 + dy1 * dy1 ) * ( dx2 * dx2 + dy2 * dy2 ) + 1e - 10 ) ; <nl> } <nl> <nl> + <nl> / / returns sequence of squares detected on the image . <nl> / / the sequence is stored in the specified memory storage <nl> static void findSquares ( const Mat & image , vector < vector < Point > > & squares ) <nl> + { <nl> + squares . clear ( ) ; <nl> + Mat pyr , timg , gray0 ( image . size ( ) , CV_8U ) , gray ; <nl> + <nl> + / / down - scale and upscale the image to filter out the noise <nl> + pyrDown ( image , pyr , Size ( image . cols / 2 , image . rows / 2 ) ) ; <nl> + pyrUp ( pyr , timg , image . size ( ) ) ; <nl> + vector < vector < Point > > contours ; <nl> + <nl> + / / find squares in every color plane of the image <nl> + for ( int c = 0 ; c < 3 ; c + + ) <nl> + { <nl> + int ch [ ] = { c , 0 } ; <nl> + mixChannels ( & timg , 1 , & gray0 , 1 , ch , 1 ) ; <nl> + <nl> + / / try several threshold levels <nl> + for ( int l = 0 ; l < N ; l + + ) <nl> + { <nl> + / / hack : use Canny instead of zero threshold level . <nl> + / / Canny helps to catch squares with gradient shading <nl> + if ( l = = 0 ) <nl> + { <nl> + / / apply Canny . Take the upper threshold from slider <nl> + / / and set the lower to 0 ( which forces edges merging ) <nl> + Canny ( gray0 , gray , 0 , thresh , 5 ) ; <nl> + / / dilate canny output to remove potential <nl> + / / holes between edge segments <nl> + dilate ( gray , gray , Mat ( ) , Point ( - 1 , - 1 ) ) ; <nl> + } <nl> + else <nl> + { <nl> + / / apply threshold if l ! = 0 : <nl> + / / tgray ( x , y ) = gray ( x , y ) < ( l + 1 ) * 255 / N ? 255 : 0 <nl> + cv : : threshold ( gray0 , gray , ( l + 1 ) * 255 / N , 255 , THRESH_BINARY ) ; <nl> + } <nl> + <nl> + / / find contours and store them all as a list <nl> + findContours ( gray , contours , CV_RETR_LIST , CV_CHAIN_APPROX_SIMPLE ) ; <nl> + <nl> + vector < Point > approx ; <nl> + <nl> + / / test each contour <nl> + for ( size_t i = 0 ; i < contours . size ( ) ; i + + ) <nl> + { <nl> + / / approximate contour with accuracy proportional <nl> + / / to the contour perimeter <nl> + approxPolyDP ( Mat ( contours [ i ] ) , approx , arcLength ( Mat ( contours [ i ] ) , true ) * 0 . 02 , true ) ; <nl> + <nl> + / / square contours should have 4 vertices after approximation <nl> + / / relatively large area ( to filter out noisy contours ) <nl> + / / and be convex . <nl> + / / Note : absolute value of an area is used because <nl> + / / area may be positive or negative - in accordance with the <nl> + / / contour orientation <nl> + if ( approx . size ( ) = = 4 & & <nl> + fabs ( contourArea ( Mat ( approx ) ) ) > 1000 & & <nl> + isContourConvex ( Mat ( approx ) ) ) <nl> + { <nl> + double maxCosine = 0 ; <nl> + <nl> + for ( int j = 2 ; j < 5 ; j + + ) <nl> + { <nl> + / / find the maximum cosine of the angle between joint edges <nl> + double cosine = fabs ( angle ( approx [ j % 4 ] , approx [ j - 2 ] , approx [ j - 1 ] ) ) ; <nl> + maxCosine = MAX ( maxCosine , cosine ) ; <nl> + } <nl> + <nl> + / / if cosines of all angles are small <nl> + / / ( all angles are ~ 90 degree ) then write quandrange <nl> + / / vertices to resultant sequence <nl> + if ( maxCosine < 0 . 3 ) <nl> + squares . push_back ( approx ) ; <nl> + } <nl> + } <nl> + } <nl> + } <nl> + } <nl> + <nl> + <nl> + / / returns sequence of squares detected on the image . <nl> + / / the sequence is stored in the specified memory storage <nl> + static void findSquares_ocl ( const Mat & image , vector < vector < Point > > & squares ) <nl> { <nl> squares . clear ( ) ; <nl> <nl> static void findSquares ( const Mat & image , vector < vector < Point > > & squares ) <nl> findContours ( gray , contours , CV_RETR_LIST , CV_CHAIN_APPROX_SIMPLE ) ; <nl> <nl> vector < Point > approx ; <nl> - <nl> / / test each contour <nl> for ( size_t i = 0 ; i < contours . size ( ) ; i + + ) <nl> { <nl> static void findSquares ( const Mat & image , vector < vector < Point > > & squares ) <nl> / / area may be positive or negative - in accordance with the <nl> / / contour orientation <nl> if ( approx . size ( ) = = 4 & & <nl> - fabs ( contourArea ( Mat ( approx ) ) ) > 1000 & & <nl> - isContourConvex ( Mat ( approx ) ) ) <nl> + fabs ( contourArea ( Mat ( approx ) ) ) > 1000 & & <nl> + isContourConvex ( Mat ( approx ) ) ) <nl> { <nl> double maxCosine = 0 ; <nl> - <nl> for ( int j = 2 ; j < 5 ; j + + ) <nl> { <nl> / / find the maximum cosine of the angle between joint edges <nl> static void drawSquares ( Mat & image , const vector < vector < Point > > & squares ) <nl> int n = ( int ) squares [ i ] . size ( ) ; <nl> polylines ( image , & p , & n , 1 , true , Scalar ( 0 , 255 , 0 ) , 3 , CV_AA ) ; <nl> } <nl> + } <nl> + <nl> <nl> - imshow ( wndname , image ) ; <nl> + / / draw both pure - C + + and ocl square results onto a single image <nl> + static Mat drawSquaresBoth ( const Mat & image , <nl> + const vector < vector < Point > > & sqsCPP , <nl> + const vector < vector < Point > > & sqsOCL <nl> + ) <nl> + { <nl> + Mat imgToShow ( Size ( image . cols * 2 , image . rows ) , image . type ( ) ) ; <nl> + Mat lImg = imgToShow ( Rect ( Point ( 0 , 0 ) , image . size ( ) ) ) ; <nl> + Mat rImg = imgToShow ( Rect ( Point ( image . cols , 0 ) , image . size ( ) ) ) ; <nl> + image . copyTo ( lImg ) ; <nl> + image . copyTo ( rImg ) ; <nl> + drawSquares ( lImg , sqsCPP ) ; <nl> + drawSquares ( rImg , sqsOCL ) ; <nl> + float fontScale = 0 . 8f ; <nl> + Scalar white = Scalar : : all ( 255 ) , black = Scalar : : all ( 0 ) ; <nl> + <nl> + putText ( lImg , " C + + " , Point ( 10 , 20 ) , FONT_HERSHEY_COMPLEX_SMALL , fontScale , black , 2 ) ; <nl> + putText ( rImg , " OCL " , Point ( 10 , 20 ) , FONT_HERSHEY_COMPLEX_SMALL , fontScale , black , 2 ) ; <nl> + putText ( lImg , " C + + " , Point ( 10 , 20 ) , FONT_HERSHEY_COMPLEX_SMALL , fontScale , white , 1 ) ; <nl> + putText ( rImg , " OCL " , Point ( 10 , 20 ) , FONT_HERSHEY_COMPLEX_SMALL , fontScale , white , 1 ) ; <nl> + <nl> + return imgToShow ; <nl> } <nl> <nl> <nl> - int main ( int / * argc * / , char * * / * argv * / ) <nl> + int main ( int argc , char * * argv ) <nl> { <nl> + const char * keys = <nl> + " { i | input | | specify input image } " <nl> + " { o | output | squares_output . jpg | specify output save path } " ; <nl> + CommandLineParser cmd ( argc , argv , keys ) ; <nl> + string inputName = cmd . get < string > ( " i " ) ; <nl> + string outfile = cmd . get < string > ( " o " ) ; <nl> + if ( inputName . empty ( ) ) <nl> + { <nl> + cout < < " Avaible options : " < < endl ; <nl> + cmd . printParams ( ) ; <nl> + return 0 ; <nl> + } <nl> <nl> - / / ocl : : setBinpath ( " F : / kernel_bin " ) ; <nl> vector < ocl : : Info > info ; <nl> CV_Assert ( ocl : : getDevice ( info ) ) ; <nl> - <nl> - static const char * names [ ] = { " pic1 . png " , " pic2 . png " , " pic3 . png " , <nl> - " pic4 . png " , " pic5 . png " , " pic6 . png " , 0 } ; <nl> - help ( ) ; <nl> + int iterations = 10 ; <nl> namedWindow ( wndname , 1 ) ; <nl> - vector < vector < Point > > squares ; <nl> + vector < vector < Point > > squares_cpu , squares_ocl ; <nl> <nl> - for ( int i = 0 ; names [ i ] ! = 0 ; i + + ) <nl> + Mat image = imread ( inputName , 1 ) ; <nl> + if ( image . empty ( ) ) <nl> { <nl> - Mat image = imread ( names [ i ] , 1 ) ; <nl> - if ( image . empty ( ) ) <nl> - { <nl> - cout < < " Couldn ' t load " < < names [ i ] < < endl ; <nl> - continue ; <nl> - } <nl> + cout < < " Couldn ' t load " < < inputName < < endl ; <nl> + return - 1 ; <nl> + } <nl> + int j = iterations ; <nl> + int64 t_ocl = 0 , t_cpp = 0 ; <nl> + / / warm - ups <nl> + cout < < " warming up . . . " < < endl ; <nl> + findSquares ( image , squares_cpu ) ; <nl> + findSquares_ocl ( image , squares_ocl ) ; <nl> + <nl> + <nl> + # if ACCURACY_CHECK <nl> + cout < < " Checking ocl accuracy . . . " < < endl ; <nl> + cout < < ( checkPoints ( squares_cpu , squares_ocl ) ? " Pass " : " Failed " ) < < endl ; <nl> + # endif <nl> + do <nl> + { <nl> + int64 t_start = cv : : getTickCount ( ) ; <nl> + findSquares ( image , squares_cpu ) ; <nl> + t_cpp + = cv : : getTickCount ( ) - t_start ; <nl> <nl> - findSquares ( image , squares ) ; <nl> - drawSquares ( image , squares ) ; <nl> <nl> - int c = waitKey ( ) ; <nl> - if ( ( char ) c = = 27 ) <nl> - break ; <nl> + t_start = cv : : getTickCount ( ) ; <nl> + findSquares_ocl ( image , squares_ocl ) ; <nl> + t_ocl + = cv : : getTickCount ( ) - t_start ; <nl> + cout < < " run loop : " < < j < < endl ; <nl> } <nl> + while ( - - j ) ; <nl> + cout < < " cpp average time : " < < 1000 . 0f * ( double ) t_cpp / getTickFrequency ( ) / iterations < < " ms " < < endl ; <nl> + cout < < " ocl average time : " < < 1000 . 0f * ( double ) t_ocl / getTickFrequency ( ) / iterations < < " ms " < < endl ; <nl> + <nl> + Mat result = drawSquaresBoth ( image , squares_cpu , squares_ocl ) ; <nl> + imshow ( wndname , result ) ; <nl> + imwrite ( outfile , result ) ; <nl> + cvWaitKey ( 0 ) ; <nl> <nl> return 0 ; <nl> } <nl> mmm a / samples / ocl / stereo_match . cpp <nl> ppp b / samples / ocl / stereo_match . cpp <nl> using namespace cv ; <nl> using namespace std ; <nl> using namespace ocl ; <nl> <nl> - bool help_showed = false ; <nl> - <nl> - struct Params <nl> - { <nl> - Params ( ) ; <nl> - static Params read ( int argc , char * * argv ) ; <nl> - <nl> - string left ; <nl> - string right ; <nl> - <nl> - string method_str ( ) const <nl> - { <nl> - switch ( method ) <nl> - { <nl> - case BM : return " BM " ; <nl> - case BP : return " BP " ; <nl> - case CSBP : return " CSBP " ; <nl> - } <nl> - return " " ; <nl> - } <nl> - enum { BM , BP , CSBP } method ; <nl> - int ndisp ; / / Max disparity + 1 <nl> - enum { GPU , CPU } type ; <nl> - } ; <nl> - <nl> <nl> struct App <nl> { <nl> - App ( const Params & p ) ; <nl> + App ( CommandLineParser & cmd ) ; <nl> void run ( ) ; <nl> void handleKey ( char key ) ; <nl> void printParams ( ) const ; <nl> <nl> - void workBegin ( ) { work_begin = getTickCount ( ) ; } <nl> + void workBegin ( ) <nl> + { <nl> + work_begin = getTickCount ( ) ; <nl> + } <nl> void workEnd ( ) <nl> { <nl> int64 d = getTickCount ( ) - work_begin ; <nl> double f = getTickFrequency ( ) ; <nl> work_fps = f / d ; <nl> } <nl> - <nl> + string method_str ( ) const <nl> + { <nl> + switch ( method ) <nl> + { <nl> + case BM : <nl> + return " BM " ; <nl> + case BP : <nl> + return " BP " ; <nl> + case CSBP : <nl> + return " CSBP " ; <nl> + } <nl> + return " " ; <nl> + } <nl> string text ( ) const <nl> { <nl> stringstream ss ; <nl> - ss < < " ( " < < p . method_str ( ) < < " ) FPS : " < < setiosflags ( ios : : left ) <nl> - < < setprecision ( 4 ) < < work_fps ; <nl> + ss < < " ( " < < method_str ( ) < < " ) FPS : " < < setiosflags ( ios : : left ) <nl> + < < setprecision ( 4 ) < < work_fps ; <nl> return ss . str ( ) ; <nl> } <nl> private : <nl> - Params p ; <nl> bool running ; <nl> <nl> Mat left_src , right_src ; <nl> struct App <nl> <nl> int64 work_begin ; <nl> double work_fps ; <nl> - } ; <nl> <nl> - static void printHelp ( ) <nl> - { <nl> - cout < < " Usage : stereo_match_gpu \ n " <nl> - < < " \ t - - left < left_view > - - right < right_view > # must be rectified \ n " <nl> - < < " \ t - - method < stereo_match_method > # BM | BP | CSBP \ n " <nl> - < < " \ t - - ndisp < number > # number of disparity levels \ n " <nl> - < < " \ t - - type < device_type > # cpu | CPU | gpu | GPU \ n " ; <nl> - help_showed = true ; <nl> - } <nl> + string l_img , r_img ; <nl> + string out_img ; <nl> + enum { BM , BP , CSBP } method ; <nl> + int ndisp ; / / Max disparity + 1 <nl> + enum { GPU , CPU } type ; <nl> + } ; <nl> <nl> int main ( int argc , char * * argv ) <nl> { <nl> + const char * keys = <nl> + " { h | help | false | print help message } " <nl> + " { l | left | | specify left image } " <nl> + " { r | right | | specify right image } " <nl> + " { m | method | BM | specify match method ( BM / BP / CSBP ) } " <nl> + " { n | ndisp | 64 | specify number of disparity levels } " <nl> + " { s | cpu_ocl | false | use cpu or gpu as ocl device to process the image } " <nl> + " { o | output | stereo_match_output . jpg | specify output path when input is images } " ; <nl> + CommandLineParser cmd ( argc , argv , keys ) ; <nl> + if ( cmd . get < bool > ( " help " ) ) <nl> + { <nl> + cout < < " Avaible options : " < < endl ; <nl> + cmd . printParams ( ) ; <nl> + return 0 ; <nl> + } <nl> try <nl> { <nl> - if ( argc < 2 ) <nl> - { <nl> - printHelp ( ) ; <nl> - return 1 ; <nl> - } <nl> + App app ( cmd ) ; <nl> + int flag = CVCL_DEVICE_TYPE_GPU ; <nl> + if ( cmd . get < bool > ( " s " ) = = true ) <nl> + flag = CVCL_DEVICE_TYPE_CPU ; <nl> <nl> - Params args = Params : : read ( argc , argv ) ; <nl> - if ( help_showed ) <nl> - return - 1 ; <nl> - <nl> - int flags [ 2 ] = { CVCL_DEVICE_TYPE_GPU , CVCL_DEVICE_TYPE_CPU } ; <nl> vector < Info > info ; <nl> - <nl> - if ( getDevice ( info , flags [ args . type ] ) = = 0 ) <nl> + if ( getDevice ( info , flag ) = = 0 ) <nl> { <nl> throw runtime_error ( " Error : Did not find a valid OpenCL device ! " ) ; <nl> } <nl> cout < < " Device name : " < < info [ 0 ] . DeviceName [ 0 ] < < endl ; <nl> <nl> - App app ( args ) ; <nl> app . run ( ) ; <nl> } <nl> catch ( const exception & e ) <nl> int main ( int argc , char * * argv ) <nl> return 0 ; <nl> } <nl> <nl> - <nl> - Params : : Params ( ) <nl> - { <nl> - method = BM ; <nl> - ndisp = 64 ; <nl> - type = GPU ; <nl> - } <nl> - <nl> - <nl> - Params Params : : read ( int argc , char * * argv ) <nl> - { <nl> - Params p ; <nl> - <nl> - for ( int i = 1 ; i < argc ; i + + ) <nl> - { <nl> - if ( string ( argv [ i ] ) = = " - - left " ) p . left = argv [ + + i ] ; <nl> - else if ( string ( argv [ i ] ) = = " - - right " ) p . right = argv [ + + i ] ; <nl> - else if ( string ( argv [ i ] ) = = " - - method " ) <nl> - { <nl> - if ( string ( argv [ i + 1 ] ) = = " BM " ) p . method = BM ; <nl> - else if ( string ( argv [ i + 1 ] ) = = " BP " ) p . method = BP ; <nl> - else if ( string ( argv [ i + 1 ] ) = = " CSBP " ) p . method = CSBP ; <nl> - else throw runtime_error ( " unknown stereo match method : " + string ( argv [ i + 1 ] ) ) ; <nl> - i + + ; <nl> - } <nl> - else if ( string ( argv [ i ] ) = = " - - ndisp " ) p . ndisp = atoi ( argv [ + + i ] ) ; <nl> - else if ( string ( argv [ i ] ) = = " - - type " ) <nl> - { <nl> - string t ( argv [ + + i ] ) ; <nl> - if ( t = = " cpu " | | t = = " CPU " ) <nl> - { <nl> - p . type = CPU ; <nl> - } <nl> - else if ( t = = " gpu " | | t = = " GPU " ) <nl> - { <nl> - p . type = GPU ; <nl> - } <nl> - else throw runtime_error ( " unknown device type : " + t ) ; <nl> - } <nl> - else if ( string ( argv [ i ] ) = = " - - help " ) printHelp ( ) ; <nl> - else throw runtime_error ( " unknown key : " + string ( argv [ i ] ) ) ; <nl> - } <nl> - <nl> - return p ; <nl> - } <nl> - <nl> - <nl> - App : : App ( const Params & params ) <nl> - : p ( params ) , running ( false ) <nl> + App : : App ( CommandLineParser & cmd ) <nl> + : running ( false ) , method ( BM ) <nl> { <nl> cout < < " stereo_match_ocl sample \ n " ; <nl> cout < < " \ nControls : \ n " <nl> - < < " \ tesc - exit \ n " <nl> - < < " \ tp - print current parameters \ n " <nl> - < < " \ tg - convert source images into gray \ n " <nl> - < < " \ tm - change stereo match method \ n " <nl> - < < " \ ts - change Sobel prefiltering flag ( for BM only ) \ n " <nl> - < < " \ t1 / q - increase / decrease maximum disparity \ n " <nl> - < < " \ t2 / w - increase / decrease window size ( for BM only ) \ n " <nl> - < < " \ t3 / e - increase / decrease iteration count ( for BP and CSBP only ) \ n " <nl> - < < " \ t4 / r - increase / decrease level count ( for BP and CSBP only ) \ n " ; <nl> + < < " \ tesc - exit \ n " <nl> + < < " \ tp - print current parameters \ n " <nl> + < < " \ tg - convert source images into gray \ n " <nl> + < < " \ tm - change stereo match method \ n " <nl> + < < " \ ts - change Sobel prefiltering flag ( for BM only ) \ n " <nl> + < < " \ t1 / q - increase / decrease maximum disparity \ n " <nl> + < < " \ t2 / w - increase / decrease window size ( for BM only ) \ n " <nl> + < < " \ t3 / e - increase / decrease iteration count ( for BP and CSBP only ) \ n " <nl> + < < " \ t4 / r - increase / decrease level count ( for BP and CSBP only ) \ n " ; <nl> + l_img = cmd . get < string > ( " l " ) ; <nl> + r_img = cmd . get < string > ( " r " ) ; <nl> + string mstr = cmd . get < string > ( " m " ) ; <nl> + if ( mstr = = " BM " ) method = BM ; <nl> + else if ( mstr = = " BP " ) method = BP ; <nl> + else if ( mstr = = " CSBP " ) method = CSBP ; <nl> + else cout < < " unknown method ! \ n " ; <nl> + ndisp = cmd . get < int > ( " n " ) ; <nl> + out_img = cmd . get < string > ( " o " ) ; <nl> } <nl> <nl> <nl> void App : : run ( ) <nl> { <nl> / / Load images <nl> - left_src = imread ( p . left ) ; <nl> - right_src = imread ( p . right ) ; <nl> - if ( left_src . empty ( ) ) throw runtime_error ( " can ' t open file \ " " + p . left + " \ " " ) ; <nl> - if ( right_src . empty ( ) ) throw runtime_error ( " can ' t open file \ " " + p . right + " \ " " ) ; <nl> + left_src = imread ( l_img ) ; <nl> + right_src = imread ( r_img ) ; <nl> + if ( left_src . empty ( ) ) throw runtime_error ( " can ' t open file \ " " + l_img + " \ " " ) ; <nl> + if ( right_src . empty ( ) ) throw runtime_error ( " can ' t open file \ " " + r_img + " \ " " ) ; <nl> <nl> cvtColor ( left_src , left , CV_BGR2GRAY ) ; <nl> cvtColor ( right_src , right , CV_BGR2GRAY ) ; <nl> void App : : run ( ) <nl> imshow ( " right " , right ) ; <nl> <nl> / / Set common parameters <nl> - bm . ndisp = p . ndisp ; <nl> - bp . ndisp = p . ndisp ; <nl> - csbp . ndisp = p . ndisp ; <nl> + bm . ndisp = ndisp ; <nl> + bp . ndisp = ndisp ; <nl> + csbp . ndisp = ndisp ; <nl> <nl> cout < < endl ; <nl> printParams ( ) ; <nl> <nl> running = true ; <nl> + bool written = false ; <nl> while ( running ) <nl> { <nl> <nl> void App : : run ( ) <nl> Mat disp ; <nl> oclMat d_disp ; <nl> workBegin ( ) ; <nl> - switch ( p . method ) <nl> + switch ( method ) <nl> { <nl> - case Params : : BM : <nl> + case BM : <nl> if ( d_left . channels ( ) > 1 | | d_right . channels ( ) > 1 ) <nl> { <nl> cout < < " BM doesn ' t support color images \ n " ; <nl> void App : : run ( ) <nl> } <nl> bm ( d_left , d_right , d_disp ) ; <nl> break ; <nl> - case Params : : BP : <nl> + case BP : <nl> bp ( d_left , d_right , d_disp ) ; <nl> break ; <nl> - case Params : : CSBP : <nl> + case CSBP : <nl> csbp ( d_left , d_right , d_disp ) ; <nl> break ; <nl> } <nl> - ocl : : finish ( ) ; <nl> - workEnd ( ) ; <nl> - <nl> / / Show results <nl> d_disp . download ( disp ) ; <nl> - if ( p . method ! = Params : : BM ) <nl> + workEnd ( ) ; <nl> + if ( method ! = BM ) <nl> { <nl> disp . convertTo ( disp , 0 ) ; <nl> } <nl> putText ( disp , text ( ) , Point ( 5 , 25 ) , FONT_HERSHEY_SIMPLEX , 1 . 0 , Scalar : : all ( 255 ) ) ; <nl> imshow ( " disparity " , disp ) ; <nl> - <nl> + if ( ! written ) <nl> + { <nl> + imwrite ( out_img , disp ) ; <nl> + written = true ; <nl> + } <nl> handleKey ( ( char ) waitKey ( 3 ) ) ; <nl> } <nl> } <nl> void App : : printParams ( ) const <nl> cout < < " mmm Parameters mmm \ n " ; <nl> cout < < " image_size : ( " < < left . cols < < " , " < < left . rows < < " ) \ n " ; <nl> cout < < " image_channels : " < < left . channels ( ) < < endl ; <nl> - cout < < " method : " < < p . method_str ( ) < < endl <nl> - < < " ndisp : " < < p . ndisp < < endl ; <nl> - switch ( p . method ) <nl> + cout < < " method : " < < method_str ( ) < < endl <nl> + < < " ndisp : " < < ndisp < < endl ; <nl> + switch ( method ) <nl> { <nl> - case Params : : BM : <nl> + case BM : <nl> cout < < " win_size : " < < bm . winSize < < endl ; <nl> cout < < " prefilter_sobel : " < < bm . preset < < endl ; <nl> break ; <nl> - case Params : : BP : <nl> + case BP : <nl> cout < < " iter_count : " < < bp . iters < < endl ; <nl> cout < < " level_count : " < < bp . levels < < endl ; <nl> break ; <nl> - case Params : : CSBP : <nl> + case CSBP : <nl> cout < < " iter_count : " < < csbp . iters < < endl ; <nl> cout < < " level_count : " < < csbp . levels < < endl ; <nl> break ; <nl> void App : : handleKey ( char key ) <nl> case 27 : <nl> running = false ; <nl> break ; <nl> - case ' p ' : case ' P ' : <nl> + case ' p ' : <nl> + case ' P ' : <nl> printParams ( ) ; <nl> break ; <nl> - case ' g ' : case ' G ' : <nl> - if ( left . channels ( ) = = 1 & & p . method ! = Params : : BM ) <nl> + case ' g ' : <nl> + case ' G ' : <nl> + if ( left . channels ( ) = = 1 & & method ! = BM ) <nl> { <nl> left = left_src ; <nl> right = right_src ; <nl> void App : : handleKey ( char key ) <nl> imshow ( " left " , left ) ; <nl> imshow ( " right " , right ) ; <nl> break ; <nl> - case ' m ' : case ' M ' : <nl> - switch ( p . method ) <nl> + case ' m ' : <nl> + case ' M ' : <nl> + switch ( method ) <nl> { <nl> - case Params : : BM : <nl> - p . method = Params : : BP ; <nl> + case BM : <nl> + method = BP ; <nl> break ; <nl> - case Params : : BP : <nl> - p . method = Params : : CSBP ; <nl> + case BP : <nl> + method = CSBP ; <nl> break ; <nl> - case Params : : CSBP : <nl> - p . method = Params : : BM ; <nl> + case CSBP : <nl> + method = BM ; <nl> break ; <nl> } <nl> - cout < < " method : " < < p . method_str ( ) < < endl ; <nl> + cout < < " method : " < < method_str ( ) < < endl ; <nl> break ; <nl> - case ' s ' : case ' S ' : <nl> - if ( p . method = = Params : : BM ) <nl> + case ' s ' : <nl> + case ' S ' : <nl> + if ( method = = BM ) <nl> { <nl> switch ( bm . preset ) <nl> { <nl> void App : : handleKey ( char key ) <nl> } <nl> break ; <nl> case ' 1 ' : <nl> - p . ndisp = p . ndisp = = 1 ? 8 : p . ndisp + 8 ; <nl> - cout < < " ndisp : " < < p . ndisp < < endl ; <nl> - bm . ndisp = p . ndisp ; <nl> - bp . ndisp = p . ndisp ; <nl> - csbp . ndisp = p . ndisp ; <nl> + ndisp = = 1 ? ndisp = 8 : ndisp + = 8 ; <nl> + cout < < " ndisp : " < < ndisp < < endl ; <nl> + bm . ndisp = ndisp ; <nl> + bp . ndisp = ndisp ; <nl> + csbp . ndisp = ndisp ; <nl> break ; <nl> - case ' q ' : case ' Q ' : <nl> - p . ndisp = max ( p . ndisp - 8 , 1 ) ; <nl> - cout < < " ndisp : " < < p . ndisp < < endl ; <nl> - bm . ndisp = p . ndisp ; <nl> - bp . ndisp = p . ndisp ; <nl> - csbp . ndisp = p . ndisp ; <nl> + case ' q ' : <nl> + case ' Q ' : <nl> + ndisp = max ( ndisp - 8 , 1 ) ; <nl> + cout < < " ndisp : " < < ndisp < < endl ; <nl> + bm . ndisp = ndisp ; <nl> + bp . ndisp = ndisp ; <nl> + csbp . ndisp = ndisp ; <nl> break ; <nl> case ' 2 ' : <nl> - if ( p . method = = Params : : BM ) <nl> + if ( method = = BM ) <nl> { <nl> bm . winSize = min ( bm . winSize + 1 , 51 ) ; <nl> cout < < " win_size : " < < bm . winSize < < endl ; <nl> } <nl> break ; <nl> - case ' w ' : case ' W ' : <nl> - if ( p . method = = Params : : BM ) <nl> + case ' w ' : <nl> + case ' W ' : <nl> + if ( method = = BM ) <nl> { <nl> bm . winSize = max ( bm . winSize - 1 , 2 ) ; <nl> cout < < " win_size : " < < bm . winSize < < endl ; <nl> } <nl> break ; <nl> case ' 3 ' : <nl> - if ( p . method = = Params : : BP ) <nl> + if ( method = = BP ) <nl> { <nl> bp . iters + = 1 ; <nl> cout < < " iter_count : " < < bp . iters < < endl ; <nl> } <nl> - else if ( p . method = = Params : : CSBP ) <nl> + else if ( method = = CSBP ) <nl> { <nl> csbp . iters + = 1 ; <nl> cout < < " iter_count : " < < csbp . iters < < endl ; <nl> } <nl> break ; <nl> - case ' e ' : case ' E ' : <nl> - if ( p . method = = Params : : BP ) <nl> + case ' e ' : <nl> + case ' E ' : <nl> + if ( method = = BP ) <nl> { <nl> bp . iters = max ( bp . iters - 1 , 1 ) ; <nl> cout < < " iter_count : " < < bp . iters < < endl ; <nl> } <nl> - else if ( p . method = = Params : : CSBP ) <nl> + else if ( method = = CSBP ) <nl> { <nl> csbp . iters = max ( csbp . iters - 1 , 1 ) ; <nl> cout < < " iter_count : " < < csbp . iters < < endl ; <nl> } <nl> break ; <nl> case ' 4 ' : <nl> - if ( p . method = = Params : : BP ) <nl> + if ( method = = BP ) <nl> { <nl> bp . levels + = 1 ; <nl> cout < < " level_count : " < < bp . levels < < endl ; <nl> } <nl> - else if ( p . method = = Params : : CSBP ) <nl> + else if ( method = = CSBP ) <nl> { <nl> csbp . levels + = 1 ; <nl> cout < < " level_count : " < < csbp . levels < < endl ; <nl> } <nl> break ; <nl> - case ' r ' : case ' R ' : <nl> - if ( p . method = = Params : : BP ) <nl> + case ' r ' : <nl> + case ' R ' : <nl> + if ( method = = BP ) <nl> { <nl> bp . levels = max ( bp . levels - 1 , 1 ) ; <nl> cout < < " level_count : " < < bp . levels < < endl ; <nl> } <nl> - else if ( p . method = = Params : : CSBP ) <nl> + else if ( method = = CSBP ) <nl> { <nl> csbp . levels = max ( csbp . levels - 1 , 1 ) ; <nl> cout < < " level_count : " < < csbp . levels < < endl ; <nl> mmm a / samples / ocl / surf_matcher . cpp <nl> ppp b / samples / ocl / surf_matcher . cpp <nl> <nl> - / * M / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / <nl> - / / IMPORTANT : READ BEFORE DOWNLOADING , COPYING , INSTALLING OR USING . <nl> - / / <nl> - / / By downloading , copying , installing or using the software you agree to this license . <nl> - / / If you do not agree to this license , do not download , install , <nl> - / / copy or use the software . <nl> - / / <nl> - / / <nl> - / / License Agreement <nl> - / / For Open Source Computer Vision Library <nl> - / / <nl> - / / Copyright ( C ) 2010 - 2012 , Multicoreware , Inc . , all rights reserved . <nl> - / / Copyright ( C ) 2010 - 2012 , Advanced Micro Devices , Inc . , all rights reserved . <nl> - / / Third party copyrights are property of their respective owners . <nl> - / / <nl> - / / @ Authors <nl> - / / Peng Xiao , pengxiao @ multicorewareinc . com <nl> - / / <nl> - / / Redistribution and use in source and binary forms , with or without modification , <nl> - / / are permitted provided that the following conditions are met : <nl> - / / <nl> - / / * Redistribution ' s of source code must retain the above copyright notice , <nl> - / / this list of conditions and the following disclaimer . <nl> - / / <nl> - / / * Redistribution ' s in binary form must reproduce the above copyright notice , <nl> - / / this list of conditions and the following disclaimer in the documentation <nl> - / / and / or other oclMaterials provided with the distribution . <nl> - / / <nl> - / / * The name of the copyright holders may not be used to endorse or promote products <nl> - / / derived from this software without specific prior written permission . <nl> - / / <nl> - / / This software is provided by the copyright holders and contributors as is and <nl> - / / any express or implied warranties , including , but not limited to , the implied <nl> - / / warranties of merchantability and fitness for a particular purpose are disclaimed . <nl> - / / In no event shall the Intel Corporation or contributors be liable for any direct , <nl> - / / indirect , incidental , special , exemplary , or consequential damages <nl> - / / ( including , but not limited to , procurement of substitute goods or services ; <nl> - / / loss of use , data , or profits ; or business interruption ) however caused <nl> - / / and on any theory of liability , whether in contract , strict liability , <nl> - / / or tort ( including negligence or otherwise ) arising in any way out of <nl> - / / the use of this software , even if advised of the possibility of such damage . <nl> - / / <nl> - / / M * / <nl> - <nl> # include < iostream > <nl> # include < stdio . h > <nl> # include " opencv2 / core / core . hpp " <nl> const float GOOD_PORTION = 0 . 15f ; <nl> <nl> namespace <nl> { <nl> - void help ( ) ; <nl> - <nl> - void help ( ) <nl> - { <nl> - std : : cout < < " \ nThis program demonstrates using SURF_OCL features detector and descriptor extractor " < < std : : endl ; <nl> - std : : cout < < " \ nUsage : \ n \ tsurf_matcher - - left < image1 > - - right < image2 > [ - c ] " < < std : : endl ; <nl> - std : : cout < < " \ nExample : \ n \ tsurf_matcher - - left box . png - - right box_in_scene . png " < < std : : endl ; <nl> - } <nl> <nl> int64 work_begin = 0 ; <nl> int64 work_end = 0 ; <nl> <nl> - void workBegin ( ) <nl> - { <nl> + void workBegin ( ) <nl> + { <nl> work_begin = getTickCount ( ) ; <nl> } <nl> void workEnd ( ) <nl> { <nl> work_end = getTickCount ( ) - work_begin ; <nl> } <nl> - double getTime ( ) { <nl> + double getTime ( ) <nl> + { <nl> return work_end / ( ( double ) cvGetTickFrequency ( ) * 1000 . ) ; <nl> } <nl> <nl> struct SURFMatcher <nl> Mat drawGoodMatches ( <nl> const Mat & cpu_img1 , <nl> const Mat & cpu_img2 , <nl> - const vector < KeyPoint > & keypoints1 , <nl> - const vector < KeyPoint > & keypoints2 , <nl> + const vector < KeyPoint > & keypoints1 , <nl> + const vector < KeyPoint > & keypoints2 , <nl> vector < DMatch > & matches , <nl> vector < Point2f > & scene_corners_ <nl> - ) <nl> + ) <nl> { <nl> - / / - - Sort matches and preserve top 10 % matches <nl> + / / - - Sort matches and preserve top 10 % matches <nl> std : : sort ( matches . begin ( ) , matches . end ( ) ) ; <nl> std : : vector < DMatch > good_matches ; <nl> double minDist = matches . front ( ) . distance , <nl> - maxDist = matches . back ( ) . distance ; <nl> + maxDist = matches . back ( ) . distance ; <nl> <nl> const int ptsPairs = std : : min ( GOOD_PTS_MAX , ( int ) ( matches . size ( ) * GOOD_PORTION ) ) ; <nl> for ( int i = 0 ; i < ptsPairs ; i + + ) <nl> Mat drawGoodMatches ( <nl> / / drawing the results <nl> Mat img_matches ; <nl> drawMatches ( cpu_img1 , keypoints1 , cpu_img2 , keypoints2 , <nl> - good_matches , img_matches , Scalar : : all ( - 1 ) , Scalar : : all ( - 1 ) , <nl> - vector < char > ( ) , DrawMatchesFlags : : NOT_DRAW_SINGLE_POINTS ) ; <nl> + good_matches , img_matches , Scalar : : all ( - 1 ) , Scalar : : all ( - 1 ) , <nl> + vector < char > ( ) , DrawMatchesFlags : : NOT_DRAW_SINGLE_POINTS ) ; <nl> <nl> / / - - Localize the object <nl> std : : vector < Point2f > obj ; <nl> Mat drawGoodMatches ( <nl> } <nl> / / - - Get the corners from the image_1 ( the object to be " detected " ) <nl> std : : vector < Point2f > obj_corners ( 4 ) ; <nl> - obj_corners [ 0 ] = cvPoint ( 0 , 0 ) ; obj_corners [ 1 ] = cvPoint ( cpu_img1 . cols , 0 ) ; <nl> - obj_corners [ 2 ] = cvPoint ( cpu_img1 . cols , cpu_img1 . rows ) ; obj_corners [ 3 ] = cvPoint ( 0 , cpu_img1 . rows ) ; <nl> + obj_corners [ 0 ] = cvPoint ( 0 , 0 ) ; <nl> + obj_corners [ 1 ] = cvPoint ( cpu_img1 . cols , 0 ) ; <nl> + obj_corners [ 2 ] = cvPoint ( cpu_img1 . cols , cpu_img1 . rows ) ; <nl> + obj_corners [ 3 ] = cvPoint ( 0 , cpu_img1 . rows ) ; <nl> std : : vector < Point2f > scene_corners ( 4 ) ; <nl> - <nl> + <nl> Mat H = findHomography ( obj , scene , CV_RANSAC ) ; <nl> perspectiveTransform ( obj_corners , scene_corners , H ) ; <nl> <nl> scene_corners_ = scene_corners ; <nl> - <nl> + <nl> / / - - Draw lines between the corners ( the mapped object in the scene - image_2 ) <nl> - line ( img_matches , <nl> - scene_corners [ 0 ] + Point2f ( ( float ) cpu_img1 . cols , 0 ) , scene_corners [ 1 ] + Point2f ( ( float ) cpu_img1 . cols , 0 ) , <nl> - Scalar ( 0 , 255 , 0 ) , 2 , CV_AA ) ; <nl> - line ( img_matches , <nl> - scene_corners [ 1 ] + Point2f ( ( float ) cpu_img1 . cols , 0 ) , scene_corners [ 2 ] + Point2f ( ( float ) cpu_img1 . cols , 0 ) , <nl> - Scalar ( 0 , 255 , 0 ) , 2 , CV_AA ) ; <nl> - line ( img_matches , <nl> - scene_corners [ 2 ] + Point2f ( ( float ) cpu_img1 . cols , 0 ) , scene_corners [ 3 ] + Point2f ( ( float ) cpu_img1 . cols , 0 ) , <nl> - Scalar ( 0 , 255 , 0 ) , 2 , CV_AA ) ; <nl> - line ( img_matches , <nl> - scene_corners [ 3 ] + Point2f ( ( float ) cpu_img1 . cols , 0 ) , scene_corners [ 0 ] + Point2f ( ( float ) cpu_img1 . cols , 0 ) , <nl> - Scalar ( 0 , 255 , 0 ) , 2 , CV_AA ) ; <nl> + line ( img_matches , <nl> + scene_corners [ 0 ] + Point2f ( ( float ) cpu_img1 . cols , 0 ) , scene_corners [ 1 ] + Point2f ( ( float ) cpu_img1 . cols , 0 ) , <nl> + Scalar ( 0 , 255 , 0 ) , 2 , CV_AA ) ; <nl> + line ( img_matches , <nl> + scene_corners [ 1 ] + Point2f ( ( float ) cpu_img1 . cols , 0 ) , scene_corners [ 2 ] + Point2f ( ( float ) cpu_img1 . cols , 0 ) , <nl> + Scalar ( 0 , 255 , 0 ) , 2 , CV_AA ) ; <nl> + line ( img_matches , <nl> + scene_corners [ 2 ] + Point2f ( ( float ) cpu_img1 . cols , 0 ) , scene_corners [ 3 ] + Point2f ( ( float ) cpu_img1 . cols , 0 ) , <nl> + Scalar ( 0 , 255 , 0 ) , 2 , CV_AA ) ; <nl> + line ( img_matches , <nl> + scene_corners [ 3 ] + Point2f ( ( float ) cpu_img1 . cols , 0 ) , scene_corners [ 0 ] + Point2f ( ( float ) cpu_img1 . cols , 0 ) , <nl> + Scalar ( 0 , 255 , 0 ) , 2 , CV_AA ) ; <nl> return img_matches ; <nl> } <nl> <nl> Mat drawGoodMatches ( <nl> / / use cpu findHomography interface to calculate the transformation matrix <nl> int main ( int argc , char * argv [ ] ) <nl> { <nl> + const char * keys = <nl> + " { h | help | false | print help message } " <nl> + " { l | left | | specify left image } " <nl> + " { r | right | | specify right image } " <nl> + " { o | output | SURF_output . jpg | specify output save path ( only works in CPU or GPU only mode ) } " <nl> + " { c | use_cpu | false | use CPU algorithms } " <nl> + " { a | use_all | false | use both CPU and GPU algorithms } " ; <nl> + CommandLineParser cmd ( argc , argv , keys ) ; <nl> + if ( cmd . get < bool > ( " help " ) ) <nl> + { <nl> + std : : cout < < " Avaible options : " < < std : : endl ; <nl> + cmd . printParams ( ) ; <nl> + return 0 ; <nl> + } <nl> + <nl> vector < cv : : ocl : : Info > info ; <nl> if ( cv : : ocl : : getDevice ( info ) = = 0 ) <nl> { <nl> int main ( int argc , char * argv [ ] ) <nl> <nl> Mat cpu_img1 , cpu_img2 , cpu_img1_grey , cpu_img2_grey ; <nl> oclMat img1 , img2 ; <nl> - bool useCPU = false ; <nl> + bool useCPU = cmd . get < bool > ( " c " ) ; <nl> bool useGPU = false ; <nl> - bool useALL = false ; <nl> + bool useALL = cmd . get < bool > ( " a " ) ; <nl> + <nl> + string outpath = cmd . get < std : : string > ( " o " ) ; <nl> <nl> - for ( int i = 1 ; i < argc ; + + i ) <nl> + cpu_img1 = imread ( cmd . get < std : : string > ( " l " ) ) ; <nl> + CV_Assert ( ! cpu_img1 . empty ( ) ) ; <nl> + cvtColor ( cpu_img1 , cpu_img1_grey , CV_BGR2GRAY ) ; <nl> + img1 = cpu_img1_grey ; <nl> + <nl> + cpu_img2 = imread ( cmd . get < std : : string > ( " r " ) ) ; <nl> + CV_Assert ( ! cpu_img2 . empty ( ) ) ; <nl> + cvtColor ( cpu_img2 , cpu_img2_grey , CV_BGR2GRAY ) ; <nl> + img2 = cpu_img2_grey ; <nl> + <nl> + if ( useALL ) <nl> { <nl> - if ( string ( argv [ i ] ) = = " - - left " ) <nl> - { <nl> - cpu_img1 = imread ( argv [ + + i ] ) ; <nl> - CV_Assert ( ! cpu_img1 . empty ( ) ) ; <nl> - cvtColor ( cpu_img1 , cpu_img1_grey , CV_BGR2GRAY ) ; <nl> - img1 = cpu_img1_grey ; <nl> - } <nl> - else if ( string ( argv [ i ] ) = = " - - right " ) <nl> - { <nl> - cpu_img2 = imread ( argv [ + + i ] ) ; <nl> - CV_Assert ( ! cpu_img2 . empty ( ) ) ; <nl> - cvtColor ( cpu_img2 , cpu_img2_grey , CV_BGR2GRAY ) ; <nl> - img2 = cpu_img2_grey ; <nl> - } <nl> - else if ( string ( argv [ i ] ) = = " - c " ) <nl> - { <nl> - useCPU = true ; <nl> - useGPU = false ; <nl> - useALL = false ; <nl> - } else if ( string ( argv [ i ] ) = = " - g " ) <nl> - { <nl> - useGPU = true ; <nl> - useCPU = false ; <nl> - useALL = false ; <nl> - } else if ( string ( argv [ i ] ) = = " - a " ) <nl> - { <nl> - useALL = true ; <nl> - useCPU = false ; <nl> - useGPU = false ; <nl> - } <nl> - else if ( string ( argv [ i ] ) = = " - - help " ) <nl> - { <nl> - help ( ) ; <nl> - return - 1 ; <nl> - } <nl> + useCPU = false ; <nl> + useGPU = false ; <nl> } <nl> + else if ( useCPU = = false & & useALL = = false ) <nl> + { <nl> + useGPU = true ; <nl> + } <nl> + <nl> if ( ! useCPU ) <nl> { <nl> std : : cout <nl> - < < " Device name : " <nl> - < < info [ 0 ] . DeviceName [ 0 ] <nl> - < < std : : endl ; <nl> + < < " Device name : " <nl> + < < info [ 0 ] . DeviceName [ 0 ] <nl> + < < std : : endl ; <nl> } <nl> double surf_time = 0 . ; <nl> <nl> int main ( int argc , char * argv [ ] ) <nl> / / instantiate detectors / matchers <nl> SURFDetector < SURF > cpp_surf ; <nl> SURFDetector < SURF_OCL > ocl_surf ; <nl> - <nl> + <nl> SURFMatcher < BFMatcher > cpp_matcher ; <nl> SURFMatcher < BFMatcher_OCL > ocl_matcher ; <nl> <nl> / / - - start of timing section <nl> - if ( useCPU ) <nl> + if ( useCPU ) <nl> { <nl> for ( int i = 0 ; i < = LOOP_NUM ; i + + ) <nl> { <nl> int main ( int argc , char * argv [ ] ) <nl> <nl> surf_time = getTime ( ) ; <nl> std : : cout < < " SURF run time : " < < surf_time / LOOP_NUM < < " ms " < < std : : endl < < " \ n " ; <nl> - } else <nl> + } <nl> + else <nl> { <nl> / / cpu runs <nl> for ( int i = 0 ; i < = LOOP_NUM ; i + + ) <nl> int main ( int argc , char * argv [ ] ) <nl> for ( size_t i = 0 ; i < cpu_corner . size ( ) ; i + + ) <nl> { <nl> if ( ( std : : abs ( cpu_corner [ i ] . x - gpu_corner [ i ] . x ) > 10 ) <nl> - | | ( std : : abs ( cpu_corner [ i ] . y - gpu_corner [ i ] . y ) > 10 ) ) <nl> + | | ( std : : abs ( cpu_corner [ i ] . y - gpu_corner [ i ] . y ) > 10 ) ) <nl> { <nl> std : : cout < < " Failed \ n " ; <nl> result = false ; <nl> break ; <nl> } <nl> result = true ; <nl> - } <nl> + } <nl> if ( result ) <nl> std : : cout < < " Passed \ n " ; <nl> } <nl> int main ( int argc , char * argv [ ] ) <nl> { <nl> namedWindow ( " cpu surf matches " , 0 ) ; <nl> imshow ( " cpu surf matches " , img_matches ) ; <nl> + imwrite ( outpath , img_matches ) ; <nl> } <nl> else if ( useGPU ) <nl> { <nl> namedWindow ( " ocl surf matches " , 0 ) ; <nl> imshow ( " ocl surf matches " , img_matches ) ; <nl> - } else <nl> + imwrite ( outpath , img_matches ) ; <nl> + } <nl> + else <nl> { <nl> namedWindow ( " cpu surf matches " , 0 ) ; <nl> imshow ( " cpu surf matches " , img_matches ) ; <nl> new file mode 100644 <nl> index 00000000000 . . cff9692ed67 <nl> mmm / dev / null <nl> ppp b / samples / ocl / tvl1_optical_flow . cpp <nl> <nl> + # include < iostream > <nl> + # include < vector > <nl> + # include < iomanip > <nl> + <nl> + # include " opencv2 / highgui / highgui . hpp " <nl> + # include " opencv2 / ocl / ocl . hpp " <nl> + # include " opencv2 / video / video . hpp " <nl> + <nl> + using namespace std ; <nl> + using namespace cv ; <nl> + using namespace cv : : ocl ; <nl> + <nl> + typedef unsigned char uchar ; <nl> + # define LOOP_NUM 10 <nl> + int64 work_begin = 0 ; <nl> + int64 work_end = 0 ; <nl> + <nl> + static void workBegin ( ) <nl> + { <nl> + work_begin = getTickCount ( ) ; <nl> + } <nl> + static void workEnd ( ) <nl> + { <nl> + work_end + = ( getTickCount ( ) - work_begin ) ; <nl> + } <nl> + static double getTime ( ) <nl> + { <nl> + return work_end * 1000 . / getTickFrequency ( ) ; <nl> + } <nl> + <nl> + template < typename T > inline T clamp ( T x , T a , T b ) <nl> + { <nl> + return ( ( x ) > ( a ) ? ( ( x ) < ( b ) ? ( x ) : ( b ) ) : ( a ) ) ; <nl> + } <nl> + <nl> + template < typename T > inline T mapValue ( T x , T a , T b , T c , T d ) <nl> + { <nl> + x = clamp ( x , a , b ) ; <nl> + return c + ( d - c ) * ( x - a ) / ( b - a ) ; <nl> + } <nl> + <nl> + static void getFlowField ( const Mat & u , const Mat & v , Mat & flowField ) <nl> + { <nl> + float maxDisplacement = 1 . 0f ; <nl> + <nl> + for ( int i = 0 ; i < u . rows ; + + i ) <nl> + { <nl> + const float * ptr_u = u . ptr < float > ( i ) ; <nl> + const float * ptr_v = v . ptr < float > ( i ) ; <nl> + <nl> + for ( int j = 0 ; j < u . cols ; + + j ) <nl> + { <nl> + float d = max ( fabsf ( ptr_u [ j ] ) , fabsf ( ptr_v [ j ] ) ) ; <nl> + <nl> + if ( d > maxDisplacement ) <nl> + maxDisplacement = d ; <nl> + } <nl> + } <nl> + <nl> + flowField . create ( u . size ( ) , CV_8UC4 ) ; <nl> + <nl> + for ( int i = 0 ; i < flowField . rows ; + + i ) <nl> + { <nl> + const float * ptr_u = u . ptr < float > ( i ) ; <nl> + const float * ptr_v = v . ptr < float > ( i ) ; <nl> + <nl> + <nl> + Vec4b * row = flowField . ptr < Vec4b > ( i ) ; <nl> + <nl> + for ( int j = 0 ; j < flowField . cols ; + + j ) <nl> + { <nl> + row [ j ] [ 0 ] = 0 ; <nl> + row [ j ] [ 1 ] = static_cast < unsigned char > ( mapValue ( - ptr_v [ j ] , - maxDisplacement , maxDisplacement , 0 . 0f , 255 . 0f ) ) ; <nl> + row [ j ] [ 2 ] = static_cast < unsigned char > ( mapValue ( ptr_u [ j ] , - maxDisplacement , maxDisplacement , 0 . 0f , 255 . 0f ) ) ; <nl> + row [ j ] [ 3 ] = 255 ; <nl> + } <nl> + } <nl> + } <nl> + <nl> + <nl> + int main ( int argc , const char * argv [ ] ) <nl> + { <nl> + static std : : vector < Info > ocl_info ; <nl> + ocl : : getDevice ( ocl_info ) ; <nl> + / / if you want to use undefault device , set it here <nl> + setDevice ( ocl_info [ 0 ] ) ; <nl> + <nl> + / / set this to save kernel compile time from second time you run <nl> + ocl : : setBinpath ( " . / " ) ; <nl> + const char * keys = <nl> + " { h | help | false | print help message } " <nl> + " { l | left | | specify left image } " <nl> + " { r | right | | specify right image } " <nl> + " { o | output | tvl1_output . jpg | specify output save path } " <nl> + " { c | camera | 0 | enable camera capturing } " <nl> + " { s | use_cpu | false | use cpu or gpu to process the image } " <nl> + " { v | video | | use video as input } " ; <nl> + <nl> + CommandLineParser cmd ( argc , argv , keys ) ; <nl> + <nl> + if ( cmd . get < bool > ( " help " ) ) <nl> + { <nl> + cout < < " Usage : pyrlk_optical_flow [ options ] " < < endl ; <nl> + cout < < " Avaible options : " < < endl ; <nl> + cmd . printParams ( ) ; <nl> + return 0 ; <nl> + } <nl> + <nl> + bool defaultPicturesFail = false ; <nl> + string fname0 = cmd . get < string > ( " l " ) ; <nl> + string fname1 = cmd . get < string > ( " r " ) ; <nl> + string vdofile = cmd . get < string > ( " v " ) ; <nl> + string outpath = cmd . get < string > ( " o " ) ; <nl> + bool useCPU = cmd . get < bool > ( " s " ) ; <nl> + bool useCamera = cmd . get < bool > ( " c " ) ; <nl> + int inputName = cmd . get < int > ( " c " ) ; <nl> + <nl> + Mat frame0 = imread ( fname0 , cv : : IMREAD_GRAYSCALE ) ; <nl> + Mat frame1 = imread ( fname1 , cv : : IMREAD_GRAYSCALE ) ; <nl> + cv : : Ptr < cv : : DenseOpticalFlow > alg = cv : : createOptFlow_DualTVL1 ( ) ; <nl> + cv : : ocl : : OpticalFlowDual_TVL1_OCL d_alg ; <nl> + <nl> + <nl> + Mat flow , show_flow ; <nl> + Mat flow_vec [ 2 ] ; <nl> + if ( frame0 . empty ( ) | | frame1 . empty ( ) ) <nl> + { <nl> + useCamera = true ; <nl> + defaultPicturesFail = true ; <nl> + CvCapture * capture = 0 ; <nl> + capture = cvCaptureFromCAM ( inputName ) ; <nl> + if ( ! capture ) <nl> + { <nl> + cout < < " Can ' t load input images " < < endl ; <nl> + return - 1 ; <nl> + } <nl> + } <nl> + <nl> + <nl> + if ( useCamera ) <nl> + { <nl> + CvCapture * capture = 0 ; <nl> + Mat frame , frameCopy ; <nl> + Mat frame0Gray , frame1Gray ; <nl> + Mat ptr0 , ptr1 ; <nl> + <nl> + if ( vdofile = = " " ) <nl> + capture = cvCaptureFromCAM ( inputName ) ; <nl> + else <nl> + capture = cvCreateFileCapture ( vdofile . c_str ( ) ) ; <nl> + <nl> + int c = inputName ; <nl> + if ( ! capture ) <nl> + { <nl> + if ( vdofile = = " " ) <nl> + cout < < " Capture from CAM " < < c < < " didn ' t work " < < endl ; <nl> + else <nl> + cout < < " Capture from file " < < vdofile < < " failed " < < endl ; <nl> + if ( defaultPicturesFail ) <nl> + { <nl> + return - 1 ; <nl> + } <nl> + goto nocamera ; <nl> + } <nl> + <nl> + cout < < " In capture . . . " < < endl ; <nl> + for ( int i = 0 ; ; i + + ) <nl> + { <nl> + frame = cvQueryFrame ( capture ) ; <nl> + if ( frame . empty ( ) ) <nl> + break ; <nl> + <nl> + if ( i = = 0 ) <nl> + { <nl> + frame . copyTo ( frame0 ) ; <nl> + cvtColor ( frame0 , frame0Gray , COLOR_BGR2GRAY ) ; <nl> + } <nl> + else <nl> + { <nl> + if ( i % 2 = = 1 ) <nl> + { <nl> + frame . copyTo ( frame1 ) ; <nl> + cvtColor ( frame1 , frame1Gray , COLOR_BGR2GRAY ) ; <nl> + ptr0 = frame0Gray ; <nl> + ptr1 = frame1Gray ; <nl> + } <nl> + else <nl> + { <nl> + frame . copyTo ( frame0 ) ; <nl> + cvtColor ( frame0 , frame0Gray , COLOR_BGR2GRAY ) ; <nl> + ptr0 = frame1Gray ; <nl> + ptr1 = frame0Gray ; <nl> + } <nl> + <nl> + if ( useCPU ) <nl> + { <nl> + alg - > calc ( ptr0 , ptr1 , flow ) ; <nl> + split ( flow , flow_vec ) ; <nl> + } <nl> + else <nl> + { <nl> + oclMat d_flowx , d_flowy ; <nl> + d_alg ( oclMat ( ptr0 ) , oclMat ( ptr1 ) , d_flowx , d_flowy ) ; <nl> + d_flowx . download ( flow_vec [ 0 ] ) ; <nl> + d_flowy . download ( flow_vec [ 1 ] ) ; <nl> + } <nl> + if ( i % 2 = = 1 ) <nl> + frame1 . copyTo ( frameCopy ) ; <nl> + else <nl> + frame0 . copyTo ( frameCopy ) ; <nl> + getFlowField ( flow_vec [ 0 ] , flow_vec [ 1 ] , show_flow ) ; <nl> + imshow ( " PyrLK [ Sparse ] " , show_flow ) ; <nl> + } <nl> + <nl> + if ( waitKey ( 10 ) > = 0 ) <nl> + goto _cleanup_ ; <nl> + } <nl> + <nl> + waitKey ( 0 ) ; <nl> + <nl> + _cleanup_ : <nl> + cvReleaseCapture ( & capture ) ; <nl> + } <nl> + else <nl> + { <nl> + nocamera : <nl> + oclMat d_flowx , d_flowy ; <nl> + for ( int i = 0 ; i < = LOOP_NUM ; i + + ) <nl> + { <nl> + cout < < " loop " < < i < < endl ; <nl> + <nl> + if ( i > 0 ) workBegin ( ) ; <nl> + if ( useCPU ) <nl> + { <nl> + alg - > calc ( frame0 , frame1 , flow ) ; <nl> + split ( flow , flow_vec ) ; <nl> + } <nl> + else <nl> + { <nl> + d_alg ( oclMat ( frame0 ) , oclMat ( frame1 ) , d_flowx , d_flowy ) ; <nl> + d_flowx . download ( flow_vec [ 0 ] ) ; <nl> + d_flowy . download ( flow_vec [ 1 ] ) ; <nl> + } <nl> + if ( i > 0 & & i < = LOOP_NUM ) <nl> + workEnd ( ) ; <nl> + <nl> + if ( i = = LOOP_NUM ) <nl> + { <nl> + if ( useCPU ) <nl> + cout < < " average CPU time ( noCamera ) : " ; <nl> + else <nl> + cout < < " average GPU time ( noCamera ) : " ; <nl> + cout < < getTime ( ) / LOOP_NUM < < " ms " < < endl ; <nl> + <nl> + getFlowField ( flow_vec [ 0 ] , flow_vec [ 1 ] , show_flow ) ; <nl> + imshow ( " PyrLK [ Sparse ] " , show_flow ) ; <nl> + imwrite ( outpath , show_flow ) ; <nl> + } <nl> + } <nl> + } <nl> + <nl> + waitKey ( ) ; <nl> + <nl> + return 0 ; <nl> + } <nl> \ No newline at end of file <nl>
Merge pull request from bitwangyaoyao : 2 . 4_tests
opencv/opencv
4ed3d33dd7210fbaaba82998c43cd61899d641b9
2013-06-24T08:11:04Z
mmm a / lib / Sema / CMakeLists . txt <nl> ppp b / lib / Sema / CMakeLists . txt <nl> add_swift_library ( swiftSema STATIC <nl> TypeCheckNameLookup . cpp <nl> TypeCheckPattern . cpp <nl> TypeCheckProtocol . cpp <nl> + TypeCheckProtocolInference . cpp <nl> TypeCheckREPL . cpp <nl> TypeCheckRequest . cpp <nl> TypeCheckStmt . cpp <nl> mmm a / lib / Sema / DerivedConformances . h <nl> ppp b / lib / Sema / DerivedConformances . h <nl> <nl> <nl> namespace swift { <nl> class Decl ; <nl> + class DeclRefExpr ; <nl> class FuncDecl ; <nl> class NominalTypeDecl ; <nl> + class PatternBindingDecl ; <nl> class Type ; <nl> class TypeChecker ; <nl> class ValueDecl ; <nl> + class VarDecl ; <nl> <nl> namespace DerivedConformance { <nl> <nl> mmm a / lib / Sema / TypeCheckProtocol . cpp <nl> ppp b / lib / Sema / TypeCheckProtocol . cpp <nl> <nl> / / whether a given type conforms to a given protocol . <nl> / / = = = mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - = = = / / <nl> <nl> + # include " TypeCheckProtocol . h " <nl> # include " ConstraintSystem . h " <nl> # include " DerivedConformances . h " <nl> # include " MiscDiagnostics . h " <nl> <nl> # include " swift / ClangImporter / ClangModule . h " <nl> # include " swift / Sema / IDETypeChecking . h " <nl> # include " swift / Serialization / SerializedModuleLoader . h " <nl> - # include " llvm / ADT / ScopedHashTable . h " <nl> # include " llvm / ADT / SmallString . h " <nl> # include " llvm / ADT / Statistic . h " <nl> # include " llvm / Support / Compiler . h " <nl> STATISTIC ( NumRequirementEnvironments , " # of requirement environments " ) ; <nl> using namespace swift ; <nl> <nl> namespace { <nl> - struct RequirementMatch ; <nl> - struct RequirementCheck ; <nl> - <nl> / / / Describes the environment of a requirement that will be used when <nl> / / / matching witnesses against the requirement and to form the resulting <nl> / / / \ c Witness value . <nl> namespace { <nl> } <nl> } ; <nl> <nl> - class WitnessChecker { <nl> - protected : <nl> - TypeChecker & TC ; <nl> - ProtocolDecl * Proto ; <nl> - Type Adoptee ; <nl> - / / The conforming context , either a nominal type or extension . <nl> - DeclContext * DC ; <nl> - <nl> - / / An auxiliary lookup table to be used for witnesses remapped via <nl> - / / @ _implements ( Protocol , DeclName ) <nl> - llvm : : DenseMap < DeclName , llvm : : TinyPtrVector < ValueDecl * > > ImplementsTable ; <nl> - <nl> - WitnessChecker ( TypeChecker & tc , ProtocolDecl * proto , <nl> - Type adoptee , DeclContext * dc ) <nl> - : TC ( tc ) , Proto ( proto ) , Adoptee ( adoptee ) , DC ( dc ) { <nl> - if ( auto N = DC - > getAsNominalTypeOrNominalTypeExtensionContext ( ) ) { <nl> - for ( auto D : N - > getMembers ( ) ) { <nl> - if ( auto V = dyn_cast < ValueDecl > ( D ) ) { <nl> - if ( ! V - > hasName ( ) ) <nl> - continue ; <nl> - if ( auto A = V - > getAttrs ( ) . getAttribute < ImplementsAttr > ( ) ) { <nl> - A - > getMemberName ( ) . addToLookupTable ( ImplementsTable , V ) ; <nl> - } <nl> - } <nl> - } <nl> - } <nl> - } <nl> - <nl> - / / / Gather the value witnesses for the given requirement . <nl> - / / / <nl> - / / / \ param ignoringNames If non - null and there are no value <nl> - / / / witnesses with the correct full name , the results will reflect <nl> - / / / lookup for just the base name and the pointee will be set to <nl> - / / / \ c true . <nl> - SmallVector < ValueDecl * , 4 > lookupValueWitnesses ( ValueDecl * req , <nl> - bool * ignoringNames ) ; <nl> - <nl> - void lookupValueWitnessesViaImplementsAttr ( ValueDecl * req , <nl> - SmallVector < ValueDecl * , 4 > <nl> - & witnesses ) ; <nl> - <nl> - bool findBestWitness ( ValueDecl * requirement , <nl> - bool * ignoringNames , <nl> - NormalProtocolConformance * conformance , <nl> - SmallVectorImpl < RequirementMatch > & matches , <nl> - unsigned & numViable , <nl> - unsigned & bestIdx , <nl> - bool & doNotDiagnoseMatches ) ; <nl> - <nl> - bool checkWitnessAccess ( AccessScope & requiredAccessScope , <nl> - ValueDecl * requirement , <nl> - ValueDecl * witness , <nl> - bool * isSetter ) ; <nl> - <nl> - bool checkWitnessAvailability ( ValueDecl * requirement , <nl> - ValueDecl * witness , <nl> - AvailabilityContext * requirementInfo ) ; <nl> - <nl> - RequirementCheck checkWitness ( AccessScope requiredAccessScope , <nl> - ValueDecl * requirement , <nl> - const RequirementMatch & match ) ; <nl> - } ; <nl> - <nl> / / / \ brief The result of matching a particular declaration to a given <nl> / / / requirement . <nl> enum class MatchKind : unsigned char { <nl> namespace { <nl> <nl> return false ; <nl> } <nl> + } <nl> <nl> - / / / \ brief Describes a match between a requirement and a witness . <nl> - struct RequirementMatch { <nl> - RequirementMatch ( ValueDecl * witness , MatchKind kind , <nl> - Optional < RequirementEnvironment > & & env = None ) <nl> - : Witness ( witness ) , Kind ( kind ) , WitnessType ( ) , ReqEnv ( std : : move ( env ) ) { <nl> - assert ( ! hasWitnessType ( ) & & " Should have witness type " ) ; <nl> - } <nl> - <nl> - RequirementMatch ( ValueDecl * witness , MatchKind kind , <nl> - Type witnessType , <nl> - Optional < RequirementEnvironment > & & env = None , <nl> - ArrayRef < OptionalAdjustment > optionalAdjustments = { } ) <nl> - : Witness ( witness ) , Kind ( kind ) , WitnessType ( witnessType ) , <nl> - ReqEnv ( std : : move ( env ) ) , <nl> - OptionalAdjustments ( optionalAdjustments . begin ( ) , <nl> - optionalAdjustments . end ( ) ) <nl> - { <nl> - assert ( hasWitnessType ( ) = = ! witnessType . isNull ( ) & & <nl> - " Should ( or should not ) have witness type " ) ; <nl> - } <nl> + / / / \ brief Describes a match between a requirement and a witness . <nl> + struct swift : : RequirementMatch { <nl> + RequirementMatch ( ValueDecl * witness , MatchKind kind , <nl> + Optional < RequirementEnvironment > & & env = None ) <nl> + : Witness ( witness ) , Kind ( kind ) , WitnessType ( ) , ReqEnv ( std : : move ( env ) ) { <nl> + assert ( ! hasWitnessType ( ) & & " Should have witness type " ) ; <nl> + } <nl> + <nl> + RequirementMatch ( ValueDecl * witness , MatchKind kind , <nl> + Type witnessType , <nl> + Optional < RequirementEnvironment > & & env = None , <nl> + ArrayRef < OptionalAdjustment > optionalAdjustments = { } ) <nl> + : Witness ( witness ) , Kind ( kind ) , WitnessType ( witnessType ) , <nl> + ReqEnv ( std : : move ( env ) ) , <nl> + OptionalAdjustments ( optionalAdjustments . begin ( ) , <nl> + optionalAdjustments . end ( ) ) <nl> + { <nl> + assert ( hasWitnessType ( ) = = ! witnessType . isNull ( ) & & <nl> + " Should ( or should not ) have witness type " ) ; <nl> + } <nl> <nl> - / / / \ brief The witness that matches the ( implied ) requirement . <nl> - ValueDecl * Witness ; <nl> - <nl> - / / / \ brief The kind of match . <nl> - MatchKind Kind ; <nl> + / / / \ brief The witness that matches the ( implied ) requirement . <nl> + ValueDecl * Witness ; <nl> <nl> - / / / \ brief The type of the witness when it is referenced . <nl> - Type WitnessType ; <nl> + / / / \ brief The kind of match . <nl> + MatchKind Kind ; <nl> <nl> - / / / \ brief The requirement environment to use for the witness thunk . <nl> - Optional < RequirementEnvironment > ReqEnv ; <nl> + / / / \ brief The type of the witness when it is referenced . <nl> + Type WitnessType ; <nl> <nl> - / / / The set of optional adjustments performed on the witness . <nl> - SmallVector < OptionalAdjustment , 2 > OptionalAdjustments ; <nl> + / / / \ brief The requirement environment to use for the witness thunk . <nl> + Optional < RequirementEnvironment > ReqEnv ; <nl> <nl> - / / / \ brief Determine whether this match is viable . <nl> - bool isViable ( ) const { <nl> - switch ( Kind ) { <nl> - case MatchKind : : ExactMatch : <nl> - case MatchKind : : OptionalityConflict : <nl> - case MatchKind : : RenamedMatch : <nl> - return true ; <nl> + / / / The set of optional adjustments performed on the witness . <nl> + SmallVector < OptionalAdjustment , 2 > OptionalAdjustments ; <nl> <nl> - case MatchKind : : WitnessInvalid : <nl> - case MatchKind : : KindConflict : <nl> - case MatchKind : : TypeConflict : <nl> - case MatchKind : : StaticNonStaticConflict : <nl> - case MatchKind : : SettableConflict : <nl> - case MatchKind : : PrefixNonPrefixConflict : <nl> - case MatchKind : : PostfixNonPostfixConflict : <nl> - case MatchKind : : MutatingConflict : <nl> - case MatchKind : : NonMutatingConflict : <nl> - case MatchKind : : ConsumingConflict : <nl> - case MatchKind : : RethrowsConflict : <nl> - case MatchKind : : ThrowsConflict : <nl> - case MatchKind : : NonObjC : <nl> - return false ; <nl> - } <nl> + / / / \ brief Determine whether this match is viable . <nl> + bool isViable ( ) const { <nl> + switch ( Kind ) { <nl> + case MatchKind : : ExactMatch : <nl> + case MatchKind : : OptionalityConflict : <nl> + case MatchKind : : RenamedMatch : <nl> + return true ; <nl> <nl> - llvm_unreachable ( " Unhandled MatchKind in switch . " ) ; <nl> + case MatchKind : : WitnessInvalid : <nl> + case MatchKind : : KindConflict : <nl> + case MatchKind : : TypeConflict : <nl> + case MatchKind : : StaticNonStaticConflict : <nl> + case MatchKind : : SettableConflict : <nl> + case MatchKind : : PrefixNonPrefixConflict : <nl> + case MatchKind : : PostfixNonPostfixConflict : <nl> + case MatchKind : : MutatingConflict : <nl> + case MatchKind : : NonMutatingConflict : <nl> + case MatchKind : : ConsumingConflict : <nl> + case MatchKind : : RethrowsConflict : <nl> + case MatchKind : : ThrowsConflict : <nl> + case MatchKind : : NonObjC : <nl> + return false ; <nl> } <nl> <nl> - / / / \ brief Determine whether this requirement match has a witness type . <nl> - bool hasWitnessType ( ) const { <nl> - switch ( Kind ) { <nl> - case MatchKind : : ExactMatch : <nl> - case MatchKind : : RenamedMatch : <nl> - case MatchKind : : TypeConflict : <nl> - case MatchKind : : OptionalityConflict : <nl> - return true ; <nl> + llvm_unreachable ( " Unhandled MatchKind in switch . " ) ; <nl> + } <nl> <nl> - case MatchKind : : WitnessInvalid : <nl> - case MatchKind : : KindConflict : <nl> - case MatchKind : : StaticNonStaticConflict : <nl> - case MatchKind : : SettableConflict : <nl> - case MatchKind : : PrefixNonPrefixConflict : <nl> - case MatchKind : : PostfixNonPostfixConflict : <nl> - case MatchKind : : MutatingConflict : <nl> - case MatchKind : : NonMutatingConflict : <nl> - case MatchKind : : ConsumingConflict : <nl> - case MatchKind : : RethrowsConflict : <nl> - case MatchKind : : ThrowsConflict : <nl> - case MatchKind : : NonObjC : <nl> - return false ; <nl> - } <nl> + / / / \ brief Determine whether this requirement match has a witness type . <nl> + bool hasWitnessType ( ) const { <nl> + switch ( Kind ) { <nl> + case MatchKind : : ExactMatch : <nl> + case MatchKind : : RenamedMatch : <nl> + case MatchKind : : TypeConflict : <nl> + case MatchKind : : OptionalityConflict : <nl> + return true ; <nl> <nl> - llvm_unreachable ( " Unhandled MatchKind in switch . " ) ; <nl> + case MatchKind : : WitnessInvalid : <nl> + case MatchKind : : KindConflict : <nl> + case MatchKind : : StaticNonStaticConflict : <nl> + case MatchKind : : SettableConflict : <nl> + case MatchKind : : PrefixNonPrefixConflict : <nl> + case MatchKind : : PostfixNonPostfixConflict : <nl> + case MatchKind : : MutatingConflict : <nl> + case MatchKind : : NonMutatingConflict : <nl> + case MatchKind : : ConsumingConflict : <nl> + case MatchKind : : RethrowsConflict : <nl> + case MatchKind : : ThrowsConflict : <nl> + case MatchKind : : NonObjC : <nl> + return false ; <nl> } <nl> <nl> - SmallVector < Substitution , 2 > WitnessSubstitutions ; <nl> + llvm_unreachable ( " Unhandled MatchKind in switch . " ) ; <nl> + } <nl> <nl> - swift : : Witness getWitness ( ASTContext & ctx ) const { <nl> - SmallVector < Substitution , 2 > syntheticSubs ; <nl> - auto syntheticEnv = ReqEnv - > getSyntheticEnvironment ( ) ; <nl> - ReqEnv - > getRequirementSignature ( ) - > getSubstitutions ( <nl> - ReqEnv - > getRequirementToSyntheticMap ( ) , <nl> - syntheticSubs ) ; <nl> - return swift : : Witness ( this - > Witness , WitnessSubstitutions , <nl> - syntheticEnv , syntheticSubs ) ; <nl> - } <nl> - } ; <nl> + SmallVector < Substitution , 2 > WitnessSubstitutions ; <nl> <nl> - / / / \ brief Describes the suitability of the chosen witness for <nl> - / / / the requirement . <nl> - struct RequirementCheck { <nl> - CheckKind Kind ; <nl> + swift : : Witness getWitness ( ASTContext & ctx ) const { <nl> + SmallVector < Substitution , 2 > syntheticSubs ; <nl> + auto syntheticEnv = ReqEnv - > getSyntheticEnvironment ( ) ; <nl> + ReqEnv - > getRequirementSignature ( ) - > getSubstitutions ( <nl> + ReqEnv - > getRequirementToSyntheticMap ( ) , <nl> + syntheticSubs ) ; <nl> + return swift : : Witness ( this - > Witness , WitnessSubstitutions , <nl> + syntheticEnv , syntheticSubs ) ; <nl> + } <nl> + } ; <nl> <nl> - / / / The required access scope , if the check failed due to the <nl> - / / / witness being less accessible than the requirement . <nl> - AccessScope RequiredAccessScope ; <nl> + / / / \ brief Describes the suitability of the chosen witness for <nl> + / / / the requirement . <nl> + struct swift : : RequirementCheck { <nl> + CheckKind Kind ; <nl> <nl> - / / / The required availability , if the check failed due to the <nl> - / / / witness being less available than the requirement . <nl> - AvailabilityContext RequiredAvailability ; <nl> + / / / The required access scope , if the check failed due to the <nl> + / / / witness being less accessible than the requirement . <nl> + AccessScope RequiredAccessScope ; <nl> <nl> - RequirementCheck ( CheckKind kind ) <nl> - : Kind ( kind ) , RequiredAccessScope ( AccessScope : : getPublic ( ) ) , <nl> - RequiredAvailability ( AvailabilityContext : : alwaysAvailable ( ) ) { } <nl> + / / / The required availability , if the check failed due to the <nl> + / / / witness being less available than the requirement . <nl> + AvailabilityContext RequiredAvailability ; <nl> <nl> - RequirementCheck ( CheckKind kind , AccessScope requiredAccessScope ) <nl> - : Kind ( kind ) , RequiredAccessScope ( requiredAccessScope ) , <nl> - RequiredAvailability ( AvailabilityContext : : alwaysAvailable ( ) ) { } <nl> + RequirementCheck ( CheckKind kind ) <nl> + : Kind ( kind ) , RequiredAccessScope ( AccessScope : : getPublic ( ) ) , <nl> + RequiredAvailability ( AvailabilityContext : : alwaysAvailable ( ) ) { } <nl> <nl> - RequirementCheck ( CheckKind kind , AvailabilityContext requiredAvailability ) <nl> - : Kind ( kind ) , RequiredAccessScope ( AccessScope : : getPublic ( ) ) , <nl> - RequiredAvailability ( requiredAvailability ) { } <nl> - } ; <nl> - } / / end anonymous namespace <nl> + RequirementCheck ( CheckKind kind , AccessScope requiredAccessScope ) <nl> + : Kind ( kind ) , RequiredAccessScope ( requiredAccessScope ) , <nl> + RequiredAvailability ( AvailabilityContext : : alwaysAvailable ( ) ) { } <nl> + <nl> + RequirementCheck ( CheckKind kind , AvailabilityContext requiredAvailability ) <nl> + : Kind ( kind ) , RequiredAccessScope ( AccessScope : : getPublic ( ) ) , <nl> + RequiredAvailability ( requiredAvailability ) { } <nl> + } ; <nl> <nl> / / / If the given type is a direct reference to an associated type of <nl> / / / the given protocol , return the referenced associated type . <nl> static bool isBetterMatch ( TypeChecker & tc , DeclContext * dc , <nl> return false ; <nl> } <nl> <nl> + WitnessChecker : : WitnessChecker ( TypeChecker & tc , ProtocolDecl * proto , <nl> + Type adoptee , DeclContext * dc ) <nl> + : TC ( tc ) , Proto ( proto ) , Adoptee ( adoptee ) , DC ( dc ) { <nl> + if ( auto N = DC - > getAsNominalTypeOrNominalTypeExtensionContext ( ) ) { <nl> + for ( auto D : N - > getMembers ( ) ) { <nl> + if ( auto V = dyn_cast < ValueDecl > ( D ) ) { <nl> + if ( ! V - > hasName ( ) ) <nl> + continue ; <nl> + if ( auto A = V - > getAttrs ( ) . getAttribute < ImplementsAttr > ( ) ) { <nl> + A - > getMemberName ( ) . addToLookupTable ( ImplementsTable , V ) ; <nl> + } <nl> + } <nl> + } <nl> + } <nl> + } <nl> + <nl> void <nl> WitnessChecker : : lookupValueWitnessesViaImplementsAttr ( <nl> ValueDecl * req , SmallVector < ValueDecl * , 4 > & witnesses ) { <nl> checkWitness ( AccessScope requiredAccessScope , <nl> <nl> # pragma mark Witness resolution <nl> <nl> - namespace { <nl> - / / / The result of attempting to resolve a witness . <nl> - enum class ResolveWitnessResult { <nl> - / / / The resolution succeeded . <nl> - Success , <nl> - / / / There was an explicit witness available , but it failed some <nl> - / / / criteria . <nl> - ExplicitFailed , <nl> - / / / There was no witness available . <nl> - Missing <nl> - } ; <nl> - <nl> - / / / Describes the result of checking a type witness . <nl> - / / / <nl> - / / / This class evaluates true if an error occurred . <nl> - class CheckTypeWitnessResult { <nl> - Type Requirement ; <nl> - <nl> - public : <nl> - CheckTypeWitnessResult ( ) { } <nl> - CheckTypeWitnessResult ( Type reqt ) : Requirement ( reqt ) { } <nl> - <nl> - Type getRequirement ( ) const { return Requirement ; } <nl> - bool isConformanceRequirement ( ) const { <nl> - return Requirement - > isExistentialType ( ) ; <nl> - } <nl> - <nl> - explicit operator bool ( ) const { return ! Requirement . isNull ( ) ; } <nl> - } ; <nl> - <nl> - / / / The set of associated types that have been inferred by matching <nl> - / / / the given value witness to its corresponding requirement . <nl> - struct InferredAssociatedTypesByWitness { <nl> - / / / The witness we matched . <nl> - ValueDecl * Witness = nullptr ; <nl> - <nl> - / / / The associated types inferred from matching this witness . <nl> - SmallVector < std : : pair < AssociatedTypeDecl * , Type > , 4 > Inferred ; <nl> - <nl> - / / / Inferred associated types that don ' t meet the associated type <nl> - / / / requirements . <nl> - SmallVector < std : : tuple < AssociatedTypeDecl * , Type , CheckTypeWitnessResult > , <nl> - 2 > NonViable ; <nl> - <nl> - void dump ( llvm : : raw_ostream & out , unsigned indent ) const { <nl> - out < < " \ n " ; <nl> - out . indent ( indent ) < < " ( " ; <nl> - if ( Witness ) { <nl> - Witness - > dumpRef ( out ) ; <nl> - } <nl> - <nl> - for ( const auto & inferred : Inferred ) { <nl> - out < < " \ n " ; <nl> - out . indent ( indent + 2 ) ; <nl> - out < < inferred . first - > getName ( ) < < " : = " <nl> - < < inferred . second . getString ( ) ; <nl> - } <nl> - <nl> - for ( const auto & inferred : NonViable ) { <nl> - out < < " \ n " ; <nl> - out . indent ( indent + 2 ) ; <nl> - out < < std : : get < 0 > ( inferred ) - > getName ( ) < < " : = " <nl> - < < std : : get < 1 > ( inferred ) . getString ( ) ; <nl> - auto type = std : : get < 2 > ( inferred ) . getRequirement ( ) ; <nl> - out < < " [ failed constraint " < < type . getString ( ) < < " ] " ; <nl> - } <nl> - <nl> - out < < " ) " ; <nl> - } <nl> - <nl> - LLVM_ATTRIBUTE_DEPRECATED ( void dump ( ) const , <nl> - " only for use in the debugger " ) ; <nl> - } ; <nl> - <nl> - void InferredAssociatedTypesByWitness : : dump ( ) const { <nl> - dump ( llvm : : errs ( ) , 0 ) ; <nl> - } <nl> - <nl> - / / / The set of witnesses that were considered when attempting to <nl> - / / / infer associated types . <nl> - typedef SmallVector < InferredAssociatedTypesByWitness , 2 > <nl> - InferredAssociatedTypesByWitnesses ; <nl> + / / / This is a wrapper of multiple instances of ConformanceChecker to allow us <nl> + / / / to diagnose and fix code from a more global perspective ; for instance , <nl> + / / / having this wrapper can help issue a fixit that inserts protocol stubs from <nl> + / / / multiple protocols under checking . <nl> + class swift : : MultiConformanceChecker { <nl> + TypeChecker & TC ; <nl> + llvm : : SmallVector < ValueDecl * , 16 > UnsatisfiedReqs ; <nl> + llvm : : SmallVector < ConformanceChecker , 4 > AllUsedCheckers ; <nl> + llvm : : SmallVector < NormalProtocolConformance * , 4 > AllConformances ; <nl> + llvm : : SetVector < ValueDecl * > MissingWitnesses ; <nl> + llvm : : SmallPtrSet < ValueDecl * , 8 > CoveredMembers ; <nl> <nl> - void dumpInferredAssociatedTypesByWitnesses ( <nl> - const InferredAssociatedTypesByWitnesses & inferred , <nl> - llvm : : raw_ostream & out , <nl> - unsigned indent ) { <nl> - for ( const auto & value : inferred ) { <nl> - value . dump ( out , indent ) ; <nl> - } <nl> - } <nl> + / / / Check one conformance . <nl> + ProtocolConformance * checkIndividualConformance ( <nl> + NormalProtocolConformance * conformance , bool issueFixit ) ; <nl> <nl> - void dumpInferredAssociatedTypesByWitnesses ( <nl> - const InferredAssociatedTypesByWitnesses & inferred ) LLVM_ATTRIBUTE_USED ; <nl> + / / / Determine whether the given requirement was left unsatisfied . <nl> + bool isUnsatisfiedReq ( NormalProtocolConformance * conformance , ValueDecl * req ) ; <nl> + public : <nl> + MultiConformanceChecker ( TypeChecker & TC ) : TC ( TC ) { } <nl> <nl> - void dumpInferredAssociatedTypesByWitnesses ( <nl> - const InferredAssociatedTypesByWitnesses & inferred ) { <nl> - dumpInferredAssociatedTypesByWitnesses ( inferred , llvm : : errs ( ) , 0 ) ; <nl> + / / / Add a conformance into the batched checker . <nl> + void addConformance ( NormalProtocolConformance * conformance ) { <nl> + AllConformances . push_back ( conformance ) ; <nl> } <nl> <nl> - / / / A mapping from requirements to the set of matches with witnesses . <nl> - typedef SmallVector < std : : pair < ValueDecl * , <nl> - InferredAssociatedTypesByWitnesses > , 4 > <nl> - InferredAssociatedTypes ; <nl> - <nl> - void dumpInferredAssociatedTypes ( const InferredAssociatedTypes & inferred , <nl> - llvm : : raw_ostream & out , <nl> - unsigned indent ) { <nl> - for ( const auto & value : inferred ) { <nl> - out < < " \ n " ; <nl> - out . indent ( indent ) < < " ( " ; <nl> - value . first - > dumpRef ( out ) ; <nl> - dumpInferredAssociatedTypesByWitnesses ( value . second , out , indent + 2 ) ; <nl> - out < < " ) " ; <nl> - } <nl> - out < < " \ n " ; <nl> + / / / Peek the unsatisfied requirements collected during conformance checking . <nl> + ArrayRef < ValueDecl * > getUnsatisfiedRequirements ( ) { <nl> + return llvm : : makeArrayRef ( UnsatisfiedReqs ) ; <nl> } <nl> <nl> - void dumpInferredAssociatedTypes ( <nl> - const InferredAssociatedTypes & inferred ) LLVM_ATTRIBUTE_USED ; <nl> - <nl> - void dumpInferredAssociatedTypes ( const InferredAssociatedTypes & inferred ) { <nl> - dumpInferredAssociatedTypes ( inferred , llvm : : errs ( ) , 0 ) ; <nl> + / / / Whether this member is " covered " by one of the conformances . <nl> + bool isCoveredMember ( ValueDecl * member ) const { <nl> + return CoveredMembers . count ( member ) > 0 ; <nl> } <nl> <nl> - enum class MissingWitnessDiagnosisKind { <nl> - FixItOnly , <nl> - ErrorOnly , <nl> - ErrorFixIt , <nl> - } ; <nl> - <nl> - / / / The protocol conformance checker . <nl> - / / / <nl> - / / / This helper class handles most of the details of checking whether a <nl> - / / / given type ( \ c Adoptee ) conforms to a protocol ( \ c Proto ) . <nl> - class ConformanceChecker : public WitnessChecker { <nl> - friend class MultiConformanceChecker ; <nl> - NormalProtocolConformance * Conformance ; <nl> - SourceLoc Loc ; <nl> - <nl> - / / / Witnesses that are currently being resolved . <nl> - llvm : : SmallPtrSet < ValueDecl * , 4 > ResolvingWitnesses ; <nl> - <nl> - / / / Caches the set of associated types that are referenced in each <nl> - / / / requirement . <nl> - llvm : : DenseMap < ValueDecl * , llvm : : SmallVector < AssociatedTypeDecl * , 2 > > <nl> - ReferencedAssociatedTypes ; <nl> - <nl> - / / / Keep track of missing witnesses , either type or value , for later <nl> - / / / diagnosis emits . This may contain witnesses that are external to the <nl> - / / / protocol under checking . <nl> - llvm : : SetVector < ValueDecl * > & GlobalMissingWitnesses ; <nl> - <nl> - / / / Keep track of the slice in GlobalMissingWitnesses that is local to <nl> - / / / this protocol under checking . <nl> - unsigned LocalMissingWitnessesStartIndex ; <nl> - <nl> - / / / True if we shouldn ' t complain about problems with this conformance <nl> - / / / right now , i . e . if methods are being called outside <nl> - / / / checkConformance ( ) . <nl> - bool SuppressDiagnostics ; <nl> - <nl> - / / / Whether we ' ve already complained about problems with this conformance . <nl> - bool AlreadyComplained = false ; <nl> - <nl> - / / / Whether we checked the requirement signature already . <nl> - bool CheckedRequirementSignature = false ; <nl> - <nl> - / / / Retrieve the associated types that are referenced by the given <nl> - / / / requirement with a base of ' Self ' . <nl> - ArrayRef < AssociatedTypeDecl * > getReferencedAssociatedTypes ( ValueDecl * req ) ; <nl> - <nl> - / / / Record a ( non - type ) witness for the given requirement . <nl> - void recordWitness ( ValueDecl * requirement , const RequirementMatch & match ) ; <nl> - <nl> - / / / Record that the given optional requirement has no witness . <nl> - void recordOptionalWitness ( ValueDecl * requirement ) ; <nl> - <nl> - / / / Record that the given requirement has no valid witness . <nl> - void recordInvalidWitness ( ValueDecl * requirement ) ; <nl> - <nl> - / / / Record a type witness . <nl> - / / / <nl> - / / / \ param assocType The associated type whose witness is being recorded . <nl> - / / / <nl> - / / / \ param type The witness type . <nl> - / / / <nl> - / / / \ param typeDecl The decl the witness type came from ; can be null . <nl> - void recordTypeWitness ( AssociatedTypeDecl * assocType , Type type , <nl> - TypeDecl * typeDecl , bool performRedeclarationCheck ) ; <nl> - <nl> - / / / Enforce restrictions on non - final classes witnessing requirements <nl> - / / / involving the protocol ' Self ' type . <nl> - void checkNonFinalClassWitness ( ValueDecl * requirement , <nl> - ValueDecl * witness ) ; <nl> - <nl> - / / / Resolve a ( non - type ) witness via name lookup . <nl> - ResolveWitnessResult resolveWitnessViaLookup ( ValueDecl * requirement ) ; <nl> - <nl> - / / / Resolve a ( non - type ) witness via derivation . <nl> - ResolveWitnessResult resolveWitnessViaDerivation ( ValueDecl * requirement ) ; <nl> - <nl> - / / / Resolve a ( non - type ) witness via default definition or optional . <nl> - ResolveWitnessResult resolveWitnessViaDefault ( ValueDecl * requirement ) ; <nl> + / / / Check all conformances and emit diagnosis globally . <nl> + void checkAllConformances ( ) ; <nl> + } ; <nl> <nl> - / / / Attempt to resolve a type witness via member name lookup . <nl> - ResolveWitnessResult resolveTypeWitnessViaLookup ( <nl> - AssociatedTypeDecl * assocType ) ; <nl> - <nl> - / / / Infer associated type witnesses for the given tentative <nl> - / / / requirement / witness match . <nl> - InferredAssociatedTypesByWitness inferTypeWitnessesViaValueWitness ( <nl> - ValueDecl * req , <nl> - ValueDecl * witness ) ; <nl> - <nl> - / / / Infer associated type witnesses for the given value requirement . <nl> - InferredAssociatedTypesByWitnesses inferTypeWitnessesViaValueWitnesses ( <nl> - const llvm : : SetVector < AssociatedTypeDecl * > & allUnresolved , <nl> - ValueDecl * req ) ; <nl> - <nl> - / / / Infer associated type witnesses for all relevant value requirements . <nl> - / / / <nl> - / / / \ param assocTypes The set of associated types we ' re interested in . <nl> - InferredAssociatedTypes <nl> - inferTypeWitnessesViaValueWitnesses ( <nl> - const llvm : : SetVector < AssociatedTypeDecl * > & assocTypes ) ; <nl> - <nl> - / / / Diagnose or defer a diagnostic , as appropriate . <nl> - / / / <nl> - / / / \ param requirement The requirement with which this diagnostic is <nl> - / / / associated , if any . <nl> - / / / <nl> - / / / \ param isError Whether this diagnostic is an error . <nl> - / / / <nl> - / / / \ param fn A function to call to emit the actual diagnostic . If <nl> - / / / diagnostics are being deferred , <nl> - void diagnoseOrDefer ( <nl> - ValueDecl * requirement , bool isError , <nl> - std : : function < void ( NormalProtocolConformance * ) > fn ) ; <nl> - <nl> - void <nl> - addUsedConformances ( ProtocolConformance * conformance , <nl> - llvm : : SmallPtrSetImpl < ProtocolConformance * > & visited ) ; <nl> - void addUsedConformances ( ProtocolConformance * conformance ) ; <nl> - <nl> - ArrayRef < ValueDecl * > getLocalMissingWitness ( ) { <nl> - return GlobalMissingWitnesses . getArrayRef ( ) . <nl> - slice ( LocalMissingWitnessesStartIndex , <nl> - GlobalMissingWitnesses . size ( ) - LocalMissingWitnessesStartIndex ) ; <nl> - } <nl> + bool MultiConformanceChecker : : <nl> + isUnsatisfiedReq ( NormalProtocolConformance * conformance , ValueDecl * req ) { <nl> + if ( conformance - > isInvalid ( ) ) return false ; <nl> + if ( isa < TypeDecl > ( req ) ) return false ; <nl> <nl> - void clearGlobalMissingWitnesses ( ) { <nl> - GlobalMissingWitnesses . clear ( ) ; <nl> - LocalMissingWitnessesStartIndex = GlobalMissingWitnesses . size ( ) ; <nl> - } <nl> + auto witness = conformance - > hasWitness ( req ) <nl> + ? conformance - > getWitness ( req , nullptr ) . getDecl ( ) <nl> + : nullptr ; <nl> <nl> - public : <nl> - / / / Call this to diagnose currently known missing witnesses . <nl> - void diagnoseMissingWitnesses ( MissingWitnessDiagnosisKind Kind ) ; <nl> - / / / Emit any diagnostics that have been delayed . <nl> - void emitDelayedDiags ( ) ; <nl> - <nl> - ConformanceChecker ( TypeChecker & tc , NormalProtocolConformance * conformance , <nl> - llvm : : SetVector < ValueDecl * > & GlobalMissingWitnesses , <nl> - bool suppressDiagnostics = true ) <nl> - : WitnessChecker ( tc , conformance - > getProtocol ( ) , <nl> - conformance - > getType ( ) , <nl> - conformance - > getDeclContext ( ) ) , <nl> - Conformance ( conformance ) , Loc ( conformance - > getLoc ( ) ) , <nl> - GlobalMissingWitnesses ( GlobalMissingWitnesses ) , <nl> - LocalMissingWitnessesStartIndex ( GlobalMissingWitnesses . size ( ) ) , <nl> - SuppressDiagnostics ( suppressDiagnostics ) { <nl> - / / The protocol may have only been validatedDeclForNameLookup ' d until <nl> - / / here , so fill in any information that ' s missing . <nl> - tc . validateDecl ( conformance - > getProtocol ( ) ) ; <nl> - } <nl> + / / An optional requirement might not have a witness . . . <nl> + if ( ! witness ) <nl> + return req - > getAttrs ( ) . hasAttribute < OptionalAttr > ( ) ; <nl> <nl> - / / / Resolve all of the type witnesses . <nl> - void resolveTypeWitnesses ( ) ; <nl> + / / If the witness lands within the declaration context of the conformance , <nl> + / / record it as a " covered " member . <nl> + if ( witness - > getDeclContext ( ) = = conformance - > getDeclContext ( ) ) <nl> + CoveredMembers . insert ( witness ) ; <nl> <nl> - / / / Resolve the witness for the given non - type requirement as <nl> - / / / directly as possible , only resolving other witnesses if <nl> - / / / needed , e . g . , to determine type witnesses used within the <nl> - / / / requirement . <nl> - / / / <nl> - / / / This entry point is designed to be used when the witness for a <nl> - / / / particular requirement and adoptee is required , before the <nl> - / / / conformance has been completed checked . <nl> - void resolveSingleWitness ( ValueDecl * requirement ) ; <nl> - <nl> - / / / Resolve the type witness for the given associated type as <nl> - / / / directly as possible . <nl> - void resolveSingleTypeWitness ( AssociatedTypeDecl * assocType ) ; <nl> - <nl> - / / / Check all of the protocols requirements are actually satisfied by a <nl> - / / / the chosen type witnesses . <nl> - void ensureRequirementsAreSatisfied ( ) ; <nl> - <nl> - / / / Check the entire protocol conformance , ensuring that all <nl> - / / / witnesses are resolved and emitting any diagnostics . <nl> - void checkConformance ( MissingWitnessDiagnosisKind Kind ) ; <nl> - } ; <nl> + / / The witness might come from a protocol or protocol extension . <nl> + if ( witness - > getDeclContext ( ) <nl> + - > getAsProtocolOrProtocolExtensionContext ( ) ) <nl> + return true ; <nl> <nl> - / / / This is a wrapper of multiple instances of ConformanceChecker to allow us <nl> - / / / to diagnose and fix code from a more global perspective ; for instance , <nl> - / / / having this wrapper can help issue a fixit that inserts protocol stubs from <nl> - / / / multiple protocols under checking . <nl> - class MultiConformanceChecker { <nl> - TypeChecker & TC ; <nl> - llvm : : SmallVector < ValueDecl * , 16 > UnsatisfiedReqs ; <nl> - llvm : : SmallVector < ConformanceChecker , 4 > AllUsedCheckers ; <nl> - llvm : : SmallVector < NormalProtocolConformance * , 4 > AllConformances ; <nl> - llvm : : SetVector < ValueDecl * > MissingWitnesses ; <nl> - llvm : : SmallPtrSet < ValueDecl * , 8 > CoveredMembers ; <nl> - <nl> - / / / Check one conformance . <nl> - ProtocolConformance * checkIndividualConformance ( <nl> - NormalProtocolConformance * conformance , bool issueFixit ) ; <nl> - <nl> - / / / Determine whether the given requirement was left unsatisfied . <nl> - bool isUnsatisfiedReq ( NormalProtocolConformance * conformance , ValueDecl * req ) ; <nl> - public : <nl> - MultiConformanceChecker ( TypeChecker & TC ) : TC ( TC ) { } <nl> + return false ; <nl> + } <nl> <nl> - / / / Add a conformance into the batched checker . <nl> - void addConformance ( NormalProtocolConformance * conformance ) { <nl> - AllConformances . push_back ( conformance ) ; <nl> + void MultiConformanceChecker : : checkAllConformances ( ) { <nl> + bool anyInvalid = false ; <nl> + for ( unsigned I = 0 , N = AllConformances . size ( ) ; I < N ; I + + ) { <nl> + auto * conformance = AllConformances [ I ] ; <nl> + / / Check this conformance and emit fixits if this is the last one in the pool . <nl> + checkIndividualConformance ( conformance , I = = N - 1 ) ; <nl> + anyInvalid | = conformance - > isInvalid ( ) ; <nl> + if ( anyInvalid ) <nl> + continue ; <nl> + / / Check whether there are any unsatisfied requirements . <nl> + auto proto = conformance - > getProtocol ( ) ; <nl> + for ( auto member : proto - > getMembers ( ) ) { <nl> + auto req = dyn_cast < ValueDecl > ( member ) ; <nl> + if ( ! req | | ! req - > isProtocolRequirement ( ) ) continue ; <nl> + <nl> + / / If the requirement is unsatisfied , we might want to warn <nl> + / / about near misses ; record it . <nl> + if ( isUnsatisfiedReq ( conformance , req ) ) { <nl> + UnsatisfiedReqs . push_back ( req ) ; <nl> + continue ; <nl> + } <nl> } <nl> + } <nl> + / / If all missing witnesses are issued with fixits , we are done . <nl> + if ( MissingWitnesses . empty ( ) ) <nl> + return ; <nl> <nl> - / / / Peek the unsatisfied requirements collected during conformance checking . <nl> - ArrayRef < ValueDecl * > getUnsatisfiedRequirements ( ) { <nl> - return llvm : : makeArrayRef ( UnsatisfiedReqs ) ; <nl> + / / Otherwise , backtrack to the last checker that has missing witnesses <nl> + / / and diagnose missing witnesses from there . <nl> + for ( auto It = AllUsedCheckers . rbegin ( ) ; It ! = AllUsedCheckers . rend ( ) ; <nl> + It + + ) { <nl> + if ( ! It - > getLocalMissingWitness ( ) . empty ( ) ) { <nl> + It - > diagnoseMissingWitnesses ( MissingWitnessDiagnosisKind : : FixItOnly ) ; <nl> } <nl> + } <nl> + } <nl> <nl> - / / / Whether this member is " covered " by one of the conformances . <nl> - bool isCoveredMember ( ValueDecl * member ) const { <nl> - return CoveredMembers . count ( member ) > 0 ; <nl> - } <nl> + / / / \ brief Determine whether the type \ c T conforms to the protocol \ c Proto , <nl> + / / / recording the complete witness table if it does . <nl> + ProtocolConformance * MultiConformanceChecker : : <nl> + checkIndividualConformance ( NormalProtocolConformance * conformance , <nl> + bool issueFixit ) { <nl> + std : : vector < ValueDecl * > revivedMissingWitnesses ; <nl> + switch ( conformance - > getState ( ) ) { <nl> + case ProtocolConformanceState : : Incomplete : <nl> + if ( conformance - > isInvalid ( ) ) { <nl> + / / Revive registered missing witnesses to handle it below . <nl> + revivedMissingWitnesses = TC . Context . <nl> + takeDelayedMissingWitnesses ( conformance ) ; <nl> + <nl> + / / If we have no missing witnesses for this invalid conformance , the <nl> + / / conformance is invalid for other reasons , so emit diagnosis now . <nl> + if ( revivedMissingWitnesses . empty ( ) ) { <nl> + / / Emit any delayed diagnostics . <nl> + ConformanceChecker ( TC , conformance , MissingWitnesses , false ) . <nl> + emitDelayedDiags ( ) ; <nl> + } <nl> + } <nl> <nl> - / / / Check all conformances and emit diagnosis globally . <nl> - void checkAllConformances ( ) ; <nl> - } ; <nl> + / / Check the rest of the conformance below . <nl> + break ; <nl> <nl> - bool MultiConformanceChecker : : <nl> - isUnsatisfiedReq ( NormalProtocolConformance * conformance , ValueDecl * req ) { <nl> - if ( conformance - > isInvalid ( ) ) return false ; <nl> - if ( isa < TypeDecl > ( req ) ) return false ; <nl> + case ProtocolConformanceState : : CheckingTypeWitnesses : <nl> + case ProtocolConformanceState : : Checking : <nl> + case ProtocolConformanceState : : Complete : <nl> + / / Nothing to do . <nl> + return conformance ; <nl> + } <nl> <nl> - auto witness = conformance - > hasWitness ( req ) <nl> - ? conformance - > getWitness ( req , nullptr ) . getDecl ( ) <nl> - : nullptr ; <nl> + / / Dig out some of the fields from the conformance . <nl> + Type T = conformance - > getType ( ) ; <nl> + auto canT = T - > getCanonicalType ( ) ; <nl> + DeclContext * DC = conformance - > getDeclContext ( ) ; <nl> + auto Proto = conformance - > getProtocol ( ) ; <nl> + SourceLoc ComplainLoc = conformance - > getLoc ( ) ; <nl> <nl> - / / An optional requirement might not have a witness . . . <nl> - if ( ! witness ) <nl> - return req - > getAttrs ( ) . hasAttribute < OptionalAttr > ( ) ; <nl> + / / Note that we are checking this conformance now . <nl> + conformance - > setState ( ProtocolConformanceState : : Checking ) ; <nl> + SWIFT_DEFER { conformance - > setState ( ProtocolConformanceState : : Complete ) ; } ; <nl> <nl> - / / If the witness lands within the declaration context of the conformance , <nl> - / / record it as a " covered " member . <nl> - if ( witness - > getDeclContext ( ) = = conformance - > getDeclContext ( ) ) <nl> - CoveredMembers . insert ( witness ) ; <nl> + TC . validateDecl ( Proto ) ; <nl> <nl> - / / The witness might come from a protocol or protocol extension . <nl> - if ( witness - > getDeclContext ( ) <nl> - - > getAsProtocolOrProtocolExtensionContext ( ) ) <nl> - return true ; <nl> + / / If the protocol itself is invalid , there ' s nothing we can do . <nl> + if ( Proto - > isInvalid ( ) ) { <nl> + conformance - > setInvalid ( ) ; <nl> + return conformance ; <nl> + } <nl> <nl> - return false ; <nl> + / / If the protocol requires a class , non - classes are a non - starter . <nl> + if ( Proto - > requiresClass ( ) & & ! canT - > getClassOrBoundGenericClass ( ) ) { <nl> + TC . diagnose ( ComplainLoc , diag : : non_class_cannot_conform_to_class_protocol , <nl> + T , Proto - > getDeclaredType ( ) ) ; <nl> + conformance - > setInvalid ( ) ; <nl> + return conformance ; <nl> } <nl> <nl> - void MultiConformanceChecker : : checkAllConformances ( ) { <nl> - bool anyInvalid = false ; <nl> - for ( unsigned I = 0 , N = AllConformances . size ( ) ; I < N ; I + + ) { <nl> - auto * conformance = AllConformances [ I ] ; <nl> - / / Check this conformance and emit fixits if this is the last one in the pool . <nl> - checkIndividualConformance ( conformance , I = = N - 1 ) ; <nl> - anyInvalid | = conformance - > isInvalid ( ) ; <nl> - if ( anyInvalid ) <nl> - continue ; <nl> - / / Check whether there are any unsatisfied requirements . <nl> - auto proto = conformance - > getProtocol ( ) ; <nl> - for ( auto member : proto - > getMembers ( ) ) { <nl> - auto req = dyn_cast < ValueDecl > ( member ) ; <nl> - if ( ! req | | ! req - > isProtocolRequirement ( ) ) continue ; <nl> - <nl> - / / If the requirement is unsatisfied , we might want to warn <nl> - / / about near misses ; record it . <nl> - if ( isUnsatisfiedReq ( conformance , req ) ) { <nl> - UnsatisfiedReqs . push_back ( req ) ; <nl> - continue ; <nl> - } <nl> + / / Foreign classes cannot conform to objc protocols . <nl> + if ( Proto - > isObjC ( ) ) { <nl> + if ( auto clas = canT - > getClassOrBoundGenericClass ( ) ) { <nl> + Optional < decltype ( diag : : cf_class_cannot_conform_to_objc_protocol ) > <nl> + diagKind ; <nl> + switch ( clas - > getForeignClassKind ( ) ) { <nl> + case ClassDecl : : ForeignKind : : Normal : <nl> + break ; <nl> + case ClassDecl : : ForeignKind : : CFType : <nl> + diagKind = diag : : cf_class_cannot_conform_to_objc_protocol ; <nl> + break ; <nl> + case ClassDecl : : ForeignKind : : RuntimeOnly : <nl> + diagKind = diag : : objc_runtime_visible_cannot_conform_to_objc_protocol ; <nl> + break ; <nl> } <nl> - } <nl> - / / If all missing witnesses are issued with fixits , we are done . <nl> - if ( MissingWitnesses . empty ( ) ) <nl> - return ; <nl> - <nl> - / / Otherwise , backtrack to the last checker that has missing witnesses <nl> - / / and diagnose missing witnesses from there . <nl> - for ( auto It = AllUsedCheckers . rbegin ( ) ; It ! = AllUsedCheckers . rend ( ) ; <nl> - It + + ) { <nl> - if ( ! It - > getLocalMissingWitness ( ) . empty ( ) ) { <nl> - It - > diagnoseMissingWitnesses ( MissingWitnessDiagnosisKind : : FixItOnly ) ; <nl> + if ( diagKind ) { <nl> + TC . diagnose ( ComplainLoc , diagKind . getValue ( ) , <nl> + T , Proto - > getDeclaredType ( ) ) ; <nl> + conformance - > setInvalid ( ) ; <nl> + return conformance ; <nl> } <nl> } <nl> } <nl> <nl> - / / / \ brief Determine whether the type \ c T conforms to the protocol \ c Proto , <nl> - / / / recording the complete witness table if it does . <nl> - ProtocolConformance * MultiConformanceChecker : : <nl> - checkIndividualConformance ( NormalProtocolConformance * conformance , <nl> - bool issueFixit ) { <nl> - std : : vector < ValueDecl * > revivedMissingWitnesses ; <nl> - switch ( conformance - > getState ( ) ) { <nl> - case ProtocolConformanceState : : Incomplete : <nl> - if ( conformance - > isInvalid ( ) ) { <nl> - / / Revive registered missing witnesses to handle it below . <nl> - revivedMissingWitnesses = TC . Context . <nl> - takeDelayedMissingWitnesses ( conformance ) ; <nl> - <nl> - / / If we have no missing witnesses for this invalid conformance , the <nl> - / / conformance is invalid for other reasons , so emit diagnosis now . <nl> - if ( revivedMissingWitnesses . empty ( ) ) { <nl> - / / Emit any delayed diagnostics . <nl> - ConformanceChecker ( TC , conformance , MissingWitnesses , false ) . <nl> - emitDelayedDiags ( ) ; <nl> - } <nl> - } <nl> - <nl> - / / Check the rest of the conformance below . <nl> - break ; <nl> - <nl> - case ProtocolConformanceState : : CheckingTypeWitnesses : <nl> - case ProtocolConformanceState : : Checking : <nl> - case ProtocolConformanceState : : Complete : <nl> - / / Nothing to do . <nl> - return conformance ; <nl> - } <nl> - <nl> - / / Dig out some of the fields from the conformance . <nl> - Type T = conformance - > getType ( ) ; <nl> - auto canT = T - > getCanonicalType ( ) ; <nl> - DeclContext * DC = conformance - > getDeclContext ( ) ; <nl> - auto Proto = conformance - > getProtocol ( ) ; <nl> - SourceLoc ComplainLoc = conformance - > getLoc ( ) ; <nl> - <nl> - / / Note that we are checking this conformance now . <nl> - conformance - > setState ( ProtocolConformanceState : : Checking ) ; <nl> - SWIFT_DEFER { conformance - > setState ( ProtocolConformanceState : : Complete ) ; } ; <nl> - <nl> - TC . validateDecl ( Proto ) ; <nl> - <nl> - / / If the protocol itself is invalid , there ' s nothing we can do . <nl> - if ( Proto - > isInvalid ( ) ) { <nl> - conformance - > setInvalid ( ) ; <nl> - return conformance ; <nl> + / / If the protocol contains missing requirements , it can ' t be conformed to <nl> + / / at all . <nl> + if ( Proto - > hasMissingRequirements ( ) ) { <nl> + bool hasDiagnosed = false ; <nl> + auto * protoFile = Proto - > getModuleScopeContext ( ) ; <nl> + if ( auto * serialized = dyn_cast < SerializedASTFile > ( protoFile ) ) { <nl> + if ( serialized - > getLanguageVersionBuiltWith ( ) ! = <nl> + TC . getLangOpts ( ) . EffectiveLanguageVersion ) { <nl> + TC . diagnose ( ComplainLoc , <nl> + diag : : protocol_has_missing_requirements_versioned , <nl> + T , Proto - > getDeclaredType ( ) , <nl> + serialized - > getLanguageVersionBuiltWith ( ) , <nl> + TC . getLangOpts ( ) . EffectiveLanguageVersion ) ; <nl> + hasDiagnosed = true ; <nl> + } <nl> } <nl> - <nl> - / / If the protocol requires a class , non - classes are a non - starter . <nl> - if ( Proto - > requiresClass ( ) & & ! canT - > getClassOrBoundGenericClass ( ) ) { <nl> - TC . diagnose ( ComplainLoc , diag : : non_class_cannot_conform_to_class_protocol , <nl> + if ( ! hasDiagnosed ) { <nl> + TC . diagnose ( ComplainLoc , diag : : protocol_has_missing_requirements , <nl> T , Proto - > getDeclaredType ( ) ) ; <nl> - conformance - > setInvalid ( ) ; <nl> - return conformance ; <nl> } <nl> + conformance - > setInvalid ( ) ; <nl> + return conformance ; <nl> + } <nl> <nl> - / / Foreign classes cannot conform to objc protocols . <nl> - if ( Proto - > isObjC ( ) ) { <nl> - if ( auto clas = canT - > getClassOrBoundGenericClass ( ) ) { <nl> - Optional < decltype ( diag : : cf_class_cannot_conform_to_objc_protocol ) > <nl> - diagKind ; <nl> - switch ( clas - > getForeignClassKind ( ) ) { <nl> - case ClassDecl : : ForeignKind : : Normal : <nl> - break ; <nl> - case ClassDecl : : ForeignKind : : CFType : <nl> - diagKind = diag : : cf_class_cannot_conform_to_objc_protocol ; <nl> - break ; <nl> - case ClassDecl : : ForeignKind : : RuntimeOnly : <nl> - diagKind = diag : : objc_runtime_visible_cannot_conform_to_objc_protocol ; <nl> - break ; <nl> - } <nl> - if ( diagKind ) { <nl> - TC . diagnose ( ComplainLoc , diagKind . getValue ( ) , <nl> - T , Proto - > getDeclaredType ( ) ) ; <nl> - conformance - > setInvalid ( ) ; <nl> - return conformance ; <nl> - } <nl> + / / Check that T conforms to all inherited protocols . <nl> + for ( auto InheritedProto : Proto - > getInheritedProtocols ( ) ) { <nl> + auto InheritedConformance = <nl> + TC . conformsToProtocol ( <nl> + T , InheritedProto , DC , <nl> + ( ConformanceCheckFlags : : Used | <nl> + ConformanceCheckFlags : : SkipConditionalRequirements ) , <nl> + ComplainLoc ) ; <nl> + if ( ! InheritedConformance | | ! InheritedConformance - > isConcrete ( ) ) { <nl> + / / Recursive call already diagnosed this problem , but tack on a note <nl> + / / to establish the relationship . <nl> + if ( ComplainLoc . isValid ( ) ) { <nl> + TC . diagnose ( Proto , <nl> + diag : : inherited_protocol_does_not_conform , T , <nl> + InheritedProto - > getDeclaredType ( ) ) ; <nl> } <nl> - } <nl> <nl> - / / If the protocol contains missing requirements , it can ' t be conformed to <nl> - / / at all . <nl> - if ( Proto - > hasMissingRequirements ( ) ) { <nl> - bool hasDiagnosed = false ; <nl> - auto * protoFile = Proto - > getModuleScopeContext ( ) ; <nl> - if ( auto * serialized = dyn_cast < SerializedASTFile > ( protoFile ) ) { <nl> - if ( serialized - > getLanguageVersionBuiltWith ( ) ! = <nl> - TC . getLangOpts ( ) . EffectiveLanguageVersion ) { <nl> - TC . diagnose ( ComplainLoc , <nl> - diag : : protocol_has_missing_requirements_versioned , <nl> - T , Proto - > getDeclaredType ( ) , <nl> - serialized - > getLanguageVersionBuiltWith ( ) , <nl> - TC . getLangOpts ( ) . EffectiveLanguageVersion ) ; <nl> - hasDiagnosed = true ; <nl> - } <nl> - } <nl> - if ( ! hasDiagnosed ) { <nl> - TC . diagnose ( ComplainLoc , diag : : protocol_has_missing_requirements , <nl> - T , Proto - > getDeclaredType ( ) ) ; <nl> - } <nl> conformance - > setInvalid ( ) ; <nl> return conformance ; <nl> } <nl> + } <nl> <nl> - / / Check that T conforms to all inherited protocols . <nl> - for ( auto InheritedProto : Proto - > getInheritedProtocols ( ) ) { <nl> - auto InheritedConformance = <nl> - TC . conformsToProtocol ( <nl> - T , InheritedProto , DC , <nl> - ( ConformanceCheckFlags : : Used | <nl> - ConformanceCheckFlags : : SkipConditionalRequirements ) , <nl> - ComplainLoc ) ; <nl> - if ( ! InheritedConformance | | ! InheritedConformance - > isConcrete ( ) ) { <nl> - / / Recursive call already diagnosed this problem , but tack on a note <nl> - / / to establish the relationship . <nl> - if ( ComplainLoc . isValid ( ) ) { <nl> - TC . diagnose ( Proto , <nl> - diag : : inherited_protocol_does_not_conform , T , <nl> - InheritedProto - > getDeclaredType ( ) ) ; <nl> - } <nl> - <nl> - conformance - > setInvalid ( ) ; <nl> - return conformance ; <nl> - } <nl> - } <nl> - <nl> - if ( conformance - > isComplete ( ) ) <nl> - return conformance ; <nl> - <nl> - / / The conformance checker we ' re using . <nl> - AllUsedCheckers . emplace_back ( TC , conformance , MissingWitnesses ) ; <nl> - MissingWitnesses . insert ( revivedMissingWitnesses . begin ( ) , <nl> - revivedMissingWitnesses . end ( ) ) ; <nl> - AllUsedCheckers . back ( ) . checkConformance ( issueFixit ? <nl> - MissingWitnessDiagnosisKind : : ErrorFixIt : <nl> - MissingWitnessDiagnosisKind : : ErrorOnly ) ; <nl> + if ( conformance - > isComplete ( ) ) <nl> return conformance ; <nl> - } <nl> - } / / end anonymous namespace <nl> + <nl> + / / The conformance checker we ' re using . <nl> + AllUsedCheckers . emplace_back ( TC , conformance , MissingWitnesses ) ; <nl> + MissingWitnesses . insert ( revivedMissingWitnesses . begin ( ) , <nl> + revivedMissingWitnesses . end ( ) ) ; <nl> + AllUsedCheckers . back ( ) . checkConformance ( issueFixit ? <nl> + MissingWitnessDiagnosisKind : : ErrorFixIt : <nl> + MissingWitnessDiagnosisKind : : ErrorOnly ) ; <nl> + return conformance ; <nl> + } <nl> <nl> / / / \ brief Add the next associated type deduction to the string representation <nl> / / / of the deductions , used in diagnostics . <nl> diagnoseMatch ( ModuleDecl * module , NormalProtocolConformance * conformance , <nl> } <nl> } <nl> <nl> + ConformanceChecker : : ConformanceChecker ( <nl> + TypeChecker & tc , NormalProtocolConformance * conformance , <nl> + llvm : : SetVector < ValueDecl * > & GlobalMissingWitnesses , <nl> + bool suppressDiagnostics ) <nl> + : WitnessChecker ( tc , conformance - > getProtocol ( ) , <nl> + conformance - > getType ( ) , <nl> + conformance - > getDeclContext ( ) ) , <nl> + Conformance ( conformance ) , Loc ( conformance - > getLoc ( ) ) , <nl> + GlobalMissingWitnesses ( GlobalMissingWitnesses ) , <nl> + LocalMissingWitnessesStartIndex ( GlobalMissingWitnesses . size ( ) ) , <nl> + SuppressDiagnostics ( suppressDiagnostics ) { <nl> + / / The protocol may have only been validatedDeclForNameLookup ' d until <nl> + / / here , so fill in any information that ' s missing . <nl> + tc . validateDecl ( conformance - > getProtocol ( ) ) ; <nl> + } <nl> + <nl> ArrayRef < AssociatedTypeDecl * > <nl> ConformanceChecker : : getReferencedAssociatedTypes ( ValueDecl * req ) { <nl> / / Check whether we ' ve already cached this information . <nl> ResolveWitnessResult ConformanceChecker : : resolveWitnessViaDefault ( <nl> <nl> # pragma mark Type witness resolution <nl> <nl> - / / / Check whether the given type witness can be used for the given <nl> - / / / associated type . <nl> - / / / <nl> - / / / \ returns an empty result on success , or a description of the error . <nl> - static CheckTypeWitnessResult checkTypeWitness ( TypeChecker & tc , DeclContext * dc , <nl> + CheckTypeWitnessResult swift : : checkTypeWitness ( TypeChecker & tc , DeclContext * dc , <nl> ProtocolDecl * proto , <nl> AssociatedTypeDecl * assocType , <nl> Type type ) { <nl> ConformanceChecker : : inferTypeWitnessesViaValueWitness ( ValueDecl * req , <nl> return inferred ; <nl> } <nl> <nl> - namespace { <nl> - / / / A potential solution to the set of inferred type witnesses . <nl> - struct InferredTypeWitnessesSolution { <nl> - / / / The set of type witnesses inferred by this solution , along <nl> - / / / with the index into the value witnesses where the type was <nl> - / / / inferred . <nl> - llvm : : SmallDenseMap < AssociatedTypeDecl * , std : : pair < Type , unsigned > , 4 > <nl> - TypeWitnesses ; <nl> - <nl> - / / / The value witnesses selected by this step of the solution . <nl> - SmallVector < std : : pair < ValueDecl * , ValueDecl * > , 4 > ValueWitnesses ; <nl> - <nl> - / / / The number of value witnesses that occur in protocol <nl> - / / / extensions . <nl> - unsigned NumValueWitnessesInProtocolExtensions ; <nl> - <nl> - # ifndef NDEBUG <nl> - LLVM_ATTRIBUTE_USED <nl> - # endif <nl> - void dump ( ) { <nl> - llvm : : errs ( ) < < " Type Witnesses : \ n " ; <nl> - for ( auto & typeWitness : TypeWitnesses ) { <nl> - llvm : : errs ( ) < < " " < < typeWitness . first - > getName ( ) < < " : = " ; <nl> - typeWitness . second . first - > print ( llvm : : errs ( ) ) ; <nl> - llvm : : errs ( ) < < " value " < < typeWitness . second . second < < ' \ n ' ; <nl> - } <nl> - llvm : : errs ( ) < < " Value Witnesses : \ n " ; <nl> - for ( unsigned i : indices ( ValueWitnesses ) ) { <nl> - auto & valueWitness = ValueWitnesses [ i ] ; <nl> - llvm : : errs ( ) < < i < < " : " < < ( Decl * ) valueWitness . first <nl> - < < ' ' < < valueWitness . first - > getBaseName ( ) < < ' \ n ' ; <nl> - valueWitness . first - > getDeclContext ( ) - > dumpContext ( ) ; <nl> - llvm : : errs ( ) < < " for " < < ( Decl * ) valueWitness . second <nl> - < < ' ' < < valueWitness . second - > getBaseName ( ) < < ' \ n ' ; <nl> - valueWitness . second - > getDeclContext ( ) - > dumpContext ( ) ; <nl> - } <nl> - } <nl> - } ; <nl> - <nl> - / / / A failed type witness binding . <nl> - struct FailedTypeWitness { <nl> - / / / The value requirement that triggered inference . <nl> - ValueDecl * Requirement ; <nl> - <nl> - / / / The corresponding value witness from which the type witness <nl> - / / / was inferred . <nl> - ValueDecl * Witness ; <nl> - <nl> - / / / The actual type witness that was inferred . <nl> - Type TypeWitness ; <nl> - <nl> - / / / The failed type witness result . <nl> - CheckTypeWitnessResult Result ; <nl> - } ; <nl> - <nl> - / / / A conflict between two inferred type witnesses for the same <nl> - / / / associated type . <nl> - struct TypeWitnessConflict { <nl> - / / / The associated type . <nl> - AssociatedTypeDecl * AssocType ; <nl> - <nl> - / / / The first type . <nl> - Type FirstType ; <nl> - <nl> - / / / The requirement to which the first witness was matched . <nl> - ValueDecl * FirstRequirement ; <nl> - <nl> - / / / The witness from which the first type witness was inferred . <nl> - ValueDecl * FirstWitness ; <nl> - <nl> - / / / The second type . <nl> - Type SecondType ; <nl> - <nl> - / / / The requirement to which the second witness was matched . <nl> - ValueDecl * SecondRequirement ; <nl> - <nl> - / / / The witness from which the second type witness was inferred . <nl> - ValueDecl * SecondWitness ; <nl> - } ; <nl> - } / / end anonymous namespace <nl> - <nl> - static Comparison <nl> - compareDeclsForInference ( TypeChecker & TC , DeclContext * DC , <nl> - ValueDecl * decl1 , ValueDecl * decl2 ) { <nl> - / / TC . compareDeclarations assumes that it ' s comparing two decls that <nl> - / / apply equally well to a call site . We haven ' t yet inferred the <nl> - / / associated types for a type , so the ranking algorithm used by <nl> - / / compareDeclarations to score protocol extensions is inappropriate , <nl> - / / since we may have potential witnesses from extensions with mutually <nl> - / / exclusive associated type constraints , and compareDeclarations will <nl> - / / consider these unordered since neither extension ' s generic signature <nl> - / / is a superset of the other . <nl> - <nl> - / / If the witnesses come from the same decl context , score normally . <nl> - auto dc1 = decl1 - > getDeclContext ( ) ; <nl> - auto dc2 = decl2 - > getDeclContext ( ) ; <nl> - <nl> - if ( dc1 = = dc2 ) <nl> - return TC . compareDeclarations ( DC , decl1 , decl2 ) ; <nl> - <nl> - auto isProtocolExt1 = <nl> - ( bool ) dc1 - > getAsProtocolExtensionContext ( ) ; <nl> - auto isProtocolExt2 = <nl> - ( bool ) dc2 - > getAsProtocolExtensionContext ( ) ; <nl> - <nl> - / / If one witness comes from a protocol extension , favor the one <nl> - / / from a concrete context . <nl> - if ( isProtocolExt1 ! = isProtocolExt2 ) { <nl> - return isProtocolExt1 ? Comparison : : Worse : Comparison : : Better ; <nl> - } <nl> - <nl> - / / If both witnesses came from concrete contexts , score normally . <nl> - / / Associated type inference shouldn ' t impact the result . <nl> - / / FIXME : It could , if someone constrained to ConcreteType . AssocType . . . <nl> - if ( ! isProtocolExt1 ) <nl> - return TC . compareDeclarations ( DC , decl1 , decl2 ) ; <nl> - <nl> - / / Compare protocol extensions by which protocols they require Self to <nl> - / / conform to . If one extension requires a superset of the other ' s <nl> - / / constraints , it wins . <nl> - auto sig1 = dc1 - > getGenericSignatureOfContext ( ) ; <nl> - auto sig2 = dc2 - > getGenericSignatureOfContext ( ) ; <nl> - <nl> - / / FIXME : Extensions sometimes have null generic signatures while <nl> - / / checking the standard library . . . <nl> - if ( ! sig1 | | ! sig2 ) <nl> - return TC . compareDeclarations ( DC , decl1 , decl2 ) ; <nl> - <nl> - auto selfParam = GenericTypeParamType : : get ( 0 , 0 , TC . Context ) ; <nl> - <nl> - / / Collect the protocols required by extension 1 . <nl> - Type class1 ; <nl> - SmallPtrSet < ProtocolDecl * , 4 > protos1 ; <nl> - <nl> - std : : function < void ( ProtocolDecl * ) > insertProtocol ; <nl> - insertProtocol = [ & ] ( ProtocolDecl * p ) { <nl> - if ( ! protos1 . insert ( p ) . second ) <nl> - return ; <nl> - <nl> - for ( auto parent : p - > getInheritedProtocols ( ) ) <nl> - insertProtocol ( parent ) ; <nl> - } ; <nl> - <nl> - for ( auto & reqt : sig1 - > getRequirements ( ) ) { <nl> - if ( ! reqt . getFirstType ( ) - > isEqual ( selfParam ) ) <nl> - continue ; <nl> - switch ( reqt . getKind ( ) ) { <nl> - case RequirementKind : : Conformance : { <nl> - auto * proto = reqt . getSecondType ( ) - > castTo < ProtocolType > ( ) - > getDecl ( ) ; <nl> - insertProtocol ( proto ) ; <nl> - break ; <nl> - } <nl> - case RequirementKind : : Superclass : <nl> - class1 = reqt . getSecondType ( ) ; <nl> - break ; <nl> - <nl> - case RequirementKind : : SameType : <nl> - case RequirementKind : : Layout : <nl> - break ; <nl> - } <nl> - } <nl> - <nl> - / / Compare with the protocols required by extension 2 . <nl> - Type class2 ; <nl> - SmallPtrSet < ProtocolDecl * , 4 > protos2 ; <nl> - bool protos2AreSubsetOf1 = true ; <nl> - std : : function < void ( ProtocolDecl * ) > removeProtocol ; <nl> - removeProtocol = [ & ] ( ProtocolDecl * p ) { <nl> - if ( ! protos2 . insert ( p ) . second ) <nl> - return ; <nl> - <nl> - protos2AreSubsetOf1 & = protos1 . erase ( p ) ; <nl> - for ( auto parent : p - > getInheritedProtocols ( ) ) <nl> - removeProtocol ( parent ) ; <nl> - } ; <nl> - <nl> - for ( auto & reqt : sig2 - > getRequirements ( ) ) { <nl> - if ( ! reqt . getFirstType ( ) - > isEqual ( selfParam ) ) <nl> - continue ; <nl> - switch ( reqt . getKind ( ) ) { <nl> - case RequirementKind : : Conformance : { <nl> - auto * proto = reqt . getSecondType ( ) - > castTo < ProtocolType > ( ) - > getDecl ( ) ; <nl> - removeProtocol ( proto ) ; <nl> - break ; <nl> - } <nl> - case RequirementKind : : Superclass : <nl> - class2 = reqt . getSecondType ( ) ; <nl> - break ; <nl> - <nl> - case RequirementKind : : SameType : <nl> - case RequirementKind : : Layout : <nl> - break ; <nl> - } <nl> - } <nl> - <nl> - auto isClassConstraintAsStrict = [ & ] ( Type t1 , Type t2 ) - > bool { <nl> - if ( ! t1 ) <nl> - return ! t2 ; <nl> - <nl> - if ( ! t2 ) <nl> - return true ; <nl> - <nl> - return TC . isSubclassOf ( t1 , t2 , DC ) ; <nl> - } ; <nl> - <nl> - bool protos1AreSubsetOf2 = protos1 . empty ( ) ; <nl> - / / If the second extension requires strictly more protocols than the <nl> - / / first , it ' s better . <nl> - if ( protos1AreSubsetOf2 > protos2AreSubsetOf1 <nl> - & & isClassConstraintAsStrict ( class2 , class1 ) ) { <nl> - return Comparison : : Worse ; <nl> - / / If the first extension requires strictly more protocols than the <nl> - / / second , it ' s better . <nl> - } else if ( protos2AreSubsetOf1 > protos1AreSubsetOf2 <nl> - & & isClassConstraintAsStrict ( class1 , class2 ) ) { <nl> - return Comparison : : Better ; <nl> - } <nl> - <nl> - / / If they require the same set of protocols , or non - overlapping <nl> - / / sets , judge them normally . <nl> - return TC . compareDeclarations ( DC , decl1 , decl2 ) ; <nl> - } <nl> - <nl> - / / / " Sanitize " requirements for conformance checking , removing any requirements <nl> - / / / that unnecessarily refer to associated types of other protocols . <nl> - static void sanitizeProtocolRequirements ( <nl> - ProtocolDecl * proto , <nl> - ArrayRef < Requirement > requirements , <nl> - SmallVectorImpl < Requirement > & sanitized ) { <nl> - std : : function < Type ( Type ) > sanitizeType ; <nl> - sanitizeType = [ & ] ( Type outerType ) { <nl> - return outerType . transformRec ( [ & ] ( TypeBase * type ) - > Optional < Type > { <nl> - if ( auto depMemTy = dyn_cast < DependentMemberType > ( type ) ) { <nl> - if ( ! depMemTy - > getAssocType ( ) | | <nl> - depMemTy - > getAssocType ( ) - > getProtocol ( ) ! = proto ) { <nl> - for ( auto member : proto - > lookupDirect ( depMemTy - > getName ( ) ) ) { <nl> - if ( auto assocType = dyn_cast < AssociatedTypeDecl > ( member ) ) { <nl> - return Type ( DependentMemberType : : get ( <nl> - sanitizeType ( depMemTy - > getBase ( ) ) , <nl> - assocType ) ) ; <nl> - } <nl> - } <nl> - <nl> - if ( depMemTy - > getBase ( ) - > is < GenericTypeParamType > ( ) ) <nl> - return Type ( ) ; <nl> - } <nl> - } <nl> - <nl> - return None ; <nl> - } ) ; <nl> - } ; <nl> - <nl> - for ( const auto & req : requirements ) { <nl> - switch ( req . getKind ( ) ) { <nl> - case RequirementKind : : Conformance : <nl> - case RequirementKind : : SameType : <nl> - case RequirementKind : : Superclass : { <nl> - Type firstType = sanitizeType ( req . getFirstType ( ) ) ; <nl> - Type secondType = sanitizeType ( req . getSecondType ( ) ) ; <nl> - if ( firstType & & secondType ) { <nl> - sanitized . push_back ( { req . getKind ( ) , firstType , secondType } ) ; <nl> - } <nl> - break ; <nl> - } <nl> - <nl> - case RequirementKind : : Layout : { <nl> - Type firstType = sanitizeType ( req . getFirstType ( ) ) ; <nl> - if ( firstType ) { <nl> - sanitized . push_back ( { req . getKind ( ) , firstType , <nl> - req . getLayoutConstraint ( ) } ) ; <nl> - } <nl> - break ; <nl> - } <nl> - } <nl> - } <nl> - } <nl> - <nl> - void ConformanceChecker : : resolveTypeWitnesses ( ) { <nl> - llvm : : SetVector < AssociatedTypeDecl * > unresolvedAssocTypes ; <nl> - <nl> - SWIFT_DEFER { <nl> - / / Resolution attempts to have the witnesses be correct by construction , but <nl> - / / this isn ' t guaranteed , so let ' s double check . <nl> - ensureRequirementsAreSatisfied ( ) ; <nl> - } ; <nl> - <nl> - / / Track when we are checking type witnesses . <nl> - ProtocolConformanceState initialState = Conformance - > getState ( ) ; <nl> - Conformance - > setState ( ProtocolConformanceState : : CheckingTypeWitnesses ) ; <nl> - SWIFT_DEFER { Conformance - > setState ( initialState ) ; } ; <nl> - <nl> - for ( auto assocType : Proto - > getAssociatedTypeMembers ( ) ) { <nl> - / / If we already have a type witness , do nothing . <nl> - if ( Conformance - > hasTypeWitness ( assocType ) ) <nl> - continue ; <nl> - <nl> - / / Try to resolve this type witness via name lookup , which is the <nl> - / / most direct mechanism , overriding all others . <nl> - switch ( resolveTypeWitnessViaLookup ( assocType ) ) { <nl> - case ResolveWitnessResult : : Success : <nl> - / / Success . Move on to the next . <nl> - continue ; <nl> - <nl> - case ResolveWitnessResult : : ExplicitFailed : <nl> - continue ; <nl> - <nl> - case ResolveWitnessResult : : Missing : <nl> - / / Note that we haven ' t resolved this associated type yet . <nl> - unresolvedAssocTypes . insert ( assocType ) ; <nl> - break ; <nl> - } <nl> - } <nl> - <nl> - / / If we resolved everything , we ' re done . <nl> - if ( unresolvedAssocTypes . empty ( ) ) <nl> - return ; <nl> - <nl> - / / Infer type witnesses from value witnesses . <nl> - auto inferred = inferTypeWitnessesViaValueWitnesses ( unresolvedAssocTypes ) ; <nl> - DEBUG ( llvm : : dbgs ( ) < < " Candidates for inference : \ n " ; <nl> - dumpInferredAssociatedTypes ( inferred ) ) ; <nl> - <nl> - / / Compute the set of solutions . <nl> - SmallVector < std : : pair < ValueDecl * , ValueDecl * > , 4 > valueWitnesses ; <nl> - unsigned numValueWitnessesInProtocolExtensions = 0 ; <nl> - llvm : : ScopedHashTable < AssociatedTypeDecl * , std : : pair < Type , unsigned > > <nl> - typeWitnesses ; <nl> - typedef decltype ( typeWitnesses ) : : ScopeTy TypeWitnessesScope ; <nl> - unsigned numTypeWitnesses = 0 ; <nl> - SmallVector < InferredTypeWitnessesSolution , 4 > solutions ; <nl> - SmallVector < InferredTypeWitnessesSolution , 4 > nonViableSolutions ; <nl> - <nl> - / / Information to use for diagnosing failures when we don ' t have <nl> - / / something more specific . <nl> - <nl> - / / Which type witness was missing ? <nl> - AssociatedTypeDecl * missingTypeWitness = nullptr ; <nl> - <nl> - / / Was there a conflict in type witness deduction ? <nl> - Optional < TypeWitnessConflict > typeWitnessConflict ; <nl> - unsigned numTypeWitnessesBeforeConflict ; <nl> - <nl> - / / Did an associated type default fail ? <nl> - AssociatedTypeDecl * failedDefaultedAssocType = nullptr ; <nl> - Type failedDefaultedWitness ; <nl> - CheckTypeWitnessResult failedDefaultedResult ; <nl> - <nl> - / / Local function to compute the default type of an associated type . <nl> - auto computeDefaultTypeWitness = [ & ] ( AssociatedTypeDecl * assocType ) - > Type { <nl> - / / If we don ' t have a default definition , we ' re done . <nl> - if ( assocType - > getDefaultDefinitionLoc ( ) . isNull ( ) ) <nl> - return Type ( ) ; <nl> - <nl> - auto selfType = Proto - > getSelfInterfaceType ( ) ; <nl> - <nl> - / / Create a set of type substitutions for all known associated type . <nl> - / / FIXME : Base this on dependent types rather than archetypes ? <nl> - TypeSubstitutionMap substitutions ; <nl> - substitutions [ Proto - > mapTypeIntoContext ( selfType ) <nl> - - > castTo < ArchetypeType > ( ) ] = DC - > mapTypeIntoContext ( Adoptee ) ; <nl> - for ( auto assocType : Proto - > getAssociatedTypeMembers ( ) ) { <nl> - auto archetype = Proto - > mapTypeIntoContext ( <nl> - assocType - > getDeclaredInterfaceType ( ) ) <nl> - - > getAs < ArchetypeType > ( ) ; <nl> - if ( ! archetype ) <nl> - continue ; <nl> - if ( Conformance - > hasTypeWitness ( assocType ) ) { <nl> - substitutions [ archetype ] = <nl> - DC - > mapTypeIntoContext ( <nl> - Conformance - > getTypeWitness ( assocType , nullptr ) ) ; <nl> - } else { <nl> - auto known = typeWitnesses . begin ( assocType ) ; <nl> - if ( known ! = typeWitnesses . end ( ) ) <nl> - substitutions [ archetype ] = known - > first ; <nl> - else <nl> - substitutions [ archetype ] = ErrorType : : get ( archetype ) ; <nl> - } <nl> - } <nl> - <nl> - TC . validateDecl ( assocType ) ; <nl> - Type defaultType = assocType - > getDefaultDefinitionLoc ( ) . getType ( ) ; <nl> - <nl> - / / FIXME : Circularity <nl> - if ( ! defaultType ) <nl> - return Type ( ) ; <nl> - <nl> - defaultType = defaultType . subst ( <nl> - QueryTypeSubstitutionMap { substitutions } , <nl> - LookUpConformanceInModule ( DC - > getParentModule ( ) ) ) ; <nl> - <nl> - if ( ! defaultType ) <nl> - return Type ( ) ; <nl> - <nl> - if ( auto failed = checkTypeWitness ( TC , DC , Proto , assocType , defaultType ) ) { <nl> - / / Record the failure , if we haven ' t seen one already . <nl> - if ( ! failedDefaultedAssocType ) { <nl> - failedDefaultedAssocType = assocType ; <nl> - failedDefaultedWitness = defaultType ; <nl> - failedDefaultedResult = failed ; <nl> - } <nl> - <nl> - return Type ( ) ; <nl> - } <nl> - <nl> - return defaultType ; <nl> - } ; <nl> - <nl> - / / Local function to compute the derived type of an associated type , <nl> - / / for protocols known to the compiler . <nl> - auto computeDerivedTypeWitness = [ & ] ( AssociatedTypeDecl * assocType ) - > Type { <nl> - if ( Adoptee - > hasError ( ) ) <nl> - return Type ( ) ; <nl> - <nl> - / / UnresolvedTypes propagated their unresolvedness to any witnesses . <nl> - if ( Adoptee - > is < UnresolvedType > ( ) ) <nl> - return Adoptee ; <nl> - <nl> - / / Can we derive conformances for this protocol and adoptee ? <nl> - NominalTypeDecl * derivingTypeDecl = Adoptee - > getAnyNominal ( ) ; <nl> - if ( ! DerivedConformance : : derivesProtocolConformance ( TC , derivingTypeDecl , <nl> - Proto ) ) <nl> - return Type ( ) ; <nl> - <nl> - / / Try to derive the type witness . <nl> - Type derivedType = TC . deriveTypeWitness ( DC , derivingTypeDecl , assocType ) ; <nl> - if ( ! derivedType ) <nl> - return Type ( ) ; <nl> - <nl> - / / Make sure that the derived type is sane . <nl> - if ( checkTypeWitness ( TC , DC , Proto , assocType , derivedType ) ) { <nl> - diagnoseOrDefer ( assocType , true , <nl> - [ derivedType ] ( NormalProtocolConformance * conformance ) { <nl> - / / FIXME : give more detail here ? <nl> - auto & diags = derivedType - > getASTContext ( ) . Diags ; <nl> - diags . diagnose ( conformance - > getLoc ( ) , <nl> - diag : : protocol_derivation_is_broken , <nl> - conformance - > getProtocol ( ) - > getDeclaredType ( ) , <nl> - derivedType ) ; <nl> - } ) ; <nl> - <nl> - return Type ( ) ; <nl> - } <nl> - <nl> - return derivedType ; <nl> - } ; <nl> - <nl> - / / Local function that folds dependent member types with non - dependent <nl> - / / bases into actual member references . <nl> - std : : function < Type ( Type ) > foldDependentMemberTypes ; <nl> - llvm : : DenseSet < AssociatedTypeDecl * > recursionCheck ; <nl> - foldDependentMemberTypes = [ & ] ( Type type ) - > Type { <nl> - if ( auto depMemTy = type - > getAs < DependentMemberType > ( ) ) { <nl> - auto baseTy = depMemTy - > getBase ( ) . transform ( foldDependentMemberTypes ) ; <nl> - if ( baseTy . isNull ( ) | | baseTy - > hasTypeParameter ( ) ) <nl> - return nullptr ; <nl> - <nl> - auto assocType = depMemTy - > getAssocType ( ) ; <nl> - if ( ! assocType ) <nl> - return nullptr ; <nl> - <nl> - if ( ! recursionCheck . insert ( assocType ) . second ) <nl> - return nullptr ; <nl> - <nl> - SWIFT_DEFER { recursionCheck . erase ( assocType ) ; } ; <nl> - <nl> - / / Try to substitute into the base type . <nl> - if ( Type result = depMemTy - > substBaseType ( DC - > getParentModule ( ) , baseTy ) ) { <nl> - return result ; <nl> - } <nl> - <nl> - / / If that failed , check whether it ' s because of the conformance we ' re <nl> - / / evaluating . <nl> - auto localConformance <nl> - = TC . conformsToProtocol ( <nl> - baseTy , assocType - > getProtocol ( ) , DC , <nl> - ConformanceCheckFlags : : SkipConditionalRequirements ) ; <nl> - if ( ! localConformance | | localConformance - > isAbstract ( ) | | <nl> - ( localConformance - > getConcrete ( ) - > getRootNormalConformance ( ) <nl> - ! = Conformance ) ) { <nl> - return nullptr ; <nl> - } <nl> - <nl> - / / Find the tentative type witness for this associated type . <nl> - auto known = typeWitnesses . begin ( assocType ) ; <nl> - if ( known = = typeWitnesses . end ( ) ) <nl> - return nullptr ; <nl> - <nl> - return known - > first . transform ( foldDependentMemberTypes ) ; <nl> - } <nl> - <nl> - / / The presence of a generic type parameter indicates that we <nl> - / / cannot use this type binding . <nl> - if ( type - > is < GenericTypeParamType > ( ) ) { <nl> - return nullptr ; <nl> - } <nl> - <nl> - return type ; <nl> - <nl> - } ; <nl> - <nl> - auto typeInContext = <nl> - Conformance - > getDeclContext ( ) - > mapTypeIntoContext ( Conformance - > getType ( ) ) ; <nl> - <nl> - / / Local function that checks the current ( complete ) set of type witnesses <nl> - / / to determine whether they meet all of the requirements and to deal with <nl> - / / substitution of type witness bindings into other type witness bindings . <nl> - auto checkCurrentTypeWitnesses = [ & ] ( ) - > bool { <nl> - / / Fold the dependent member types within this type . <nl> - for ( auto assocType : Proto - > getAssociatedTypeMembers ( ) ) { <nl> - if ( Conformance - > hasTypeWitness ( assocType ) ) <nl> - continue ; <nl> - <nl> - / / If the type binding does not have a type parameter , there ' s nothing <nl> - / / to do . <nl> - auto known = typeWitnesses . begin ( assocType ) ; <nl> - assert ( known ! = typeWitnesses . end ( ) ) ; <nl> - if ( ! known - > first - > hasTypeParameter ( ) & & <nl> - ! known - > first - > hasDependentMember ( ) ) <nl> - continue ; <nl> - <nl> - Type replaced = known - > first . transform ( foldDependentMemberTypes ) ; <nl> - if ( replaced . isNull ( ) ) <nl> - return true ; <nl> - <nl> - known - > first = replaced ; <nl> - } <nl> - <nl> - / / Check any same - type requirements in the protocol ' s requirement signature . <nl> - if ( Proto - > isRequirementSignatureComputed ( ) ) { <nl> - SubstOptions options ( None ) ; <nl> - options . getTentativeTypeWitness = <nl> - [ & ] ( const NormalProtocolConformance * conformance , <nl> - AssociatedTypeDecl * assocType ) - > TypeBase * { <nl> - if ( conformance ! = Conformance ) return nullptr ; <nl> - <nl> - auto type = typeWitnesses . begin ( assocType ) - > first ; <nl> - return type - > mapTypeOutOfContext ( ) . getPointer ( ) ; <nl> - } ; <nl> - <nl> - auto substitutions = <nl> - SubstitutionMap : : getProtocolSubstitutions ( <nl> - Proto , typeInContext , <nl> - ProtocolConformanceRef ( Conformance ) ) ; <nl> - <nl> - SmallVector < Requirement , 4 > sanitizedRequirements ; <nl> - sanitizeProtocolRequirements ( Proto , Proto - > getRequirementSignature ( ) , <nl> - sanitizedRequirements ) ; <nl> - auto result = <nl> - TC . checkGenericArguments ( DC , SourceLoc ( ) , SourceLoc ( ) , <nl> - typeInContext , <nl> - { Proto - > getProtocolSelfType ( ) } , <nl> - sanitizedRequirements , <nl> - QuerySubstitutionMap { substitutions } , <nl> - TypeChecker : : LookUpConformance ( <nl> - TC , Conformance - > getDeclContext ( ) ) , <nl> - nullptr , None , nullptr , options ) ; <nl> - switch ( result ) { <nl> - case RequirementCheckResult : : Failure : <nl> - case RequirementCheckResult : : UnsatisfiedDependency : <nl> - return true ; <nl> - <nl> - case RequirementCheckResult : : Success : <nl> - case RequirementCheckResult : : SubstitutionFailure : <nl> - return false ; <nl> - } <nl> - } <nl> - return false ; <nl> - } ; <nl> - <nl> - / / Local function to perform the depth - first search of the solution <nl> - / / space . <nl> - std : : function < void ( unsigned ) > findSolutions ; <nl> - findSolutions = [ & ] ( unsigned reqDepth ) { <nl> - / / If we hit the last requirement , record and check this solution . <nl> - if ( reqDepth = = inferred . size ( ) ) { <nl> - / / Introduce a hash table scope ; we may add type witnesses here . <nl> - TypeWitnessesScope typeWitnessesScope ( typeWitnesses ) ; <nl> - <nl> - / / Check for completeness of the solution <nl> - for ( auto assocType : unresolvedAssocTypes ) { <nl> - / / Local function to record a missing associated type . <nl> - auto recordMissing = [ & ] { <nl> - if ( ! missingTypeWitness ) <nl> - missingTypeWitness = assocType ; <nl> - } ; <nl> - <nl> - auto typeWitness = typeWitnesses . begin ( assocType ) ; <nl> - if ( typeWitness ! = typeWitnesses . end ( ) ) { <nl> - / / The solution contains an error . <nl> - if ( typeWitness - > first - > hasError ( ) ) { <nl> - recordMissing ( ) ; <nl> - return ; <nl> - } <nl> - <nl> - continue ; <nl> - } <nl> - <nl> - / / We don ' t have a type witness for this associated type . <nl> - <nl> - / / If we can form a default type , do so . <nl> - if ( Type defaultType = computeDefaultTypeWitness ( assocType ) ) { <nl> - if ( defaultType - > hasError ( ) ) { <nl> - recordMissing ( ) ; <nl> - return ; <nl> - } <nl> - <nl> - typeWitnesses . insert ( assocType , { defaultType , reqDepth } ) ; <nl> - continue ; <nl> - } <nl> - <nl> - / / If we can derive a type witness , do so . <nl> - if ( Type derivedType = computeDerivedTypeWitness ( assocType ) ) { <nl> - if ( derivedType - > hasError ( ) ) { <nl> - recordMissing ( ) ; <nl> - return ; <nl> - } <nl> - <nl> - typeWitnesses . insert ( assocType , { derivedType , reqDepth } ) ; <nl> - continue ; <nl> - } <nl> - <nl> - / / If there is a generic parameter of the named type , use that . <nl> - if ( auto gpList = DC - > getGenericParamsOfContext ( ) ) { <nl> - GenericTypeParamDecl * foundGP = nullptr ; <nl> - for ( auto gp : * gpList ) { <nl> - if ( gp - > getName ( ) = = assocType - > getName ( ) ) { <nl> - foundGP = gp ; <nl> - break ; <nl> - } <nl> - } <nl> - <nl> - if ( foundGP ) { <nl> - auto gpType = DC - > mapTypeIntoContext ( <nl> - foundGP - > getDeclaredInterfaceType ( ) ) ; <nl> - typeWitnesses . insert ( assocType , { gpType , reqDepth } ) ; <nl> - continue ; <nl> - } <nl> - } <nl> - <nl> - / / The solution is incomplete . <nl> - recordMissing ( ) ; <nl> - return ; <nl> - } <nl> - <nl> - / / / Check the current set of type witnesses . <nl> - bool invalid = checkCurrentTypeWitnesses ( ) ; <nl> - <nl> - / / Determine whether there is already a solution with the same <nl> - / / bindings . <nl> - for ( const auto & solution : solutions ) { <nl> - bool sameSolution = true ; <nl> - for ( const auto & existingTypeWitness : solution . TypeWitnesses ) { <nl> - auto typeWitness = typeWitnesses . begin ( existingTypeWitness . first ) ; <nl> - if ( ! typeWitness - > first - > isEqual ( existingTypeWitness . second . first ) ) { <nl> - sameSolution = false ; <nl> - break ; <nl> - } <nl> - } <nl> - <nl> - / / We found the same solution . There is no point in recording <nl> - / / a new one . <nl> - if ( sameSolution ) <nl> - return ; <nl> - } <nl> - <nl> - auto & solutionList = invalid ? nonViableSolutions : solutions ; <nl> - solutionList . push_back ( InferredTypeWitnessesSolution ( ) ) ; <nl> - auto & solution = solutionList . back ( ) ; <nl> - <nl> - / / Copy the type witnesses . <nl> - for ( auto assocType : unresolvedAssocTypes ) { <nl> - auto typeWitness = typeWitnesses . begin ( assocType ) ; <nl> - solution . TypeWitnesses . insert ( { assocType , * typeWitness } ) ; <nl> - } <nl> - <nl> - / / Copy the value witnesses . <nl> - solution . ValueWitnesses = valueWitnesses ; <nl> - solution . NumValueWitnessesInProtocolExtensions <nl> - = numValueWitnessesInProtocolExtensions ; <nl> - <nl> - / / We ' re done recording the solution . <nl> - return ; <nl> - } <nl> - <nl> - / / Iterate over the potential witnesses for this requirement , <nl> - / / looking for solutions involving each one . <nl> - const auto & inferredReq = inferred [ reqDepth ] ; <nl> - for ( const auto & witnessReq : inferredReq . second ) { <nl> - / / Enter a new scope for the type witnesses hash table . <nl> - TypeWitnessesScope typeWitnessesScope ( typeWitnesses ) ; <nl> - llvm : : SaveAndRestore < unsigned > savedNumTypeWitnesses ( numTypeWitnesses ) ; <nl> - <nl> - / / Record this value witness , popping it when we exit the current scope . <nl> - valueWitnesses . push_back ( { inferredReq . first , witnessReq . Witness } ) ; <nl> - if ( witnessReq . Witness - > getDeclContext ( ) - > getAsProtocolExtensionContext ( ) ) <nl> - + + numValueWitnessesInProtocolExtensions ; <nl> - SWIFT_DEFER { <nl> - if ( witnessReq . Witness - > getDeclContext ( ) - > getAsProtocolExtensionContext ( ) ) <nl> - - - numValueWitnessesInProtocolExtensions ; <nl> - valueWitnesses . pop_back ( ) ; <nl> - } ; <nl> - <nl> - / / Introduce each of the type witnesses into the hash table . <nl> - bool failed = false ; <nl> - for ( const auto & typeWitness : witnessReq . Inferred ) { <nl> - / / If we ' ve seen a type witness for this associated type that <nl> - / / conflicts , there is no solution . <nl> - auto known = typeWitnesses . begin ( typeWitness . first ) ; <nl> - if ( known ! = typeWitnesses . end ( ) ) { <nl> - / / If witnesses for two difference requirements inferred the same <nl> - / / type , we ' re okay . <nl> - if ( known - > first - > isEqual ( typeWitness . second ) ) <nl> - continue ; <nl> - <nl> - / / If one has a type parameter remaining but the other does not , <nl> - / / drop the one with the type parameter . <nl> - if ( ( known - > first - > hasTypeParameter ( ) | | <nl> - known - > first - > hasDependentMember ( ) ) <nl> - ! = ( typeWitness . second - > hasTypeParameter ( ) | | <nl> - typeWitness . second - > hasDependentMember ( ) ) ) { <nl> - if ( typeWitness . second - > hasTypeParameter ( ) | | <nl> - typeWitness . second - > hasDependentMember ( ) ) <nl> - continue ; <nl> - <nl> - known - > first = typeWitness . second ; <nl> - continue ; <nl> - } <nl> - <nl> - if ( ! typeWitnessConflict | | <nl> - numTypeWitnesses > numTypeWitnessesBeforeConflict ) { <nl> - typeWitnessConflict = { typeWitness . first , <nl> - typeWitness . second , <nl> - inferredReq . first , <nl> - witnessReq . Witness , <nl> - known - > first , <nl> - valueWitnesses [ known - > second ] . first , <nl> - valueWitnesses [ known - > second ] . second } ; <nl> - numTypeWitnessesBeforeConflict = numTypeWitnesses ; <nl> - } <nl> - <nl> - failed = true ; <nl> - break ; <nl> - } <nl> - <nl> - / / Record the type witness . <nl> - + + numTypeWitnesses ; <nl> - typeWitnesses . insert ( typeWitness . first , { typeWitness . second , reqDepth } ) ; <nl> - } <nl> - <nl> - if ( failed ) <nl> - continue ; <nl> - <nl> - / / Recurse <nl> - findSolutions ( reqDepth + 1 ) ; <nl> - } <nl> - } ; <nl> - findSolutions ( 0 ) ; <nl> - <nl> - / / Go make sure that type declarations that would act as witnesses <nl> - / / did not get injected while we were performing checks above . This <nl> - / / can happen when two associated types in different protocols have <nl> - / / the same name , and validating a declaration ( above ) triggers the <nl> - / / type - witness generation for that second protocol , introducing a <nl> - / / new type declaration . <nl> - for ( auto assocType : unresolvedAssocTypes ) { <nl> - switch ( resolveTypeWitnessViaLookup ( assocType ) ) { <nl> - case ResolveWitnessResult : : Success : <nl> - case ResolveWitnessResult : : ExplicitFailed : <nl> - / / A declaration that can become a witness has shown up . Go <nl> - / / perform the resolution again now that we have more <nl> - / / information . <nl> - return resolveTypeWitnesses ( ) ; <nl> - <nl> - case ResolveWitnessResult : : Missing : <nl> - / / The type witness is still missing . Keep going . <nl> - break ; <nl> - } <nl> - } <nl> - <nl> - / / If we have more than one solution , do some simple ranking . <nl> - if ( solutions . size ( ) > 1 ) { <nl> - / / Find the smallest number of value witnesses found in protocol extensions . <nl> - unsigned bestNumValueWitnessesInProtocolExtensions <nl> - = solutions . front ( ) . NumValueWitnessesInProtocolExtensions ; <nl> - for ( unsigned i = 1 , n = solutions . size ( ) ; i ! = n ; + + i ) { <nl> - bestNumValueWitnessesInProtocolExtensions <nl> - = std : : min ( bestNumValueWitnessesInProtocolExtensions , <nl> - solutions [ i ] . NumValueWitnessesInProtocolExtensions ) ; <nl> - } <nl> - <nl> - / / Erase any solutions with more value witnesses in protocol <nl> - / / extensions than the best . <nl> - solutions . erase ( <nl> - std : : remove_if ( solutions . begin ( ) , solutions . end ( ) , <nl> - [ & ] ( const InferredTypeWitnessesSolution & solution ) { <nl> - return solution . NumValueWitnessesInProtocolExtensions > <nl> - bestNumValueWitnessesInProtocolExtensions ; <nl> - } ) , <nl> - solutions . end ( ) ) ; <nl> - } <nl> - <nl> - / / If we ( still ) have more than one solution , find the one with <nl> - / / more - specialized witnesses . <nl> - if ( solutions . size ( ) > 1 ) { <nl> - / / Local function to compare two solutions . <nl> - auto compareSolutions = [ & ] ( const InferredTypeWitnessesSolution & first , <nl> - const InferredTypeWitnessesSolution & second ) { <nl> - assert ( first . ValueWitnesses . size ( ) = = second . ValueWitnesses . size ( ) ) ; <nl> - bool firstBetter = false ; <nl> - bool secondBetter = false ; <nl> - for ( unsigned i = 0 , n = first . ValueWitnesses . size ( ) ; i ! = n ; + + i ) { <nl> - assert ( first . ValueWitnesses [ i ] . first = = second . ValueWitnesses [ i ] . first ) ; <nl> - auto firstWitness = first . ValueWitnesses [ i ] . second ; <nl> - auto secondWitness = second . ValueWitnesses [ i ] . second ; <nl> - if ( firstWitness = = secondWitness ) <nl> - continue ; <nl> - <nl> - switch ( compareDeclsForInference ( TC , DC , firstWitness , secondWitness ) ) { <nl> - case Comparison : : Better : <nl> - if ( secondBetter ) <nl> - return false ; <nl> - <nl> - firstBetter = true ; <nl> - break ; <nl> - <nl> - case Comparison : : Worse : <nl> - if ( firstBetter ) <nl> - return false ; <nl> - <nl> - secondBetter = true ; <nl> - break ; <nl> - <nl> - case Comparison : : Unordered : <nl> - break ; <nl> - } <nl> - } <nl> - <nl> - return firstBetter ; <nl> - } ; <nl> - <nl> - / / Find a solution that ' s at least as good as the solutions that follow it . <nl> - unsigned bestIdx = 0 ; <nl> - for ( unsigned i = 1 , n = solutions . size ( ) ; i ! = n ; + + i ) { <nl> - if ( compareSolutions ( solutions [ i ] , solutions [ bestIdx ] ) ) <nl> - bestIdx = i ; <nl> - } <nl> - <nl> - / / Make sure that solution is better than any of the other solutions . <nl> - bool ambiguous = false ; <nl> - for ( unsigned i = 1 , n = solutions . size ( ) ; i ! = n ; + + i ) { <nl> - if ( i ! = bestIdx & & ! compareSolutions ( solutions [ bestIdx ] , solutions [ i ] ) ) { <nl> - ambiguous = true ; <nl> - break ; <nl> - } <nl> - } <nl> - <nl> - / / If we had a best solution , keep just that solution . <nl> - if ( ! ambiguous ) { <nl> - if ( bestIdx ! = 0 ) <nl> - solutions [ 0 ] = std : : move ( solutions [ bestIdx ] ) ; <nl> - solutions . erase ( solutions . begin ( ) + 1 , solutions . end ( ) ) ; <nl> - } <nl> - } <nl> - <nl> - / / If we have no solution , but we did find something that is nonviable , <nl> - / / use the first nonviable one to improve error reporting . <nl> - if ( solutions . empty ( ) & & ! nonViableSolutions . empty ( ) ) { <nl> - solutions . push_back ( std : : move ( nonViableSolutions . front ( ) ) ) ; <nl> - } <nl> - <nl> - / / If we found a single solution , take it . <nl> - if ( solutions . size ( ) = = 1 ) { <nl> - / / Record each of the deduced witnesses . <nl> - auto & typeWitnesses = solutions . front ( ) . TypeWitnesses ; <nl> - for ( auto assocType : unresolvedAssocTypes ) { <nl> - assert ( typeWitnesses . count ( assocType ) = = 1 & & " missing witness " ) ; <nl> - auto replacement = typeWitnesses [ assocType ] . first ; <nl> - / / FIXME : We can end up here with dependent types that were not folded <nl> - / / away for some reason . <nl> - if ( replacement - > hasDependentMember ( ) ) <nl> - replacement = ErrorType : : get ( TC . Context ) ; <nl> - else if ( replacement - > hasArchetype ( ) ) <nl> - replacement = replacement - > mapTypeOutOfContext ( ) ; <nl> - recordTypeWitness ( assocType , replacement , nullptr , true ) ; <nl> - } <nl> - <nl> - return ; <nl> - } <nl> - <nl> - / / Error cases follow . <nl> - Conformance - > setInvalid ( ) ; <nl> - <nl> - / / We ' re going to produce an error below . Mark each unresolved <nl> - / / associated type witness as erroneous . <nl> - for ( auto assocType : unresolvedAssocTypes ) { <nl> - recordTypeWitness ( assocType , ErrorType : : get ( TC . Context ) , nullptr , true ) ; <nl> - } <nl> - <nl> - / / No solutions . Diagnose the first associated type for which we <nl> - / / could not determine a witness . <nl> - if ( solutions . empty ( ) ) { <nl> - / / If a defaulted type witness failed , diagnose it . <nl> - if ( failedDefaultedAssocType ) { <nl> - diagnoseOrDefer ( failedDefaultedAssocType , true , <nl> - [ failedDefaultedAssocType , failedDefaultedWitness , <nl> - failedDefaultedResult ] ( NormalProtocolConformance * conformance ) { <nl> - auto proto = conformance - > getProtocol ( ) ; <nl> - auto & diags = proto - > getASTContext ( ) . Diags ; <nl> - diags . diagnose ( failedDefaultedAssocType , <nl> - diag : : default_associated_type_req_fail , <nl> - failedDefaultedWitness , <nl> - failedDefaultedAssocType - > getFullName ( ) , <nl> - proto - > getDeclaredType ( ) , <nl> - failedDefaultedResult . getRequirement ( ) , <nl> - failedDefaultedResult . isConformanceRequirement ( ) ) ; <nl> - } ) ; <nl> - return ; <nl> - } <nl> - <nl> - / / Form a mapping from associated type declarations to failed type <nl> - / / witnesses . <nl> - llvm : : DenseMap < AssociatedTypeDecl * , SmallVector < FailedTypeWitness , 2 > > <nl> - failedTypeWitnesses ; <nl> - for ( const auto & inferredReq : inferred ) { <nl> - for ( const auto & inferredWitness : inferredReq . second ) { <nl> - for ( const auto & nonViable : inferredWitness . NonViable ) { <nl> - failedTypeWitnesses [ std : : get < 0 > ( nonViable ) ] <nl> - . push_back ( { inferredReq . first , inferredWitness . Witness , <nl> - std : : get < 1 > ( nonViable ) , std : : get < 2 > ( nonViable ) } ) ; <nl> - } <nl> - } <nl> - } <nl> - <nl> - / / Local function to attempt to diagnose potential type witnesses <nl> - / / that failed requirements . <nl> - auto tryDiagnoseTypeWitness = [ & ] ( AssociatedTypeDecl * assocType ) - > bool { <nl> - auto known = failedTypeWitnesses . find ( assocType ) ; <nl> - if ( known = = failedTypeWitnesses . end ( ) ) <nl> - return false ; <nl> - <nl> - auto failedSet = std : : move ( known - > second ) ; <nl> - diagnoseOrDefer ( assocType , true , <nl> - [ assocType , failedSet ] ( NormalProtocolConformance * conformance ) { <nl> - auto proto = conformance - > getProtocol ( ) ; <nl> - auto & diags = proto - > getASTContext ( ) . Diags ; <nl> - diags . diagnose ( assocType , diag : : bad_associated_type_deduction , <nl> - assocType - > getFullName ( ) , proto - > getFullName ( ) ) ; <nl> - for ( const auto & failed : failedSet ) { <nl> - diags . diagnose ( failed . Witness , <nl> - diag : : associated_type_deduction_witness_failed , <nl> - failed . Requirement - > getFullName ( ) , <nl> - failed . TypeWitness , <nl> - failed . Result . getRequirement ( ) , <nl> - failed . Result . isConformanceRequirement ( ) ) ; <nl> - } <nl> - } ) ; <nl> - <nl> - return true ; <nl> - } ; <nl> - <nl> - / / Try to diagnose the first missing type witness we encountered . <nl> - if ( missingTypeWitness & & tryDiagnoseTypeWitness ( missingTypeWitness ) ) <nl> - return ; <nl> - <nl> - / / Failing that , try to diagnose any type witness that failed a <nl> - / / requirement . <nl> - for ( auto assocType : unresolvedAssocTypes ) { <nl> - if ( tryDiagnoseTypeWitness ( assocType ) ) <nl> - return ; <nl> - } <nl> - <nl> - / / If we saw a conflict , complain about it . <nl> - if ( typeWitnessConflict ) { <nl> - diagnoseOrDefer ( typeWitnessConflict - > AssocType , true , <nl> - [ typeWitnessConflict ] ( NormalProtocolConformance * conformance ) { <nl> - auto & diags = conformance - > getDeclContext ( ) - > getASTContext ( ) . Diags ; <nl> - diags . diagnose ( typeWitnessConflict - > AssocType , <nl> - diag : : ambiguous_associated_type_deduction , <nl> - typeWitnessConflict - > AssocType - > getFullName ( ) , <nl> - typeWitnessConflict - > FirstType , <nl> - typeWitnessConflict - > SecondType ) ; <nl> - <nl> - diags . diagnose ( typeWitnessConflict - > FirstWitness , <nl> - diag : : associated_type_deduction_witness , <nl> - typeWitnessConflict - > FirstRequirement - > getFullName ( ) , <nl> - typeWitnessConflict - > FirstType ) ; <nl> - diags . diagnose ( typeWitnessConflict - > SecondWitness , <nl> - diag : : associated_type_deduction_witness , <nl> - typeWitnessConflict - > SecondRequirement - > getFullName ( ) , <nl> - typeWitnessConflict - > SecondType ) ; <nl> - } ) ; <nl> - <nl> - return ; <nl> - } <nl> - <nl> - / / Save the missing type witnesses for later diagnosis . <nl> - GlobalMissingWitnesses . insert ( unresolvedAssocTypes . begin ( ) , <nl> - unresolvedAssocTypes . end ( ) ) ; <nl> - <nl> - return ; <nl> - } <nl> - <nl> - / / Multiple solutions . Diagnose the ambiguity . <nl> - for ( auto assocType : unresolvedAssocTypes ) { <nl> - / / Find two types that conflict . <nl> - auto & firstSolution = solutions . front ( ) ; <nl> - <nl> - / / Local function to retrieve the value witness for the current associated <nl> - / / type within the given solution . <nl> - auto getValueWitness = [ & ] ( InferredTypeWitnessesSolution & solution ) { <nl> - unsigned witnessIdx = solution . TypeWitnesses [ assocType ] . second ; <nl> - if ( witnessIdx < solution . ValueWitnesses . size ( ) ) <nl> - return solution . ValueWitnesses [ witnessIdx ] ; <nl> - <nl> - return std : : pair < ValueDecl * , ValueDecl * > ( nullptr , nullptr ) ; <nl> - } ; <nl> - <nl> - Type firstType = firstSolution . TypeWitnesses [ assocType ] . first ; <nl> - <nl> - / / Extract the value witness used to deduce this associated type , if any . <nl> - auto firstMatch = getValueWitness ( firstSolution ) ; <nl> - <nl> - Type secondType ; <nl> - std : : pair < ValueDecl * , ValueDecl * > secondMatch ; <nl> - for ( auto & solution : solutions ) { <nl> - Type typeWitness = solution . TypeWitnesses [ assocType ] . first ; <nl> - if ( ! typeWitness - > isEqual ( firstType ) ) { <nl> - secondType = typeWitness ; <nl> - secondMatch = getValueWitness ( solution ) ; <nl> - break ; <nl> - } <nl> - } <nl> - <nl> - if ( ! secondType ) <nl> - continue ; <nl> - <nl> - / / We found an ambiguity . diagnose it . <nl> - diagnoseOrDefer ( assocType , true , <nl> - [ assocType , firstType , firstMatch , secondType , secondMatch ] ( <nl> - NormalProtocolConformance * conformance ) { <nl> - auto & diags = assocType - > getASTContext ( ) . Diags ; <nl> - diags . diagnose ( assocType , diag : : ambiguous_associated_type_deduction , <nl> - assocType - > getFullName ( ) , firstType , secondType ) ; <nl> - <nl> - auto diagnoseWitness = [ & ] ( std : : pair < ValueDecl * , ValueDecl * > match , <nl> - Type type ) { <nl> - / / If we have a requirement / witness pair , diagnose it . <nl> - if ( match . first & & match . second ) { <nl> - diags . diagnose ( match . second , <nl> - diag : : associated_type_deduction_witness , <nl> - match . first - > getFullName ( ) , type ) ; <nl> - <nl> - return ; <nl> - } <nl> - <nl> - / / Otherwise , we have a default . <nl> - diags . diagnose ( assocType , diag : : associated_type_deduction_default , <nl> - type ) <nl> - . highlight ( assocType - > getDefaultDefinitionLoc ( ) . getSourceRange ( ) ) ; <nl> - } ; <nl> - <nl> - diagnoseWitness ( firstMatch , firstType ) ; <nl> - diagnoseWitness ( secondMatch , secondType ) ; <nl> - } ) ; <nl> - <nl> - return ; <nl> - } <nl> - } <nl> - <nl> - void ConformanceChecker : : resolveSingleTypeWitness ( <nl> - AssociatedTypeDecl * assocType ) { <nl> - / / Ensure we diagnose if the witness is missing . <nl> - SWIFT_DEFER { <nl> - diagnoseMissingWitnesses ( MissingWitnessDiagnosisKind : : ErrorFixIt ) ; <nl> - } ; <nl> - switch ( resolveTypeWitnessViaLookup ( assocType ) ) { <nl> - case ResolveWitnessResult : : Success : <nl> - case ResolveWitnessResult : : ExplicitFailed : <nl> - / / We resolved this type witness one way or another . <nl> - return ; <nl> - <nl> - case ResolveWitnessResult : : Missing : <nl> - / / The type witness is still missing . Resolve all of the type witnesses . <nl> - resolveTypeWitnesses ( ) ; <nl> - return ; <nl> - } <nl> - } <nl> - <nl> - void ConformanceChecker : : resolveSingleWitness ( ValueDecl * requirement ) { <nl> - assert ( ! isa < AssociatedTypeDecl > ( requirement ) & & " Not a value witness " ) ; <nl> - assert ( ! Conformance - > hasWitness ( requirement ) & & " Already resolved " ) ; <nl> - <nl> - / / Note that we ' re resolving this witness . <nl> - assert ( ResolvingWitnesses . count ( requirement ) = = 0 & & " Currently resolving " ) ; <nl> - ResolvingWitnesses . insert ( requirement ) ; <nl> - SWIFT_DEFER { ResolvingWitnesses . erase ( requirement ) ; } ; <nl> - <nl> - / / Make sure we ' ve validated the requirement . <nl> - if ( ! requirement - > hasInterfaceType ( ) ) <nl> - TC . validateDecl ( requirement ) ; <nl> - <nl> - if ( requirement - > isInvalid ( ) | | ! requirement - > hasValidSignature ( ) ) { <nl> - Conformance - > setInvalid ( ) ; <nl> - return ; <nl> - } <nl> - <nl> - if ( ! requirement - > isProtocolRequirement ( ) ) <nl> - return ; <nl> - <nl> - / / Resolve all associated types before trying to resolve this witness . <nl> - resolveTypeWitnesses ( ) ; <nl> - <nl> - / / If any of the type witnesses was erroneous , don ' t bother to check <nl> - / / this value witness : it will fail . <nl> - for ( auto assocType : getReferencedAssociatedTypes ( requirement ) ) { <nl> - if ( Conformance - > getTypeWitness ( assocType , nullptr ) - > hasError ( ) ) { <nl> - Conformance - > setInvalid ( ) ; <nl> - return ; <nl> - } <nl> - } <nl> - <nl> - / / Try to resolve the witness via explicit definitions . <nl> - switch ( resolveWitnessViaLookup ( requirement ) ) { <nl> - case ResolveWitnessResult : : Success : <nl> - return ; <nl> - <nl> - case ResolveWitnessResult : : ExplicitFailed : <nl> - Conformance - > setInvalid ( ) ; <nl> - recordInvalidWitness ( requirement ) ; <nl> - return ; <nl> - <nl> - case ResolveWitnessResult : : Missing : <nl> - / / Continue trying below . <nl> - break ; <nl> - } <nl> - <nl> - / / Try to resolve the witness via derivation . <nl> - switch ( resolveWitnessViaDerivation ( requirement ) ) { <nl> - case ResolveWitnessResult : : Success : <nl> - return ; <nl> - <nl> - case ResolveWitnessResult : : ExplicitFailed : <nl> - Conformance - > setInvalid ( ) ; <nl> - recordInvalidWitness ( requirement ) ; <nl> - return ; <nl> - <nl> - case ResolveWitnessResult : : Missing : <nl> - / / Continue trying below . <nl> - break ; <nl> - } <nl> - <nl> - / / Try to resolve the witness via defaults . <nl> - switch ( resolveWitnessViaDefault ( requirement ) ) { <nl> - case ResolveWitnessResult : : Success : <nl> - return ; <nl> - <nl> - case ResolveWitnessResult : : ExplicitFailed : <nl> - Conformance - > setInvalid ( ) ; <nl> - recordInvalidWitness ( requirement ) ; <nl> - return ; <nl> - <nl> - case ResolveWitnessResult : : Missing : <nl> - llvm_unreachable ( " Should have failed " ) ; <nl> - break ; <nl> - } <nl> - } <nl> - <nl> static void recordConformanceDependency ( DeclContext * DC , <nl> NominalTypeDecl * Adoptee , <nl> ProtocolConformance * Conformance , <nl> new file mode 100644 <nl> index 000000000000 . . e84fac670936 <nl> mmm / dev / null <nl> ppp b / lib / Sema / TypeCheckProtocol . h <nl> <nl> + / / = = = mmm ConstraintSystem . h - Constraint - based Type Checking mmm - * - C + + - * - = = = / / <nl> + / / <nl> + / / This source file is part of the Swift . org open source project <nl> + / / <nl> + / / Copyright ( c ) 2014 - 2017 Apple Inc . and the Swift project authors <nl> + / / Licensed under Apache License v2 . 0 with Runtime Library Exception <nl> + / / <nl> + / / See https : / / swift . org / LICENSE . txt for license information <nl> + / / See https : / / swift . org / CONTRIBUTORS . txt for the list of Swift project authors <nl> + / / <nl> + / / = = = mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - = = = / / <nl> + / / <nl> + / / This file provides the constraint - based type checker , anchored by the <nl> + / / \ c ConstraintSystem class , which provides type checking and type <nl> + / / inference for expressions . <nl> + / / <nl> + / / = = = mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - = = = / / <nl> + # ifndef SWIFT_SEMA_PROTOCOL_H <nl> + # define SWIFT_SEMA_PROTOCOL_H <nl> + <nl> + # include " swift / AST / Type . h " <nl> + # include " swift / AST / Types . h " <nl> + # include " llvm / ADT / ScopedHashTable . h " <nl> + # include " llvm / ADT / SetVector . h " <nl> + # include " llvm / ADT / SmallPtrSet . h " <nl> + # include " llvm / ADT / SmallVector . h " <nl> + <nl> + namespace swift { <nl> + <nl> + class AccessScope ; <nl> + class AssociatedTypeDecl ; <nl> + class AvailabilityContext ; <nl> + class DeclContext ; <nl> + class NormalProtocolConformance ; <nl> + class ProtocolDecl ; <nl> + class TypeChecker ; <nl> + class ValueDecl ; <nl> + <nl> + / / / A conflict between two inferred type witnesses for the same <nl> + / / / associated type . <nl> + struct TypeWitnessConflict { <nl> + / / / The associated type . <nl> + AssociatedTypeDecl * AssocType ; <nl> + <nl> + / / / The first type . <nl> + Type FirstType ; <nl> + <nl> + / / / The requirement to which the first witness was matched . <nl> + ValueDecl * FirstRequirement ; <nl> + <nl> + / / / The witness from which the first type witness was inferred . <nl> + ValueDecl * FirstWitness ; <nl> + <nl> + / / / The second type . <nl> + Type SecondType ; <nl> + <nl> + / / / The requirement to which the second witness was matched . <nl> + ValueDecl * SecondRequirement ; <nl> + <nl> + / / / The witness from which the second type witness was inferred . <nl> + ValueDecl * SecondWitness ; <nl> + } ; <nl> + <nl> + / / / Describes the result of checking a type witness . <nl> + / / / <nl> + / / / This class evaluates true if an error occurred . <nl> + class CheckTypeWitnessResult { <nl> + Type Requirement ; <nl> + <nl> + public : <nl> + CheckTypeWitnessResult ( ) { } <nl> + CheckTypeWitnessResult ( Type reqt ) : Requirement ( reqt ) { } <nl> + <nl> + Type getRequirement ( ) const { return Requirement ; } <nl> + bool isConformanceRequirement ( ) const { <nl> + return Requirement - > isExistentialType ( ) ; <nl> + } <nl> + <nl> + explicit operator bool ( ) const { return ! Requirement . isNull ( ) ; } <nl> + } ; <nl> + <nl> + / / / Check whether the given type witness can be used for the given <nl> + / / / associated type . <nl> + / / / <nl> + / / / \ returns an empty result on success , or a description of the error . <nl> + CheckTypeWitnessResult checkTypeWitness ( TypeChecker & tc , DeclContext * dc , <nl> + ProtocolDecl * proto , <nl> + AssociatedTypeDecl * assocType , <nl> + Type type ) ; <nl> + <nl> + / / / The set of associated types that have been inferred by matching <nl> + / / / the given value witness to its corresponding requirement . <nl> + struct InferredAssociatedTypesByWitness { <nl> + / / / The witness we matched . <nl> + ValueDecl * Witness = nullptr ; <nl> + <nl> + / / / The associated types inferred from matching this witness . <nl> + SmallVector < std : : pair < AssociatedTypeDecl * , Type > , 4 > Inferred ; <nl> + <nl> + / / / Inferred associated types that don ' t meet the associated type <nl> + / / / requirements . <nl> + SmallVector < std : : tuple < AssociatedTypeDecl * , Type , CheckTypeWitnessResult > , <nl> + 2 > NonViable ; <nl> + <nl> + void dump ( llvm : : raw_ostream & out , unsigned indent ) const ; <nl> + <nl> + LLVM_ATTRIBUTE_DEPRECATED ( void dump ( ) const , <nl> + " only for use in the debugger " ) ; <nl> + } ; <nl> + <nl> + / / / The set of witnesses that were considered when attempting to <nl> + / / / infer associated types . <nl> + typedef SmallVector < InferredAssociatedTypesByWitness , 2 > <nl> + InferredAssociatedTypesByWitnesses ; <nl> + <nl> + / / / A mapping from requirements to the set of matches with witnesses . <nl> + typedef SmallVector < std : : pair < ValueDecl * , <nl> + InferredAssociatedTypesByWitnesses > , 4 > <nl> + InferredAssociatedTypes ; <nl> + <nl> + / / / A potential solution to the set of inferred type witnesses . <nl> + struct InferredTypeWitnessesSolution { <nl> + / / / The set of type witnesses inferred by this solution , along <nl> + / / / with the index into the value witnesses where the type was <nl> + / / / inferred . <nl> + llvm : : SmallDenseMap < AssociatedTypeDecl * , std : : pair < Type , unsigned > , 4 > <nl> + TypeWitnesses ; <nl> + <nl> + / / / The value witnesses selected by this step of the solution . <nl> + SmallVector < std : : pair < ValueDecl * , ValueDecl * > , 4 > ValueWitnesses ; <nl> + <nl> + / / / The number of value witnesses that occur in protocol <nl> + / / / extensions . <nl> + unsigned NumValueWitnessesInProtocolExtensions ; <nl> + <nl> + # ifndef NDEBUG <nl> + LLVM_ATTRIBUTE_USED <nl> + # endif <nl> + void dump ( ) ; <nl> + } ; <nl> + <nl> + struct RequirementMatch ; <nl> + struct RequirementCheck ; <nl> + <nl> + class WitnessChecker { <nl> + protected : <nl> + TypeChecker & TC ; <nl> + ProtocolDecl * Proto ; <nl> + Type Adoptee ; <nl> + / / The conforming context , either a nominal type or extension . <nl> + DeclContext * DC ; <nl> + <nl> + / / An auxiliary lookup table to be used for witnesses remapped via <nl> + / / @ _implements ( Protocol , DeclName ) <nl> + llvm : : DenseMap < DeclName , llvm : : TinyPtrVector < ValueDecl * > > ImplementsTable ; <nl> + <nl> + WitnessChecker ( TypeChecker & tc , ProtocolDecl * proto , <nl> + Type adoptee , DeclContext * dc ) ; <nl> + <nl> + / / / Gather the value witnesses for the given requirement . <nl> + / / / <nl> + / / / \ param ignoringNames If non - null and there are no value <nl> + / / / witnesses with the correct full name , the results will reflect <nl> + / / / lookup for just the base name and the pointee will be set to <nl> + / / / \ c true . <nl> + SmallVector < ValueDecl * , 4 > lookupValueWitnesses ( ValueDecl * req , <nl> + bool * ignoringNames ) ; <nl> + <nl> + void lookupValueWitnessesViaImplementsAttr ( ValueDecl * req , <nl> + SmallVector < ValueDecl * , 4 > <nl> + & witnesses ) ; <nl> + <nl> + bool findBestWitness ( ValueDecl * requirement , <nl> + bool * ignoringNames , <nl> + NormalProtocolConformance * conformance , <nl> + SmallVectorImpl < RequirementMatch > & matches , <nl> + unsigned & numViable , <nl> + unsigned & bestIdx , <nl> + bool & doNotDiagnoseMatches ) ; <nl> + <nl> + bool checkWitnessAccess ( AccessScope & requiredAccessScope , <nl> + ValueDecl * requirement , <nl> + ValueDecl * witness , <nl> + bool * isSetter ) ; <nl> + <nl> + bool checkWitnessAvailability ( ValueDecl * requirement , <nl> + ValueDecl * witness , <nl> + AvailabilityContext * requirementInfo ) ; <nl> + <nl> + RequirementCheck checkWitness ( AccessScope requiredAccessScope , <nl> + ValueDecl * requirement , <nl> + const RequirementMatch & match ) ; <nl> + } ; <nl> + <nl> + / / / The result of attempting to resolve a witness . <nl> + enum class ResolveWitnessResult { <nl> + / / / The resolution succeeded . <nl> + Success , <nl> + / / / There was an explicit witness available , but it failed some <nl> + / / / criteria . <nl> + ExplicitFailed , <nl> + / / / There was no witness available . <nl> + Missing <nl> + } ; <nl> + <nl> + enum class MissingWitnessDiagnosisKind { <nl> + FixItOnly , <nl> + ErrorOnly , <nl> + ErrorFixIt , <nl> + } ; <nl> + <nl> + class AssociatedTypeInference ; <nl> + class MultiConformanceChecker ; <nl> + <nl> + / / / The protocol conformance checker . <nl> + / / / <nl> + / / / This helper class handles most of the details of checking whether a <nl> + / / / given type ( \ c Adoptee ) conforms to a protocol ( \ c Proto ) . <nl> + class ConformanceChecker : public WitnessChecker { <nl> + friend class MultiConformanceChecker ; <nl> + friend class AssociatedTypeInference ; <nl> + <nl> + NormalProtocolConformance * Conformance ; <nl> + SourceLoc Loc ; <nl> + <nl> + / / / Witnesses that are currently being resolved . <nl> + llvm : : SmallPtrSet < ValueDecl * , 4 > ResolvingWitnesses ; <nl> + <nl> + / / / Caches the set of associated types that are referenced in each <nl> + / / / requirement . <nl> + llvm : : DenseMap < ValueDecl * , llvm : : SmallVector < AssociatedTypeDecl * , 2 > > <nl> + ReferencedAssociatedTypes ; <nl> + <nl> + / / / Keep track of missing witnesses , either type or value , for later <nl> + / / / diagnosis emits . This may contain witnesses that are external to the <nl> + / / / protocol under checking . <nl> + llvm : : SetVector < ValueDecl * > & GlobalMissingWitnesses ; <nl> + <nl> + / / / Keep track of the slice in GlobalMissingWitnesses that is local to <nl> + / / / this protocol under checking . <nl> + unsigned LocalMissingWitnessesStartIndex ; <nl> + <nl> + / / / True if we shouldn ' t complain about problems with this conformance <nl> + / / / right now , i . e . if methods are being called outside <nl> + / / / checkConformance ( ) . <nl> + bool SuppressDiagnostics ; <nl> + <nl> + / / / Whether we ' ve already complained about problems with this conformance . <nl> + bool AlreadyComplained = false ; <nl> + <nl> + / / / Whether we checked the requirement signature already . <nl> + bool CheckedRequirementSignature = false ; <nl> + <nl> + / / / Retrieve the associated types that are referenced by the given <nl> + / / / requirement with a base of ' Self ' . <nl> + ArrayRef < AssociatedTypeDecl * > getReferencedAssociatedTypes ( ValueDecl * req ) ; <nl> + <nl> + / / / Record a ( non - type ) witness for the given requirement . <nl> + void recordWitness ( ValueDecl * requirement , const RequirementMatch & match ) ; <nl> + <nl> + / / / Record that the given optional requirement has no witness . <nl> + void recordOptionalWitness ( ValueDecl * requirement ) ; <nl> + <nl> + / / / Record that the given requirement has no valid witness . <nl> + void recordInvalidWitness ( ValueDecl * requirement ) ; <nl> + <nl> + / / / Record a type witness . <nl> + / / / <nl> + / / / \ param assocType The associated type whose witness is being recorded . <nl> + / / / <nl> + / / / \ param type The witness type . <nl> + / / / <nl> + / / / \ param typeDecl The decl the witness type came from ; can be null . <nl> + void recordTypeWitness ( AssociatedTypeDecl * assocType , Type type , <nl> + TypeDecl * typeDecl , bool performRedeclarationCheck ) ; <nl> + <nl> + / / / Enforce restrictions on non - final classes witnessing requirements <nl> + / / / involving the protocol ' Self ' type . <nl> + void checkNonFinalClassWitness ( ValueDecl * requirement , <nl> + ValueDecl * witness ) ; <nl> + <nl> + / / / Resolve a ( non - type ) witness via name lookup . <nl> + ResolveWitnessResult resolveWitnessViaLookup ( ValueDecl * requirement ) ; <nl> + <nl> + / / / Resolve a ( non - type ) witness via derivation . <nl> + ResolveWitnessResult resolveWitnessViaDerivation ( ValueDecl * requirement ) ; <nl> + <nl> + / / / Resolve a ( non - type ) witness via default definition or optional . <nl> + ResolveWitnessResult resolveWitnessViaDefault ( ValueDecl * requirement ) ; <nl> + <nl> + / / / Attempt to resolve a type witness via member name lookup . <nl> + ResolveWitnessResult resolveTypeWitnessViaLookup ( <nl> + AssociatedTypeDecl * assocType ) ; <nl> + <nl> + / / / Infer associated type witnesses for the given tentative <nl> + / / / requirement / witness match . <nl> + InferredAssociatedTypesByWitness inferTypeWitnessesViaValueWitness ( <nl> + ValueDecl * req , <nl> + ValueDecl * witness ) ; <nl> + <nl> + / / / Infer associated type witnesses for the given value requirement . <nl> + InferredAssociatedTypesByWitnesses inferTypeWitnessesViaValueWitnesses ( <nl> + const llvm : : SetVector < AssociatedTypeDecl * > & allUnresolved , <nl> + ValueDecl * req ) ; <nl> + <nl> + / / / Infer associated type witnesses for all relevant value requirements . <nl> + / / / <nl> + / / / \ param assocTypes The set of associated types we ' re interested in . <nl> + InferredAssociatedTypes <nl> + inferTypeWitnessesViaValueWitnesses ( <nl> + const llvm : : SetVector < AssociatedTypeDecl * > & assocTypes ) ; <nl> + <nl> + / / / Diagnose or defer a diagnostic , as appropriate . <nl> + / / / <nl> + / / / \ param requirement The requirement with which this diagnostic is <nl> + / / / associated , if any . <nl> + / / / <nl> + / / / \ param isError Whether this diagnostic is an error . <nl> + / / / <nl> + / / / \ param fn A function to call to emit the actual diagnostic . If <nl> + / / / diagnostics are being deferred , <nl> + void diagnoseOrDefer ( <nl> + ValueDecl * requirement , bool isError , <nl> + std : : function < void ( NormalProtocolConformance * ) > fn ) ; <nl> + <nl> + void <nl> + addUsedConformances ( ProtocolConformance * conformance , <nl> + llvm : : SmallPtrSetImpl < ProtocolConformance * > & visited ) ; <nl> + void addUsedConformances ( ProtocolConformance * conformance ) ; <nl> + <nl> + ArrayRef < ValueDecl * > getLocalMissingWitness ( ) { <nl> + return GlobalMissingWitnesses . getArrayRef ( ) . <nl> + slice ( LocalMissingWitnessesStartIndex , <nl> + GlobalMissingWitnesses . size ( ) - LocalMissingWitnessesStartIndex ) ; <nl> + } <nl> + <nl> + void clearGlobalMissingWitnesses ( ) { <nl> + GlobalMissingWitnesses . clear ( ) ; <nl> + LocalMissingWitnessesStartIndex = GlobalMissingWitnesses . size ( ) ; <nl> + } <nl> + <nl> + public : <nl> + / / / Call this to diagnose currently known missing witnesses . <nl> + void diagnoseMissingWitnesses ( MissingWitnessDiagnosisKind Kind ) ; <nl> + / / / Emit any diagnostics that have been delayed . <nl> + void emitDelayedDiags ( ) ; <nl> + <nl> + ConformanceChecker ( TypeChecker & tc , NormalProtocolConformance * conformance , <nl> + llvm : : SetVector < ValueDecl * > & GlobalMissingWitnesses , <nl> + bool suppressDiagnostics = true ) ; <nl> + <nl> + / / / Resolve all of the type witnesses . <nl> + void resolveTypeWitnesses ( ) ; <nl> + <nl> + / / / Resolve the witness for the given non - type requirement as <nl> + / / / directly as possible , only resolving other witnesses if <nl> + / / / needed , e . g . , to determine type witnesses used within the <nl> + / / / requirement . <nl> + / / / <nl> + / / / This entry point is designed to be used when the witness for a <nl> + / / / particular requirement and adoptee is required , before the <nl> + / / / conformance has been completed checked . <nl> + void resolveSingleWitness ( ValueDecl * requirement ) ; <nl> + <nl> + / / / Resolve the type witness for the given associated type as <nl> + / / / directly as possible . <nl> + void resolveSingleTypeWitness ( AssociatedTypeDecl * assocType ) ; <nl> + <nl> + / / / Check all of the protocols requirements are actually satisfied by a <nl> + / / / the chosen type witnesses . <nl> + void ensureRequirementsAreSatisfied ( ) ; <nl> + <nl> + / / / Check the entire protocol conformance , ensuring that all <nl> + / / / witnesses are resolved and emitting any diagnostics . <nl> + void checkConformance ( MissingWitnessDiagnosisKind Kind ) ; <nl> + } ; <nl> + / / / Captures the state needed to infer associated types . <nl> + class AssociatedTypeInference { <nl> + / / / The type checker we ' ll need to validate declarations etc . <nl> + TypeChecker & tc ; <nl> + <nl> + / / / The conformance for which we are inferring associated types . <nl> + NormalProtocolConformance * conformance ; <nl> + <nl> + / / / The protocol for which we are inferring associated types . <nl> + ProtocolDecl * proto ; <nl> + <nl> + / / / The declaration context in which conformance to the protocol is <nl> + / / / declared . <nl> + DeclContext * dc ; <nl> + <nl> + / / / The type that is adopting the protocol . <nl> + Type adoptee ; <nl> + <nl> + / / / The set of type witnesses inferred from value witnesses . <nl> + InferredAssociatedTypes inferred ; <nl> + <nl> + / / / Hash table containing the type witnesses that we ' ve inferred for <nl> + / / / each associated type , as well as an indication of how we inferred them . <nl> + llvm : : ScopedHashTable < AssociatedTypeDecl * , std : : pair < Type , unsigned > > <nl> + typeWitnesses ; <nl> + <nl> + / / / Information about a failed , defaulted associated type . <nl> + AssociatedTypeDecl * failedDefaultedAssocType = nullptr ; <nl> + Type failedDefaultedWitness ; <nl> + CheckTypeWitnessResult failedDefaultedResult ; <nl> + <nl> + / / / Information about a failed , derived associated type . <nl> + AssociatedTypeDecl * failedDerivedAssocType = nullptr ; <nl> + Type failedDerivedWitness ; <nl> + <nl> + / / Which type witness was missing ? <nl> + AssociatedTypeDecl * missingTypeWitness = nullptr ; <nl> + <nl> + / / Was there a conflict in type witness deduction ? <nl> + Optional < TypeWitnessConflict > typeWitnessConflict ; <nl> + unsigned numTypeWitnessesBeforeConflict = 0 ; <nl> + <nl> + public : <nl> + AssociatedTypeInference ( TypeChecker & tc , <nl> + NormalProtocolConformance * conformance ) ; <nl> + <nl> + private : <nl> + / / / Compute the default type witness from an associated type default , <nl> + / / / if there is one . <nl> + Type computeDefaultTypeWitness ( AssociatedTypeDecl * assocType ) ; <nl> + <nl> + / / / Compute the " derived " type witness for an associated type that is <nl> + / / / known to the compiler . <nl> + Type computeDerivedTypeWitness ( AssociatedTypeDecl * assocType ) ; <nl> + <nl> + / / / Substitute the current type witnesses into the given interface type . <nl> + Type substCurrentTypeWitnesses ( Type type ) ; <nl> + <nl> + / / / Check whether the current set of type witnesses meets the <nl> + / / / requirements of the protocol . <nl> + bool checkCurrentTypeWitnesses ( ) ; <nl> + <nl> + / / / Top - level operation to find solutions for the given unresolved <nl> + / / / associated types . <nl> + void findSolutions ( <nl> + ArrayRef < AssociatedTypeDecl * > unresolvedAssocTypes , <nl> + SmallVectorImpl < InferredTypeWitnessesSolution > & solutions ) ; <nl> + <nl> + / / / Explore the solution space to find both viable and non - viable solutions . <nl> + void findSolutionsRec ( <nl> + ArrayRef < AssociatedTypeDecl * > unresolvedAssocTypes , <nl> + SmallVectorImpl < InferredTypeWitnessesSolution > & solutions , <nl> + SmallVectorImpl < InferredTypeWitnessesSolution > & nonViableSolutions , <nl> + SmallVector < std : : pair < ValueDecl * , ValueDecl * > , 4 > & valueWitnesses , <nl> + unsigned numTypeWitnesses , <nl> + unsigned numValueWitnessesInProtocolExtensions , <nl> + unsigned reqDepth ) ; <nl> + <nl> + / / / Determine whether the first solution is better than the second <nl> + / / / solution . <nl> + bool isBetterSolution ( const InferredTypeWitnessesSolution & first , <nl> + const InferredTypeWitnessesSolution & second ) ; <nl> + <nl> + / / / Find the best solution . <nl> + / / / <nl> + / / / \ param solutions All of the solutions to consider . On success , <nl> + / / / this will contain only the best solution . <nl> + / / / <nl> + / / / \ returns \ c false if there was a single best solution , <nl> + / / / \ c true if no single best solution exists . <nl> + bool findBestSolution ( <nl> + SmallVectorImpl < InferredTypeWitnessesSolution > & solutions ) ; <nl> + <nl> + / / / Emit a diagnostic for the case where there are no solutions at all <nl> + / / / to consider . <nl> + / / / <nl> + / / / \ returns true if a diagnostic was emitted , false otherwise . <nl> + bool diagnoseNoSolutions ( <nl> + ArrayRef < AssociatedTypeDecl * > unresolvedAssocTypes , <nl> + ConformanceChecker & checker ) ; <nl> + <nl> + / / / Emit a diagnostic when there are multiple solutions . <nl> + / / / <nl> + / / / \ returns true if a diagnostic was emitted , false otherwise . <nl> + bool diagnoseAmbiguousSolutions ( <nl> + ArrayRef < AssociatedTypeDecl * > unresolvedAssocTypes , <nl> + ConformanceChecker & checker , <nl> + SmallVectorImpl < InferredTypeWitnessesSolution > & solutions ) ; <nl> + <nl> + public : <nl> + / / / Describes a mapping from associated type declarations to their <nl> + / / / type witnesses ( as interface types ) . <nl> + typedef std : : vector < std : : pair < AssociatedTypeDecl * , Type > > <nl> + InferredTypeWitnesses ; <nl> + <nl> + / / / Perform associated type inference . <nl> + / / / <nl> + / / / \ returns \ c true if an error occurred , \ c false otherwise <nl> + Optional < InferredTypeWitnesses > solve ( ConformanceChecker & checker ) ; <nl> + } ; <nl> + <nl> + } <nl> + <nl> + # endif / / SWIFT_SEMA_PROTOCOL_H <nl> new file mode 100644 <nl> index 000000000000 . . 74b7e29ed258 <nl> mmm / dev / null <nl> ppp b / lib / Sema / TypeCheckProtocolInference . cpp <nl> <nl> + / / = = = mmm TypeCheckProtocolInference . cpp - Associated Type Inference mmmmmm - = = = / / <nl> + / / <nl> + / / This source file is part of the Swift . org open source project <nl> + / / <nl> + / / Copyright ( c ) 2014 - 2017 Apple Inc . and the Swift project authors <nl> + / / Licensed under Apache License v2 . 0 with Runtime Library Exception <nl> + / / <nl> + / / See https : / / swift . org / LICENSE . txt for license information <nl> + / / See https : / / swift . org / CONTRIBUTORS . txt for the list of Swift project authors <nl> + / / <nl> + / / = = = mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - = = = / / <nl> + / / <nl> + / / This file implements semantic analysis for protocols , in particular , checking <nl> + / / whether a given type conforms to a given protocol . <nl> + / / = = = mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - = = = / / <nl> + # include " TypeCheckProtocol . h " <nl> + # include " DerivedConformances . h " <nl> + # include " TypeChecker . h " <nl> + <nl> + # include " swift / AST / Decl . h " <nl> + # include " swift / AST / GenericSignature . h " <nl> + # include " swift / AST / ProtocolConformance . h " <nl> + # include " swift / AST / SubstitutionMap . h " <nl> + # include " swift / AST / Types . h " <nl> + # include " swift / Basic / Defer . h " <nl> + # include " llvm / ADT / TinyPtrVector . h " <nl> + <nl> + # define DEBUG_TYPE " Associated type inference " <nl> + # include " llvm / Support / Debug . h " <nl> + <nl> + using namespace swift ; <nl> + <nl> + void InferredAssociatedTypesByWitness : : dump ( ) const { <nl> + dump ( llvm : : errs ( ) , 0 ) ; <nl> + } <nl> + <nl> + void InferredAssociatedTypesByWitness : : dump ( llvm : : raw_ostream & out , <nl> + unsigned indent ) const { <nl> + out < < " \ n " ; <nl> + out . indent ( indent ) < < " ( " ; <nl> + if ( Witness ) { <nl> + Witness - > dumpRef ( out ) ; <nl> + } <nl> + <nl> + for ( const auto & inferred : Inferred ) { <nl> + out < < " \ n " ; <nl> + out . indent ( indent + 2 ) ; <nl> + out < < inferred . first - > getName ( ) < < " : = " <nl> + < < inferred . second . getString ( ) ; <nl> + } <nl> + <nl> + for ( const auto & inferred : NonViable ) { <nl> + out < < " \ n " ; <nl> + out . indent ( indent + 2 ) ; <nl> + out < < std : : get < 0 > ( inferred ) - > getName ( ) < < " : = " <nl> + < < std : : get < 1 > ( inferred ) . getString ( ) ; <nl> + auto type = std : : get < 2 > ( inferred ) . getRequirement ( ) ; <nl> + out < < " [ failed constraint " < < type . getString ( ) < < " ] " ; <nl> + } <nl> + <nl> + out < < " ) " ; <nl> + } <nl> + <nl> + void InferredTypeWitnessesSolution : : dump ( ) { <nl> + llvm : : errs ( ) < < " Type Witnesses : \ n " ; <nl> + for ( auto & typeWitness : TypeWitnesses ) { <nl> + llvm : : errs ( ) < < " " < < typeWitness . first - > getName ( ) < < " : = " ; <nl> + typeWitness . second . first - > print ( llvm : : errs ( ) ) ; <nl> + llvm : : errs ( ) < < " value " < < typeWitness . second . second < < ' \ n ' ; <nl> + } <nl> + llvm : : errs ( ) < < " Value Witnesses : \ n " ; <nl> + for ( unsigned i : indices ( ValueWitnesses ) ) { <nl> + auto & valueWitness = ValueWitnesses [ i ] ; <nl> + llvm : : errs ( ) < < i < < " : " < < ( Decl * ) valueWitness . first <nl> + < < ' ' < < valueWitness . first - > getBaseName ( ) < < ' \ n ' ; <nl> + valueWitness . first - > getDeclContext ( ) - > dumpContext ( ) ; <nl> + llvm : : errs ( ) < < " for " < < ( Decl * ) valueWitness . second <nl> + < < ' ' < < valueWitness . second - > getBaseName ( ) < < ' \ n ' ; <nl> + valueWitness . second - > getDeclContext ( ) - > dumpContext ( ) ; <nl> + } <nl> + } <nl> + <nl> + namespace { <nl> + void dumpInferredAssociatedTypesByWitnesses ( <nl> + const InferredAssociatedTypesByWitnesses & inferred , <nl> + llvm : : raw_ostream & out , <nl> + unsigned indent ) { <nl> + for ( const auto & value : inferred ) { <nl> + value . dump ( out , indent ) ; <nl> + } <nl> + } <nl> + <nl> + void dumpInferredAssociatedTypesByWitnesses ( <nl> + const InferredAssociatedTypesByWitnesses & inferred ) LLVM_ATTRIBUTE_USED ; <nl> + <nl> + void dumpInferredAssociatedTypesByWitnesses ( <nl> + const InferredAssociatedTypesByWitnesses & inferred ) { <nl> + dumpInferredAssociatedTypesByWitnesses ( inferred , llvm : : errs ( ) , 0 ) ; <nl> + } <nl> + <nl> + void dumpInferredAssociatedTypes ( const InferredAssociatedTypes & inferred , <nl> + llvm : : raw_ostream & out , <nl> + unsigned indent ) { <nl> + for ( const auto & value : inferred ) { <nl> + out < < " \ n " ; <nl> + out . indent ( indent ) < < " ( " ; <nl> + value . first - > dumpRef ( out ) ; <nl> + dumpInferredAssociatedTypesByWitnesses ( value . second , out , indent + 2 ) ; <nl> + out < < " ) " ; <nl> + } <nl> + out < < " \ n " ; <nl> + } <nl> + <nl> + void dumpInferredAssociatedTypes ( <nl> + const InferredAssociatedTypes & inferred ) LLVM_ATTRIBUTE_USED ; <nl> + <nl> + void dumpInferredAssociatedTypes ( const InferredAssociatedTypes & inferred ) { <nl> + dumpInferredAssociatedTypes ( inferred , llvm : : errs ( ) , 0 ) ; <nl> + } <nl> + } <nl> + <nl> + AssociatedTypeInference : : AssociatedTypeInference ( <nl> + TypeChecker & tc , <nl> + NormalProtocolConformance * conformance ) <nl> + : tc ( tc ) , conformance ( conformance ) , proto ( conformance - > getProtocol ( ) ) , <nl> + dc ( conformance - > getDeclContext ( ) ) , <nl> + adoptee ( conformance - > getType ( ) ) { } <nl> + <nl> + Type AssociatedTypeInference : : computeDefaultTypeWitness ( <nl> + AssociatedTypeDecl * assocType ) { <nl> + / / If we don ' t have a default definition , we ' re done . <nl> + if ( assocType - > getDefaultDefinitionLoc ( ) . isNull ( ) ) <nl> + return Type ( ) ; <nl> + <nl> + auto selfType = proto - > getSelfInterfaceType ( ) ; <nl> + <nl> + / / Create a set of type substitutions for all known associated type . <nl> + / / FIXME : Base this on dependent types rather than archetypes ? <nl> + TypeSubstitutionMap substitutions ; <nl> + substitutions [ proto - > mapTypeIntoContext ( selfType ) <nl> + - > castTo < ArchetypeType > ( ) ] = dc - > mapTypeIntoContext ( adoptee ) ; <nl> + for ( auto assocType : proto - > getAssociatedTypeMembers ( ) ) { <nl> + auto archetype = proto - > mapTypeIntoContext ( <nl> + assocType - > getDeclaredInterfaceType ( ) ) <nl> + - > getAs < ArchetypeType > ( ) ; <nl> + if ( ! archetype ) <nl> + continue ; <nl> + if ( conformance - > hasTypeWitness ( assocType ) ) { <nl> + substitutions [ archetype ] = <nl> + dc - > mapTypeIntoContext ( <nl> + conformance - > getTypeWitness ( assocType , nullptr ) ) ; <nl> + } else { <nl> + auto known = typeWitnesses . begin ( assocType ) ; <nl> + if ( known ! = typeWitnesses . end ( ) ) <nl> + substitutions [ archetype ] = known - > first ; <nl> + else <nl> + substitutions [ archetype ] = ErrorType : : get ( archetype ) ; <nl> + } <nl> + } <nl> + <nl> + tc . validateDecl ( assocType ) ; <nl> + Type defaultType = assocType - > getDefaultDefinitionLoc ( ) . getType ( ) ; <nl> + <nl> + / / FIXME : Circularity <nl> + if ( ! defaultType ) <nl> + return Type ( ) ; <nl> + <nl> + defaultType = defaultType . subst ( <nl> + QueryTypeSubstitutionMap { substitutions } , <nl> + LookUpConformanceInModule ( dc - > getParentModule ( ) ) ) ; <nl> + <nl> + if ( ! defaultType ) <nl> + return Type ( ) ; <nl> + <nl> + if ( auto failed = checkTypeWitness ( tc , dc , proto , assocType , defaultType ) ) { <nl> + / / Record the failure , if we haven ' t seen one already . <nl> + if ( ! failedDefaultedAssocType ) { <nl> + failedDefaultedAssocType = assocType ; <nl> + failedDefaultedWitness = defaultType ; <nl> + failedDefaultedResult = failed ; <nl> + } <nl> + <nl> + return Type ( ) ; <nl> + } <nl> + <nl> + return defaultType ; <nl> + } <nl> + <nl> + Type AssociatedTypeInference : : computeDerivedTypeWitness ( <nl> + AssociatedTypeDecl * assocType ) { <nl> + if ( adoptee - > hasError ( ) ) <nl> + return Type ( ) ; <nl> + <nl> + / / Can we derive conformances for this protocol and adoptee ? <nl> + NominalTypeDecl * derivingTypeDecl = adoptee - > getAnyNominal ( ) ; <nl> + if ( ! DerivedConformance : : derivesProtocolConformance ( tc , derivingTypeDecl , <nl> + proto ) ) <nl> + return Type ( ) ; <nl> + <nl> + / / Try to derive the type witness . <nl> + Type derivedType = tc . deriveTypeWitness ( dc , derivingTypeDecl , assocType ) ; <nl> + if ( ! derivedType ) <nl> + return Type ( ) ; <nl> + <nl> + / / Make sure that the derived type is sane . <nl> + if ( checkTypeWitness ( tc , dc , proto , assocType , derivedType ) ) { <nl> + / / / FIXME : Diagnose based on this . <nl> + failedDerivedAssocType = assocType ; <nl> + failedDerivedWitness = derivedType ; <nl> + return Type ( ) ; <nl> + } <nl> + <nl> + return derivedType ; <nl> + } <nl> + <nl> + Type AssociatedTypeInference : : substCurrentTypeWitnesses ( Type type ) { <nl> + / / Local function that folds dependent member types with non - dependent <nl> + / / bases into actual member references . <nl> + std : : function < Type ( Type ) > foldDependentMemberTypes ; <nl> + llvm : : DenseSet < AssociatedTypeDecl * > recursionCheck ; <nl> + foldDependentMemberTypes = [ & ] ( Type type ) - > Type { <nl> + if ( auto depMemTy = type - > getAs < DependentMemberType > ( ) ) { <nl> + auto baseTy = depMemTy - > getBase ( ) . transform ( foldDependentMemberTypes ) ; <nl> + if ( baseTy . isNull ( ) | | baseTy - > hasTypeParameter ( ) ) <nl> + return nullptr ; <nl> + <nl> + auto assocType = depMemTy - > getAssocType ( ) ; <nl> + if ( ! assocType ) <nl> + return nullptr ; <nl> + <nl> + if ( ! recursionCheck . insert ( assocType ) . second ) <nl> + return nullptr ; <nl> + <nl> + SWIFT_DEFER { recursionCheck . erase ( assocType ) ; } ; <nl> + <nl> + / / Try to substitute into the base type . <nl> + if ( Type result = depMemTy - > substBaseType ( dc - > getParentModule ( ) , baseTy ) ) { <nl> + return result ; <nl> + } <nl> + <nl> + / / If that failed , check whether it ' s because of the conformance we ' re <nl> + / / evaluating . <nl> + auto localConformance <nl> + = tc . conformsToProtocol ( <nl> + baseTy , assocType - > getProtocol ( ) , dc , <nl> + ConformanceCheckFlags : : SkipConditionalRequirements ) ; <nl> + if ( ! localConformance | | localConformance - > isAbstract ( ) | | <nl> + ( localConformance - > getConcrete ( ) - > getRootNormalConformance ( ) <nl> + ! = conformance ) ) { <nl> + return nullptr ; <nl> + } <nl> + <nl> + / / Find the tentative type witness for this associated type . <nl> + auto known = typeWitnesses . begin ( assocType ) ; <nl> + if ( known = = typeWitnesses . end ( ) ) <nl> + return nullptr ; <nl> + <nl> + return known - > first . transform ( foldDependentMemberTypes ) ; <nl> + } <nl> + <nl> + / / The presence of a generic type parameter indicates that we <nl> + / / cannot use this type binding . <nl> + if ( type - > is < GenericTypeParamType > ( ) ) { <nl> + return nullptr ; <nl> + } <nl> + <nl> + return type ; <nl> + } ; <nl> + <nl> + return type . transform ( foldDependentMemberTypes ) ; <nl> + } <nl> + <nl> + / / / " Sanitize " requirements for conformance checking , removing any requirements <nl> + / / / that unnecessarily refer to associated types of other protocols . <nl> + static void sanitizeProtocolRequirements ( <nl> + ProtocolDecl * proto , <nl> + ArrayRef < Requirement > requirements , <nl> + SmallVectorImpl < Requirement > & sanitized ) { <nl> + std : : function < Type ( Type ) > sanitizeType ; <nl> + sanitizeType = [ & ] ( Type outerType ) { <nl> + return outerType . transformRec ( [ & ] ( TypeBase * type ) - > Optional < Type > { <nl> + if ( auto depMemTy = dyn_cast < DependentMemberType > ( type ) ) { <nl> + if ( ! depMemTy - > getAssocType ( ) | | <nl> + depMemTy - > getAssocType ( ) - > getProtocol ( ) ! = proto ) { <nl> + for ( auto member : proto - > lookupDirect ( depMemTy - > getName ( ) ) ) { <nl> + if ( auto assocType = dyn_cast < AssociatedTypeDecl > ( member ) ) { <nl> + return Type ( DependentMemberType : : get ( <nl> + sanitizeType ( depMemTy - > getBase ( ) ) , <nl> + assocType ) ) ; <nl> + } <nl> + } <nl> + <nl> + if ( depMemTy - > getBase ( ) - > is < GenericTypeParamType > ( ) ) <nl> + return Type ( ) ; <nl> + } <nl> + } <nl> + <nl> + return None ; <nl> + } ) ; <nl> + } ; <nl> + <nl> + for ( const auto & req : requirements ) { <nl> + switch ( req . getKind ( ) ) { <nl> + case RequirementKind : : Conformance : <nl> + case RequirementKind : : SameType : <nl> + case RequirementKind : : Superclass : { <nl> + Type firstType = sanitizeType ( req . getFirstType ( ) ) ; <nl> + Type secondType = sanitizeType ( req . getSecondType ( ) ) ; <nl> + if ( firstType & & secondType ) { <nl> + sanitized . push_back ( { req . getKind ( ) , firstType , secondType } ) ; <nl> + } <nl> + break ; <nl> + } <nl> + <nl> + case RequirementKind : : Layout : { <nl> + Type firstType = sanitizeType ( req . getFirstType ( ) ) ; <nl> + if ( firstType ) { <nl> + sanitized . push_back ( { req . getKind ( ) , firstType , <nl> + req . getLayoutConstraint ( ) } ) ; <nl> + } <nl> + break ; <nl> + } <nl> + } <nl> + } <nl> + } <nl> + <nl> + bool AssociatedTypeInference : : checkCurrentTypeWitnesses ( ) { <nl> + / / Fold the dependent member types within this type . <nl> + for ( auto assocType : proto - > getAssociatedTypeMembers ( ) ) { <nl> + if ( conformance - > hasTypeWitness ( assocType ) ) <nl> + continue ; <nl> + <nl> + / / If the type binding does not have a type parameter , there ' s nothing <nl> + / / to do . <nl> + auto known = typeWitnesses . begin ( assocType ) ; <nl> + assert ( known ! = typeWitnesses . end ( ) ) ; <nl> + if ( ! known - > first - > hasTypeParameter ( ) & & <nl> + ! known - > first - > hasDependentMember ( ) ) <nl> + continue ; <nl> + <nl> + Type replaced = substCurrentTypeWitnesses ( known - > first ) ; <nl> + if ( replaced . isNull ( ) ) <nl> + return true ; <nl> + <nl> + known - > first = replaced ; <nl> + } <nl> + <nl> + / / If we don ' t have a requirement signature for this protocol , bail out . <nl> + / / FIXME : We should never get to this point . Or we should always fail . <nl> + if ( ! proto - > isRequirementSignatureComputed ( ) ) return false ; <nl> + <nl> + / / Check any same - type requirements in the protocol ' s requirement signature . <nl> + SubstOptions options ( None ) ; <nl> + options . getTentativeTypeWitness = <nl> + [ & ] ( const NormalProtocolConformance * conformance , <nl> + AssociatedTypeDecl * assocType ) - > TypeBase * { <nl> + if ( conformance ! = this - > conformance ) return nullptr ; <nl> + <nl> + auto type = typeWitnesses . begin ( assocType ) - > first ; <nl> + return type - > mapTypeOutOfContext ( ) . getPointer ( ) ; <nl> + } ; <nl> + <nl> + auto typeInContext = dc - > mapTypeIntoContext ( adoptee ) ; <nl> + <nl> + auto substitutions = <nl> + SubstitutionMap : : getProtocolSubstitutions ( <nl> + proto , typeInContext , <nl> + ProtocolConformanceRef ( conformance ) ) ; <nl> + <nl> + SmallVector < Requirement , 4 > sanitizedRequirements ; <nl> + sanitizeProtocolRequirements ( proto , proto - > getRequirementSignature ( ) , <nl> + sanitizedRequirements ) ; <nl> + auto result = <nl> + tc . checkGenericArguments ( dc , SourceLoc ( ) , SourceLoc ( ) , <nl> + typeInContext , <nl> + { proto - > getProtocolSelfType ( ) } , <nl> + sanitizedRequirements , <nl> + QuerySubstitutionMap { substitutions } , <nl> + TypeChecker : : LookUpConformance ( tc , dc ) , <nl> + nullptr , None , nullptr , options ) ; <nl> + switch ( result ) { <nl> + case RequirementCheckResult : : Failure : <nl> + case RequirementCheckResult : : UnsatisfiedDependency : <nl> + return true ; <nl> + <nl> + case RequirementCheckResult : : Success : <nl> + case RequirementCheckResult : : SubstitutionFailure : <nl> + return false ; <nl> + } <nl> + <nl> + return false ; <nl> + } <nl> + <nl> + void AssociatedTypeInference : : findSolutions ( <nl> + ArrayRef < AssociatedTypeDecl * > unresolvedAssocTypes , <nl> + SmallVectorImpl < InferredTypeWitnessesSolution > & solutions ) { <nl> + SmallVector < InferredTypeWitnessesSolution , 4 > nonViableSolutions ; <nl> + SmallVector < std : : pair < ValueDecl * , ValueDecl * > , 4 > valueWitnesses ; <nl> + findSolutionsRec ( unresolvedAssocTypes , solutions , nonViableSolutions , <nl> + valueWitnesses , 0 , 0 , 0 ) ; <nl> + } <nl> + <nl> + void AssociatedTypeInference : : findSolutionsRec ( <nl> + ArrayRef < AssociatedTypeDecl * > unresolvedAssocTypes , <nl> + SmallVectorImpl < InferredTypeWitnessesSolution > & solutions , <nl> + SmallVectorImpl < InferredTypeWitnessesSolution > & nonViableSolutions , <nl> + SmallVector < std : : pair < ValueDecl * , ValueDecl * > , 4 > & valueWitnesses , <nl> + unsigned numTypeWitnesses , <nl> + unsigned numValueWitnessesInProtocolExtensions , <nl> + unsigned reqDepth ) { <nl> + typedef decltype ( typeWitnesses ) : : ScopeTy TypeWitnessesScope ; <nl> + <nl> + / / If we hit the last requirement , record and check this solution . <nl> + if ( reqDepth = = inferred . size ( ) ) { <nl> + / / Introduce a hash table scope ; we may add type witnesses here . <nl> + TypeWitnessesScope typeWitnessesScope ( typeWitnesses ) ; <nl> + <nl> + / / Check for completeness of the solution <nl> + for ( auto assocType : unresolvedAssocTypes ) { <nl> + / / Local function to record a missing associated type . <nl> + auto recordMissing = [ & ] { <nl> + if ( ! missingTypeWitness ) <nl> + missingTypeWitness = assocType ; <nl> + } ; <nl> + <nl> + auto typeWitness = typeWitnesses . begin ( assocType ) ; <nl> + if ( typeWitness ! = typeWitnesses . end ( ) ) { <nl> + / / The solution contains an error . <nl> + if ( typeWitness - > first - > hasError ( ) ) { <nl> + recordMissing ( ) ; <nl> + return ; <nl> + } <nl> + <nl> + continue ; <nl> + } <nl> + <nl> + / / We don ' t have a type witness for this associated type . <nl> + <nl> + / / If we can form a default type , do so . <nl> + if ( Type defaultType = computeDefaultTypeWitness ( assocType ) ) { <nl> + if ( defaultType - > hasError ( ) ) { <nl> + recordMissing ( ) ; <nl> + return ; <nl> + } <nl> + <nl> + typeWitnesses . insert ( assocType , { defaultType , reqDepth } ) ; <nl> + continue ; <nl> + } <nl> + <nl> + / / If we can derive a type witness , do so . <nl> + if ( Type derivedType = computeDerivedTypeWitness ( assocType ) ) { <nl> + if ( derivedType - > hasError ( ) ) { <nl> + recordMissing ( ) ; <nl> + return ; <nl> + } <nl> + <nl> + typeWitnesses . insert ( assocType , { derivedType , reqDepth } ) ; <nl> + continue ; <nl> + } <nl> + <nl> + / / If there is a generic parameter of the named type , use that . <nl> + if ( auto gpList = dc - > getGenericParamsOfContext ( ) ) { <nl> + GenericTypeParamDecl * foundGP = nullptr ; <nl> + for ( auto gp : * gpList ) { <nl> + if ( gp - > getName ( ) = = assocType - > getName ( ) ) { <nl> + foundGP = gp ; <nl> + break ; <nl> + } <nl> + } <nl> + <nl> + if ( foundGP ) { <nl> + auto gpType = dc - > mapTypeIntoContext ( <nl> + foundGP - > getDeclaredInterfaceType ( ) ) ; <nl> + typeWitnesses . insert ( assocType , { gpType , reqDepth } ) ; <nl> + continue ; <nl> + } <nl> + } <nl> + <nl> + / / The solution is incomplete . <nl> + recordMissing ( ) ; <nl> + return ; <nl> + } <nl> + <nl> + / / / Check the current set of type witnesses . <nl> + bool invalid = checkCurrentTypeWitnesses ( ) ; <nl> + <nl> + / / Determine whether there is already a solution with the same <nl> + / / bindings . <nl> + for ( const auto & solution : solutions ) { <nl> + bool sameSolution = true ; <nl> + for ( const auto & existingTypeWitness : solution . TypeWitnesses ) { <nl> + auto typeWitness = typeWitnesses . begin ( existingTypeWitness . first ) ; <nl> + if ( ! typeWitness - > first - > isEqual ( existingTypeWitness . second . first ) ) { <nl> + sameSolution = false ; <nl> + break ; <nl> + } <nl> + } <nl> + <nl> + / / We found the same solution . There is no point in recording <nl> + / / a new one . <nl> + if ( sameSolution ) <nl> + return ; <nl> + } <nl> + <nl> + auto & solutionList = invalid ? nonViableSolutions : solutions ; <nl> + solutionList . push_back ( InferredTypeWitnessesSolution ( ) ) ; <nl> + auto & solution = solutionList . back ( ) ; <nl> + <nl> + / / Copy the type witnesses . <nl> + for ( auto assocType : unresolvedAssocTypes ) { <nl> + auto typeWitness = typeWitnesses . begin ( assocType ) ; <nl> + solution . TypeWitnesses . insert ( { assocType , * typeWitness } ) ; <nl> + } <nl> + <nl> + / / Copy the value witnesses . <nl> + solution . ValueWitnesses = valueWitnesses ; <nl> + solution . NumValueWitnessesInProtocolExtensions <nl> + = numValueWitnessesInProtocolExtensions ; <nl> + <nl> + / / We ' re done recording the solution . <nl> + return ; <nl> + } <nl> + <nl> + / / Iterate over the potential witnesses for this requirement , <nl> + / / looking for solutions involving each one . <nl> + const auto & inferredReq = inferred [ reqDepth ] ; <nl> + for ( const auto & witnessReq : inferredReq . second ) { <nl> + / / Enter a new scope for the type witnesses hash table . <nl> + TypeWitnessesScope typeWitnessesScope ( typeWitnesses ) ; <nl> + llvm : : SaveAndRestore < unsigned > savedNumTypeWitnesses ( numTypeWitnesses ) ; <nl> + <nl> + / / Record this value witness , popping it when we exit the current scope . <nl> + valueWitnesses . push_back ( { inferredReq . first , witnessReq . Witness } ) ; <nl> + if ( witnessReq . Witness - > getDeclContext ( ) - > getAsProtocolExtensionContext ( ) ) <nl> + + + numValueWitnessesInProtocolExtensions ; <nl> + SWIFT_DEFER { <nl> + if ( witnessReq . Witness - > getDeclContext ( ) - > getAsProtocolExtensionContext ( ) ) <nl> + - - numValueWitnessesInProtocolExtensions ; <nl> + valueWitnesses . pop_back ( ) ; <nl> + } ; <nl> + <nl> + / / Introduce each of the type witnesses into the hash table . <nl> + bool failed = false ; <nl> + for ( const auto & typeWitness : witnessReq . Inferred ) { <nl> + / / If we ' ve seen a type witness for this associated type that <nl> + / / conflicts , there is no solution . <nl> + auto known = typeWitnesses . begin ( typeWitness . first ) ; <nl> + if ( known ! = typeWitnesses . end ( ) ) { <nl> + / / If witnesses for two difference requirements inferred the same <nl> + / / type , we ' re okay . <nl> + if ( known - > first - > isEqual ( typeWitness . second ) ) <nl> + continue ; <nl> + <nl> + / / If one has a type parameter remaining but the other does not , <nl> + / / drop the one with the type parameter . <nl> + if ( ( known - > first - > hasTypeParameter ( ) | | <nl> + known - > first - > hasDependentMember ( ) ) <nl> + ! = ( typeWitness . second - > hasTypeParameter ( ) | | <nl> + typeWitness . second - > hasDependentMember ( ) ) ) { <nl> + if ( typeWitness . second - > hasTypeParameter ( ) | | <nl> + typeWitness . second - > hasDependentMember ( ) ) <nl> + continue ; <nl> + <nl> + known - > first = typeWitness . second ; <nl> + continue ; <nl> + } <nl> + <nl> + if ( ! typeWitnessConflict | | <nl> + numTypeWitnesses > numTypeWitnessesBeforeConflict ) { <nl> + typeWitnessConflict = { typeWitness . first , <nl> + typeWitness . second , <nl> + inferredReq . first , <nl> + witnessReq . Witness , <nl> + known - > first , <nl> + valueWitnesses [ known - > second ] . first , <nl> + valueWitnesses [ known - > second ] . second } ; <nl> + numTypeWitnessesBeforeConflict = numTypeWitnesses ; <nl> + } <nl> + <nl> + failed = true ; <nl> + break ; <nl> + } <nl> + <nl> + / / Record the type witness . <nl> + + + numTypeWitnesses ; <nl> + typeWitnesses . insert ( typeWitness . first , { typeWitness . second , reqDepth } ) ; <nl> + } <nl> + <nl> + if ( failed ) <nl> + continue ; <nl> + <nl> + / / Recurse <nl> + findSolutionsRec ( unresolvedAssocTypes , solutions , nonViableSolutions , <nl> + valueWitnesses , numTypeWitnesses , <nl> + numValueWitnessesInProtocolExtensions , reqDepth + 1 ) ; <nl> + } <nl> + } <nl> + <nl> + static Comparison <nl> + compareDeclsForInference ( TypeChecker & TC , DeclContext * DC , <nl> + ValueDecl * decl1 , ValueDecl * decl2 ) { <nl> + / / TC . compareDeclarations assumes that it ' s comparing two decls that <nl> + / / apply equally well to a call site . We haven ' t yet inferred the <nl> + / / associated types for a type , so the ranking algorithm used by <nl> + / / compareDeclarations to score protocol extensions is inappropriate , <nl> + / / since we may have potential witnesses from extensions with mutually <nl> + / / exclusive associated type constraints , and compareDeclarations will <nl> + / / consider these unordered since neither extension ' s generic signature <nl> + / / is a superset of the other . <nl> + <nl> + / / If the witnesses come from the same decl context , score normally . <nl> + auto dc1 = decl1 - > getDeclContext ( ) ; <nl> + auto dc2 = decl2 - > getDeclContext ( ) ; <nl> + <nl> + if ( dc1 = = dc2 ) <nl> + return TC . compareDeclarations ( DC , decl1 , decl2 ) ; <nl> + <nl> + auto isProtocolExt1 = <nl> + ( bool ) dc1 - > getAsProtocolExtensionContext ( ) ; <nl> + auto isProtocolExt2 = <nl> + ( bool ) dc2 - > getAsProtocolExtensionContext ( ) ; <nl> + <nl> + / / If one witness comes from a protocol extension , favor the one <nl> + / / from a concrete context . <nl> + if ( isProtocolExt1 ! = isProtocolExt2 ) { <nl> + return isProtocolExt1 ? Comparison : : Worse : Comparison : : Better ; <nl> + } <nl> + <nl> + / / If both witnesses came from concrete contexts , score normally . <nl> + / / Associated type inference shouldn ' t impact the result . <nl> + / / FIXME : It could , if someone constrained to ConcreteType . AssocType . . . <nl> + if ( ! isProtocolExt1 ) <nl> + return TC . compareDeclarations ( DC , decl1 , decl2 ) ; <nl> + <nl> + / / Compare protocol extensions by which protocols they require Self to <nl> + / / conform to . If one extension requires a superset of the other ' s <nl> + / / constraints , it wins . <nl> + auto sig1 = dc1 - > getGenericSignatureOfContext ( ) ; <nl> + auto sig2 = dc2 - > getGenericSignatureOfContext ( ) ; <nl> + <nl> + / / FIXME : Extensions sometimes have null generic signatures while <nl> + / / checking the standard library . . . <nl> + if ( ! sig1 | | ! sig2 ) <nl> + return TC . compareDeclarations ( DC , decl1 , decl2 ) ; <nl> + <nl> + auto selfParam = GenericTypeParamType : : get ( 0 , 0 , TC . Context ) ; <nl> + <nl> + / / Collect the protocols required by extension 1 . <nl> + Type class1 ; <nl> + SmallPtrSet < ProtocolDecl * , 4 > protos1 ; <nl> + <nl> + std : : function < void ( ProtocolDecl * ) > insertProtocol ; <nl> + insertProtocol = [ & ] ( ProtocolDecl * p ) { <nl> + if ( ! protos1 . insert ( p ) . second ) <nl> + return ; <nl> + <nl> + for ( auto parent : p - > getInheritedProtocols ( ) ) <nl> + insertProtocol ( parent ) ; <nl> + } ; <nl> + <nl> + for ( auto & reqt : sig1 - > getRequirements ( ) ) { <nl> + if ( ! reqt . getFirstType ( ) - > isEqual ( selfParam ) ) <nl> + continue ; <nl> + switch ( reqt . getKind ( ) ) { <nl> + case RequirementKind : : Conformance : { <nl> + auto * proto = reqt . getSecondType ( ) - > castTo < ProtocolType > ( ) - > getDecl ( ) ; <nl> + insertProtocol ( proto ) ; <nl> + break ; <nl> + } <nl> + case RequirementKind : : Superclass : <nl> + class1 = reqt . getSecondType ( ) ; <nl> + break ; <nl> + <nl> + case RequirementKind : : SameType : <nl> + case RequirementKind : : Layout : <nl> + break ; <nl> + } <nl> + } <nl> + <nl> + / / Compare with the protocols required by extension 2 . <nl> + Type class2 ; <nl> + SmallPtrSet < ProtocolDecl * , 4 > protos2 ; <nl> + bool protos2AreSubsetOf1 = true ; <nl> + std : : function < void ( ProtocolDecl * ) > removeProtocol ; <nl> + removeProtocol = [ & ] ( ProtocolDecl * p ) { <nl> + if ( ! protos2 . insert ( p ) . second ) <nl> + return ; <nl> + <nl> + protos2AreSubsetOf1 & = protos1 . erase ( p ) ; <nl> + for ( auto parent : p - > getInheritedProtocols ( ) ) <nl> + removeProtocol ( parent ) ; <nl> + } ; <nl> + <nl> + for ( auto & reqt : sig2 - > getRequirements ( ) ) { <nl> + if ( ! reqt . getFirstType ( ) - > isEqual ( selfParam ) ) <nl> + continue ; <nl> + switch ( reqt . getKind ( ) ) { <nl> + case RequirementKind : : Conformance : { <nl> + auto * proto = reqt . getSecondType ( ) - > castTo < ProtocolType > ( ) - > getDecl ( ) ; <nl> + removeProtocol ( proto ) ; <nl> + break ; <nl> + } <nl> + case RequirementKind : : Superclass : <nl> + class2 = reqt . getSecondType ( ) ; <nl> + break ; <nl> + <nl> + case RequirementKind : : SameType : <nl> + case RequirementKind : : Layout : <nl> + break ; <nl> + } <nl> + } <nl> + <nl> + auto isClassConstraintAsStrict = [ & ] ( Type t1 , Type t2 ) - > bool { <nl> + if ( ! t1 ) <nl> + return ! t2 ; <nl> + <nl> + if ( ! t2 ) <nl> + return true ; <nl> + <nl> + return TC . isSubclassOf ( t1 , t2 , DC ) ; <nl> + } ; <nl> + <nl> + bool protos1AreSubsetOf2 = protos1 . empty ( ) ; <nl> + / / If the second extension requires strictly more protocols than the <nl> + / / first , it ' s better . <nl> + if ( protos1AreSubsetOf2 > protos2AreSubsetOf1 <nl> + & & isClassConstraintAsStrict ( class2 , class1 ) ) { <nl> + return Comparison : : Worse ; <nl> + / / If the first extension requires strictly more protocols than the <nl> + / / second , it ' s better . <nl> + } else if ( protos2AreSubsetOf1 > protos1AreSubsetOf2 <nl> + & & isClassConstraintAsStrict ( class1 , class2 ) ) { <nl> + return Comparison : : Better ; <nl> + } <nl> + <nl> + / / If they require the same set of protocols , or non - overlapping <nl> + / / sets , judge them normally . <nl> + return TC . compareDeclarations ( DC , decl1 , decl2 ) ; <nl> + } <nl> + <nl> + bool AssociatedTypeInference : : isBetterSolution ( <nl> + const InferredTypeWitnessesSolution & first , <nl> + const InferredTypeWitnessesSolution & second ) { <nl> + assert ( first . ValueWitnesses . size ( ) = = second . ValueWitnesses . size ( ) ) ; <nl> + bool firstBetter = false ; <nl> + bool secondBetter = false ; <nl> + for ( unsigned i = 0 , n = first . ValueWitnesses . size ( ) ; i ! = n ; + + i ) { <nl> + assert ( first . ValueWitnesses [ i ] . first = = second . ValueWitnesses [ i ] . first ) ; <nl> + auto firstWitness = first . ValueWitnesses [ i ] . second ; <nl> + auto secondWitness = second . ValueWitnesses [ i ] . second ; <nl> + if ( firstWitness = = secondWitness ) <nl> + continue ; <nl> + <nl> + switch ( compareDeclsForInference ( tc , dc , firstWitness , secondWitness ) ) { <nl> + case Comparison : : Better : <nl> + if ( secondBetter ) <nl> + return false ; <nl> + <nl> + firstBetter = true ; <nl> + break ; <nl> + <nl> + case Comparison : : Worse : <nl> + if ( firstBetter ) <nl> + return false ; <nl> + <nl> + secondBetter = true ; <nl> + break ; <nl> + <nl> + case Comparison : : Unordered : <nl> + break ; <nl> + } <nl> + } <nl> + <nl> + return firstBetter ; <nl> + } <nl> + <nl> + bool AssociatedTypeInference : : findBestSolution ( <nl> + SmallVectorImpl < InferredTypeWitnessesSolution > & solutions ) { <nl> + if ( solutions . empty ( ) ) return true ; <nl> + if ( solutions . size ( ) = = 1 ) return false ; <nl> + <nl> + / / Find the smallest number of value witnesses found in protocol extensions . <nl> + / / FIXME : This is a silly heuristic that should go away . <nl> + unsigned bestNumValueWitnessesInProtocolExtensions <nl> + = solutions . front ( ) . NumValueWitnessesInProtocolExtensions ; <nl> + for ( unsigned i = 1 , n = solutions . size ( ) ; i ! = n ; + + i ) { <nl> + bestNumValueWitnessesInProtocolExtensions <nl> + = std : : min ( bestNumValueWitnessesInProtocolExtensions , <nl> + solutions [ i ] . NumValueWitnessesInProtocolExtensions ) ; <nl> + } <nl> + <nl> + / / Erase any solutions with more value witnesses in protocol <nl> + / / extensions than the best . <nl> + solutions . erase ( <nl> + std : : remove_if ( solutions . begin ( ) , solutions . end ( ) , <nl> + [ & ] ( const InferredTypeWitnessesSolution & solution ) { <nl> + return solution . NumValueWitnessesInProtocolExtensions > <nl> + bestNumValueWitnessesInProtocolExtensions ; <nl> + } ) , <nl> + solutions . end ( ) ) ; <nl> + <nl> + / / If we ' re down to one solution , success ! <nl> + if ( solutions . size ( ) = = 1 ) return false ; <nl> + <nl> + / / Find a solution that ' s at least as good as the solutions that follow it . <nl> + unsigned bestIdx = 0 ; <nl> + for ( unsigned i = 1 , n = solutions . size ( ) ; i ! = n ; + + i ) { <nl> + if ( isBetterSolution ( solutions [ i ] , solutions [ bestIdx ] ) ) <nl> + bestIdx = i ; <nl> + } <nl> + <nl> + / / Make sure that solution is better than any of the other solutions . <nl> + bool ambiguous = false ; <nl> + for ( unsigned i = 1 , n = solutions . size ( ) ; i ! = n ; + + i ) { <nl> + if ( i ! = bestIdx & & ! isBetterSolution ( solutions [ bestIdx ] , solutions [ i ] ) ) { <nl> + ambiguous = true ; <nl> + break ; <nl> + } <nl> + } <nl> + <nl> + / / If the result was ambiguous , fail . <nl> + if ( ambiguous ) { <nl> + assert ( solutions . size ( ) ! = 1 & & " should have succeeded somewhere above ? " ) ; <nl> + return true ; <nl> + <nl> + } <nl> + / / Keep the best solution , erasing all others . <nl> + if ( bestIdx ! = 0 ) <nl> + solutions [ 0 ] = std : : move ( solutions [ bestIdx ] ) ; <nl> + solutions . erase ( solutions . begin ( ) + 1 , solutions . end ( ) ) ; <nl> + return false ; <nl> + } <nl> + <nl> + namespace { <nl> + / / / A failed type witness binding . <nl> + struct FailedTypeWitness { <nl> + / / / The value requirement that triggered inference . <nl> + ValueDecl * Requirement ; <nl> + <nl> + / / / The corresponding value witness from which the type witness <nl> + / / / was inferred . <nl> + ValueDecl * Witness ; <nl> + <nl> + / / / The actual type witness that was inferred . <nl> + Type TypeWitness ; <nl> + <nl> + / / / The failed type witness result . <nl> + CheckTypeWitnessResult Result ; <nl> + } ; <nl> + } / / end anonymous namespace <nl> + <nl> + bool AssociatedTypeInference : : diagnoseNoSolutions ( <nl> + ArrayRef < AssociatedTypeDecl * > unresolvedAssocTypes , <nl> + ConformanceChecker & checker ) { <nl> + / / If a defaulted type witness failed , diagnose it . <nl> + if ( failedDefaultedAssocType ) { <nl> + auto failedDefaultedAssocType = this - > failedDefaultedAssocType ; <nl> + auto failedDefaultedWitness = this - > failedDefaultedWitness ; <nl> + auto failedDefaultedResult = this - > failedDefaultedResult ; <nl> + <nl> + checker . diagnoseOrDefer ( failedDefaultedAssocType , true , <nl> + [ failedDefaultedAssocType , failedDefaultedWitness , <nl> + failedDefaultedResult ] ( NormalProtocolConformance * conformance ) { <nl> + auto proto = conformance - > getProtocol ( ) ; <nl> + auto & diags = proto - > getASTContext ( ) . Diags ; <nl> + diags . diagnose ( failedDefaultedAssocType , <nl> + diag : : default_associated_type_req_fail , <nl> + failedDefaultedWitness , <nl> + failedDefaultedAssocType - > getFullName ( ) , <nl> + proto - > getDeclaredType ( ) , <nl> + failedDefaultedResult . getRequirement ( ) , <nl> + failedDefaultedResult . isConformanceRequirement ( ) ) ; <nl> + } ) ; <nl> + <nl> + return true ; <nl> + } <nl> + <nl> + / / Form a mapping from associated type declarations to failed type <nl> + / / witnesses . <nl> + llvm : : DenseMap < AssociatedTypeDecl * , SmallVector < FailedTypeWitness , 2 > > <nl> + failedTypeWitnesses ; <nl> + for ( const auto & inferredReq : inferred ) { <nl> + for ( const auto & inferredWitness : inferredReq . second ) { <nl> + for ( const auto & nonViable : inferredWitness . NonViable ) { <nl> + failedTypeWitnesses [ std : : get < 0 > ( nonViable ) ] <nl> + . push_back ( { inferredReq . first , inferredWitness . Witness , <nl> + std : : get < 1 > ( nonViable ) , std : : get < 2 > ( nonViable ) } ) ; <nl> + } <nl> + } <nl> + } <nl> + <nl> + / / Local function to attempt to diagnose potential type witnesses <nl> + / / that failed requirements . <nl> + auto tryDiagnoseTypeWitness = [ & ] ( AssociatedTypeDecl * assocType ) - > bool { <nl> + auto known = failedTypeWitnesses . find ( assocType ) ; <nl> + if ( known = = failedTypeWitnesses . end ( ) ) <nl> + return false ; <nl> + <nl> + auto failedSet = std : : move ( known - > second ) ; <nl> + checker . diagnoseOrDefer ( assocType , true , <nl> + [ assocType , failedSet ] ( NormalProtocolConformance * conformance ) { <nl> + auto proto = conformance - > getProtocol ( ) ; <nl> + auto & diags = proto - > getASTContext ( ) . Diags ; <nl> + diags . diagnose ( assocType , diag : : bad_associated_type_deduction , <nl> + assocType - > getFullName ( ) , proto - > getFullName ( ) ) ; <nl> + for ( const auto & failed : failedSet ) { <nl> + diags . diagnose ( failed . Witness , <nl> + diag : : associated_type_deduction_witness_failed , <nl> + failed . Requirement - > getFullName ( ) , <nl> + failed . TypeWitness , <nl> + failed . Result . getRequirement ( ) , <nl> + failed . Result . isConformanceRequirement ( ) ) ; <nl> + } <nl> + } ) ; <nl> + <nl> + return true ; <nl> + } ; <nl> + <nl> + / / Try to diagnose the first missing type witness we encountered . <nl> + if ( missingTypeWitness & & tryDiagnoseTypeWitness ( missingTypeWitness ) ) <nl> + return true ; <nl> + <nl> + / / Failing that , try to diagnose any type witness that failed a <nl> + / / requirement . <nl> + for ( auto assocType : unresolvedAssocTypes ) { <nl> + if ( tryDiagnoseTypeWitness ( assocType ) ) <nl> + return true ; <nl> + } <nl> + <nl> + / / If we saw a conflict , complain about it . <nl> + if ( typeWitnessConflict ) { <nl> + auto typeWitnessConflict = this - > typeWitnessConflict ; <nl> + <nl> + checker . diagnoseOrDefer ( typeWitnessConflict - > AssocType , true , <nl> + [ typeWitnessConflict ] ( NormalProtocolConformance * conformance ) { <nl> + auto & diags = conformance - > getDeclContext ( ) - > getASTContext ( ) . Diags ; <nl> + diags . diagnose ( typeWitnessConflict - > AssocType , <nl> + diag : : ambiguous_associated_type_deduction , <nl> + typeWitnessConflict - > AssocType - > getFullName ( ) , <nl> + typeWitnessConflict - > FirstType , <nl> + typeWitnessConflict - > SecondType ) ; <nl> + <nl> + diags . diagnose ( typeWitnessConflict - > FirstWitness , <nl> + diag : : associated_type_deduction_witness , <nl> + typeWitnessConflict - > FirstRequirement - > getFullName ( ) , <nl> + typeWitnessConflict - > FirstType ) ; <nl> + diags . diagnose ( typeWitnessConflict - > SecondWitness , <nl> + diag : : associated_type_deduction_witness , <nl> + typeWitnessConflict - > SecondRequirement - > getFullName ( ) , <nl> + typeWitnessConflict - > SecondType ) ; <nl> + } ) ; <nl> + <nl> + return true ; <nl> + } <nl> + <nl> + return false ; <nl> + } <nl> + <nl> + bool AssociatedTypeInference : : diagnoseAmbiguousSolutions ( <nl> + ArrayRef < AssociatedTypeDecl * > unresolvedAssocTypes , <nl> + ConformanceChecker & checker , <nl> + SmallVectorImpl < InferredTypeWitnessesSolution > & solutions ) { <nl> + for ( auto assocType : unresolvedAssocTypes ) { <nl> + / / Find two types that conflict . <nl> + auto & firstSolution = solutions . front ( ) ; <nl> + <nl> + / / Local function to retrieve the value witness for the current associated <nl> + / / type within the given solution . <nl> + auto getValueWitness = [ & ] ( InferredTypeWitnessesSolution & solution ) { <nl> + unsigned witnessIdx = solution . TypeWitnesses [ assocType ] . second ; <nl> + if ( witnessIdx < solution . ValueWitnesses . size ( ) ) <nl> + return solution . ValueWitnesses [ witnessIdx ] ; <nl> + <nl> + return std : : pair < ValueDecl * , ValueDecl * > ( nullptr , nullptr ) ; <nl> + } ; <nl> + <nl> + Type firstType = firstSolution . TypeWitnesses [ assocType ] . first ; <nl> + <nl> + / / Extract the value witness used to deduce this associated type , if any . <nl> + auto firstMatch = getValueWitness ( firstSolution ) ; <nl> + <nl> + Type secondType ; <nl> + std : : pair < ValueDecl * , ValueDecl * > secondMatch ; <nl> + for ( auto & solution : solutions ) { <nl> + Type typeWitness = solution . TypeWitnesses [ assocType ] . first ; <nl> + if ( ! typeWitness - > isEqual ( firstType ) ) { <nl> + secondType = typeWitness ; <nl> + secondMatch = getValueWitness ( solution ) ; <nl> + break ; <nl> + } <nl> + } <nl> + <nl> + if ( ! secondType ) <nl> + continue ; <nl> + <nl> + / / We found an ambiguity . diagnose it . <nl> + checker . diagnoseOrDefer ( assocType , true , <nl> + [ assocType , firstType , firstMatch , secondType , secondMatch ] ( <nl> + NormalProtocolConformance * conformance ) { <nl> + auto & diags = assocType - > getASTContext ( ) . Diags ; <nl> + diags . diagnose ( assocType , diag : : ambiguous_associated_type_deduction , <nl> + assocType - > getFullName ( ) , firstType , secondType ) ; <nl> + <nl> + auto diagnoseWitness = [ & ] ( std : : pair < ValueDecl * , ValueDecl * > match , <nl> + Type type ) { <nl> + / / If we have a requirement / witness pair , diagnose it . <nl> + if ( match . first & & match . second ) { <nl> + diags . diagnose ( match . second , <nl> + diag : : associated_type_deduction_witness , <nl> + match . first - > getFullName ( ) , type ) ; <nl> + <nl> + return ; <nl> + } <nl> + <nl> + / / Otherwise , we have a default . <nl> + diags . diagnose ( assocType , diag : : associated_type_deduction_default , <nl> + type ) <nl> + . highlight ( assocType - > getDefaultDefinitionLoc ( ) . getSourceRange ( ) ) ; <nl> + } ; <nl> + <nl> + diagnoseWitness ( firstMatch , firstType ) ; <nl> + diagnoseWitness ( secondMatch , secondType ) ; <nl> + } ) ; <nl> + <nl> + return true ; <nl> + } <nl> + <nl> + return false ; <nl> + } <nl> + <nl> + auto AssociatedTypeInference : : solve ( ConformanceChecker & checker ) <nl> + - > Optional < InferredTypeWitnesses > { <nl> + / / Track when we are checking type witnesses . <nl> + ProtocolConformanceState initialState = conformance - > getState ( ) ; <nl> + conformance - > setState ( ProtocolConformanceState : : CheckingTypeWitnesses ) ; <nl> + SWIFT_DEFER { conformance - > setState ( initialState ) ; } ; <nl> + <nl> + / / Try to resolve type witnesses via name lookup . <nl> + llvm : : SetVector < AssociatedTypeDecl * > unresolvedAssocTypes ; <nl> + for ( auto assocType : proto - > getAssociatedTypeMembers ( ) ) { <nl> + / / If we already have a type witness , do nothing . <nl> + if ( conformance - > hasTypeWitness ( assocType ) ) <nl> + continue ; <nl> + <nl> + / / Try to resolve this type witness via name lookup , which is the <nl> + / / most direct mechanism , overriding all others . <nl> + switch ( checker . resolveTypeWitnessViaLookup ( assocType ) ) { <nl> + case ResolveWitnessResult : : Success : <nl> + / / Success . Move on to the next . <nl> + continue ; <nl> + <nl> + case ResolveWitnessResult : : ExplicitFailed : <nl> + continue ; <nl> + <nl> + case ResolveWitnessResult : : Missing : <nl> + / / Note that we haven ' t resolved this associated type yet . <nl> + unresolvedAssocTypes . insert ( assocType ) ; <nl> + break ; <nl> + } <nl> + } <nl> + <nl> + / / Result variable to use for returns so that we get NRVO . <nl> + Optional < InferredTypeWitnesses > result ; <nl> + result = { } ; <nl> + <nl> + / / If we resolved everything , we ' re done . <nl> + if ( unresolvedAssocTypes . empty ( ) ) <nl> + return result ; <nl> + <nl> + / / Infer potential type witnesses from value witnesses . <nl> + inferred = checker . inferTypeWitnessesViaValueWitnesses ( unresolvedAssocTypes ) ; <nl> + DEBUG ( llvm : : dbgs ( ) < < " Candidates for inference : \ n " ; <nl> + dumpInferredAssociatedTypes ( inferred ) ) ; <nl> + <nl> + / / Compute the set of solutions . <nl> + SmallVector < InferredTypeWitnessesSolution , 4 > solutions ; <nl> + findSolutions ( unresolvedAssocTypes . getArrayRef ( ) , solutions ) ; <nl> + <nl> + / / Go make sure that type declarations that would act as witnesses <nl> + / / did not get injected while we were performing checks above . This <nl> + / / can happen when two associated types in different protocols have <nl> + / / the same name , and validating a declaration ( above ) triggers the <nl> + / / type - witness generation for that second protocol , introducing a <nl> + / / new type declaration . <nl> + / / FIXME : This is ridiculous . <nl> + for ( auto assocType : unresolvedAssocTypes ) { <nl> + switch ( checker . resolveTypeWitnessViaLookup ( assocType ) ) { <nl> + case ResolveWitnessResult : : Success : <nl> + case ResolveWitnessResult : : ExplicitFailed : <nl> + / / A declaration that can become a witness has shown up . Go <nl> + / / perform the resolution again now that we have more <nl> + / / information . <nl> + return solve ( checker ) ; <nl> + <nl> + case ResolveWitnessResult : : Missing : <nl> + / / The type witness is still missing . Keep going . <nl> + break ; <nl> + } <nl> + } <nl> + <nl> + / / Find the best solution . <nl> + if ( ! findBestSolution ( solutions ) ) { <nl> + assert ( solutions . size ( ) = = 1 & & " Not a unique best solution ? " ) ; <nl> + / / Form the resulting solution . <nl> + auto & typeWitnesses = solutions . front ( ) . TypeWitnesses ; <nl> + for ( auto assocType : unresolvedAssocTypes ) { <nl> + assert ( typeWitnesses . count ( assocType ) = = 1 & & " missing witness " ) ; <nl> + auto replacement = typeWitnesses [ assocType ] . first ; <nl> + / / FIXME : We can end up here with dependent types that were not folded <nl> + / / away for some reason . <nl> + if ( replacement - > hasDependentMember ( ) ) <nl> + return None ; <nl> + <nl> + if ( replacement - > hasArchetype ( ) ) <nl> + replacement = replacement - > mapTypeOutOfContext ( ) ; <nl> + <nl> + result - > push_back ( { assocType , replacement } ) ; <nl> + } <nl> + <nl> + return result ; <nl> + } <nl> + <nl> + / / Diagnose the complete lack of solutions . <nl> + if ( solutions . empty ( ) & & <nl> + diagnoseNoSolutions ( unresolvedAssocTypes . getArrayRef ( ) , checker ) ) <nl> + return None ; <nl> + <nl> + / / Diagnose ambiguous solutions . <nl> + if ( ! solutions . empty ( ) & & <nl> + diagnoseAmbiguousSolutions ( unresolvedAssocTypes . getArrayRef ( ) , checker , <nl> + solutions ) ) <nl> + return None ; <nl> + <nl> + / / Save the missing type witnesses for later diagnosis . <nl> + checker . GlobalMissingWitnesses . insert ( unresolvedAssocTypes . begin ( ) , <nl> + unresolvedAssocTypes . end ( ) ) ; <nl> + return None ; <nl> + } <nl> + <nl> + void ConformanceChecker : : resolveTypeWitnesses ( ) { <nl> + SWIFT_DEFER { <nl> + / / Resolution attempts to have the witnesses be correct by construction , but <nl> + / / this isn ' t guaranteed , so let ' s double check . <nl> + ensureRequirementsAreSatisfied ( ) ; <nl> + } ; <nl> + <nl> + / / Attempt to infer associated type witnesses . <nl> + AssociatedTypeInference inference ( TC , Conformance ) ; <nl> + if ( auto inferred = inference . solve ( * this ) ) { <nl> + for ( const auto & inferredWitness : * inferred ) { <nl> + recordTypeWitness ( inferredWitness . first , inferredWitness . second , <nl> + / * typeDecl = * / nullptr , <nl> + / * performRedeclarationCheck = * / true ) ; <nl> + } <nl> + <nl> + ensureRequirementsAreSatisfied ( ) ; <nl> + return ; <nl> + } <nl> + <nl> + / / Conformance failed . Record errors for each of the witnesses . <nl> + Conformance - > setInvalid ( ) ; <nl> + <nl> + / / We ' re going to produce an error below . Mark each unresolved <nl> + / / associated type witness as erroneous . <nl> + for ( auto assocType : Proto - > getAssociatedTypeMembers ( ) ) { <nl> + / / If we already have a type witness , do nothing . <nl> + if ( Conformance - > hasTypeWitness ( assocType ) ) <nl> + continue ; <nl> + <nl> + recordTypeWitness ( assocType , ErrorType : : get ( TC . Context ) , nullptr , true ) ; <nl> + } <nl> + <nl> + return ; <nl> + <nl> + / / Multiple solutions . Diagnose the ambiguity . <nl> + <nl> + } <nl> + <nl> + void ConformanceChecker : : resolveSingleTypeWitness ( <nl> + AssociatedTypeDecl * assocType ) { <nl> + / / Ensure we diagnose if the witness is missing . <nl> + SWIFT_DEFER { <nl> + diagnoseMissingWitnesses ( MissingWitnessDiagnosisKind : : ErrorFixIt ) ; <nl> + } ; <nl> + switch ( resolveTypeWitnessViaLookup ( assocType ) ) { <nl> + case ResolveWitnessResult : : Success : <nl> + case ResolveWitnessResult : : ExplicitFailed : <nl> + / / We resolved this type witness one way or another . <nl> + return ; <nl> + <nl> + case ResolveWitnessResult : : Missing : <nl> + / / The type witness is still missing . Resolve all of the type witnesses . <nl> + resolveTypeWitnesses ( ) ; <nl> + return ; <nl> + } <nl> + } <nl> + <nl> + void ConformanceChecker : : resolveSingleWitness ( ValueDecl * requirement ) { <nl> + assert ( ! isa < AssociatedTypeDecl > ( requirement ) & & " Not a value witness " ) ; <nl> + assert ( ! Conformance - > hasWitness ( requirement ) & & " Already resolved " ) ; <nl> + <nl> + / / Note that we ' re resolving this witness . <nl> + assert ( ResolvingWitnesses . count ( requirement ) = = 0 & & " Currently resolving " ) ; <nl> + ResolvingWitnesses . insert ( requirement ) ; <nl> + SWIFT_DEFER { ResolvingWitnesses . erase ( requirement ) ; } ; <nl> + <nl> + / / Make sure we ' ve validated the requirement . <nl> + if ( ! requirement - > hasInterfaceType ( ) ) <nl> + TC . validateDecl ( requirement ) ; <nl> + <nl> + if ( requirement - > isInvalid ( ) | | ! requirement - > hasValidSignature ( ) ) { <nl> + Conformance - > setInvalid ( ) ; <nl> + return ; <nl> + } <nl> + <nl> + if ( ! requirement - > isProtocolRequirement ( ) ) <nl> + return ; <nl> + <nl> + / / Resolve all associated types before trying to resolve this witness . <nl> + resolveTypeWitnesses ( ) ; <nl> + <nl> + / / If any of the type witnesses was erroneous , don ' t bother to check <nl> + / / this value witness : it will fail . <nl> + for ( auto assocType : getReferencedAssociatedTypes ( requirement ) ) { <nl> + if ( Conformance - > getTypeWitness ( assocType , nullptr ) - > hasError ( ) ) { <nl> + Conformance - > setInvalid ( ) ; <nl> + return ; <nl> + } <nl> + } <nl> + <nl> + / / Try to resolve the witness via explicit definitions . <nl> + switch ( resolveWitnessViaLookup ( requirement ) ) { <nl> + case ResolveWitnessResult : : Success : <nl> + return ; <nl> + <nl> + case ResolveWitnessResult : : ExplicitFailed : <nl> + Conformance - > setInvalid ( ) ; <nl> + recordInvalidWitness ( requirement ) ; <nl> + return ; <nl> + <nl> + case ResolveWitnessResult : : Missing : <nl> + / / Continue trying below . <nl> + break ; <nl> + } <nl> + <nl> + / / Try to resolve the witness via derivation . <nl> + switch ( resolveWitnessViaDerivation ( requirement ) ) { <nl> + case ResolveWitnessResult : : Success : <nl> + return ; <nl> + <nl> + case ResolveWitnessResult : : ExplicitFailed : <nl> + Conformance - > setInvalid ( ) ; <nl> + recordInvalidWitness ( requirement ) ; <nl> + return ; <nl> + <nl> + case ResolveWitnessResult : : Missing : <nl> + / / Continue trying below . <nl> + break ; <nl> + } <nl> + <nl> + / / Try to resolve the witness via defaults . <nl> + switch ( resolveWitnessViaDefault ( requirement ) ) { <nl> + case ResolveWitnessResult : : Success : <nl> + return ; <nl> + <nl> + case ResolveWitnessResult : : ExplicitFailed : <nl> + Conformance - > setInvalid ( ) ; <nl> + recordInvalidWitness ( requirement ) ; <nl> + return ; <nl> + <nl> + case ResolveWitnessResult : : Missing : <nl> + llvm_unreachable ( " Should have failed " ) ; <nl> + break ; <nl> + } <nl> + } <nl> mmm a / test / Constraints / associated_types . swift <nl> ppp b / test / Constraints / associated_types . swift <nl> protocol XReqt { } <nl> protocol YReqt { } <nl> <nl> protocol SameTypedDefaultWithReqts { <nl> - associatedtype X : XReqt <nl> - associatedtype Y : YReqt <nl> + associatedtype X : XReqt / / expected - note { { protocol requires nested type ' X ' ; do you want to add it ? } } <nl> + associatedtype Y : YReqt / / expected - note { { protocol requires nested type ' Y ' ; do you want to add it ? } } <nl> static var x : X { get } <nl> static var y : Y { get } <nl> } <nl> struct UsesSameTypedDefaultWithoutSatisfyingReqts : SameTypedDefaultWithReqts { <nl> } <nl> <nl> protocol SameTypedDefaultBaseWithReqts { <nl> - associatedtype X : XReqt <nl> + associatedtype X : XReqt / / expected - note { { protocol requires nested type ' X ' ; do you want to add it ? } } <nl> static var x : X { get } <nl> } <nl> protocol SameTypedDefaultDerivedWithReqts : SameTypedDefaultBaseWithReqts { <nl> mmm a / test / Generics / associated_type_where_clause . swift <nl> ppp b / test / Generics / associated_type_where_clause . swift <nl> struct ConcreteConforms2 : Conforms { typealias T = Int } <nl> struct ConcreteConformsNonFoo2 : Conforms { typealias T = Float } <nl> <nl> protocol NestedConforms { <nl> - associatedtype U where U : Conforms , U . T : Foo2 <nl> + associatedtype U where U : Conforms , U . T : Foo2 / / expected - note { { protocol requires nested type ' U ' ; do you want to add it ? } } <nl> <nl> func foo ( _ : U ) <nl> } <nl> struct BadConcreteNestedConforms : NestedConforms { <nl> typealias U = ConcreteConformsNonFoo2 <nl> } <nl> struct BadConcreteNestedConformsInfer : NestedConforms { <nl> - / / expected - error @ - 1 { { type ' ConcreteConformsNonFoo2 . T ' ( aka ' Float ' ) does not conform to protocol ' Foo2 ' } } <nl> + / / expected - error @ - 1 { { type ' BadConcreteNestedConformsInfer ' does not conform to protocol ' NestedConforms ' } } <nl> func foo ( _ : ConcreteConformsNonFoo2 ) { } <nl> } <nl> <nl> func needsNestedConformsDefault < X : NestedConformsDefault > ( _ : X . Type ) { <nl> } <nl> <nl> protocol NestedSameType { <nl> - associatedtype U : Conforms where U . T = = Int <nl> + associatedtype U : Conforms where U . T = = Int / / expected - note { { protocol requires nested type ' U ' ; do you want to add it ? } } <nl> <nl> func foo ( _ : U ) <nl> } <nl> struct BadConcreteNestedSameType : NestedSameType { <nl> typealias U = ConcreteConformsNonFoo2 <nl> } <nl> struct BadConcreteNestedSameTypeInfer : NestedSameType { <nl> - / / expected - error @ - 1 { { ' NestedSameType ' requires the types ' ConcreteConformsNonFoo2 . T ' ( aka ' Float ' ) and ' Int ' be equivalent } } <nl> - / / expected - note @ - 2 { { requirement specified as ' Self . U . T ' = = ' Int ' [ with Self = BadConcreteNestedSameTypeInfer ] } } <nl> + / / expected - error @ - 1 { { type ' BadConcreteNestedSameTypeInfer ' does not conform to protocol ' NestedSameType ' } } <nl> func foo ( _ : ConcreteConformsNonFoo2 ) { } <nl> } <nl> <nl> mmm a / test / decl / protocol / conforms / failure . swift <nl> ppp b / test / decl / protocol / conforms / failure . swift <nl> struct P5Conformer : P5 { / / expected - error { { does not conform } } <nl> <nl> <nl> protocol P6Base { <nl> - associatedtype Foo <nl> + associatedtype Foo / / expected - note { { protocol requires nested type ' Foo ' ; do you want to add it ? } } <nl> func foo ( ) <nl> func bar ( ) - > Foo <nl> } <nl> extension P6 { <nl> func bar ( ) - > Bar ? { return nil } <nl> } <nl> <nl> - struct P6Conformer : P6 { / / expected - error { { does not conform } } <nl> + struct P6Conformer : P6 { / / expected - error 2 { { does not conform } } <nl> func foo ( ) { } <nl> } <nl> <nl>
Merge remote - tracking branch ' origin / master ' into master - next
apple/swift
199cb5b75d0974ae0f1381c7b47e65393206a978
2017-12-10T08:09:50Z
new file mode 100644 <nl> index 00000000000 . . 3c598a735bc <nl> mmm / dev / null <nl> ppp b / ports / cereal / CONTROL <nl> <nl> + Source : cereal <nl> + Version : 1 . 2 . 1 <nl> + Description : a header - only C + + 11 serialization library ( built in support for binary , XML and JSon ) <nl>
Create CONTROL file
microsoft/vcpkg
b2619d58c67842e5dd23eb4fea974c35270ab9dd
2017-01-14T22:56:34Z
mmm a / torch / autograd / variable . py <nl> ppp b / torch / autograd / variable . py <nl> <nl> import weakref <nl> from torch . _six import imap <nl> from torch . _C import _add_docstr <nl> + import torch . onnx <nl> + <nl> + <nl> + def _size_as_tensor ( g , input ) : <nl> + return g . op ( ' Shape ' , input ) <nl> + <nl> + <nl> + def _resize_from_tensor ( g , input , shape ) : <nl> + return g . op ( ' ReshapeDynamic ' , input , shape ) <nl> <nl> <nl> class Variable ( _C . _VariableBase ) : <nl> def btrifact ( self , info = None , pivot = True ) : <nl> else : <nl> return super ( Variable , self ) . btrifact ( pivot = pivot ) <nl> <nl> + @ torch . onnx . symbolic_override ( _size_as_tensor ) <nl> + def size_as_tensor ( self ) : <nl> + return torch . Tensor ( tuple ( self . size ( ) ) ) <nl> + <nl> + @ torch . onnx . symbolic_override ( _resize_from_tensor ) <nl> + def resize_from_tensor ( self , size ) : <nl> + from . _functions import Resize <nl> + return Resize . apply ( self , torch . Size ( size ( ) ) ) <nl> + <nl> def resize ( self , * sizes ) : <nl> warnings . warn ( " non - inplace resize is deprecated " ) <nl> from . _functions import Resize <nl>
introduce size_as_tensor and resize_from_tensor ( )
pytorch/pytorch
4fa08535ed8c63f05c7e33ca6faa255c0bb5e93b
2018-03-15T18:47:35Z
mmm a / tensorflow / compiler / xla / service / BUILD <nl> ppp b / tensorflow / compiler / xla / service / BUILD <nl> cc_library ( <nl> srcs = [ " hlo_runner_interface . cc " ] , <nl> hdrs = [ " hlo_runner_interface . h " ] , <nl> deps = [ <nl> - " : compiler " , <nl> " : computation_placer " , <nl> + " : executable " , <nl> " : hlo " , <nl> - " : hlo_module_group " , <nl> " : hlo_parser " , <nl> - " / / tensorflow / compiler / xla : shape_util " , <nl> " / / tensorflow / compiler / xla : status_macros " , <nl> " / / tensorflow / compiler / xla : statusor " , <nl> " / / tensorflow / compiler / xla : types " , <nl> " / / tensorflow / compiler / xla : util " , <nl> " / / tensorflow / compiler / xla : xla_data_proto_cc " , <nl> " / / tensorflow / core : core_cpu_internal " , <nl> - " / / tensorflow / core : lib " , <nl> - " / / tensorflow / core : lib_internal " , <nl> - " @ com_google_absl / / absl / memory " , <nl> " @ com_google_absl / / absl / types : span " , <nl> ] , <nl> ) <nl> mmm a / tensorflow / compiler / xla / service / hlo_runner . cc <nl> ppp b / tensorflow / compiler / xla / service / hlo_runner . cc <nl> StatusOr < Literal > HloRunner : : Execute ( std : : unique_ptr < HloModule > module , <nl> } <nl> <nl> StatusOr < Literal > HloRunner : : ExecuteWithExecutable ( <nl> - std : : unique_ptr < Executable > executable , absl : : Span < const Literal > arguments , <nl> - ExecutionProfile * profile ) { <nl> + std : : unique_ptr < Executable > executable , <nl> + absl : : Span < const Literal * const > arguments , ExecutionProfile * profile ) { <nl> TF_ASSIGN_OR_RETURN ( std : : vector < ScopedShapedBuffer > argument_buffers , <nl> TransferLiteralsToDevice ( arguments ) ) ; <nl> TF_ASSIGN_OR_RETURN ( ExecutionOutput result , <nl> mmm a / tensorflow / compiler / xla / service / hlo_runner . h <nl> ppp b / tensorflow / compiler / xla / service / hlo_runner . h <nl> class HloRunner : public HloRunnerInterface { <nl> bool run_hlo_passes , <nl> ExecutionProfile * profile ) override ; <nl> <nl> + using HloRunnerInterface : : ExecuteWithExecutable ; <nl> + <nl> StatusOr < Literal > ExecuteWithExecutable ( <nl> std : : unique_ptr < Executable > executable , <nl> - absl : : Span < const Literal > arguments , ExecutionProfile * profile = nullptr ) ; <nl> + absl : : Span < const Literal * const > arguments , <nl> + ExecutionProfile * profile ) override ; <nl> <nl> / / As Execute ( ) , but accepts and returns device buffers instead of host <nl> / / buffers . <nl> mmm a / tensorflow / compiler / xla / service / hlo_runner_interface . cc <nl> ppp b / tensorflow / compiler / xla / service / hlo_runner_interface . cc <nl> StatusOr < Literal > HloRunnerInterface : : Execute ( <nl> / * profile = * / profile ) ; <nl> } <nl> <nl> + StatusOr < Literal > HloRunnerInterface : : ExecuteWithExecutable ( <nl> + std : : unique_ptr < Executable > executable , absl : : Span < const Literal > arguments , <nl> + ExecutionProfile * profile ) { <nl> + / / Construct a vector of plain pointers for the arguments . <nl> + std : : vector < const Literal * > argument_pointers ; <nl> + argument_pointers . reserve ( arguments . size ( ) ) ; <nl> + for ( const auto & argument : arguments ) { <nl> + argument_pointers . push_back ( & argument ) ; <nl> + } <nl> + return ExecuteWithExecutable ( std : : move ( executable ) , argument_pointers , <nl> + nullptr ) ; <nl> + } <nl> + <nl> } / / namespace xla <nl> mmm a / tensorflow / compiler / xla / service / hlo_runner_interface . h <nl> ppp b / tensorflow / compiler / xla / service / hlo_runner_interface . h <nl> limitations under the License . <nl> <nl> # include " absl / types / span . h " <nl> # include " tensorflow / compiler / xla / service / computation_placer . h " <nl> + # include " tensorflow / compiler / xla / service / executable . h " <nl> # include " tensorflow / compiler / xla / service / hlo_computation . h " <nl> # include " tensorflow / compiler / xla / service / hlo_module . h " <nl> # include " tensorflow / compiler / xla / status_macros . h " <nl> class HloRunnerInterface { <nl> bool run_hlo_passes , <nl> ExecutionProfile * profile ) = 0 ; <nl> <nl> + / / Same as above , but with Executable as input . <nl> + StatusOr < Literal > ExecuteWithExecutable ( <nl> + std : : unique_ptr < Executable > executable , <nl> + absl : : Span < const Literal > arguments , ExecutionProfile * profile = nullptr ) ; <nl> + <nl> + StatusOr < Literal > ExecuteWithExecutable ( <nl> + std : : unique_ptr < Executable > executable , <nl> + absl : : Span < const Literal * const > arguments ) { <nl> + return ExecuteWithExecutable ( std : : move ( executable ) , arguments , nullptr ) ; <nl> + } <nl> + <nl> + virtual StatusOr < Literal > ExecuteWithExecutable ( <nl> + std : : unique_ptr < Executable > executable , <nl> + absl : : Span < const Literal * const > arguments , <nl> + ExecutionProfile * profile ) = 0 ; <nl> + <nl> / / Executes a given HLO module into a set of replicas , and returns a map <nl> / / with the replica number as key , and the corresponding returned literal as <nl> / / value . <nl>
Internal build rule change .
tensorflow/tensorflow
c0141706a4a8150ae10f460b27cf2dc26088ae8a
2020-12-02T01:46:15Z
mmm a / spec / api - screen - spec . js <nl> ppp b / spec / api - screen - spec . js <nl> describe ( ' screen module ' , ( ) = > { <nl> assert ( display . size . height > 0 ) <nl> } ) <nl> } ) <nl> - <nl> - describe ( ' screen . getMenuBarHeight ( ) ' , ( ) = > { <nl> - before ( function ( ) { <nl> - if ( process . platform ! = = ' darwin ' ) { <nl> - this . skip ( ) <nl> - } <nl> - } ) <nl> - <nl> - it ( ' returns an integer ' , ( ) = > { <nl> - const screenHeight = screen . getMenuBarHeight ( ) <nl> - assert . equal ( typeof screenHeight , ' number ' ) <nl> - } ) <nl> - } ) <nl> } ) <nl>
remove screen . getMenuBarHeight spec
electron/electron
3635872f37f27829c85a22946e86152dc3517e14
2018-03-06T01:10:34Z
mmm a / BUILD . gn <nl> ppp b / BUILD . gn <nl> action ( " js2c " ) { <nl> sources = [ <nl> " src / runtime . js " , <nl> " src / v8natives . js " , <nl> + " src / symbol . js " , <nl> " src / array . js " , <nl> " src / string . js " , <nl> - " src / symbol . js " , <nl> " src / uri . js " , <nl> " third_party / fdlibm / fdlibm . js " , <nl> " src / math . js " , <nl>
Fix GN build .
v8/v8
4db68f26e29c77ce1203e674daf9a1dbebbbbfe4
2014-08-09T10:02:42Z
mmm a / src / arm / full - codegen - arm . cc <nl> ppp b / src / arm / full - codegen - arm . cc <nl> void FullCodeGenerator : : VisitAssignment ( Assignment * expr ) { <nl> EmitNamedPropertyAssignment ( expr ) ; <nl> break ; <nl> case NAMED_SUPER_PROPERTY : <nl> - EmitNamedSuperPropertyAssignment ( expr ) ; <nl> + EmitNamedSuperPropertyStore ( property ) ; <nl> + context ( ) - > Plug ( r0 ) ; <nl> break ; <nl> case KEYED_PROPERTY : <nl> EmitKeyedPropertyAssignment ( expr ) ; <nl> void FullCodeGenerator : : EmitNamedPropertyAssignment ( Assignment * expr ) { <nl> } <nl> <nl> <nl> - void FullCodeGenerator : : EmitNamedSuperPropertyAssignment ( Assignment * expr ) { <nl> + void FullCodeGenerator : : EmitNamedSuperPropertyStore ( Property * prop ) { <nl> / / Assignment to named property of super . <nl> / / r0 : value <nl> / / stack : receiver ( ' this ' ) , home_object <nl> - Property * prop = expr - > target ( ) - > AsProperty ( ) ; <nl> DCHECK ( prop ! = NULL ) ; <nl> Literal * key = prop - > key ( ) - > AsLiteral ( ) ; <nl> DCHECK ( key ! = NULL ) ; <nl> void FullCodeGenerator : : EmitNamedSuperPropertyAssignment ( Assignment * expr ) { <nl> __ CallRuntime ( ( strict_mode ( ) = = STRICT ? Runtime : : kStoreToSuper_Strict <nl> : Runtime : : kStoreToSuper_Sloppy ) , <nl> 4 ) ; <nl> - context ( ) - > Plug ( r0 ) ; <nl> } <nl> <nl> <nl> void FullCodeGenerator : : VisitCountOperation ( CountOperation * expr ) { <nl> <nl> / / Expression can only be a property , a global or a ( parameter or local ) <nl> / / slot . <nl> - enum LhsKind { VARIABLE , NAMED_PROPERTY , KEYED_PROPERTY } ; <nl> + enum LhsKind { <nl> + VARIABLE , <nl> + NAMED_PROPERTY , <nl> + KEYED_PROPERTY , <nl> + NAMED_SUPER_PROPERTY <nl> + } ; <nl> LhsKind assign_type = VARIABLE ; <nl> Property * prop = expr - > expression ( ) - > AsProperty ( ) ; <nl> / / In case of a property we use the uninitialized expression context <nl> / / of the key to detect a named property . <nl> if ( prop ! = NULL ) { <nl> assign_type = <nl> - ( prop - > key ( ) - > IsPropertyName ( ) ) ? NAMED_PROPERTY : KEYED_PROPERTY ; <nl> - if ( prop - > IsSuperAccess ( ) ) { <nl> - / / throw exception . <nl> - VisitSuperReference ( prop - > obj ( ) - > AsSuperReference ( ) ) ; <nl> - return ; <nl> - } <nl> + ( prop - > key ( ) - > IsPropertyName ( ) ) <nl> + ? ( prop - > IsSuperAccess ( ) ? NAMED_SUPER_PROPERTY : NAMED_PROPERTY ) <nl> + : KEYED_PROPERTY ; <nl> } <nl> <nl> / / Evaluate expression and get value . <nl> void FullCodeGenerator : : VisitCountOperation ( CountOperation * expr ) { <nl> VisitForStackValue ( prop - > obj ( ) ) ; <nl> __ ldr ( LoadDescriptor : : ReceiverRegister ( ) , MemOperand ( sp , 0 ) ) ; <nl> EmitNamedPropertyLoad ( prop ) ; <nl> + } else if ( assign_type = = NAMED_SUPER_PROPERTY ) { <nl> + VisitForStackValue ( prop - > obj ( ) - > AsSuperReference ( ) - > this_var ( ) ) ; <nl> + EmitLoadHomeObject ( prop - > obj ( ) - > AsSuperReference ( ) ) ; <nl> + __ Push ( result_register ( ) ) ; <nl> + const Register scratch = r1 ; <nl> + __ ldr ( scratch , MemOperand ( sp , kPointerSize ) ) ; <nl> + __ Push ( scratch ) ; <nl> + __ Push ( result_register ( ) ) ; <nl> + EmitNamedSuperPropertyLoad ( prop ) ; <nl> } else { <nl> VisitForStackValue ( prop - > obj ( ) ) ; <nl> VisitForStackValue ( prop - > key ( ) ) ; <nl> void FullCodeGenerator : : VisitCountOperation ( CountOperation * expr ) { <nl> case NAMED_PROPERTY : <nl> __ str ( r0 , MemOperand ( sp , kPointerSize ) ) ; <nl> break ; <nl> + case NAMED_SUPER_PROPERTY : <nl> + __ str ( r0 , MemOperand ( sp , 2 * kPointerSize ) ) ; <nl> + break ; <nl> case KEYED_PROPERTY : <nl> __ str ( r0 , MemOperand ( sp , 2 * kPointerSize ) ) ; <nl> break ; <nl> void FullCodeGenerator : : VisitCountOperation ( CountOperation * expr ) { <nl> case NAMED_PROPERTY : <nl> __ str ( r0 , MemOperand ( sp , kPointerSize ) ) ; <nl> break ; <nl> + case NAMED_SUPER_PROPERTY : <nl> + __ str ( r0 , MemOperand ( sp , 2 * kPointerSize ) ) ; <nl> + break ; <nl> case KEYED_PROPERTY : <nl> __ str ( r0 , MemOperand ( sp , 2 * kPointerSize ) ) ; <nl> break ; <nl> void FullCodeGenerator : : VisitCountOperation ( CountOperation * expr ) { <nl> } <nl> break ; <nl> } <nl> + case NAMED_SUPER_PROPERTY : { <nl> + EmitNamedSuperPropertyStore ( prop ) ; <nl> + if ( expr - > is_postfix ( ) ) { <nl> + if ( ! context ( ) - > IsEffect ( ) ) { <nl> + context ( ) - > PlugTOS ( ) ; <nl> + } <nl> + } else { <nl> + context ( ) - > Plug ( r0 ) ; <nl> + } <nl> + break ; <nl> + } <nl> case KEYED_PROPERTY : { <nl> __ Pop ( StoreDescriptor : : ReceiverRegister ( ) , <nl> StoreDescriptor : : NameRegister ( ) ) ; <nl> mmm a / src / arm64 / full - codegen - arm64 . cc <nl> ppp b / src / arm64 / full - codegen - arm64 . cc <nl> void FullCodeGenerator : : VisitAssignment ( Assignment * expr ) { <nl> EmitNamedPropertyAssignment ( expr ) ; <nl> break ; <nl> case NAMED_SUPER_PROPERTY : <nl> - EmitNamedSuperPropertyAssignment ( expr ) ; <nl> + EmitNamedSuperPropertyStore ( property ) ; <nl> + context ( ) - > Plug ( x0 ) ; <nl> break ; <nl> case KEYED_PROPERTY : <nl> EmitKeyedPropertyAssignment ( expr ) ; <nl> void FullCodeGenerator : : EmitNamedPropertyAssignment ( Assignment * expr ) { <nl> } <nl> <nl> <nl> - void FullCodeGenerator : : EmitNamedSuperPropertyAssignment ( Assignment * expr ) { <nl> + void FullCodeGenerator : : EmitNamedSuperPropertyStore ( Property * prop ) { <nl> / / Assignment to named property of super . <nl> / / x0 : value <nl> / / stack : receiver ( ' this ' ) , home_object <nl> - Property * prop = expr - > target ( ) - > AsProperty ( ) ; <nl> DCHECK ( prop ! = NULL ) ; <nl> Literal * key = prop - > key ( ) - > AsLiteral ( ) ; <nl> DCHECK ( key ! = NULL ) ; <nl> void FullCodeGenerator : : EmitNamedSuperPropertyAssignment ( Assignment * expr ) { <nl> __ CallRuntime ( ( strict_mode ( ) = = STRICT ? Runtime : : kStoreToSuper_Strict <nl> : Runtime : : kStoreToSuper_Sloppy ) , <nl> 4 ) ; <nl> - context ( ) - > Plug ( x0 ) ; <nl> } <nl> <nl> <nl> void FullCodeGenerator : : VisitCountOperation ( CountOperation * expr ) { <nl> <nl> / / Expression can only be a property , a global or a ( parameter or local ) <nl> / / slot . <nl> - enum LhsKind { VARIABLE , NAMED_PROPERTY , KEYED_PROPERTY } ; <nl> + enum LhsKind { <nl> + VARIABLE , <nl> + NAMED_PROPERTY , <nl> + KEYED_PROPERTY , <nl> + NAMED_SUPER_PROPERTY <nl> + } ; <nl> LhsKind assign_type = VARIABLE ; <nl> Property * prop = expr - > expression ( ) - > AsProperty ( ) ; <nl> / / In case of a property we use the uninitialized expression context <nl> / / of the key to detect a named property . <nl> if ( prop ! = NULL ) { <nl> assign_type = <nl> - ( prop - > key ( ) - > IsPropertyName ( ) ) ? NAMED_PROPERTY : KEYED_PROPERTY ; <nl> - if ( prop - > IsSuperAccess ( ) ) { <nl> - / / throw exception . <nl> - VisitSuperReference ( prop - > obj ( ) - > AsSuperReference ( ) ) ; <nl> - return ; <nl> - } <nl> + ( prop - > key ( ) - > IsPropertyName ( ) ) <nl> + ? ( prop - > IsSuperAccess ( ) ? NAMED_SUPER_PROPERTY : NAMED_PROPERTY ) <nl> + : KEYED_PROPERTY ; <nl> } <nl> <nl> / / Evaluate expression and get value . <nl> void FullCodeGenerator : : VisitCountOperation ( CountOperation * expr ) { <nl> VisitForStackValue ( prop - > obj ( ) ) ; <nl> __ Peek ( LoadDescriptor : : ReceiverRegister ( ) , 0 ) ; <nl> EmitNamedPropertyLoad ( prop ) ; <nl> + } else if ( assign_type = = NAMED_SUPER_PROPERTY ) { <nl> + VisitForStackValue ( prop - > obj ( ) - > AsSuperReference ( ) - > this_var ( ) ) ; <nl> + EmitLoadHomeObject ( prop - > obj ( ) - > AsSuperReference ( ) ) ; <nl> + __ Push ( result_register ( ) ) ; <nl> + const Register scratch = x10 ; <nl> + __ Peek ( scratch , kPointerSize ) ; <nl> + __ Push ( scratch , result_register ( ) ) ; <nl> + EmitNamedSuperPropertyLoad ( prop ) ; <nl> } else { <nl> / / KEYED_PROPERTY <nl> VisitForStackValue ( prop - > obj ( ) ) ; <nl> void FullCodeGenerator : : VisitCountOperation ( CountOperation * expr ) { <nl> case NAMED_PROPERTY : <nl> __ Poke ( x0 , kPointerSize ) ; <nl> break ; <nl> + case NAMED_SUPER_PROPERTY : <nl> + __ Poke ( x0 , kPointerSize * 2 ) ; <nl> + break ; <nl> case KEYED_PROPERTY : <nl> __ Poke ( x0 , kPointerSize * 2 ) ; <nl> break ; <nl> void FullCodeGenerator : : VisitCountOperation ( CountOperation * expr ) { <nl> case NAMED_PROPERTY : <nl> __ Poke ( x0 , kXRegSize ) ; <nl> break ; <nl> + case NAMED_SUPER_PROPERTY : <nl> + __ Poke ( x0 , 2 * kXRegSize ) ; <nl> + break ; <nl> case KEYED_PROPERTY : <nl> __ Poke ( x0 , 2 * kXRegSize ) ; <nl> break ; <nl> void FullCodeGenerator : : VisitCountOperation ( CountOperation * expr ) { <nl> } <nl> break ; <nl> } <nl> + case NAMED_SUPER_PROPERTY : { <nl> + EmitNamedSuperPropertyStore ( prop ) ; <nl> + if ( expr - > is_postfix ( ) ) { <nl> + if ( ! context ( ) - > IsEffect ( ) ) { <nl> + context ( ) - > PlugTOS ( ) ; <nl> + } <nl> + } else { <nl> + context ( ) - > Plug ( x0 ) ; <nl> + } <nl> + break ; <nl> + } <nl> case KEYED_PROPERTY : { <nl> __ Pop ( StoreDescriptor : : NameRegister ( ) ) ; <nl> __ Pop ( StoreDescriptor : : ReceiverRegister ( ) ) ; <nl> mmm a / src / full - codegen . h <nl> ppp b / src / full - codegen . h <nl> class FullCodeGenerator : public AstVisitor { <nl> <nl> / / Complete a super named property assignment . The right - hand - side value <nl> / / is expected in accumulator . <nl> - void EmitNamedSuperPropertyAssignment ( Assignment * expr ) ; <nl> + void EmitNamedSuperPropertyStore ( Property * prop ) ; <nl> <nl> / / Complete a keyed property assignment . The receiver and key are <nl> / / expected on top of the stack and the right - hand - side value in the <nl> mmm a / src / ia32 / full - codegen - ia32 . cc <nl> ppp b / src / ia32 / full - codegen - ia32 . cc <nl> void FullCodeGenerator : : VisitAssignment ( Assignment * expr ) { <nl> EmitNamedPropertyAssignment ( expr ) ; <nl> break ; <nl> case NAMED_SUPER_PROPERTY : <nl> - EmitNamedSuperPropertyAssignment ( expr ) ; <nl> + EmitNamedSuperPropertyStore ( property ) ; <nl> + context ( ) - > Plug ( eax ) ; <nl> break ; <nl> case KEYED_PROPERTY : <nl> EmitKeyedPropertyAssignment ( expr ) ; <nl> void FullCodeGenerator : : EmitNamedPropertyAssignment ( Assignment * expr ) { <nl> } <nl> <nl> <nl> - void FullCodeGenerator : : EmitNamedSuperPropertyAssignment ( Assignment * expr ) { <nl> + void FullCodeGenerator : : EmitNamedSuperPropertyStore ( Property * prop ) { <nl> / / Assignment to named property of super . <nl> / / eax : value <nl> / / stack : receiver ( ' this ' ) , home_object <nl> - Property * prop = expr - > target ( ) - > AsProperty ( ) ; <nl> DCHECK ( prop ! = NULL ) ; <nl> Literal * key = prop - > key ( ) - > AsLiteral ( ) ; <nl> DCHECK ( key ! = NULL ) ; <nl> void FullCodeGenerator : : EmitNamedSuperPropertyAssignment ( Assignment * expr ) { <nl> __ CallRuntime ( ( strict_mode ( ) = = STRICT ? Runtime : : kStoreToSuper_Strict <nl> : Runtime : : kStoreToSuper_Sloppy ) , <nl> 4 ) ; <nl> - context ( ) - > Plug ( eax ) ; <nl> } <nl> <nl> <nl> void FullCodeGenerator : : VisitCountOperation ( CountOperation * expr ) { <nl> <nl> / / Expression can only be a property , a global or a ( parameter or local ) <nl> / / slot . <nl> - enum LhsKind { VARIABLE , NAMED_PROPERTY , KEYED_PROPERTY } ; <nl> + enum LhsKind { <nl> + VARIABLE , <nl> + NAMED_PROPERTY , <nl> + KEYED_PROPERTY , <nl> + NAMED_SUPER_PROPERTY <nl> + } ; <nl> LhsKind assign_type = VARIABLE ; <nl> Property * prop = expr - > expression ( ) - > AsProperty ( ) ; <nl> / / In case of a property we use the uninitialized expression context <nl> / / of the key to detect a named property . <nl> if ( prop ! = NULL ) { <nl> assign_type = <nl> - ( prop - > key ( ) - > IsPropertyName ( ) ) ? NAMED_PROPERTY : KEYED_PROPERTY ; <nl> - if ( prop - > IsSuperAccess ( ) ) { <nl> - / / throw exception . <nl> - VisitSuperReference ( prop - > obj ( ) - > AsSuperReference ( ) ) ; <nl> - return ; <nl> - } <nl> + ( prop - > key ( ) - > IsPropertyName ( ) ) <nl> + ? ( prop - > IsSuperAccess ( ) ? NAMED_SUPER_PROPERTY : NAMED_PROPERTY ) <nl> + : KEYED_PROPERTY ; <nl> } <nl> <nl> / / Evaluate expression and get value . <nl> void FullCodeGenerator : : VisitCountOperation ( CountOperation * expr ) { <nl> VisitForStackValue ( prop - > obj ( ) ) ; <nl> __ mov ( LoadDescriptor : : ReceiverRegister ( ) , Operand ( esp , 0 ) ) ; <nl> EmitNamedPropertyLoad ( prop ) ; <nl> + } else if ( assign_type = = NAMED_SUPER_PROPERTY ) { <nl> + VisitForStackValue ( prop - > obj ( ) - > AsSuperReference ( ) - > this_var ( ) ) ; <nl> + EmitLoadHomeObject ( prop - > obj ( ) - > AsSuperReference ( ) ) ; <nl> + __ push ( result_register ( ) ) ; <nl> + __ push ( MemOperand ( esp , kPointerSize ) ) ; <nl> + __ push ( result_register ( ) ) ; <nl> + EmitNamedSuperPropertyLoad ( prop ) ; <nl> } else { <nl> VisitForStackValue ( prop - > obj ( ) ) ; <nl> VisitForStackValue ( prop - > key ( ) ) ; <nl> void FullCodeGenerator : : VisitCountOperation ( CountOperation * expr ) { <nl> case NAMED_PROPERTY : <nl> __ mov ( Operand ( esp , kPointerSize ) , eax ) ; <nl> break ; <nl> + case NAMED_SUPER_PROPERTY : <nl> + __ mov ( Operand ( esp , 2 * kPointerSize ) , eax ) ; <nl> + break ; <nl> case KEYED_PROPERTY : <nl> __ mov ( Operand ( esp , 2 * kPointerSize ) , eax ) ; <nl> break ; <nl> void FullCodeGenerator : : VisitCountOperation ( CountOperation * expr ) { <nl> case NAMED_PROPERTY : <nl> __ mov ( Operand ( esp , kPointerSize ) , eax ) ; <nl> break ; <nl> + case NAMED_SUPER_PROPERTY : <nl> + __ mov ( Operand ( esp , 2 * kPointerSize ) , eax ) ; <nl> + break ; <nl> case KEYED_PROPERTY : <nl> __ mov ( Operand ( esp , 2 * kPointerSize ) , eax ) ; <nl> break ; <nl> void FullCodeGenerator : : VisitCountOperation ( CountOperation * expr ) { <nl> } <nl> break ; <nl> } <nl> + case NAMED_SUPER_PROPERTY : { <nl> + EmitNamedSuperPropertyStore ( prop ) ; <nl> + if ( expr - > is_postfix ( ) ) { <nl> + if ( ! context ( ) - > IsEffect ( ) ) { <nl> + context ( ) - > PlugTOS ( ) ; <nl> + } <nl> + } else { <nl> + context ( ) - > Plug ( eax ) ; <nl> + } <nl> + break ; <nl> + } <nl> case KEYED_PROPERTY : { <nl> __ pop ( StoreDescriptor : : NameRegister ( ) ) ; <nl> __ pop ( StoreDescriptor : : ReceiverRegister ( ) ) ; <nl> mmm a / src / x64 / full - codegen - x64 . cc <nl> ppp b / src / x64 / full - codegen - x64 . cc <nl> void FullCodeGenerator : : VisitAssignment ( Assignment * expr ) { <nl> EmitNamedPropertyAssignment ( expr ) ; <nl> break ; <nl> case NAMED_SUPER_PROPERTY : <nl> - EmitNamedSuperPropertyAssignment ( expr ) ; <nl> + EmitNamedSuperPropertyStore ( property ) ; <nl> + context ( ) - > Plug ( rax ) ; <nl> break ; <nl> case KEYED_PROPERTY : <nl> EmitKeyedPropertyAssignment ( expr ) ; <nl> void FullCodeGenerator : : EmitNamedPropertyAssignment ( Assignment * expr ) { <nl> } <nl> <nl> <nl> - void FullCodeGenerator : : EmitNamedSuperPropertyAssignment ( Assignment * expr ) { <nl> + void FullCodeGenerator : : EmitNamedSuperPropertyStore ( Property * prop ) { <nl> / / Assignment to named property of super . <nl> / / rax : value <nl> / / stack : receiver ( ' this ' ) , home_object <nl> - Property * prop = expr - > target ( ) - > AsProperty ( ) ; <nl> DCHECK ( prop ! = NULL ) ; <nl> Literal * key = prop - > key ( ) - > AsLiteral ( ) ; <nl> DCHECK ( key ! = NULL ) ; <nl> void FullCodeGenerator : : EmitNamedSuperPropertyAssignment ( Assignment * expr ) { <nl> __ CallRuntime ( ( strict_mode ( ) = = STRICT ? Runtime : : kStoreToSuper_Strict <nl> : Runtime : : kStoreToSuper_Sloppy ) , <nl> 4 ) ; <nl> - context ( ) - > Plug ( rax ) ; <nl> } <nl> <nl> <nl> void FullCodeGenerator : : VisitCountOperation ( CountOperation * expr ) { <nl> <nl> / / Expression can only be a property , a global or a ( parameter or local ) <nl> / / slot . <nl> - enum LhsKind { VARIABLE , NAMED_PROPERTY , KEYED_PROPERTY } ; <nl> + enum LhsKind { <nl> + VARIABLE , <nl> + NAMED_PROPERTY , <nl> + KEYED_PROPERTY , <nl> + NAMED_SUPER_PROPERTY <nl> + } ; <nl> LhsKind assign_type = VARIABLE ; <nl> Property * prop = expr - > expression ( ) - > AsProperty ( ) ; <nl> / / In case of a property we use the uninitialized expression context <nl> / / of the key to detect a named property . <nl> if ( prop ! = NULL ) { <nl> assign_type = <nl> - ( prop - > key ( ) - > IsPropertyName ( ) ) ? NAMED_PROPERTY : KEYED_PROPERTY ; <nl> - if ( prop - > IsSuperAccess ( ) ) { <nl> - / / throw exception . <nl> - VisitSuperReference ( prop - > obj ( ) - > AsSuperReference ( ) ) ; <nl> - return ; <nl> - } <nl> + ( prop - > key ( ) - > IsPropertyName ( ) ) <nl> + ? ( prop - > IsSuperAccess ( ) ? NAMED_SUPER_PROPERTY : NAMED_PROPERTY ) <nl> + : KEYED_PROPERTY ; <nl> } <nl> <nl> / / Evaluate expression and get value . <nl> void FullCodeGenerator : : VisitCountOperation ( CountOperation * expr ) { <nl> VisitForStackValue ( prop - > obj ( ) ) ; <nl> __ movp ( LoadDescriptor : : ReceiverRegister ( ) , Operand ( rsp , 0 ) ) ; <nl> EmitNamedPropertyLoad ( prop ) ; <nl> + } else if ( assign_type = = NAMED_SUPER_PROPERTY ) { <nl> + VisitForStackValue ( prop - > obj ( ) - > AsSuperReference ( ) - > this_var ( ) ) ; <nl> + EmitLoadHomeObject ( prop - > obj ( ) - > AsSuperReference ( ) ) ; <nl> + __ Push ( result_register ( ) ) ; <nl> + __ Push ( MemOperand ( rsp , kPointerSize ) ) ; <nl> + __ Push ( result_register ( ) ) ; <nl> + EmitNamedSuperPropertyLoad ( prop ) ; <nl> } else { <nl> VisitForStackValue ( prop - > obj ( ) ) ; <nl> VisitForStackValue ( prop - > key ( ) ) ; <nl> void FullCodeGenerator : : VisitCountOperation ( CountOperation * expr ) { <nl> case NAMED_PROPERTY : <nl> __ movp ( Operand ( rsp , kPointerSize ) , rax ) ; <nl> break ; <nl> + case NAMED_SUPER_PROPERTY : <nl> + __ movp ( Operand ( rsp , 2 * kPointerSize ) , rax ) ; <nl> + break ; <nl> case KEYED_PROPERTY : <nl> __ movp ( Operand ( rsp , 2 * kPointerSize ) , rax ) ; <nl> break ; <nl> void FullCodeGenerator : : VisitCountOperation ( CountOperation * expr ) { <nl> case NAMED_PROPERTY : <nl> __ movp ( Operand ( rsp , kPointerSize ) , rax ) ; <nl> break ; <nl> + case NAMED_SUPER_PROPERTY : <nl> + __ movp ( Operand ( rsp , 2 * kPointerSize ) , rax ) ; <nl> + break ; <nl> case KEYED_PROPERTY : <nl> __ movp ( Operand ( rsp , 2 * kPointerSize ) , rax ) ; <nl> break ; <nl> void FullCodeGenerator : : VisitCountOperation ( CountOperation * expr ) { <nl> } <nl> break ; <nl> } <nl> + case NAMED_SUPER_PROPERTY : { <nl> + EmitNamedSuperPropertyStore ( prop ) ; <nl> + if ( expr - > is_postfix ( ) ) { <nl> + if ( ! context ( ) - > IsEffect ( ) ) { <nl> + context ( ) - > PlugTOS ( ) ; <nl> + } <nl> + } else { <nl> + context ( ) - > Plug ( rax ) ; <nl> + } <nl> + break ; <nl> + } <nl> case KEYED_PROPERTY : { <nl> __ Pop ( StoreDescriptor : : NameRegister ( ) ) ; <nl> __ Pop ( StoreDescriptor : : ReceiverRegister ( ) ) ; <nl> mmm a / test / mjsunit / harmony / super . js <nl> ppp b / test / mjsunit / harmony / super . js <nl> <nl> } ( ) ) ; <nl> <nl> <nl> + ( function TestCountOperations ( ) { <nl> + function Base ( ) { } <nl> + Base . prototype = { <nl> + constructor : Base , <nl> + get x ( ) { <nl> + return this . _x ; <nl> + } , <nl> + set x ( v ) { <nl> + this . _x = v ; <nl> + } , <nl> + _x : 1 <nl> + } ; <nl> + <nl> + function Derived ( ) { } <nl> + Derived . __proto__ = Base ; <nl> + Derived . prototype = { <nl> + __proto__ : Base . prototype , <nl> + constructor : Derived , <nl> + _x : 2 <nl> + } ; <nl> + <nl> + Derived . prototype . testCounts = function ( ) { <nl> + assertEquals ( 2 , this . _x ) ; <nl> + assertEquals ( 2 , super . x ) ; <nl> + super . x + + ; <nl> + assertEquals ( 3 , super . x ) ; <nl> + + + super . x ; <nl> + assertEquals ( 4 , super . x ) ; <nl> + assertEquals ( 4 , super . x + + ) ; <nl> + assertEquals ( 5 , super . x ) ; <nl> + assertEquals ( 6 , + + super . x ) ; <nl> + assertEquals ( 6 , super . x ) ; <nl> + assertEquals ( 6 , this . _x ) ; <nl> + <nl> + super . x - - ; <nl> + assertEquals ( 5 , super . x ) ; <nl> + - - super . x ; <nl> + assertEquals ( 4 , super . x ) ; <nl> + assertEquals ( 4 , super . x - - ) ; <nl> + assertEquals ( 3 , super . x ) ; <nl> + assertEquals ( 2 , - - super . x ) ; <nl> + assertEquals ( 2 , super . x ) ; <nl> + assertEquals ( 2 , this . _x ) ; <nl> + } . toMethod ( Derived . prototype ) ; <nl> + new Derived ( ) . testCounts ( ) ; <nl> + } ( ) ) ; <nl> + <nl> + <nl> ( function TestUnsupportedCases ( ) { <nl> function f1 ( x ) { return super [ x ] ; } <nl> + function f2 ( x ) { super [ x ] = 5 ; } <nl> var o = { } <nl> assertThrows ( function ( ) { f1 . toMethod ( o ) ( x ) ; } , ReferenceError ) ; <nl> - function f2 ( ) { super . x + + ; } <nl> - assertThrows ( function ( ) { f2 . toMethod ( o ) ( ) ; } , ReferenceError ) ; <nl> + assertThrows ( function ( ) { f2 . toMethod ( o ) ( x ) ; } , ReferenceError ) ; <nl> } ( ) ) ; <nl>
Support count operations on super named properties .
v8/v8
ec209c7721dded952bf0e153edb0853b218638da
2014-09-29T13:56:32Z
mmm a / AUTHORS <nl> ppp b / AUTHORS <nl> a license to everyone to use it as detailed in LICENSE . ) <nl> * Kai Ninomiya < kainino @ chromium . org > ( copyright owned by Google , Inc . ) <nl> * Mickaël Schoentgen < contact @ tiger - 222 . fr > <nl> * Renaud Leroy < capitnflam @ gmail . com > <nl> + * Florian Stellbrink < florian @ stellbr . ink > <nl> mmm a / ChangeLog . md <nl> ppp b / ChangeLog . md <nl> full changeset diff at the end of each section . <nl> <nl> Current Trunk <nl> mmmmmmmmmmmm - <nl> + - Normalize mouse wheel delta in ` library_browser . js ` . This changes the scroll <nl> + amount in SDL , GLFW , and GLUT . ( # 7968 ) <nl> <nl> v1 . 38 . 27 : 02 / 10 / 2019 <nl> mmmmmmmmmmmmmmmmmm - - <nl> mmm a / src / library_browser . js <nl> ppp b / src / library_browser . js <nl> var LibraryBrowser = { <nl> / / opposite of native code : In native APIs the positive scroll direction is to scroll up ( away from the user ) . <nl> / / NOTE : The mouse wheel delta is a decimal number , and can be a fractional value within - 1 and 1 . If you need to represent <nl> / / this as an integer , don ' t simply cast to int , or you may receive scroll events for wheel delta = = 0 . <nl> + / / NOTE : We convert all units returned by events into steps , i . e . individual wheel notches . <nl> + / / These conversions are only approximations . Changing browsers , operating systems , or even settings can change the values . <nl> getMouseWheelDelta : function ( event ) { <nl> var delta = 0 ; <nl> switch ( event . type ) { <nl> case ' DOMMouseScroll ' : <nl> - delta = event . detail ; <nl> + / / 3 lines make up a step <nl> + delta = event . detail / 3 ; <nl> break ; <nl> case ' mousewheel ' : <nl> - delta = event . wheelDelta ; <nl> + / / 120 units make up a step <nl> + delta = event . wheelDelta / 120 ; <nl> break ; <nl> case ' wheel ' : <nl> - delta = event [ ' deltaY ' ] ; <nl> + delta = event . deltaY <nl> + switch ( event . deltaMode ) { <nl> + case 0 : <nl> + / / DOM_DELTA_PIXEL : 100 pixels make up a step <nl> + delta / = 100 ; <nl> + break ; <nl> + case 1 : <nl> + / / DOM_DELTA_LINE : 3 lines make up a step <nl> + delta / = 3 ; <nl> + break ; <nl> + case 2 : <nl> + / / DOM_DELTA_PAGE : A page makes up 80 steps <nl> + delta * = 80 ; <nl> + break ; <nl> + default : <nl> + throw ' unrecognized mouse wheel delta mode : ' + event . deltaMode ; <nl> + } <nl> break ; <nl> default : <nl> throw ' unrecognized mouse wheel event : ' + event . type ; <nl> mmm a / tests / test_sdl_mousewheel . c <nl> ppp b / tests / test_sdl_mousewheel . c <nl> int gotWheelClick = 0 ; <nl> <nl> void instruction ( ) <nl> { <nl> - if ( ! gotWheelUp | | ! gotWheelButtonUp ) printf ( " Please scroll the mouse wheel upwards ( move your finger away from you towards the display ) . \ n " ) ; <nl> - else if ( ! gotWheelDown | | ! gotWheelButtonDown ) printf ( " Please scroll the mouse wheel downwards ( move your finger towards you ) . \ n " ) ; <nl> + if ( ! gotWheelUp | | ! gotWheelButtonUp ) printf ( " Please scroll the mouse wheel upwards by a single notch ( slowly move your finger away from you towards the display ) . \ n " ) ; <nl> + else if ( ! gotWheelDown | | ! gotWheelButtonDown ) printf ( " Please scroll the mouse wheel downwards by a single notch ( slowly move your finger towards you ) . \ n " ) ; <nl> else if ( ! gotWheelClick ) printf ( " Please click the wheel button . \ n " ) ; <nl> else if ( gotWheelUp & & gotWheelButtonUp & & gotWheelDown & & gotWheelButtonDown & & gotWheelClick ) report_result ( 0 ) ; <nl> } <nl> void main_tick ( ) <nl> printf ( " SDL_MOUSEWHEEL : timestamp : % u , windowID : % u , which : % u , x : % d , y : % d \ n " , event . wheel . timestamp , event . wheel . windowID , event . wheel . which , event . wheel . x , event . wheel . y ) ; <nl> if ( ! gotWheelUp ) <nl> { <nl> - if ( event . wheel . y > 0 ) { gotWheelUp = 1 ; instruction ( ) ; } <nl> + if ( event . wheel . y > 0 & & event . wheel . y < 2 ) { gotWheelUp = 1 ; instruction ( ) ; } <nl> + else if ( event . wheel . y > = 2 ) { printf ( " The scroll amount was too large . Either you scrolled very fast or the normalization is not working . " ) ; report_result ( 1 ) ; } <nl> else if ( event . wheel . y < 0 ) { printf ( " You scrolled to the wrong direction ( downwards ) ! \ n " ) ; report_result ( 1 ) ; } <nl> } <nl> else if ( ! gotWheelDown ) <nl> { <nl> - if ( event . wheel . y < 0 ) { gotWheelDown = 1 ; instruction ( ) ; } <nl> + if ( event . wheel . y < 0 & & event . wheel . y > - 2 ) { gotWheelDown = 1 ; instruction ( ) ; } <nl> + else if ( event . wheel . y < = - 2 ) { printf ( " The scroll amount was too large . Either you scrolled very fast or the normalization is not working . " ) ; report_result ( 1 ) ; } <nl> } <nl> break ; <nl> case SDL_MOUSEBUTTONDOWN : <nl>
Mouse wheel delta adjustments ( )
emscripten-core/emscripten
7f77c64c2b0cedbb634f2797b34c6f10c4ffddc9
2019-02-11T19:57:56Z
mmm a / osquery / tables / system / windows / processes . cpp <nl> ppp b / osquery / tables / system / windows / processes . cpp <nl> void genProcess ( const WmiResultItem & result , QueryData & results_data ) { <nl> <nl> / / / Get the process UID and GID from its SID <nl> HANDLE tok = nullptr ; <nl> - std : : vector < char > tokOwner ( sizeof ( TOKEN_OWNER ) , 0x0 ) ; <nl> + std : : vector < char > tokUser ( sizeof ( TOKEN_USER ) , 0x0 ) ; <nl> auto ret = OpenProcessToken ( hProcess , TOKEN_READ , & tok ) ; <nl> if ( ret ! = 0 & & tok ! = nullptr ) { <nl> unsigned long tokOwnerBuffLen ; <nl> ret = GetTokenInformation ( tok , TokenUser , nullptr , 0 , & tokOwnerBuffLen ) ; <nl> if ( ret = = 0 & & GetLastError ( ) = = ERROR_INSUFFICIENT_BUFFER ) { <nl> - tokOwner . resize ( tokOwnerBuffLen ) ; <nl> + tokUser . resize ( tokOwnerBuffLen ) ; <nl> ret = GetTokenInformation ( <nl> - tok , TokenUser , tokOwner . data ( ) , tokOwnerBuffLen , & tokOwnerBuffLen ) ; <nl> + tok , TokenUser , tokUser . data ( ) , tokOwnerBuffLen , & tokOwnerBuffLen ) ; <nl> } <nl> <nl> / / Check if the process is using an elevated token <nl> void genProcess ( const WmiResultItem & result , QueryData & results_data ) { <nl> <nl> r [ " is_elevated_token " ] = elevated ? INTEGER ( 1 ) : INTEGER ( 0 ) ; <nl> } <nl> - if ( uid ! = 0 & & ret ! = 0 & & ! tokOwner . empty ( ) ) { <nl> - auto sid = PTOKEN_OWNER ( tokOwner . data ( ) ) - > Owner ; <nl> + if ( uid ! = 0 & & ret ! = 0 & & ! tokUser . empty ( ) ) { <nl> + auto sid = PTOKEN_OWNER ( tokUser . data ( ) ) - > Owner ; <nl> r [ " uid " ] = INTEGER ( getUidFromSid ( sid ) ) ; <nl> r [ " gid " ] = INTEGER ( getGidFromSid ( sid ) ) ; <nl> } else { <nl>
Using TOKEN_USER instead of TOKEN_OWNER struct ( )
osquery/osquery
50f66f8baa483d9f306079c94690fa8cd2f791aa
2018-06-28T10:22:24Z
mmm a / src / clustering / administration / tables / table_common . cc <nl> ppp b / src / clustering / administration / tables / table_common . cc <nl> <nl> # include " concurrency / cross_thread_signal . hpp " <nl> <nl> common_table_artificial_table_backend_t : : common_table_artificial_table_backend_t ( <nl> - boost : : shared_ptr < semilattice_readwrite_view_t < <nl> + boost : : shared_ptr < semilattice_readwrite_view_t < <nl> cluster_semilattice_metadata_t > > _semilattice_view , <nl> admin_identifier_format_t _identifier_format ) : <nl> semilattice_view ( _semilattice_view ) , <nl> mmm a / src / rdb_protocol / artificial_table / backend_cfeed . cc <nl> ppp b / src / rdb_protocol / artificial_table / backend_cfeed . cc <nl> void cfeed_artificial_table_backend_t : : notify_row ( const ql : : datum_t & pkey ) { <nl> ASSERT_FINITE_CORO_WAITING ; <nl> if ( machinery . has ( ) ) { <nl> if ( ! machinery - > all_dirty ) { <nl> - store_key_t pkey2 ( pkey . print_primary ( ) ) ; <nl> - machinery - > dirty . insert ( std : : make_pair ( pkey2 , pkey ) ) ; <nl> + machinery - > dirty . insert ( std : : make_pair ( <nl> + store_key_t ( pkey . print_primary ( ) ) , <nl> + pkey ) ) ; <nl> if ( machinery - > waker ) { <nl> machinery - > waker - > pulse_if_not_already_pulsed ( ) ; <nl> } <nl> void cfeed_artificial_table_backend_t : : notify_all ( ) { <nl> ASSERT_FINITE_CORO_WAITING ; <nl> if ( machinery . has ( ) ) { <nl> if ( ! machinery - > all_dirty ) { <nl> - / * This is in an ` if ` block so we don ' t unset ` should_break ` it <nl> + / * This is in an ` if ` block so we don ' t unset ` should_break ` if <nl> ` notify_break ( ) ` set it to ` true ` before . * / <nl> machinery - > should_break = false ; <nl> } <nl> mmm a / src / rdb_protocol / artificial_table / backend_cfeed . hpp <nl> ppp b / src / rdb_protocol / artificial_table / backend_cfeed . hpp <nl> class cfeed_artificial_table_backend_t : public virtual artificial_table_backend <nl> void notify_break ( ) ; <nl> <nl> / * Subclasses must call this when their destructor begins , to avoid the risk that the <nl> - ` cfeed_artificial_taable_backend_t ` will call virtual functions like ` read_row ( ) ` <nl> + ` cfeed_artificial_table_backend_t ` will call virtual functions like ` read_row ( ) ` <nl> after the subclass is destroyed . * / <nl> void begin_changefeed_destruction ( ) ; <nl> <nl> mmm a / src / rdb_protocol / changefeed . hpp <nl> ppp b / src / rdb_protocol / changefeed . hpp <nl> struct msg_t { <nl> struct change_t { <nl> std : : map < std : : string , std : : vector < datum_t > > old_indexes , new_indexes ; <nl> store_key_t pkey ; <nl> - / * For a newly - creatd row , ` old_val ` is ` datum_t : : null ( ) ` . For a deleted row , <nl> + / * For a newly - created row , ` old_val ` is ` datum_t : : null ( ) ` . For a deleted row , <nl> ` new_val ` is ` datum_t : : null ( ) ` . * / <nl> datum_t old_val , new_val ; <nl> RDB_DECLARE_ME_SERIALIZABLE ; <nl>
Fix minor typos and style issues .
rethinkdb/rethinkdb
507d13e043dc4b553a1ac9ac7f601fac93499697
2014-12-02T22:52:10Z
mmm a / jstests / in9 . js <nl> ppp b / jstests / in9 . js <nl> function doTest ( ) { <nl> doTest ( ) ; <nl> <nl> / / SERVER - 1943 not fixed yet <nl> - / / t . ensureIndex ( { key : 1 } ) ; <nl> - / / doTest ( ) ; <nl> + t . ensureIndex ( { key : 1 } ) ; <nl> + doTest ( ) ; <nl>
SERVER - 1943 test
mongodb/mongo
e44abd016d702c43519f2efc091c6a4ca0707994
2011-07-31T15:51:43Z
mmm a / include / swift / AST / DiagnosticsParse . def <nl> ppp b / include / swift / AST / DiagnosticsParse . def <nl> ERROR ( extra_rbrace , none , <nl> ERROR ( structure_overflow , Fatal , <nl> " structure nesting level exceeded maximum of % 0 " , ( unsigned ) ) <nl> <nl> + ERROR ( expected_close_to_if_directive , none , <nl> + " expected # else or # endif at end of conditional compilation block " , ( ) ) <nl> + ERROR ( expected_close_after_else_directive , none , <nl> + " further conditions after # else are unreachable " , ( ) ) <nl> ERROR ( unexpected_conditional_compilation_block_terminator , none , <nl> " unexpected conditional compilation block terminator " , ( ) ) <nl> - ERROR ( expected_conditional_compilation_expression , none , <nl> - " expected a condition to follow % select { # if | # elseif } 0 " , ( bool ) ) <nl> + ERROR ( incomplete_conditional_compilation_directive , none , <nl> + " incomplete condition in conditional compilation directive " , ( ) ) <nl> ERROR ( extra_tokens_conditional_compilation_directive , none , <nl> " extra tokens following conditional compilation directive " , ( ) ) <nl> <nl> ERROR ( expected_expr_assignment , none , <nl> ERROR ( expected_rbrace_in_brace_stmt , none , <nl> " expected ' } ' at end of brace statement " , ( ) ) <nl> <nl> - / / / # if Statement <nl> - ERROR ( expected_close_to_if_directive , none , <nl> - " expected # else or # endif at end of conditional compilation block " , ( ) ) <nl> - ERROR ( expected_close_after_else_directive , none , <nl> - " further conditions after # else are unreachable " , ( ) ) <nl> - <nl> / / / Associatedtype Statement <nl> ERROR ( typealias_inside_protocol_without_type , none , <nl> " typealias is missing an assigned type ; use ' associatedtype ' to define an associated type requirement " , ( ) ) <nl> mmm a / lib / Parse / ParseDecl . cpp <nl> ppp b / lib / Parse / ParseDecl . cpp <nl> ParserResult < IfConfigDecl > Parser : : parseDeclIfConfig ( ParseDeclOptions Flags ) { <nl> if ( isElse ) { <nl> ConfigState . setConditionActive ( ! foundActive ) ; <nl> } else { <nl> - if ( Tok . isAtStartOfLine ( ) ) { <nl> - diagnose ( ClauseLoc , diag : : expected_conditional_compilation_expression , <nl> - ! Clauses . empty ( ) ) ; <nl> - } <nl> - <nl> / / Evaluate the condition . <nl> ParserResult < Expr > Result = parseExprSequence ( diag : : expected_expr , <nl> / * isBasic * / true , <nl> mmm a / lib / Parse / ParseExpr . cpp <nl> ppp b / lib / Parse / ParseExpr . cpp <nl> ParserResult < Expr > Parser : : parseExprSequence ( Diag < > Message , <nl> } <nl> } <nl> SequencedExprs . push_back ( Primary . get ( ) ) ; <nl> + <nl> + if ( isForConditionalDirective & & Tok . isAtStartOfLine ( ) ) <nl> + break ; <nl> <nl> parse_operator : <nl> switch ( Tok . getKind ( ) ) { <nl> ParserResult < Expr > Parser : : parseExprSequence ( Diag < > Message , <nl> } <nl> } <nl> done : <nl> - <nl> - if ( SequencedExprs . empty ( ) ) { <nl> - if ( isForConditionalDirective ) { <nl> - diagnose ( startLoc , diag : : expected_close_to_if_directive ) ; <nl> - return makeParserError ( ) ; <nl> - } else { <nl> - / / If we had semantic errors , just fail here . <nl> - assert ( ! SequencedExprs . empty ( ) ) ; <nl> - } <nl> + <nl> + / / For conditional directives , we stop parsing after a line break . <nl> + if ( isForConditionalDirective & & ( SequencedExprs . size ( ) & 1 ) = = 0 ) { <nl> + diagnose ( getEndOfPreviousLoc ( ) , <nl> + diag : : incomplete_conditional_compilation_directive ) ; <nl> + return makeParserError ( ) ; <nl> } <nl> <nl> + / / If we had semantic errors , just fail here . <nl> + assert ( ! SequencedExprs . empty ( ) ) ; <nl> + <nl> / / If we saw no operators , don ' t build a sequence . <nl> if ( SequencedExprs . size ( ) = = 1 ) { <nl> auto Result = makeParserResult ( SequencedExprs [ 0 ] ) ; <nl> mmm a / lib / Parse / ParseStmt . cpp <nl> ppp b / lib / Parse / ParseStmt . cpp <nl> ParserResult < Stmt > Parser : : parseStmtIfConfig ( BraceItemListKind Kind ) { <nl> if ( isElse ) { <nl> ConfigState . setConditionActive ( ! foundActive ) ; <nl> } else { <nl> - if ( Tok . isAtStartOfLine ( ) ) { <nl> - diagnose ( ClauseLoc , diag : : expected_conditional_compilation_expression , <nl> - ! Clauses . empty ( ) ) ; <nl> - } <nl> - <nl> / / Evaluate the condition . <nl> ParserResult < Expr > Result = parseExprSequence ( diag : : expected_expr , <nl> / * basic * / true , <nl> mmm a / test / Parse / ConditionalCompilation / basicParseErrors . swift <nl> ppp b / test / Parse / ConditionalCompilation / basicParseErrors . swift <nl> func h ( ) { } <nl> <nl> # endif <nl> <nl> + <nl> + / / < https : / / twitter . com / practicalswift / status / 829066902869786625 > <nl> + # if / / expected - error { { incomplete condition in conditional compilation directive } } <nl> + # if 0 = = / / expected - error { { incomplete condition in conditional compilation directive } } <nl> + # if0 = / / expected - error { { incomplete condition in conditional compilation directive } } expected - error { { ' = ' must have consistent whitespace on both sides } } <nl> + class Foo { <nl> + # if / / expected - error { { incomplete condition in conditional compilation directive } } <nl> + # if 0 = = / / expected - error { { incomplete condition in conditional compilation directive } } <nl> + # if0 = / / expected - error { { incomplete condition in conditional compilation directive } } expected - error { { ' = ' must have consistent whitespace on both sides } } <nl> + } <nl> + <nl> struct S { <nl> # if FOO <nl> # else <nl> mmm a / test / Parse / ConditionalCompilation / no_configuration_error1 . swift <nl> ppp b / test / Parse / ConditionalCompilation / no_configuration_error1 . swift <nl> <nl> <nl> / / With a space next to the ' # if ' <nl> # if <nl> - / / expected - error @ - 1 { { expected a condition to follow # if } } <nl> - class C { } / / expected - error { { expected # else or # endif at end of conditional compilation block } } <nl> + / / expected - error @ - 1 { { incomplete condition in conditional compilation directive } } <nl> + class C { } <nl> # endif / / expected - error { { unexpected conditional compilation block terminator } } <nl> mmm a / test / Parse / ConditionalCompilation / no_configuration_error2 . swift <nl> ppp b / test / Parse / ConditionalCompilation / no_configuration_error2 . swift <nl> <nl> / / No space next to the ' # if ' <nl> <nl> # if <nl> - / / expected - error @ - 1 { { expected a condition to follow # if } } <nl> - class D { } / / expected - error { { expected # else or # endif at end of conditional compilation block } } <nl> + / / expected - error @ - 1 { { incomplete condition in conditional compilation directive } } <nl> + class D { } <nl> # endif <nl> / / expected - error @ - 1 { { unexpected conditional compilation block terminator } } <nl> similarity index 87 % <nl> rename from validation - test / compiler_crashers / 28610 - elements - size - 1 - even - number - of - elements - in - sequence . swift <nl> rename to validation - test / compiler_crashers_fixed / 28610 - elements - size - 1 - even - number - of - elements - in - sequence . swift <nl> mmm a / validation - test / compiler_crashers / 28610 - elements - size - 1 - even - number - of - elements - in - sequence . swift <nl> ppp b / validation - test / compiler_crashers_fixed / 28610 - elements - size - 1 - even - number - of - elements - in - sequence . swift <nl> <nl> / / See https : / / swift . org / LICENSE . txt for license information <nl> / / See https : / / swift . org / CONTRIBUTORS . txt for the list of Swift project authors <nl> <nl> - / / RUN : not - - crash % target - swift - frontend % s - emit - ir <nl> + / / RUN : not % target - swift - frontend % s - emit - ir <nl> / / REQUIRES : asserts <nl> # if0 * <nl>
Merge remote - tracking branch ' origin / master ' into master - next
apple/swift
41ab96c13fdccaeb7925acb65e1b75fe0a511b3d
2017-02-09T07:24:25Z
mmm a / tests / cpp - tests / proj . android - studio / app / jni / Android . mk <nl> ppp b / tests / cpp - tests / proj . android - studio / app / jni / Android . mk <nl> LOCAL_SRC_FILES : = main . cpp \ <nl> . . / . . / . . / Classes / UITest / CocoStudioGUITest / UIWebViewTest / UIWebViewTest . cpp \ <nl> . . / . . / . . / Classes / UITest / CocoStudioGUITest / UIWidgetAddNodeTest / UIWidgetAddNodeTest . cpp \ <nl> . . / . . / . . / Classes / UITest / CocoStudioGUITest / UIWidgetAddNodeTest / UIWidgetAddNodeTest_Editor . cpp \ <nl> + . . / . . / . . / Classes / UITest / CocoStudioGUITest / UITabControlTest / UITabControlTest . cpp \ <nl> . . / . . / . . / Classes / UITest / UITest . cpp \ <nl> . . / . . / . . / Classes / UnitTest / RefPtrTest . cpp \ <nl> . . / . . / . . / Classes / UnitTest / UnitTest . cpp \ <nl>
fix build failed of gradle
cocos2d/cocos2d-x
cf38b1fbfdc5005740e6d0ca3b56c049fb186900
2016-03-11T10:23:26Z
mmm a / core / error_macros . cpp <nl> ppp b / core / error_macros . cpp <nl> <nl> / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / <nl> # include " error_macros . h " <nl> <nl> + # include " io / logger . h " <nl> # include " os / os . h " <nl> <nl> bool _err_error_exists = false ; <nl> void remove_error_handler ( ErrorHandlerList * p_handler ) { <nl> <nl> void _err_print_error ( const char * p_function , const char * p_file , int p_line , const char * p_error , ErrorHandlerType p_type ) { <nl> <nl> - OS : : get_singleton ( ) - > print_error ( p_function , p_file , p_line , p_error , _err_error_exists ? OS : : get_singleton ( ) - > get_last_error ( ) : " " , ( OS : : ErrorType ) p_type ) ; <nl> + OS : : get_singleton ( ) - > print_error ( p_function , p_file , p_line , p_error , _err_error_exists ? OS : : get_singleton ( ) - > get_last_error ( ) : " " , ( Logger : : ErrorType ) p_type ) ; <nl> <nl> _global_lock ( ) ; <nl> ErrorHandlerList * l = error_handler_list ; <nl> mmm a / core / io / file_access_buffered_fa . h <nl> ppp b / core / io / file_access_buffered_fa . h <nl> class FileAccessBufferedFA : public FileAccessBuffered { <nl> } ; <nl> <nl> public : <nl> + void flush ( ) { <nl> + <nl> + f . flush ( ) ; <nl> + } ; <nl> + <nl> void store_8 ( uint8_t p_dest ) { <nl> <nl> f . store_8 ( p_dest ) ; <nl> mmm a / core / io / file_access_compressed . cpp <nl> ppp b / core / io / file_access_compressed . cpp <nl> Error FileAccessCompressed : : get_error ( ) const { <nl> return read_eof ? ERR_FILE_EOF : OK ; <nl> } <nl> <nl> + void FileAccessCompressed : : flush ( ) { <nl> + ERR_FAIL_COND ( ! f ) ; <nl> + ERR_FAIL_COND ( ! writing ) ; <nl> + <nl> + / / compressed files keep data in memory till close ( ) <nl> + } <nl> + <nl> void FileAccessCompressed : : store_8 ( uint8_t p_dest ) { <nl> <nl> ERR_FAIL_COND ( ! f ) ; <nl> mmm a / core / io / file_access_compressed . h <nl> ppp b / core / io / file_access_compressed . h <nl> class FileAccessCompressed : public FileAccess { <nl> <nl> virtual Error get_error ( ) const ; / / / < get last error <nl> <nl> + virtual void flush ( ) ; <nl> virtual void store_8 ( uint8_t p_dest ) ; / / / < store a byte <nl> <nl> virtual bool file_exists ( const String & p_name ) ; / / / < return true if a file exists <nl> mmm a / core / io / file_access_encrypted . cpp <nl> ppp b / core / io / file_access_encrypted . cpp <nl> void FileAccessEncrypted : : store_buffer ( const uint8_t * p_src , int p_length ) { <nl> } <nl> } <nl> <nl> + void FileAccessEncrypted : : flush ( ) { <nl> + ERR_FAIL_COND ( ! writing ) ; <nl> + <nl> + / / encrypted files keep data in memory till close ( ) <nl> + } <nl> + <nl> void FileAccessEncrypted : : store_8 ( uint8_t p_dest ) { <nl> <nl> ERR_FAIL_COND ( ! writing ) ; <nl> mmm a / core / io / file_access_encrypted . h <nl> ppp b / core / io / file_access_encrypted . h <nl> class FileAccessEncrypted : public FileAccess { <nl> <nl> virtual Error get_error ( ) const ; / / / < get last error <nl> <nl> + virtual void flush ( ) ; <nl> virtual void store_8 ( uint8_t p_dest ) ; / / / < store a byte <nl> virtual void store_buffer ( const uint8_t * p_src , int p_length ) ; / / / < store an array of bytes <nl> <nl> mmm a / core / io / file_access_memory . cpp <nl> ppp b / core / io / file_access_memory . cpp <nl> Error FileAccessMemory : : get_error ( ) const { <nl> return pos > = length ? ERR_FILE_EOF : OK ; <nl> } <nl> <nl> + void FileAccessMemory : : flush ( ) { <nl> + ERR_FAIL_COND ( ! data ) ; <nl> + } <nl> + <nl> void FileAccessMemory : : store_8 ( uint8_t p_byte ) { <nl> <nl> ERR_FAIL_COND ( ! data ) ; <nl> mmm a / core / io / file_access_memory . h <nl> ppp b / core / io / file_access_memory . h <nl> class FileAccessMemory : public FileAccess { <nl> <nl> virtual Error get_error ( ) const ; / / / < get last error <nl> <nl> + virtual void flush ( ) ; <nl> virtual void store_8 ( uint8_t p_byte ) ; / / / < store a byte <nl> virtual void store_buffer ( const uint8_t * p_src , int p_length ) ; / / / < store an array of bytes <nl> <nl> mmm a / core / io / file_access_network . cpp <nl> ppp b / core / io / file_access_network . cpp <nl> Error FileAccessNetwork : : get_error ( ) const { <nl> return pos = = total_size ? ERR_FILE_EOF : OK ; <nl> } <nl> <nl> + void FileAccessNetwork : : flush ( ) { <nl> + ERR_FAIL ( ) ; <nl> + } <nl> + <nl> void FileAccessNetwork : : store_8 ( uint8_t p_dest ) { <nl> <nl> ERR_FAIL ( ) ; <nl> mmm a / core / io / file_access_network . h <nl> ppp b / core / io / file_access_network . h <nl> class FileAccessNetwork : public FileAccess { <nl> <nl> virtual Error get_error ( ) const ; / / / < get last error <nl> <nl> + virtual void flush ( ) ; <nl> virtual void store_8 ( uint8_t p_dest ) ; / / / < store a byte <nl> <nl> virtual bool file_exists ( const String & p_path ) ; / / / < return true if a file exists <nl> mmm a / core / io / file_access_pack . cpp <nl> ppp b / core / io / file_access_pack . cpp <nl> Error FileAccessPack : : get_error ( ) const { <nl> return OK ; <nl> } <nl> <nl> + void FileAccessPack : : flush ( ) { <nl> + <nl> + ERR_FAIL ( ) ; <nl> + } <nl> + <nl> void FileAccessPack : : store_8 ( uint8_t p_dest ) { <nl> <nl> ERR_FAIL ( ) ; <nl> mmm a / core / io / file_access_pack . h <nl> ppp b / core / io / file_access_pack . h <nl> class FileAccessPack : public FileAccess { <nl> <nl> virtual Error get_error ( ) const ; <nl> <nl> + virtual void flush ( ) ; <nl> virtual void store_8 ( uint8_t p_dest ) ; <nl> <nl> virtual void store_buffer ( const uint8_t * p_src , int p_length ) ; <nl> mmm a / core / io / file_access_zip . cpp <nl> ppp b / core / io / file_access_zip . cpp <nl> Error FileAccessZip : : get_error ( ) const { <nl> return OK ; <nl> } ; <nl> <nl> + void FileAccessZip : : flush ( ) { <nl> + <nl> + ERR_FAIL ( ) ; <nl> + } <nl> + <nl> void FileAccessZip : : store_8 ( uint8_t p_dest ) { <nl> <nl> ERR_FAIL ( ) ; <nl> mmm a / core / io / file_access_zip . h <nl> ppp b / core / io / file_access_zip . h <nl> class FileAccessZip : public FileAccess { <nl> <nl> virtual Error get_error ( ) const ; / / / < get last error <nl> <nl> + virtual void flush ( ) ; <nl> virtual void store_8 ( uint8_t p_dest ) ; / / / < store a byte <nl> virtual bool file_exists ( const String & p_name ) ; / / / < return true if a file exists <nl> <nl> new file mode 100644 <nl> index 00000000000 . . 7ea5f06d7e2 <nl> mmm / dev / null <nl> ppp b / core / io / logger . cpp <nl> <nl> + / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / <nl> + / * logger . cpp * / <nl> + / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / <nl> + / * This file is part of : * / <nl> + / * GODOT ENGINE * / <nl> + / * https : / / godotengine . org * / <nl> + / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / <nl> + / * Copyright ( c ) 2007 - 2017 Juan Linietsky , Ariel Manzur . * / <nl> + / * Copyright ( c ) 2014 - 2017 Godot Engine contributors ( cf . AUTHORS . md ) * / <nl> + / * * / <nl> + / * Permission is hereby granted , free of charge , to any person obtaining * / <nl> + / * a copy of this software and associated documentation files ( the * / <nl> + / * " Software " ) , to deal in the Software without restriction , including * / <nl> + / * without limitation the rights to use , copy , modify , merge , publish , * / <nl> + / * distribute , sublicense , and / or sell copies of the Software , and to * / <nl> + / * permit persons to whom the Software is furnished to do so , subject to * / <nl> + / * the following conditions : * / <nl> + / * * / <nl> + / * The above copyright notice and this permission notice shall be * / <nl> + / * included in all copies or substantial portions of the Software . * / <nl> + / * * / <nl> + / * THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND , * / <nl> + / * EXPRESS OR IMPLIED , INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * / <nl> + / * MERCHANTABILITY , FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT . * / <nl> + / * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * / <nl> + / * CLAIM , DAMAGES OR OTHER LIABILITY , WHETHER IN AN ACTION OF CONTRACT , * / <nl> + / * TORT OR OTHERWISE , ARISING FROM , OUT OF OR IN CONNECTION WITH THE * / <nl> + / * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE . * / <nl> + / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / <nl> + <nl> + # include " logger . h " <nl> + # include " os / dir_access . h " <nl> + # include " os / os . h " <nl> + # include " print_string . h " <nl> + <nl> + bool Logger : : should_log ( bool p_err ) { <nl> + return ( ! p_err | | _print_error_enabled ) & & ( p_err | | _print_line_enabled ) ; <nl> + } <nl> + <nl> + void Logger : : log_error ( const char * p_function , const char * p_file , int p_line , const char * p_code , const char * p_rationale , ErrorType p_type ) { <nl> + if ( ! should_log ( true ) ) { <nl> + return ; <nl> + } <nl> + <nl> + const char * err_type = " * * ERROR * * " ; <nl> + switch ( p_type ) { <nl> + case ERR_ERROR : err_type = " * * ERROR * * " ; break ; <nl> + case ERR_WARNING : err_type = " * * WARNING * * " ; break ; <nl> + case ERR_SCRIPT : err_type = " * * SCRIPT ERROR * * " ; break ; <nl> + case ERR_SHADER : err_type = " * * SHADER ERROR * * " ; break ; <nl> + default : ERR_PRINT ( " Unknown error type " ) ; break ; <nl> + } <nl> + <nl> + const char * err_details ; <nl> + if ( p_rationale & & * p_rationale ) <nl> + err_details = p_rationale ; <nl> + else <nl> + err_details = p_code ; <nl> + <nl> + logf_error ( " % s : % s \ n " , err_type , err_details ) ; <nl> + logf_error ( " At : % s : % i : % s ( ) - % s \ n " , p_file , p_line , p_function , p_code ) ; <nl> + } <nl> + <nl> + void Logger : : logf ( const char * p_format , . . . ) { <nl> + if ( ! should_log ( false ) ) { <nl> + return ; <nl> + } <nl> + <nl> + va_list argp ; <nl> + va_start ( argp , p_format ) ; <nl> + <nl> + logv ( p_format , argp , false ) ; <nl> + <nl> + va_end ( argp ) ; <nl> + } <nl> + <nl> + void Logger : : logf_error ( const char * p_format , . . . ) { <nl> + if ( ! should_log ( true ) ) { <nl> + return ; <nl> + } <nl> + <nl> + va_list argp ; <nl> + va_start ( argp , p_format ) ; <nl> + <nl> + logv ( p_format , argp , true ) ; <nl> + <nl> + va_end ( argp ) ; <nl> + } <nl> + <nl> + Logger : : ~ Logger ( ) { } <nl> + <nl> + void RotatedFileLogger : : close_file ( ) { <nl> + if ( file ) { <nl> + memdelete ( file ) ; <nl> + file = NULL ; <nl> + } <nl> + } <nl> + <nl> + void RotatedFileLogger : : clear_old_backups ( ) { <nl> + int max_backups = max_files - 1 ; / / - 1 for the current file <nl> + <nl> + String basename = base_path . get_basename ( ) ; <nl> + String extension = " . " + base_path . get_extension ( ) ; <nl> + <nl> + DirAccess * da = DirAccess : : open ( base_path . get_base_dir ( ) ) ; <nl> + if ( ! da ) { <nl> + return ; <nl> + } <nl> + <nl> + da - > list_dir_begin ( ) ; <nl> + String f = da - > get_next ( ) ; <nl> + Set < String > backups ; <nl> + while ( f ! = String ( ) ) { <nl> + if ( ! da - > current_is_dir ( ) & & f . begins_with ( basename ) & & f . ends_with ( extension ) & & f ! = base_path ) { <nl> + backups . insert ( f ) ; <nl> + } <nl> + f = da - > get_next ( ) ; <nl> + } <nl> + da - > list_dir_end ( ) ; <nl> + <nl> + if ( backups . size ( ) > max_backups ) { <nl> + / / since backups are appended with timestamp and Set iterates them in sorted order , <nl> + / / first backups are the oldest <nl> + int to_delete = backups . size ( ) - max_backups ; <nl> + for ( Set < String > : : Element * E = backups . front ( ) ; E & & to_delete > 0 ; E = E - > next ( ) , - - to_delete ) { <nl> + da - > remove ( E - > get ( ) ) ; <nl> + } <nl> + } <nl> + <nl> + memdelete ( da ) ; <nl> + } <nl> + <nl> + void RotatedFileLogger : : rotate_file ( ) { <nl> + close_file ( ) ; <nl> + <nl> + if ( FileAccess : : exists ( base_path ) ) { <nl> + if ( max_files > 1 ) { <nl> + char timestamp [ 21 ] ; <nl> + OS : : Date date = OS : : get_singleton ( ) - > get_date ( ) ; <nl> + OS : : Time time = OS : : get_singleton ( ) - > get_time ( ) ; <nl> + sprintf ( timestamp , " - % 04d - % 02d - % 02d - % 02d - % 02d - % 02d " , date . year , date . month , date . day + 1 , time . hour , time . min , time . sec ) ; <nl> + <nl> + String backup_name = base_path . get_basename ( ) + timestamp + " . " + base_path . get_extension ( ) ; <nl> + <nl> + DirAccess * da = DirAccess : : open ( base_path . get_base_dir ( ) ) ; <nl> + if ( da ) { <nl> + da - > copy ( base_path , backup_name ) ; <nl> + memdelete ( da ) ; <nl> + } <nl> + clear_old_backups ( ) ; <nl> + } <nl> + } else { <nl> + DirAccess * da = DirAccess : : create ( DirAccess : : ACCESS_USERDATA ) ; <nl> + if ( da ) { <nl> + da - > make_dir_recursive ( base_path . get_base_dir ( ) ) ; <nl> + memdelete ( da ) ; <nl> + } <nl> + } <nl> + <nl> + file = FileAccess : : open ( base_path , FileAccess : : WRITE ) ; <nl> + } <nl> + <nl> + RotatedFileLogger : : RotatedFileLogger ( const String & p_base_path , int p_max_files ) { <nl> + file = NULL ; <nl> + base_path = p_base_path . simplify_path ( ) ; <nl> + max_files = p_max_files > 0 ? p_max_files : 1 ; <nl> + <nl> + rotate_file ( ) ; <nl> + } <nl> + <nl> + void RotatedFileLogger : : logv ( const char * p_format , va_list p_list , bool p_err ) { <nl> + if ( ! should_log ( p_err ) ) { <nl> + return ; <nl> + } <nl> + <nl> + if ( file ) { <nl> + const int static_buf_size = 512 ; <nl> + char static_buf [ static_buf_size ] ; <nl> + char * buf = static_buf ; <nl> + int len = vsnprintf ( buf , static_buf_size , p_format , p_list ) ; <nl> + if ( len > = static_buf_size ) { <nl> + buf = ( char * ) Memory : : alloc_static ( len + 1 ) ; <nl> + vsnprintf ( buf , len + 1 , p_format , p_list ) ; <nl> + } <nl> + file - > store_buffer ( ( uint8_t * ) buf , len ) ; <nl> + if ( len > = static_buf_size ) { <nl> + Memory : : free_static ( buf ) ; <nl> + } <nl> + # ifdef DEBUG_ENABLED <nl> + const bool need_flush = true ; <nl> + # else <nl> + bool need_flush = p_err ; <nl> + # endif <nl> + if ( need_flush ) { <nl> + file - > flush ( ) ; <nl> + } <nl> + } <nl> + } <nl> + <nl> + RotatedFileLogger : : ~ RotatedFileLogger ( ) { <nl> + close_file ( ) ; <nl> + } <nl> + <nl> + void StdLogger : : logv ( const char * p_format , va_list p_list , bool p_err ) { <nl> + if ( ! should_log ( p_err ) ) { <nl> + return ; <nl> + } <nl> + <nl> + if ( p_err ) { <nl> + vfprintf ( stderr , p_format , p_list ) ; <nl> + } else { <nl> + vprintf ( p_format , p_list ) ; <nl> + # ifdef DEBUG_ENABLED <nl> + fflush ( stdout ) ; <nl> + # endif <nl> + } <nl> + } <nl> + <nl> + StdLogger : : ~ StdLogger ( ) { } <nl> + <nl> + CompositeLogger : : CompositeLogger ( Vector < Logger * > p_loggers ) { <nl> + loggers = p_loggers ; <nl> + } <nl> + <nl> + void CompositeLogger : : logv ( const char * p_format , va_list p_list , bool p_err ) { <nl> + if ( ! should_log ( p_err ) ) { <nl> + return ; <nl> + } <nl> + <nl> + for ( int i = 0 ; i < loggers . size ( ) ; + + i ) { <nl> + va_list list_copy ; <nl> + va_copy ( list_copy , p_list ) ; <nl> + loggers [ i ] - > logv ( p_format , list_copy , p_err ) ; <nl> + va_end ( list_copy ) ; <nl> + } <nl> + } <nl> + <nl> + void CompositeLogger : : log_error ( const char * p_function , const char * p_file , int p_line , const char * p_code , const char * p_rationale , ErrorType p_type ) { <nl> + if ( ! should_log ( true ) ) { <nl> + return ; <nl> + } <nl> + <nl> + for ( int i = 0 ; i < loggers . size ( ) ; + + i ) { <nl> + loggers [ i ] - > log_error ( p_function , p_file , p_line , p_code , p_rationale , p_type ) ; <nl> + } <nl> + } <nl> + <nl> + CompositeLogger : : ~ CompositeLogger ( ) { <nl> + for ( int i = 0 ; i < loggers . size ( ) ; + + i ) { <nl> + memdelete ( loggers [ i ] ) ; <nl> + } <nl> + } <nl> new file mode 100644 <nl> index 00000000000 . . cf0cc7699f5 <nl> mmm / dev / null <nl> ppp b / core / io / logger . h <nl> <nl> + / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / <nl> + / * logger . h * / <nl> + / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / <nl> + / * This file is part of : * / <nl> + / * GODOT ENGINE * / <nl> + / * https : / / godotengine . org * / <nl> + / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / <nl> + / * Copyright ( c ) 2007 - 2017 Juan Linietsky , Ariel Manzur . * / <nl> + / * Copyright ( c ) 2014 - 2017 Godot Engine contributors ( cf . AUTHORS . md ) * / <nl> + / * * / <nl> + / * Permission is hereby granted , free of charge , to any person obtaining * / <nl> + / * a copy of this software and associated documentation files ( the * / <nl> + / * " Software " ) , to deal in the Software without restriction , including * / <nl> + / * without limitation the rights to use , copy , modify , merge , publish , * / <nl> + / * distribute , sublicense , and / or sell copies of the Software , and to * / <nl> + / * permit persons to whom the Software is furnished to do so , subject to * / <nl> + / * the following conditions : * / <nl> + / * * / <nl> + / * The above copyright notice and this permission notice shall be * / <nl> + / * included in all copies or substantial portions of the Software . * / <nl> + / * * / <nl> + / * THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND , * / <nl> + / * EXPRESS OR IMPLIED , INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * / <nl> + / * MERCHANTABILITY , FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT . * / <nl> + / * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * / <nl> + / * CLAIM , DAMAGES OR OTHER LIABILITY , WHETHER IN AN ACTION OF CONTRACT , * / <nl> + / * TORT OR OTHERWISE , ARISING FROM , OUT OF OR IN CONNECTION WITH THE * / <nl> + / * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE . * / <nl> + / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / <nl> + <nl> + # ifndef LOGGER_H <nl> + # define LOGGER_H <nl> + <nl> + # include " os / file_access . h " <nl> + # include " ustring . h " <nl> + # include " vector . h " <nl> + # include < stdarg . h > <nl> + <nl> + class Logger { <nl> + protected : <nl> + bool should_log ( bool p_err ) ; <nl> + <nl> + public : <nl> + enum ErrorType { <nl> + ERR_ERROR , <nl> + ERR_WARNING , <nl> + ERR_SCRIPT , <nl> + ERR_SHADER <nl> + } ; <nl> + <nl> + virtual void logv ( const char * p_format , va_list p_list , bool p_err ) = 0 ; <nl> + virtual void log_error ( const char * p_function , const char * p_file , int p_line , const char * p_code , const char * p_rationale , ErrorType p_type = ERR_ERROR ) ; <nl> + <nl> + void logf ( const char * p_format , . . . ) ; <nl> + void logf_error ( const char * p_format , . . . ) ; <nl> + <nl> + virtual ~ Logger ( ) ; <nl> + } ; <nl> + <nl> + / * * <nl> + * Writes messages to stdout / stderr . <nl> + * / <nl> + class StdLogger : public Logger { <nl> + <nl> + public : <nl> + virtual void logv ( const char * p_format , va_list p_list , bool p_err ) ; <nl> + virtual ~ StdLogger ( ) ; <nl> + } ; <nl> + <nl> + / * * <nl> + * Writes messages to the specified file . If the file already exists , creates a copy ( backup ) <nl> + * of it with timestamp appended to the file name . Maximum number of backups is configurable . <nl> + * When maximum is reached , the oldest backups are erased . With the maximum being equal to 1 , <nl> + * it acts as a simple file logger . <nl> + * / <nl> + class RotatedFileLogger : public Logger { <nl> + String base_path ; <nl> + int max_files ; <nl> + <nl> + FileAccess * file ; <nl> + <nl> + void rotate_file_without_closing ( ) ; <nl> + void close_file ( ) ; <nl> + void clear_old_backups ( ) ; <nl> + void rotate_file ( ) ; <nl> + <nl> + public : <nl> + RotatedFileLogger ( const String & p_base_path , int p_max_files = 10 ) ; <nl> + <nl> + virtual void logv ( const char * p_format , va_list p_list , bool p_err ) ; <nl> + <nl> + virtual ~ RotatedFileLogger ( ) ; <nl> + } ; <nl> + <nl> + class CompositeLogger : public Logger { <nl> + Vector < Logger * > loggers ; <nl> + <nl> + public : <nl> + CompositeLogger ( Vector < Logger * > p_loggers ) ; <nl> + <nl> + virtual void logv ( const char * p_format , va_list p_list , bool p_err ) ; <nl> + virtual void log_error ( const char * p_function , const char * p_file , int p_line , const char * p_code , const char * p_rationale , ErrorType p_type = ERR_ERROR ) ; <nl> + <nl> + virtual ~ CompositeLogger ( ) ; <nl> + } ; <nl> + <nl> + # endif <nl> \ No newline at end of file <nl> mmm a / core / os / file_access . cpp <nl> ppp b / core / os / file_access . cpp <nl> FileAccess * FileAccess : : create ( AccessType p_access ) { <nl> <nl> bool FileAccess : : exists ( const String & p_name ) { <nl> <nl> - if ( PackedData : : get_singleton ( ) - > has_path ( p_name ) ) <nl> + if ( PackedData : : get_singleton ( ) & & PackedData : : get_singleton ( ) - > has_path ( p_name ) ) <nl> return true ; <nl> <nl> FileAccess * f = open ( p_name , READ ) ; <nl> mmm a / core / os / file_access . h <nl> ppp b / core / os / file_access . h <nl> class FileAccess { <nl> <nl> virtual Error get_error ( ) const = 0 ; / / / < get last error <nl> <nl> + virtual void flush ( ) = 0 ; <nl> virtual void store_8 ( uint8_t p_dest ) = 0 ; / / / < store a byte <nl> virtual void store_16 ( uint16_t p_dest ) ; / / / < store 16 bits uint <nl> virtual void store_32 ( uint32_t p_dest ) ; / / / < store 32 bits uint <nl> mmm a / core / os / os . cpp <nl> ppp b / core / os / os . cpp <nl> void OS : : debug_break ( ) { <nl> / / something <nl> } ; <nl> <nl> - void OS : : print_error ( const char * p_function , const char * p_file , int p_line , const char * p_code , const char * p_rationale , ErrorType p_type ) { <nl> - <nl> - const char * err_type = " * * ERROR * * " ; <nl> - switch ( p_type ) { <nl> - case ERR_ERROR : err_type = " * * ERROR * * " ; break ; <nl> - case ERR_WARNING : err_type = " * * WARNING * * " ; break ; <nl> - case ERR_SCRIPT : err_type = " * * SCRIPT ERROR * * " ; break ; <nl> - case ERR_SHADER : err_type = " * * SHADER ERROR * * " ; break ; <nl> - default : ERR_PRINT ( " Unknown error type " ) ; break ; <nl> + void OS : : _set_logger ( Logger * p_logger ) { <nl> + if ( _logger ) { <nl> + memdelete ( _logger ) ; <nl> } <nl> + _logger = p_logger ; <nl> + } <nl> + <nl> + void OS : : initialize_logger ( ) { <nl> + _set_logger ( memnew ( StdLogger ) ) ; <nl> + } <nl> + <nl> + void OS : : print_error ( const char * p_function , const char * p_file , int p_line , const char * p_code , const char * p_rationale , Logger : : ErrorType p_type ) { <nl> <nl> - if ( p_rationale & & * p_rationale ) <nl> - print ( " % s : % s \ n " , err_type , p_rationale ) ; <nl> - print ( " % s : At : % s : % i : % s ( ) - % s \ n " , err_type , p_file , p_line , p_function , p_code ) ; <nl> + _logger - > log_error ( p_function , p_file , p_line , p_code , p_rationale , p_type ) ; <nl> } <nl> <nl> void OS : : print ( const char * p_format , . . . ) { <nl> void OS : : print ( const char * p_format , . . . ) { <nl> va_list argp ; <nl> va_start ( argp , p_format ) ; <nl> <nl> - vprint ( p_format , argp ) ; <nl> + _logger - > logv ( p_format , argp , false ) ; <nl> <nl> va_end ( argp ) ; <nl> } ; <nl> <nl> void OS : : printerr ( const char * p_format , . . . ) { <nl> - <nl> va_list argp ; <nl> va_start ( argp , p_format ) ; <nl> <nl> - vprint ( p_format , argp , true ) ; <nl> + _logger - > logv ( p_format , argp , true ) ; <nl> <nl> va_end ( argp ) ; <nl> } ; <nl> OS : : OS ( ) { <nl> <nl> _allow_hidpi = true ; <nl> _stack_bottom = ( void * ) ( & stack_bottom ) ; <nl> + <nl> + _logger = NULL ; <nl> + _set_logger ( memnew ( StdLogger ) ) ; <nl> } <nl> <nl> OS : : ~ OS ( ) { <nl> - <nl> + memdelete ( _logger ) ; <nl> singleton = NULL ; <nl> } <nl> mmm a / core / os / os . h <nl> ppp b / core / os / os . h <nl> <nl> <nl> # include " engine . h " <nl> # include " image . h " <nl> + # include " io / logger . h " <nl> # include " list . h " <nl> # include " os / main_loop . h " <nl> # include " ustring . h " <nl> class OS { <nl> <nl> void * _stack_bottom ; <nl> <nl> + Logger * _logger ; <nl> + <nl> + protected : <nl> + void _set_logger ( Logger * p_logger ) ; <nl> + <nl> public : <nl> typedef void ( * ImeCallback ) ( void * p_inp , String p_text , Point2 p_selection ) ; <nl> <nl> class OS { <nl> virtual int get_audio_driver_count ( ) const = 0 ; <nl> virtual const char * get_audio_driver_name ( int p_driver ) const = 0 ; <nl> <nl> + virtual void initialize_logger ( ) ; <nl> virtual void initialize_core ( ) = 0 ; <nl> virtual void initialize ( const VideoMode & p_desired , int p_video_driver , int p_audio_driver ) = 0 ; <nl> <nl> class OS { <nl> <nl> static OS * get_singleton ( ) ; <nl> <nl> - enum ErrorType { <nl> - ERR_ERROR , <nl> - ERR_WARNING , <nl> - ERR_SCRIPT , <nl> - ERR_SHADER <nl> - } ; <nl> - <nl> - virtual void print_error ( const char * p_function , const char * p_file , int p_line , const char * p_code , const char * p_rationale , ErrorType p_type = ERR_ERROR ) ; <nl> + void print_error ( const char * p_function , const char * p_file , int p_line , const char * p_code , const char * p_rationale , Logger : : ErrorType p_type = Logger : : ERR_ERROR ) ; <nl> + void print ( const char * p_format , . . . ) ; <nl> + void printerr ( const char * p_format , . . . ) ; <nl> <nl> - virtual void print ( const char * p_format , . . . ) ; <nl> - virtual void printerr ( const char * p_format , . . . ) ; <nl> - virtual void vprint ( const char * p_format , va_list p_list , bool p_stderr = false ) = 0 ; <nl> virtual void alert ( const String & p_alert , const String & p_title = " ALERT ! " ) = 0 ; <nl> virtual String get_stdin_string ( bool p_block = true ) = 0 ; <nl> <nl> mmm a / drivers / unix / file_access_unix . cpp <nl> ppp b / drivers / unix / file_access_unix . cpp <nl> Error FileAccessUnix : : get_error ( ) const { <nl> return last_error ; <nl> } <nl> <nl> + void FileAccessUnix : : flush ( ) { <nl> + <nl> + ERR_FAIL_COND ( ! f ) ; <nl> + fflush ( f ) ; <nl> + } <nl> + <nl> void FileAccessUnix : : store_8 ( uint8_t p_dest ) { <nl> <nl> ERR_FAIL_COND ( ! f ) ; <nl> mmm a / drivers / unix / file_access_unix . h <nl> ppp b / drivers / unix / file_access_unix . h <nl> class FileAccessUnix : public FileAccess { <nl> <nl> virtual Error get_error ( ) const ; / / / < get last error <nl> <nl> + virtual void flush ( ) ; <nl> virtual void store_8 ( uint8_t p_dest ) ; / / / < store a byte <nl> <nl> virtual bool file_exists ( const String & p_path ) ; / / / < return true if a file exists <nl> mmm a / drivers / unix / os_unix . cpp <nl> ppp b / drivers / unix / os_unix . cpp <nl> <nl> # include < string . h > <nl> # include < sys / time . h > <nl> # include < sys / wait . h > <nl> - <nl> - extern bool _print_error_enabled ; <nl> - <nl> - void OS_Unix : : print_error ( const char * p_function , const char * p_file , int p_line , const char * p_code , const char * p_rationale , ErrorType p_type ) { <nl> - <nl> - if ( ! _print_error_enabled ) <nl> - return ; <nl> - <nl> - const char * err_details ; <nl> - if ( p_rationale & & p_rationale [ 0 ] ) <nl> - err_details = p_rationale ; <nl> - else <nl> - err_details = p_code ; <nl> - <nl> - switch ( p_type ) { <nl> - case ERR_ERROR : <nl> - print ( " \ E [ 1 ; 31mERROR : % s : \ E [ 0m \ E [ 1m % s \ n " , p_function , err_details ) ; <nl> - print ( " \ E [ 0 ; 31m At : % s : % i . \ E [ 0m \ n " , p_file , p_line ) ; <nl> - break ; <nl> - case ERR_WARNING : <nl> - print ( " \ E [ 1 ; 33mWARNING : % s : \ E [ 0m \ E [ 1m % s \ n " , p_function , err_details ) ; <nl> - print ( " \ E [ 0 ; 33m At : % s : % i . \ E [ 0m \ n " , p_file , p_line ) ; <nl> - break ; <nl> - case ERR_SCRIPT : <nl> - print ( " \ E [ 1 ; 35mSCRIPT ERROR : % s : \ E [ 0m \ E [ 1m % s \ n " , p_function , err_details ) ; <nl> - print ( " \ E [ 0 ; 35m At : % s : % i . \ E [ 0m \ n " , p_file , p_line ) ; <nl> - break ; <nl> - case ERR_SHADER : <nl> - print ( " \ E [ 1 ; 36mSHADER ERROR : % s : \ E [ 0m \ E [ 1m % s \ n " , p_function , err_details ) ; <nl> - print ( " \ E [ 0 ; 36m At : % s : % i . \ E [ 0m \ n " , p_file , p_line ) ; <nl> - break ; <nl> - } <nl> - } <nl> + # include < unistd . h > <nl> <nl> void OS_Unix : : debug_break ( ) { <nl> <nl> void OS_Unix : : initialize_core ( ) { <nl> } <nl> } <nl> <nl> - void OS_Unix : : finalize_core ( ) { <nl> + void OS_Unix : : initialize_logger ( ) { <nl> + Vector < Logger * > loggers ; <nl> + loggers . push_back ( memnew ( UnixTerminalLogger ) ) ; <nl> + loggers . push_back ( memnew ( RotatedFileLogger ( " user : / / logs / log . txt " ) ) ) ; <nl> + _set_logger ( memnew ( CompositeLogger ( loggers ) ) ) ; <nl> } <nl> <nl> - void OS_Unix : : vprint ( const char * p_format , va_list p_list , bool p_stder ) { <nl> - <nl> - if ( p_stder ) { <nl> - <nl> - vfprintf ( stderr , p_format , p_list ) ; <nl> - fflush ( stderr ) ; <nl> - } else { <nl> - <nl> - vprintf ( p_format , p_list ) ; <nl> - fflush ( stdout ) ; <nl> - } <nl> + void OS_Unix : : finalize_core ( ) { <nl> } <nl> <nl> - void OS_Unix : : print ( const char * p_format , . . . ) { <nl> - <nl> - va_list argp ; <nl> - va_start ( argp , p_format ) ; <nl> - vprintf ( p_format , argp ) ; <nl> - va_end ( argp ) ; <nl> - } <nl> void OS_Unix : : alert ( const String & p_alert , const String & p_title ) { <nl> <nl> fprintf ( stderr , " ERROR : % s \ n " , p_alert . utf8 ( ) . get_data ( ) ) ; <nl> String OS_Unix : : get_executable_path ( ) const { <nl> # endif <nl> } <nl> <nl> + void UnixTerminalLogger : : log_error ( const char * p_function , const char * p_file , int p_line , const char * p_code , const char * p_rationale , ErrorType p_type ) { <nl> + if ( ! should_log ( true ) ) { <nl> + return ; <nl> + } <nl> + <nl> + const char * err_details ; <nl> + if ( p_rationale & & p_rationale [ 0 ] ) <nl> + err_details = p_rationale ; <nl> + else <nl> + err_details = p_code ; <nl> + <nl> + switch ( p_type ) { <nl> + case ERR_WARNING : <nl> + logf_error ( " \ E [ 1 ; 33mWARNING : % s : \ E [ 0m \ E [ 1m % s \ n " , p_function , err_details ) ; <nl> + logf_error ( " \ E [ 0 ; 33m At : % s : % i . \ E [ 0m \ n " , p_file , p_line ) ; <nl> + break ; <nl> + case ERR_SCRIPT : <nl> + logf_error ( " \ E [ 1 ; 35mSCRIPT ERROR : % s : \ E [ 0m \ E [ 1m % s \ n " , p_function , err_details ) ; <nl> + logf_error ( " \ E [ 0 ; 35m At : % s : % i . \ E [ 0m \ n " , p_file , p_line ) ; <nl> + break ; <nl> + case ERR_SHADER : <nl> + logf_error ( " \ E [ 1 ; 36mSHADER ERROR : % s : \ E [ 0m \ E [ 1m % s \ n " , p_function , err_details ) ; <nl> + logf_error ( " \ E [ 0 ; 36m At : % s : % i . \ E [ 0m \ n " , p_file , p_line ) ; <nl> + break ; <nl> + case ERR_ERROR : <nl> + default : <nl> + logf_error ( " \ E [ 1 ; 31mERROR : % s : \ E [ 0m \ E [ 1m % s \ n " , p_function , err_details ) ; <nl> + logf_error ( " \ E [ 0 ; 31m At : % s : % i . \ E [ 0m \ n " , p_file , p_line ) ; <nl> + break ; <nl> + } <nl> + } <nl> + <nl> + UnixTerminalLogger : : ~ UnixTerminalLogger ( ) { } <nl> + <nl> # endif <nl> mmm a / drivers / unix / os_unix . h <nl> ppp b / drivers / unix / os_unix . h <nl> class OS_Unix : public OS { <nl> virtual int get_audio_driver_count ( ) const ; <nl> virtual const char * get_audio_driver_name ( int p_driver ) const ; <nl> <nl> + virtual void initialize_logger ( ) ; <nl> virtual void initialize_core ( ) ; <nl> virtual int unix_initialize_audio ( int p_audio_driver ) ; <nl> / / virtual void initialize ( int p_video_driver , int p_audio_driver ) ; <nl> <nl> - / / virtual void finalize ( ) ; <nl> virtual void finalize_core ( ) ; <nl> <nl> String stdin_buf ; <nl> class OS_Unix : public OS { <nl> String get_global_settings_path ( ) const ; <nl> <nl> public : <nl> - virtual void print_error ( const char * p_function , const char * p_file , int p_line , const char * p_code , const char * p_rationale , ErrorType p_type = ERR_ERROR ) ; <nl> - <nl> - virtual void print ( const char * p_format , . . . ) ; <nl> - virtual void vprint ( const char * p_format , va_list p_list , bool p_stder = false ) ; <nl> virtual void alert ( const String & p_alert , const String & p_title = " ALERT ! " ) ; <nl> virtual String get_stdin_string ( bool p_block ) ; <nl> <nl> class OS_Unix : public OS { <nl> / / virtual void run ( MainLoop * p_main_loop ) ; <nl> } ; <nl> <nl> + class UnixTerminalLogger : public StdLogger { <nl> + public : <nl> + virtual void log_error ( const char * p_function , const char * p_file , int p_line , const char * p_code , const char * p_rationale , ErrorType p_type = ERR_ERROR ) ; <nl> + virtual ~ UnixTerminalLogger ( ) ; <nl> + } ; <nl> + <nl> # endif <nl> <nl> # endif <nl> new file mode 100644 <nl> index 00000000000 . . d57f391325c <nl> mmm / dev / null <nl> ppp b / drivers / unix / syslog_logger . cpp <nl> <nl> + / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / <nl> + / * syslog_logger . cpp * / <nl> + / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / <nl> + / * This file is part of : * / <nl> + / * GODOT ENGINE * / <nl> + / * https : / / godotengine . org * / <nl> + / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / <nl> + / * Copyright ( c ) 2007 - 2017 Juan Linietsky , Ariel Manzur . * / <nl> + / * Copyright ( c ) 2014 - 2017 Godot Engine contributors ( cf . AUTHORS . md ) * / <nl> + / * * / <nl> + / * Permission is hereby granted , free of charge , to any person obtaining * / <nl> + / * a copy of this software and associated documentation files ( the * / <nl> + / * " Software " ) , to deal in the Software without restriction , including * / <nl> + / * without limitation the rights to use , copy , modify , merge , publish , * / <nl> + / * distribute , sublicense , and / or sell copies of the Software , and to * / <nl> + / * permit persons to whom the Software is furnished to do so , subject to * / <nl> + / * the following conditions : * / <nl> + / * * / <nl> + / * The above copyright notice and this permission notice shall be * / <nl> + / * included in all copies or substantial portions of the Software . * / <nl> + / * * / <nl> + / * THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND , * / <nl> + / * EXPRESS OR IMPLIED , INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * / <nl> + / * MERCHANTABILITY , FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT . * / <nl> + / * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * / <nl> + / * CLAIM , DAMAGES OR OTHER LIABILITY , WHETHER IN AN ACTION OF CONTRACT , * / <nl> + / * TORT OR OTHERWISE , ARISING FROM , OUT OF OR IN CONNECTION WITH THE * / <nl> + / * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE . * / <nl> + / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / <nl> + <nl> + # ifdef UNIX_ENABLED <nl> + <nl> + # include " syslog_logger . h " <nl> + # include " print_string . h " <nl> + # include < syslog . h > <nl> + <nl> + void SyslogLogger : : logv ( const char * p_format , va_list p_list , bool p_err ) { <nl> + if ( ! should_log ( p_err ) ) { <nl> + return ; <nl> + } <nl> + <nl> + vsyslog ( p_err ? LOG_ERR : LOG_INFO , p_format , p_list ) ; <nl> + } <nl> + <nl> + void SyslogLogger : : print_error ( const char * p_function , const char * p_file , int p_line , const char * p_code , const char * p_rationale , ErrorType p_type ) { <nl> + if ( ! should_log ( true ) ) { <nl> + return ; <nl> + } <nl> + <nl> + const char * err_type = " * * ERROR * * " ; <nl> + switch ( p_type ) { <nl> + case ERR_ERROR : err_type = " * * ERROR * * " ; break ; <nl> + case ERR_WARNING : err_type = " * * WARNING * * " ; break ; <nl> + case ERR_SCRIPT : err_type = " * * SCRIPT ERROR * * " ; break ; <nl> + case ERR_SHADER : err_type = " * * SHADER ERROR * * " ; break ; <nl> + default : ERR_PRINT ( " Unknown error type " ) ; break ; <nl> + } <nl> + <nl> + const char * err_details ; <nl> + if ( p_rationale & & * p_rationale ) <nl> + err_details = p_rationale ; <nl> + else <nl> + err_details = p_code ; <nl> + <nl> + syslog ( p_type = = ERR_WARNING ? LOG_WARNING : LOG_ERR , " % s : % s \ n At : % s : % i : % s ( ) - % s " , err_type , err_details , p_file , p_line , p_function , p_code ) ; <nl> + } <nl> + <nl> + SyslogLogger : : ~ SyslogLogger ( ) { <nl> + } <nl> + <nl> + # endif <nl> \ No newline at end of file <nl> new file mode 100644 <nl> index 00000000000 . . b3cf2f9e3ab <nl> mmm / dev / null <nl> ppp b / drivers / unix / syslog_logger . h <nl> <nl> + / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / <nl> + / * syslog_logger . h * / <nl> + / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / <nl> + / * This file is part of : * / <nl> + / * GODOT ENGINE * / <nl> + / * https : / / godotengine . org * / <nl> + / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / <nl> + / * Copyright ( c ) 2007 - 2017 Juan Linietsky , Ariel Manzur . * / <nl> + / * Copyright ( c ) 2014 - 2017 Godot Engine contributors ( cf . AUTHORS . md ) * / <nl> + / * * / <nl> + / * Permission is hereby granted , free of charge , to any person obtaining * / <nl> + / * a copy of this software and associated documentation files ( the * / <nl> + / * " Software " ) , to deal in the Software without restriction , including * / <nl> + / * without limitation the rights to use , copy , modify , merge , publish , * / <nl> + / * distribute , sublicense , and / or sell copies of the Software , and to * / <nl> + / * permit persons to whom the Software is furnished to do so , subject to * / <nl> + / * the following conditions : * / <nl> + / * * / <nl> + / * The above copyright notice and this permission notice shall be * / <nl> + / * included in all copies or substantial portions of the Software . * / <nl> + / * * / <nl> + / * THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND , * / <nl> + / * EXPRESS OR IMPLIED , INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * / <nl> + / * MERCHANTABILITY , FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT . * / <nl> + / * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * / <nl> + / * CLAIM , DAMAGES OR OTHER LIABILITY , WHETHER IN AN ACTION OF CONTRACT , * / <nl> + / * TORT OR OTHERWISE , ARISING FROM , OUT OF OR IN CONNECTION WITH THE * / <nl> + / * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE . * / <nl> + / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / <nl> + <nl> + # ifndef SYSLOG_LOGGER_H <nl> + # define SYSLOG_LOGGER_H <nl> + <nl> + # ifdef UNIX_ENABLED <nl> + <nl> + # include " io / logger . h " <nl> + <nl> + class SyslogLogger : public Logger { <nl> + public : <nl> + virtual void logv ( const char * p_format , va_list p_list , bool p_err ) ; <nl> + virtual void print_error ( const char * p_function , const char * p_file , int p_line , const char * p_code , const char * p_rationale , ErrorType p_type ) ; <nl> + <nl> + virtual ~ SyslogLogger ( ) ; <nl> + } ; <nl> + <nl> + # endif <nl> + <nl> + # endif <nl> \ No newline at end of file <nl> mmm a / drivers / windows / dir_access_windows . cpp <nl> ppp b / drivers / windows / dir_access_windows . cpp <nl> Error DirAccessWindows : : make_dir ( String p_dir ) { <nl> <nl> GLOBAL_LOCK_FUNCTION <nl> <nl> + p_dir = fix_path ( p_dir ) ; <nl> if ( p_dir . is_rel_path ( ) ) <nl> p_dir = get_current_dir ( ) . plus_file ( p_dir ) ; <nl> <nl> - p_dir = fix_path ( p_dir ) ; <nl> p_dir = p_dir . replace ( " / " , " \ \ " ) ; <nl> <nl> bool success ; <nl> mmm a / drivers / windows / file_access_windows . cpp <nl> ppp b / drivers / windows / file_access_windows . cpp <nl> Error FileAccessWindows : : get_error ( ) const { <nl> return last_error ; <nl> } <nl> <nl> + void FileAccessWindows : : flush ( ) { <nl> + <nl> + ERR_FAIL_COND ( ! f ) ; <nl> + fflush ( f ) ; <nl> + } <nl> + <nl> void FileAccessWindows : : store_8 ( uint8_t p_dest ) { <nl> <nl> ERR_FAIL_COND ( ! f ) ; <nl> mmm a / drivers / windows / file_access_windows . h <nl> ppp b / drivers / windows / file_access_windows . h <nl> class FileAccessWindows : public FileAccess { <nl> <nl> virtual Error get_error ( ) const ; / / / < get last error <nl> <nl> + virtual void flush ( ) ; <nl> virtual void store_8 ( uint8_t p_dest ) ; / / / < store a byte <nl> <nl> virtual bool file_exists ( const String & p_name ) ; / / / < return true if a file exists <nl> mmm a / main / main . cpp <nl> ppp b / main / main . cpp <nl> void Main : : print_help ( const char * p_binary ) { <nl> } <nl> <nl> Error Main : : setup ( const char * execpath , int argc , char * argv [ ] , bool p_second_phase ) { <nl> - <nl> RID_OwnerBase : : init_rid ( ) ; <nl> <nl> OS : : get_singleton ( ) - > initialize_core ( ) ; <nl> Error Main : : setup ( const char * execpath , int argc , char * argv [ ] , bool p_second_ph <nl> <nl> register_core_settings ( ) ; / / here globals is present <nl> <nl> + OS : : get_singleton ( ) - > initialize_logger ( ) ; <nl> + <nl> translation_server = memnew ( TranslationServer ) ; <nl> performance = memnew ( Performance ) ; <nl> globals - > add_singleton ( ProjectSettings : : Singleton ( " Performance " , performance ) ) ; <nl> mmm a / platform / android / file_access_android . cpp <nl> ppp b / platform / android / file_access_android . cpp <nl> Error FileAccessAndroid : : get_error ( ) const { <nl> return eof ? ERR_FILE_EOF : OK ; / / not sure what else it may happen <nl> } <nl> <nl> + void FileAccessAndroid : : flush ( ) { <nl> + <nl> + ERR_FAIL ( ) ; <nl> + } <nl> + <nl> void FileAccessAndroid : : store_8 ( uint8_t p_dest ) { <nl> <nl> ERR_FAIL ( ) ; <nl> mmm a / platform / android / file_access_android . h <nl> ppp b / platform / android / file_access_android . h <nl> class FileAccessAndroid : public FileAccess { <nl> <nl> virtual Error get_error ( ) const ; / / / < get last error <nl> <nl> + virtual void flush ( ) ; <nl> virtual void store_8 ( uint8_t p_dest ) ; / / / < store a byte <nl> <nl> virtual bool file_exists ( const String & p_path ) ; / / / < return true if a file exists <nl> mmm a / platform / android / file_access_jandroid . cpp <nl> ppp b / platform / android / file_access_jandroid . cpp <nl> Error FileAccessJAndroid : : get_error ( ) const { <nl> return OK ; <nl> } <nl> <nl> + void FileAccessJAndroid : : flush ( ) { <nl> + } <nl> + <nl> void FileAccessJAndroid : : store_8 ( uint8_t p_dest ) { <nl> } <nl> <nl> mmm a / platform / android / file_access_jandroid . h <nl> ppp b / platform / android / file_access_jandroid . h <nl> class FileAccessJAndroid : public FileAccess { <nl> <nl> virtual Error get_error ( ) const ; / / / < get last error <nl> <nl> + virtual void flush ( ) ; <nl> virtual void store_8 ( uint8_t p_dest ) ; / / / < store a byte <nl> <nl> virtual bool file_exists ( const String & p_path ) ; / / / < return true if a file exists <nl> mmm a / platform / android / os_android . cpp <nl> ppp b / platform / android / os_android . cpp <nl> <nl> # include " file_access_jandroid . h " <nl> # endif <nl> <nl> + class AndroidLogger : public Logger { <nl> + public : <nl> + virtual void logv ( const char * p_format , va_list p_list , bool p_err ) { <nl> + __android_log_vprint ( p_err ? ANDROID_LOG_ERROR : ANDROID_LOG_INFO , " godot " , p_format , p_list ) ; <nl> + } <nl> + <nl> + virtual ~ AndroidLogger ( ) { } <nl> + } ; <nl> + <nl> int OS_Android : : get_video_driver_count ( ) const { <nl> <nl> return 1 ; <nl> void OS_Android : : initialize_core ( ) { <nl> # endif <nl> } <nl> <nl> + void OS_Android : : initialize_logger ( ) { <nl> + Vector < Logger * > loggers ; <nl> + loggers . push_back ( memnew ( AndroidLogger ) ) ; <nl> + loggers . push_back ( memnew ( RotatedFileLogger ( " user : / / logs / log . txt " ) ) ) ; <nl> + _set_logger ( memnew ( CompositeLogger ( loggers ) ) ) ; <nl> + } <nl> + <nl> void OS_Android : : set_opengl_extensions ( const char * p_gl_extensions ) { <nl> <nl> ERR_FAIL_COND ( ! p_gl_extensions ) ; <nl> void OS_Android : : delete_main_loop ( ) { <nl> } <nl> <nl> void OS_Android : : finalize ( ) { <nl> - <nl> memdelete ( input ) ; <nl> } <nl> <nl> - void OS_Android : : vprint ( const char * p_format , va_list p_list , bool p_stderr ) { <nl> - <nl> - __android_log_vprint ( p_stderr ? ANDROID_LOG_ERROR : ANDROID_LOG_INFO , " godot " , p_format , p_list ) ; <nl> - } <nl> - <nl> - void OS_Android : : print ( const char * p_format , . . . ) { <nl> - <nl> - va_list argp ; <nl> - va_start ( argp , p_format ) ; <nl> - __android_log_vprint ( ANDROID_LOG_INFO , " godot " , p_format , argp ) ; <nl> - va_end ( argp ) ; <nl> - } <nl> - <nl> void OS_Android : : alert ( const String & p_alert , const String & p_title ) { <nl> <nl> / / print ( " ALERT : % s \ n " , p_alert . utf8 ( ) . get_data ( ) ) ; <nl> OS_Android : : OS_Android ( GFXInitFunc p_gfx_init_func , void * p_gfx_init_ud , OpenURI <nl> set_keep_screen_on_func = p_set_keep_screen_on_func ; <nl> alert_func = p_alert_func ; <nl> use_reload_hooks = false ; <nl> + <nl> + _set_logger ( memnew ( AndroidLogger ) ) ; <nl> } <nl> <nl> OS_Android : : ~ OS_Android ( ) { <nl> mmm a / platform / android / os_android . h <nl> ppp b / platform / android / os_android . h <nl> class OS_Android : public OS_Unix { <nl> virtual int get_audio_driver_count ( ) const ; <nl> virtual const char * get_audio_driver_name ( int p_driver ) const ; <nl> <nl> + virtual void initialize_logger ( ) ; <nl> virtual void initialize_core ( ) ; <nl> virtual void initialize ( const VideoMode & p_desired , int p_video_driver , int p_audio_driver ) ; <nl> <nl> class OS_Android : public OS_Unix { <nl> <nl> static OS * get_singleton ( ) ; <nl> <nl> - virtual void vprint ( const char * p_format , va_list p_list , bool p_stderr = false ) ; <nl> - virtual void print ( const char * p_format , . . . ) ; <nl> virtual void alert ( const String & p_alert , const String & p_title = " ALERT ! " ) ; <nl> <nl> virtual void set_mouse_show ( bool p_show ) ; <nl> mmm a / platform / iphone / os_iphone . cpp <nl> ppp b / platform / iphone / os_iphone . cpp <nl> <nl> # include " core / os / dir_access . h " <nl> # include " core / os / file_access . h " <nl> # include " core / project_settings . h " <nl> + # include " drivers / unix / syslog_logger . h " <nl> <nl> # include " sem_iphone . h " <nl> <nl> void OSIPhone : : initialize_core ( ) { <nl> SemaphoreIphone : : make_default ( ) ; <nl> } ; <nl> <nl> + void OSIPhone : : initialize_logger ( ) { <nl> + Vector < Logger * > loggers ; <nl> + loggers . push_back ( memnew ( SyslogLogger ) ) ; <nl> + loggers . push_back ( memnew ( RotatedFileLogger ( " user : / / logs / log . txt " ) ) ) ; <nl> + _set_logger ( memnew ( CompositeLogger ( loggers ) ) ) ; <nl> + } <nl> + <nl> void OSIPhone : : initialize ( const VideoMode & p_desired , int p_video_driver , int p_audio_driver ) { <nl> <nl> supported_orientations = 0 ; <nl> OSIPhone : : OSIPhone ( int width , int height ) { <nl> vm . resizable = false ; <nl> set_video_mode ( vm ) ; <nl> event_count = 0 ; <nl> + <nl> + _set_logger ( memnew ( SyslogLogger ) ) ; <nl> } ; <nl> <nl> OSIPhone : : ~ OSIPhone ( ) { <nl> mmm a / platform / iphone / os_iphone . h <nl> ppp b / platform / iphone / os_iphone . h <nl> class OSIPhone : public OS_Unix { <nl> <nl> virtual VideoMode get_default_video_mode ( ) const ; <nl> <nl> + virtual void initialize_logger ( ) ; <nl> virtual void initialize_core ( ) ; <nl> virtual void initialize ( const VideoMode & p_desired , int p_video_driver , int p_audio_driver ) ; <nl> <nl> mmm a / platform / javascript / os_javascript . cpp <nl> ppp b / platform / javascript / os_javascript . cpp <nl> void OS_JavaScript : : initialize_core ( ) { <nl> FileAccess : : make_default < FileAccessBufferedFA < FileAccessUnix > > ( FileAccess : : ACCESS_RESOURCES ) ; <nl> } <nl> <nl> + void OS_JavaScript : : initialize_logger ( ) { <nl> + _set_logger ( memnew ( StdLogger ) ) ; <nl> + } <nl> + <nl> void OS_JavaScript : : set_opengl_extensions ( const char * p_gl_extensions ) { <nl> <nl> ERR_FAIL_COND ( ! p_gl_extensions ) ; <nl> mmm a / platform / javascript / os_javascript . h <nl> ppp b / platform / javascript / os_javascript . h <nl> class OS_JavaScript : public OS_Unix { <nl> virtual int get_audio_driver_count ( ) const ; <nl> virtual const char * get_audio_driver_name ( int p_driver ) const ; <nl> <nl> + virtual void initialize_logger ( ) ; <nl> virtual void initialize_core ( ) ; <nl> virtual void initialize ( const VideoMode & p_desired , int p_video_driver , int p_audio_driver ) ; <nl> <nl> class OS_JavaScript : public OS_Unix { <nl> <nl> / / static OS * get_singleton ( ) ; <nl> <nl> - virtual void print_error ( const char * p_function , const char * p_file , int p_line , const char * p_code , const char * p_rationale , ErrorType p_type ) { <nl> - <nl> - OS : : print_error ( p_function , p_file , p_line , p_code , p_rationale , p_type ) ; <nl> - } <nl> - <nl> virtual void alert ( const String & p_alert , const String & p_title = " ALERT ! " ) ; <nl> <nl> virtual void set_mouse_mode ( MouseMode p_mode ) ; <nl> mmm a / platform / osx / os_osx . h <nl> ppp b / platform / osx / os_osx . h <nl> class OS_OSX : public OS_Unix { <nl> virtual const char * get_video_driver_name ( int p_driver ) const ; <nl> virtual VideoMode get_default_video_mode ( ) const ; <nl> <nl> + virtual void initialize_logger ( ) ; <nl> virtual void initialize_core ( ) ; <nl> virtual void initialize ( const VideoMode & p_desired , int p_video_driver , int p_audio_driver ) ; <nl> virtual void finalize ( ) ; <nl> class OS_OSX : public OS_Unix { <nl> <nl> virtual String get_name ( ) ; <nl> <nl> - virtual void print_error ( const char * p_function , const char * p_file , int p_line , const char * p_code , const char * p_rationale , ErrorType p_type = ERR_ERROR ) ; <nl> - <nl> virtual void alert ( const String & p_alert , const String & p_title = " ALERT ! " ) ; <nl> <nl> virtual void set_cursor_shape ( CursorShape p_shape ) ; <nl> mmm a / platform / osx / os_osx . mm <nl> ppp b / platform / osx / os_osx . mm <nl> static void keyboardLayoutChanged ( CFNotificationCenterRef center , void * observer <nl> return " OSX " ; <nl> } <nl> <nl> - void OS_OSX : : print_error ( const char * p_function , const char * p_file , int p_line , const char * p_code , const char * p_rationale , ErrorType p_type ) { <nl> - <nl> # if MAC_OS_X_VERSION_MAX_ALLOWED > = 101200 <nl> - if ( ! _print_error_enabled ) <nl> - return ; <nl> - <nl> - const char * err_details ; <nl> - if ( p_rationale & & p_rationale [ 0 ] ) <nl> - err_details = p_rationale ; <nl> - else <nl> - err_details = p_code ; <nl> + class OSXTerminalLogger : public StdLogger { <nl> + public : <nl> + virtual void log_error ( const char * p_function , const char * p_file , int p_line , const char * p_code , const char * p_rationale , ErrorType p_type = ERR_ERROR ) { <nl> + if ( ! should_log ( true ) ) { <nl> + return ; <nl> + } <nl> <nl> - switch ( p_type ) { <nl> - case ERR_ERROR : <nl> - os_log_error ( OS_LOG_DEFAULT , " ERROR : % { public } s : % { public } s \ nAt : % { public } s : % i . " , p_function , err_details , p_file , p_line ) ; <nl> - print ( " \ E [ 1 ; 31mERROR : % s : \ E [ 0m \ E [ 1m % s \ n " , p_function , err_details ) ; <nl> - print ( " \ E [ 0 ; 31m At : % s : % i . \ E [ 0m \ n " , p_file , p_line ) ; <nl> - break ; <nl> - case ERR_WARNING : <nl> - os_log_info ( OS_LOG_DEFAULT , " WARNING : % { public } s : % { public } s \ nAt : % { public } s : % i . " , p_function , err_details , p_file , p_line ) ; <nl> - print ( " \ E [ 1 ; 33mWARNING : % s : \ E [ 0m \ E [ 1m % s \ n " , p_function , err_details ) ; <nl> - print ( " \ E [ 0 ; 33m At : % s : % i . \ E [ 0m \ n " , p_file , p_line ) ; <nl> - break ; <nl> - case ERR_SCRIPT : <nl> - os_log_error ( OS_LOG_DEFAULT , " SCRIPT ERROR : % { public } s : % { public } s \ nAt : % { public } s : % i . " , p_function , err_details , p_file , p_line ) ; <nl> - print ( " \ E [ 1 ; 35mSCRIPT ERROR : % s : \ E [ 0m \ E [ 1m % s \ n " , p_function , err_details ) ; <nl> - print ( " \ E [ 0 ; 35m At : % s : % i . \ E [ 0m \ n " , p_file , p_line ) ; <nl> - break ; <nl> - case ERR_SHADER : <nl> - os_log_error ( OS_LOG_DEFAULT , " SHADER ERROR : % { public } s : % { public } s \ nAt : % { public } s : % i . " , p_function , err_details , p_file , p_line ) ; <nl> - print ( " \ E [ 1 ; 36mSHADER ERROR : % s : \ E [ 0m \ E [ 1m % s \ n " , p_function , err_details ) ; <nl> - print ( " \ E [ 0 ; 36m At : % s : % i . \ E [ 0m \ n " , p_file , p_line ) ; <nl> - break ; <nl> + const char * err_details ; <nl> + if ( p_rationale & & p_rationale [ 0 ] ) <nl> + err_details = p_rationale ; <nl> + else <nl> + err_details = p_code ; <nl> + <nl> + switch ( p_type ) { <nl> + case ERR_WARNING : <nl> + os_log_info ( OS_LOG_DEFAULT , <nl> + " WARNING : % { public } s : % { public } s \ nAt : % { public } s : % i . " , <nl> + p_function , err_details , p_file , p_line ) ; <nl> + logf_error ( " \ E [ 1 ; 33mWARNING : % s : \ E [ 0m \ E [ 1m % s \ n " , p_function , <nl> + err_details ) ; <nl> + logf_error ( " \ E [ 0 ; 33m At : % s : % i . \ E [ 0m \ n " , p_file , p_line ) ; <nl> + break ; <nl> + case ERR_SCRIPT : <nl> + os_log_error ( OS_LOG_DEFAULT , <nl> + " SCRIPT ERROR : % { public } s : % { public } s \ nAt : % { public } s : % i . " , <nl> + p_function , err_details , p_file , p_line ) ; <nl> + logf_error ( " \ E [ 1 ; 35mSCRIPT ERROR : % s : \ E [ 0m \ E [ 1m % s \ n " , p_function , <nl> + err_details ) ; <nl> + logf_error ( " \ E [ 0 ; 35m At : % s : % i . \ E [ 0m \ n " , p_file , p_line ) ; <nl> + break ; <nl> + case ERR_SHADER : <nl> + os_log_error ( OS_LOG_DEFAULT , <nl> + " SHADER ERROR : % { public } s : % { public } s \ nAt : % { public } s : % i . " , <nl> + p_function , err_details , p_file , p_line ) ; <nl> + logf_error ( " \ E [ 1 ; 36mSHADER ERROR : % s : \ E [ 0m \ E [ 1m % s \ n " , p_function , <nl> + err_details ) ; <nl> + logf_error ( " \ E [ 0 ; 36m At : % s : % i . \ E [ 0m \ n " , p_file , p_line ) ; <nl> + break ; <nl> + case ERR_ERROR : <nl> + default : <nl> + os_log_error ( OS_LOG_DEFAULT , <nl> + " ERROR : % { public } s : % { public } s \ nAt : % { public } s : % i . " , <nl> + p_function , err_details , p_file , p_line ) ; <nl> + logf_error ( " \ E [ 1 ; 31mERROR : % s : \ E [ 0m \ E [ 1m % s \ n " , p_function , err_details ) ; <nl> + logf_error ( " \ E [ 0 ; 31m At : % s : % i . \ E [ 0m \ n " , p_file , p_line ) ; <nl> + break ; <nl> + } <nl> } <nl> + } ; <nl> + <nl> # else <nl> - OS_Unix : : print_error ( p_function , p_file , p_line , p_code , p_rationale , p_type ) ; <nl> + <nl> + typedef UnixTerminalLogger OSXTerminalLogger ; <nl> # endif <nl> + <nl> + void OS_OSX : : initialize_logger ( ) { <nl> + Vector < Logger * > loggers ; <nl> + loggers . push_back ( memnew ( OSXTerminalLogger ) ) ; <nl> + loggers . push_back ( memnew ( RotatedFileLogger ( " user : / / logs / log . txt " ) ) ) ; <nl> + _set_logger ( memnew ( CompositeLogger ( loggers ) ) ) ; <nl> } <nl> <nl> void OS_OSX : : alert ( const String & p_alert , const String & p_title ) { <nl> static void keyboardLayoutChanged ( CFNotificationCenterRef center , void * observer <nl> window_size = Vector2 ( 1024 , 600 ) ; <nl> zoomed = false ; <nl> display_scale = 1 . 0 ; <nl> + <nl> + _set_logger ( memnew ( OSXTerminalLogger ) ) ; <nl> } <nl> <nl> bool OS_OSX : : _check_internal_feature_support ( const String & p_feature ) { <nl> mmm a / platform / uwp / os_uwp . cpp <nl> ppp b / platform / uwp / os_uwp . cpp <nl> <nl> # include " platform / windows / packet_peer_udp_winsock . h " <nl> # include " platform / windows / stream_peer_winsock . h " <nl> # include " platform / windows / tcp_server_winsock . h " <nl> + # include " platform / windows / windows_terminal_logger . h " <nl> # include " project_settings . h " <nl> # include " servers / audio_server . h " <nl> # include " servers / visual / visual_server_raster . h " <nl> void OSUWP : : initialize_core ( ) { <nl> cursor_shape = CURSOR_ARROW ; <nl> } <nl> <nl> + void OSUWP : : initialize_logger ( ) { <nl> + Vector < Logger * > loggers ; <nl> + loggers . push_back ( memnew ( WindowsTerminalLogger ) ) ; <nl> + loggers . push_back ( memnew ( RotatedFileLogger ( " user : / / logs / log . txt " ) ) ) ; <nl> + _set_logger ( memnew ( CompositeLogger ( loggers ) ) ) ; <nl> + } <nl> + <nl> bool OSUWP : : can_draw ( ) const { <nl> <nl> return ! minimized ; <nl> void OSUWP : : finalize ( ) { <nl> void OSUWP : : finalize_core ( ) { <nl> } <nl> <nl> - void OSUWP : : vprint ( const char * p_format , va_list p_list , bool p_stderr ) { <nl> - <nl> - char buf [ 16384 + 1 ] ; <nl> - int len = vsnprintf ( buf , 16384 , p_format , p_list ) ; <nl> - if ( len < = 0 ) <nl> - return ; <nl> - buf [ len ] = 0 ; <nl> - <nl> - int wlen = MultiByteToWideChar ( CP_UTF8 , 0 , buf , len , NULL , 0 ) ; <nl> - if ( wlen < 0 ) <nl> - return ; <nl> - <nl> - wchar_t * wbuf = ( wchar_t * ) malloc ( ( len + 1 ) * sizeof ( wchar_t ) ) ; <nl> - MultiByteToWideChar ( CP_UTF8 , 0 , buf , len , wbuf , wlen ) ; <nl> - wbuf [ wlen ] = 0 ; <nl> - <nl> - if ( p_stderr ) <nl> - fwprintf ( stderr , L " % s " , wbuf ) ; <nl> - else <nl> - wprintf ( L " % s " , wbuf ) ; <nl> - <nl> - free ( wbuf ) ; <nl> - <nl> - fflush ( stdout ) ; <nl> - } ; <nl> - <nl> void OSUWP : : alert ( const String & p_alert , const String & p_title ) { <nl> <nl> Platform : : String ^ alert = ref new Platform : : String ( p_alert . c_str ( ) ) ; <nl> OS : : VideoMode OSUWP : : get_video_mode ( int p_screen ) const { <nl> void OSUWP : : get_fullscreen_mode_list ( List < VideoMode > * p_list , int p_screen ) const { <nl> } <nl> <nl> - void OSUWP : : print_error ( const char * p_function , const char * p_file , int p_line , const char * p_code , const char * p_rationale , ErrorType p_type ) { <nl> - <nl> - const char * err_details ; <nl> - if ( p_rationale & & p_rationale [ 0 ] ) <nl> - err_details = p_rationale ; <nl> - else <nl> - err_details = p_code ; <nl> - <nl> - switch ( p_type ) { <nl> - case ERR_ERROR : <nl> - print ( " ERROR : % s : % s \ n " , p_function , err_details ) ; <nl> - print ( " At : % s : % i \ n " , p_file , p_line ) ; <nl> - break ; <nl> - case ERR_WARNING : <nl> - print ( " WARNING : % s : % s \ n " , p_function , err_details ) ; <nl> - print ( " At : % s : % i \ n " , p_file , p_line ) ; <nl> - break ; <nl> - case ERR_SCRIPT : <nl> - print ( " SCRIPT ERROR : % s : % s \ n " , p_function , err_details ) ; <nl> - print ( " At : % s : % i \ n " , p_file , p_line ) ; <nl> - break ; <nl> - } <nl> - } <nl> - <nl> String OSUWP : : get_name ( ) { <nl> <nl> return " UWP " ; <nl> OSUWP : : OSUWP ( ) { <nl> mouse_mode_changed = CreateEvent ( NULL , TRUE , FALSE , L " os_mouse_mode_changed " ) ; <nl> <nl> AudioDriverManager : : add_driver ( & audio_driver ) ; <nl> + <nl> + _set_logger ( memnew ( WindowsTerminalLogger ) ) ; <nl> } <nl> <nl> OSUWP : : ~ OSUWP ( ) { <nl> mmm a / platform / uwp / os_uwp . h <nl> ppp b / platform / uwp / os_uwp . h <nl> class OSUWP : public OS { <nl> virtual int get_audio_driver_count ( ) const ; <nl> virtual const char * get_audio_driver_name ( int p_driver ) const ; <nl> <nl> + virtual void initialize_logger ( ) ; <nl> virtual void initialize_core ( ) ; <nl> virtual void initialize ( const VideoMode & p_desired , int p_video_driver , int p_audio_driver ) ; <nl> <nl> class OSUWP : public OS { <nl> / / Event to send to the app wrapper <nl> HANDLE mouse_mode_changed ; <nl> <nl> - void print_error ( const char * p_function , const char * p_file , int p_line , const char * p_code , const char * p_rationale , ErrorType p_type ) ; <nl> - <nl> - virtual void vprint ( const char * p_format , va_list p_list , bool p_stderr = false ) ; <nl> virtual void alert ( const String & p_alert , const String & p_title = " ALERT ! " ) ; <nl> String get_stdin_string ( bool p_block ) ; <nl> <nl> mmm a / platform / windows / SCsub <nl> ppp b / platform / windows / SCsub <nl> common_win = [ <nl> " stream_peer_winsock . cpp " , <nl> " joypad . cpp " , <nl> " power_windows . cpp " , <nl> + " windows_terminal_logger . cpp " <nl> ] <nl> <nl> restarget = " godot_res " + env [ " OBJSUFFIX " ] <nl> mmm a / platform / windows / os_windows . cpp <nl> ppp b / platform / windows / os_windows . cpp <nl> <nl> # include " servers / visual / visual_server_wrap_mt . h " <nl> # include " stream_peer_winsock . h " <nl> # include " tcp_server_winsock . h " <nl> + # include " windows_terminal_logger . h " <nl> <nl> # include < process . h > <nl> # include < regstr . h > <nl> void OS_Windows : : initialize_core ( ) { <nl> cursor_shape = CURSOR_ARROW ; <nl> } <nl> <nl> + void OS_Windows : : initialize_logger ( ) { <nl> + Vector < Logger * > loggers ; <nl> + loggers . push_back ( memnew ( WindowsTerminalLogger ) ) ; <nl> + loggers . push_back ( memnew ( RotatedFileLogger ( " user : / / logs / log . txt " ) ) ) ; <nl> + _set_logger ( memnew ( CompositeLogger ( loggers ) ) ) ; <nl> + } <nl> + <nl> bool OS_Windows : : can_draw ( ) const { <nl> <nl> return ! minimized ; <nl> void OS_Windows : : finalize_core ( ) { <nl> StreamPeerWinsock : : cleanup ( ) ; <nl> } <nl> <nl> - void OS_Windows : : vprint ( const char * p_format , va_list p_list , bool p_stderr ) { <nl> - <nl> - const unsigned int BUFFER_SIZE = 16384 ; <nl> - char buf [ BUFFER_SIZE + 1 ] ; / / + 1 for the terminating character <nl> - int len = vsnprintf ( buf , BUFFER_SIZE , p_format , p_list ) ; <nl> - if ( len < = 0 ) <nl> - return ; <nl> - if ( len > = BUFFER_SIZE ) <nl> - len = BUFFER_SIZE ; / / Output is too big , will be truncated <nl> - buf [ len ] = 0 ; <nl> - <nl> - int wlen = MultiByteToWideChar ( CP_UTF8 , 0 , buf , len , NULL , 0 ) ; <nl> - if ( wlen < 0 ) <nl> - return ; <nl> - <nl> - wchar_t * wbuf = ( wchar_t * ) malloc ( ( len + 1 ) * sizeof ( wchar_t ) ) ; <nl> - MultiByteToWideChar ( CP_UTF8 , 0 , buf , len , wbuf , wlen ) ; <nl> - wbuf [ wlen ] = 0 ; <nl> - <nl> - if ( p_stderr ) <nl> - fwprintf ( stderr , L " % ls " , wbuf ) ; <nl> - else <nl> - wprintf ( L " % ls " , wbuf ) ; <nl> - <nl> - # ifdef STDOUT_FILE <nl> - / / vwfprintf ( stdo , p_format , p_list ) ; <nl> - # endif <nl> - free ( wbuf ) ; <nl> - <nl> - fflush ( stdout ) ; <nl> - } ; <nl> - <nl> void OS_Windows : : alert ( const String & p_alert , const String & p_title ) { <nl> <nl> if ( ! is_no_window_mode_enabled ( ) ) <nl> void OS_Windows : : request_attention ( ) { <nl> FlashWindowEx ( & info ) ; <nl> } <nl> <nl> - void OS_Windows : : print_error ( const char * p_function , const char * p_file , int p_line , const char * p_code , const char * p_rationale , ErrorType p_type ) { <nl> - <nl> - HANDLE hCon = GetStdHandle ( STD_OUTPUT_HANDLE ) ; <nl> - if ( ! hCon | | hCon = = INVALID_HANDLE_VALUE ) { <nl> - <nl> - const char * err_details ; <nl> - if ( p_rationale & & p_rationale [ 0 ] ) <nl> - err_details = p_rationale ; <nl> - else <nl> - err_details = p_code ; <nl> - <nl> - switch ( p_type ) { <nl> - case ERR_ERROR : <nl> - print ( " ERROR : % s : % s \ n " , p_function , err_details ) ; <nl> - print ( " At : % s : % i \ n " , p_file , p_line ) ; <nl> - break ; <nl> - case ERR_WARNING : <nl> - print ( " WARNING : % s : % s \ n " , p_function , err_details ) ; <nl> - print ( " At : % s : % i \ n " , p_file , p_line ) ; <nl> - break ; <nl> - case ERR_SCRIPT : <nl> - print ( " SCRIPT ERROR : % s : % s \ n " , p_function , err_details ) ; <nl> - print ( " At : % s : % i \ n " , p_file , p_line ) ; <nl> - break ; <nl> - case ERR_SHADER : <nl> - print ( " SHADER ERROR : % s : % s \ n " , p_function , err_details ) ; <nl> - print ( " At : % s : % i \ n " , p_file , p_line ) ; <nl> - break ; <nl> - } <nl> - <nl> - } else { <nl> - <nl> - CONSOLE_SCREEN_BUFFER_INFO sbi ; / / original <nl> - GetConsoleScreenBufferInfo ( hCon , & sbi ) ; <nl> - <nl> - WORD current_fg = sbi . wAttributes & ( FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_INTENSITY ) ; <nl> - WORD current_bg = sbi . wAttributes & ( BACKGROUND_RED | BACKGROUND_GREEN | BACKGROUND_BLUE | BACKGROUND_INTENSITY ) ; <nl> - <nl> - uint32_t basecol = 0 ; <nl> - switch ( p_type ) { <nl> - case ERR_ERROR : basecol = FOREGROUND_RED ; break ; <nl> - case ERR_WARNING : basecol = FOREGROUND_RED | FOREGROUND_GREEN ; break ; <nl> - case ERR_SCRIPT : basecol = FOREGROUND_RED | FOREGROUND_BLUE ; break ; <nl> - case ERR_SHADER : basecol = FOREGROUND_GREEN | FOREGROUND_BLUE ; break ; <nl> - } <nl> - <nl> - basecol | = current_bg ; <nl> - <nl> - if ( p_rationale & & p_rationale [ 0 ] ) { <nl> - <nl> - SetConsoleTextAttribute ( hCon , basecol | FOREGROUND_INTENSITY ) ; <nl> - switch ( p_type ) { <nl> - case ERR_ERROR : print ( " ERROR : " ) ; break ; <nl> - case ERR_WARNING : print ( " WARNING : " ) ; break ; <nl> - case ERR_SCRIPT : print ( " SCRIPT ERROR : " ) ; break ; <nl> - case ERR_SHADER : print ( " SHADER ERROR : " ) ; break ; <nl> - } <nl> - <nl> - SetConsoleTextAttribute ( hCon , current_fg | current_bg | FOREGROUND_INTENSITY ) ; <nl> - print ( " % s \ n " , p_rationale ) ; <nl> - <nl> - SetConsoleTextAttribute ( hCon , basecol ) ; <nl> - switch ( p_type ) { <nl> - case ERR_ERROR : print ( " At : " ) ; break ; <nl> - case ERR_WARNING : print ( " At : " ) ; break ; <nl> - case ERR_SCRIPT : print ( " At : " ) ; break ; <nl> - case ERR_SHADER : print ( " At : " ) ; break ; <nl> - } <nl> - <nl> - SetConsoleTextAttribute ( hCon , current_fg | current_bg ) ; <nl> - print ( " % s : % i \ n " , p_file , p_line ) ; <nl> - <nl> - } else { <nl> - <nl> - SetConsoleTextAttribute ( hCon , basecol | FOREGROUND_INTENSITY ) ; <nl> - switch ( p_type ) { <nl> - case ERR_ERROR : print ( " ERROR : % s : " , p_function ) ; break ; <nl> - case ERR_WARNING : print ( " WARNING : % s : " , p_function ) ; break ; <nl> - case ERR_SCRIPT : print ( " SCRIPT ERROR : % s : " , p_function ) ; break ; <nl> - case ERR_SHADER : print ( " SCRIPT ERROR : % s : " , p_function ) ; break ; <nl> - } <nl> - <nl> - SetConsoleTextAttribute ( hCon , current_fg | current_bg | FOREGROUND_INTENSITY ) ; <nl> - print ( " % s \ n " , p_code ) ; <nl> - <nl> - SetConsoleTextAttribute ( hCon , basecol ) ; <nl> - switch ( p_type ) { <nl> - case ERR_ERROR : print ( " At : " ) ; break ; <nl> - case ERR_WARNING : print ( " At : " ) ; break ; <nl> - case ERR_SCRIPT : print ( " At : " ) ; break ; <nl> - case ERR_SHADER : print ( " At : " ) ; break ; <nl> - } <nl> - <nl> - SetConsoleTextAttribute ( hCon , current_fg | current_bg ) ; <nl> - print ( " % s : % i \ n " , p_file , p_line ) ; <nl> - } <nl> - <nl> - SetConsoleTextAttribute ( hCon , sbi . wAttributes ) ; <nl> - } <nl> - } <nl> - <nl> String OS_Windows : : get_name ( ) { <nl> <nl> return " Windows " ; <nl> OS_Windows : : OS_Windows ( HINSTANCE _hInstance ) { <nl> # ifdef XAUDIO2_ENABLED <nl> AudioDriverManager : : add_driver ( & driver_xaudio2 ) ; <nl> # endif <nl> + <nl> + _set_logger ( memnew ( WindowsTerminalLogger ) ) ; <nl> } <nl> <nl> OS_Windows : : ~ OS_Windows ( ) { <nl> mmm a / platform / windows / os_windows . h <nl> ppp b / platform / windows / os_windows . h <nl> class OS_Windows : public OS { <nl> virtual int get_audio_driver_count ( ) const ; <nl> virtual const char * get_audio_driver_name ( int p_driver ) const ; <nl> <nl> + virtual void initialize_logger ( ) ; <nl> virtual void initialize_core ( ) ; <nl> virtual void initialize ( const VideoMode & p_desired , int p_video_driver , int p_audio_driver ) ; <nl> <nl> class OS_Windows : public OS { <nl> public : <nl> LRESULT WndProc ( HWND hWnd , UINT uMsg , WPARAM wParam , LPARAM lParam ) ; <nl> <nl> - void print_error ( const char * p_function , const char * p_file , int p_line , const char * p_code , const char * p_rationale , ErrorType p_type ) ; <nl> - <nl> - virtual void vprint ( const char * p_format , va_list p_list , bool p_stderr = false ) ; <nl> virtual void alert ( const String & p_alert , const String & p_title = " ALERT ! " ) ; <nl> String get_stdin_string ( bool p_block ) ; <nl> <nl> new file mode 100644 <nl> index 00000000000 . . ef8140ffa7d <nl> mmm / dev / null <nl> ppp b / platform / windows / windows_terminal_logger . cpp <nl> <nl> + / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / <nl> + / * windows_terminal_logger . cpp * / <nl> + / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / <nl> + / * This file is part of : * / <nl> + / * GODOT ENGINE * / <nl> + / * https : / / godotengine . org * / <nl> + / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / <nl> + / * Copyright ( c ) 2007 - 2017 Juan Linietsky , Ariel Manzur . * / <nl> + / * Copyright ( c ) 2014 - 2017 Godot Engine contributors ( cf . AUTHORS . md ) * / <nl> + / * * / <nl> + / * Permission is hereby granted , free of charge , to any person obtaining * / <nl> + / * a copy of this software and associated documentation files ( the * / <nl> + / * " Software " ) , to deal in the Software without restriction , including * / <nl> + / * without limitation the rights to use , copy , modify , merge , publish , * / <nl> + / * distribute , sublicense , and / or sell copies of the Software , and to * / <nl> + / * permit persons to whom the Software is furnished to do so , subject to * / <nl> + / * the following conditions : * / <nl> + / * * / <nl> + / * The above copyright notice and this permission notice shall be * / <nl> + / * included in all copies or substantial portions of the Software . * / <nl> + / * * / <nl> + / * THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND , * / <nl> + / * EXPRESS OR IMPLIED , INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * / <nl> + / * MERCHANTABILITY , FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT . * / <nl> + / * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * / <nl> + / * CLAIM , DAMAGES OR OTHER LIABILITY , WHETHER IN AN ACTION OF CONTRACT , * / <nl> + / * TORT OR OTHERWISE , ARISING FROM , OUT OF OR IN CONNECTION WITH THE * / <nl> + / * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE . * / <nl> + / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / <nl> + <nl> + # include " windows_terminal_logger . h " <nl> + <nl> + # ifdef WINDOWS_ENABLED <nl> + <nl> + # include < stdio . h > <nl> + # include < windows . h > <nl> + <nl> + void WindowsTerminalLogger : : logv ( const char * p_format , va_list p_list , bool p_err ) { <nl> + if ( ! should_log ( p_err ) ) { <nl> + return ; <nl> + } <nl> + <nl> + const unsigned int BUFFER_SIZE = 16384 ; <nl> + char buf [ BUFFER_SIZE + 1 ] ; / / + 1 for the terminating character <nl> + int len = vsnprintf ( buf , BUFFER_SIZE , p_format , p_list ) ; <nl> + if ( len < = 0 ) <nl> + return ; <nl> + if ( len > = BUFFER_SIZE ) <nl> + len = BUFFER_SIZE ; / / Output is too big , will be truncated <nl> + buf [ len ] = 0 ; <nl> + <nl> + int wlen = MultiByteToWideChar ( CP_UTF8 , 0 , buf , len , NULL , 0 ) ; <nl> + if ( wlen < 0 ) <nl> + return ; <nl> + <nl> + wchar_t * wbuf = ( wchar_t * ) malloc ( ( len + 1 ) * sizeof ( wchar_t ) ) ; <nl> + MultiByteToWideChar ( CP_UTF8 , 0 , buf , len , wbuf , wlen ) ; <nl> + wbuf [ wlen ] = 0 ; <nl> + <nl> + if ( p_err ) <nl> + fwprintf ( stderr , L " % ls " , wbuf ) ; <nl> + else <nl> + wprintf ( L " % ls " , wbuf ) ; <nl> + <nl> + free ( wbuf ) ; <nl> + <nl> + # ifdef DEBUG_ENABLED <nl> + fflush ( stdout ) ; <nl> + # endif <nl> + } <nl> + <nl> + void WindowsTerminalLogger : : log_error ( const char * p_function , const char * p_file , int p_line , const char * p_code , const char * p_rationale , ErrorType p_type ) { <nl> + if ( ! should_log ( true ) ) { <nl> + return ; <nl> + } <nl> + <nl> + # ifndef UWP_ENABLED <nl> + HANDLE hCon = GetStdHandle ( STD_OUTPUT_HANDLE ) ; <nl> + if ( ! hCon | | hCon = = INVALID_HANDLE_VALUE ) { <nl> + # endif <nl> + StdLogger : : log_error ( p_function , p_file , p_line , p_code , p_rationale , p_type ) ; <nl> + # ifndef UWP_ENABLED <nl> + } else { <nl> + <nl> + CONSOLE_SCREEN_BUFFER_INFO sbi ; / / original <nl> + GetConsoleScreenBufferInfo ( hCon , & sbi ) ; <nl> + <nl> + WORD current_fg = sbi . wAttributes & ( FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_INTENSITY ) ; <nl> + WORD current_bg = sbi . wAttributes & ( BACKGROUND_RED | BACKGROUND_GREEN | BACKGROUND_BLUE | BACKGROUND_INTENSITY ) ; <nl> + <nl> + uint32_t basecol = 0 ; <nl> + switch ( p_type ) { <nl> + case ERR_ERROR : basecol = FOREGROUND_RED ; break ; <nl> + case ERR_WARNING : basecol = FOREGROUND_RED | FOREGROUND_GREEN ; break ; <nl> + case ERR_SCRIPT : basecol = FOREGROUND_RED | FOREGROUND_BLUE ; break ; <nl> + case ERR_SHADER : basecol = FOREGROUND_GREEN | FOREGROUND_BLUE ; break ; <nl> + } <nl> + <nl> + basecol | = current_bg ; <nl> + <nl> + if ( p_rationale & & p_rationale [ 0 ] ) { <nl> + <nl> + SetConsoleTextAttribute ( hCon , basecol | FOREGROUND_INTENSITY ) ; <nl> + switch ( p_type ) { <nl> + case ERR_ERROR : logf ( " ERROR : " ) ; break ; <nl> + case ERR_WARNING : logf ( " WARNING : " ) ; break ; <nl> + case ERR_SCRIPT : logf ( " SCRIPT ERROR : " ) ; break ; <nl> + case ERR_SHADER : logf ( " SHADER ERROR : " ) ; break ; <nl> + } <nl> + <nl> + SetConsoleTextAttribute ( hCon , current_fg | current_bg | FOREGROUND_INTENSITY ) ; <nl> + logf ( " % s \ n " , p_rationale ) ; <nl> + <nl> + SetConsoleTextAttribute ( hCon , basecol ) ; <nl> + switch ( p_type ) { <nl> + case ERR_ERROR : logf ( " At : " ) ; break ; <nl> + case ERR_WARNING : logf ( " At : " ) ; break ; <nl> + case ERR_SCRIPT : logf ( " At : " ) ; break ; <nl> + case ERR_SHADER : logf ( " At : " ) ; break ; <nl> + } <nl> + <nl> + SetConsoleTextAttribute ( hCon , current_fg | current_bg ) ; <nl> + logf ( " % s : % i \ n " , p_file , p_line ) ; <nl> + <nl> + } else { <nl> + <nl> + SetConsoleTextAttribute ( hCon , basecol | FOREGROUND_INTENSITY ) ; <nl> + switch ( p_type ) { <nl> + case ERR_ERROR : logf ( " ERROR : % s : " , p_function ) ; break ; <nl> + case ERR_WARNING : logf ( " WARNING : % s : " , p_function ) ; break ; <nl> + case ERR_SCRIPT : logf ( " SCRIPT ERROR : % s : " , p_function ) ; break ; <nl> + case ERR_SHADER : logf ( " SCRIPT ERROR : % s : " , p_function ) ; break ; <nl> + } <nl> + <nl> + SetConsoleTextAttribute ( hCon , current_fg | current_bg | FOREGROUND_INTENSITY ) ; <nl> + logf ( " % s \ n " , p_code ) ; <nl> + <nl> + SetConsoleTextAttribute ( hCon , basecol ) ; <nl> + switch ( p_type ) { <nl> + case ERR_ERROR : logf ( " At : " ) ; break ; <nl> + case ERR_WARNING : logf ( " At : " ) ; break ; <nl> + case ERR_SCRIPT : logf ( " At : " ) ; break ; <nl> + case ERR_SHADER : logf ( " At : " ) ; break ; <nl> + } <nl> + <nl> + SetConsoleTextAttribute ( hCon , current_fg | current_bg ) ; <nl> + logf ( " % s : % i \ n " , p_file , p_line ) ; <nl> + } <nl> + <nl> + SetConsoleTextAttribute ( hCon , sbi . wAttributes ) ; <nl> + } <nl> + # endif <nl> + } <nl> + <nl> + WindowsTerminalLogger : : ~ WindowsTerminalLogger ( ) { } <nl> + <nl> + # endif <nl> \ No newline at end of file <nl> new file mode 100644 <nl> index 00000000000 . . f6b1a68d18a <nl> mmm / dev / null <nl> ppp b / platform / windows / windows_terminal_logger . h <nl> <nl> + / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / <nl> + / * windows_terminal_logger . h * / <nl> + / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / <nl> + / * This file is part of : * / <nl> + / * GODOT ENGINE * / <nl> + / * https : / / godotengine . org * / <nl> + / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / <nl> + / * Copyright ( c ) 2007 - 2017 Juan Linietsky , Ariel Manzur . * / <nl> + / * Copyright ( c ) 2014 - 2017 Godot Engine contributors ( cf . AUTHORS . md ) * / <nl> + / * * / <nl> + / * Permission is hereby granted , free of charge , to any person obtaining * / <nl> + / * a copy of this software and associated documentation files ( the * / <nl> + / * " Software " ) , to deal in the Software without restriction , including * / <nl> + / * without limitation the rights to use , copy , modify , merge , publish , * / <nl> + / * distribute , sublicense , and / or sell copies of the Software , and to * / <nl> + / * permit persons to whom the Software is furnished to do so , subject to * / <nl> + / * the following conditions : * / <nl> + / * * / <nl> + / * The above copyright notice and this permission notice shall be * / <nl> + / * included in all copies or substantial portions of the Software . * / <nl> + / * * / <nl> + / * THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND , * / <nl> + / * EXPRESS OR IMPLIED , INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * / <nl> + / * MERCHANTABILITY , FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT . * / <nl> + / * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * / <nl> + / * CLAIM , DAMAGES OR OTHER LIABILITY , WHETHER IN AN ACTION OF CONTRACT , * / <nl> + / * TORT OR OTHERWISE , ARISING FROM , OUT OF OR IN CONNECTION WITH THE * / <nl> + / * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE . * / <nl> + / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / <nl> + <nl> + # ifndef WINDOWS_TERMINAL_LOGGER_H <nl> + # define WINDOWS_TERMINAL_LOGGER_H <nl> + <nl> + # ifdef WINDOWS_ENABLED <nl> + <nl> + # include " io / logger . h " <nl> + <nl> + class WindowsTerminalLogger : public StdLogger { <nl> + public : <nl> + virtual void logv ( const char * p_format , va_list p_list , bool p_err ) ; <nl> + virtual void log_error ( const char * p_function , const char * p_file , int p_line , const char * p_code , const char * p_rationale , ErrorType p_type = ERR_ERROR ) ; <nl> + virtual ~ WindowsTerminalLogger ( ) ; <nl> + } ; <nl> + <nl> + # endif <nl> + <nl> + # endif <nl> \ No newline at end of file <nl>
Extract logging logic
godotengine/godot
1a2311e3505765e37b736fe6bb46bb229e00701f
2017-09-25T09:19:21Z
new file mode 100644 <nl> index 0000000000 . . bde8970984 <nl> mmm / dev / null <nl> ppp b / bindings / java / pom . xml . in <nl> <nl> + < project xmlns = " http : / / maven . apache . org / POM / 4 . 0 . 0 " <nl> + xmlns : xsi = " http : / / www . w3 . org / 2001 / XMLSchema - instance " <nl> + xsi : schemaLocation = " http : / / maven . apache . org / POM / 4 . 0 . 0 <nl> + http : / / maven . apache . org / xsd / maven - 4 . 0 . 0 . xsd " > <nl> + < modelVersion > 4 . 0 . 0 < / modelVersion > <nl> + <nl> + < groupId > org . foundationdb < / groupId > <nl> + < artifactId > NAME < / artifactId > <nl> + < version > VERSION < / version > <nl> + < packaging > jar < / packaging > <nl> + <nl> + < name > foundationdb - java < / name > <nl> + < description > Java bindings for the FoundationDB database . These bindings require the FoundationDB client , which is under a different license . The client can be obtained from https : / / www . foundationdb . org / download / . < / description > <nl> + < inceptionYear > 2010 < / inceptionYear > <nl> + < url > https : / / www . foundationdb . org < / url > <nl> + <nl> + < organization > <nl> + < name > FoundationDB < / name > <nl> + < url > https : / / www . foundationdb . org < / url > <nl> + < / organization > <nl> + <nl> + < developers > <nl> + < developer > <nl> + < name > FoundationDB < / name > <nl> + < / developer > <nl> + < / developers > <nl> + <nl> + < scm > <nl> + < url > http : / / 0 . 0 . 0 . 0 < / url > <nl> + < / scm > <nl> + <nl> + < licenses > <nl> + < license > <nl> + < name > The Apache v2 License < / name > <nl> + < url > http : / / www . apache . org / licenses / < / url > <nl> + < / license > <nl> + < / licenses > <nl> + <nl> + < / project > <nl>
Restore pom . xml . in
apple/foundationdb
c5af8c8dd04ddc8a9e15113e922ddc8cd185e608
2020-09-30T18:34:35Z
mmm a / shell / common / platform_util_win . cc <nl> ppp b / shell / common / platform_util_win . cc <nl> void OpenPath ( const base : : FilePath & full_path , OpenCallback callback ) { <nl> DCHECK_CURRENTLY_ON ( content : : BrowserThread : : UI ) ; <nl> <nl> base : : PostTaskAndReplyWithResult ( <nl> - base : : ThreadPool : : CreateSingleThreadTaskRunner ( ( { base : : MayBlock ( ) , <nl> - base : : TaskPriority : : USER_BLOCKING } ) <nl> + base : : ThreadPool : : CreateCOMSTATaskRunner ( <nl> + { base : : MayBlock ( ) , base : : TaskPriority : : USER_BLOCKING } ) <nl> . get ( ) , <nl> FROM_HERE , base : : BindOnce ( & OpenPathOnThread , full_path ) , <nl> std : : move ( callback ) ) ; <nl>
fix : quick follow - up to threadpool PR ( )
electron/electron
dcab07c8b16784a529714759072735638c86b37e
2020-03-09T18:26:27Z
mmm a / include / swift / SwiftDemangle / Platform . h <nl> ppp b / include / swift / SwiftDemangle / Platform . h <nl> <nl> extern " C " { <nl> # endif <nl> <nl> - # if defined ( SwiftDemangle_EXPORTS ) <nl> + # if defined ( swiftDemangle_EXPORTS ) <nl> # if defined ( __ELF__ ) <nl> # define SWIFT_DEMANGLE_LINKAGE __attribute__ ( ( __visibility__ ( " protected " ) ) ) <nl> # elif defined ( __MACH__ ) <nl>
Merge remote - tracking branch ' origin / master ' into master - next
apple/swift
75fba8c20cddbdabc839b6f5a7d7dfbd7bd97bcb
2018-03-02T23:10:45Z
mmm a / hphp / hack / src / typing / nastCheck . ml <nl> ppp b / hphp / hack / src / typing / nastCheck . ml <nl> and func env f named_body = <nl> ) ; <nl> ( match f . f_variadic with <nl> | FVvariadicArg vparam - > <nl> - Typing_instantiability . check_param_instantiable tenv vparam ; <nl> if vparam . param_is_reference then <nl> Errors . variadic_byref_param vparam . param_pos <nl> | _ - > ( ) <nl> and method_ ( env , is_static ) m = <nl> ) ; <nl> ( match m . m_variadic with <nl> | FVvariadicArg vparam - > <nl> - Typing_instantiability . check_param_instantiable tenv vparam ; <nl> if vparam . param_is_reference then <nl> Errors . variadic_byref_param vparam . param_pos <nl> | _ - > ( ) <nl> mmm a / hphp / hack / src / typing / tast_check / instantiability_check . ml <nl> ppp b / hphp / hack / src / typing / tast_check / instantiability_check . ml <nl> let check_tparams env tparams = <nl> let check_param env param = <nl> Option . iter param . param_hint ( check_hint env ) <nl> <nl> + let check_variadic_param env param = <nl> + match param with <nl> + | FVvariadicArg vparam - > check_param env vparam <nl> + | _ - > ( ) <nl> + <nl> let handler = object <nl> inherit Tast_visitor . handler_base <nl> <nl> let handler = object <nl> <nl> method ! at_fun_ env f = <nl> check_tparams env f . f_tparams ; <nl> - List . iter f . f_params ( check_param env ) <nl> + List . iter f . f_params ( check_param env ) ; <nl> + check_variadic_param env f . f_variadic ; <nl> <nl> method ! at_method_ env m = <nl> check_tparams env m . m_tparams ; <nl> - List . iter m . m_params ( check_param env ) <nl> - end <nl> + List . iter m . m_params ( check_param env ) ; <nl> + check_variadic_param env m . m_variadic ; <nl> + <nl> + end <nl> mmm a / hphp / hack / test / typecheck / typing_fail_uninstantiable_variadic_func . php . exp <nl> ppp b / hphp / hack / test / typecheck / typing_fail_uninstantiable_variadic_func . php . exp <nl> <nl> - File " typing_fail_uninstantiable_variadic_func . php " , line 12 , characters 24 - 48 : <nl> + File " typing_fail_uninstantiable_variadic_func . php " , line 12 , characters 24 - 51 : <nl> CannotBeInstantiatedWithT is uninstantiable ( Typing [ 4002 ] ) <nl> File " typing_fail_uninstantiable_variadic_func . php " , line 11 , characters 22 - 46 : <nl> Declaration is here <nl> mmm a / hphp / hack / test / typecheck / typing_fail_uninstantiable_variadic_meth . php . exp <nl> ppp b / hphp / hack / test / typecheck / typing_fail_uninstantiable_variadic_meth . php . exp <nl> <nl> - File " typing_fail_uninstantiable_variadic_meth . php " , line 15 , characters 33 - 57 : <nl> + File " typing_fail_uninstantiable_variadic_meth . php " , line 15 , characters 33 - 60 : <nl> CannotBeInstantiatedWithT is uninstantiable ( Typing [ 4002 ] ) <nl> File " typing_fail_uninstantiable_variadic_meth . php " , line 11 , characters 22 - 46 : <nl> Declaration is here <nl>
Move check_param_instantiable to instantiability_check ( 6 / n )
facebook/hhvm
4f7814335c58e19142351522ba2b50d68e827366
2019-01-28T22:54:40Z
mmm a / test / ClangModules / autolinking . swift <nl> ppp b / test / ClangModules / autolinking . swift <nl> <nl> / / RUN : % target - swift - frontend % s - sdk % S / Inputs - I % S / Inputs / custom - modules - emit - ir - disable - autolink - framework LinkFramework - o % t / with - disabled . ll <nl> / / RUN : FileCheck - - check - prefix = CHECK - WITH - DISABLED % s < % t / with - disabled . ll <nl> <nl> + / / Linux uses a different autolinking mechanism , based on <nl> + / / swift - autolink - extract . This file tests the Darwin mechanism . <nl> / / UNSUPPORTED : OS = linux - gnu <nl> + / / UNSUPPORTED : OS = linux - gnueabihf <nl> + / / UNSUPPORTED : OS = freebsd <nl> <nl> import LinkMusket <nl> import LinkFramework <nl> mmm a / test / Frontend / embed - bitcode . swift <nl> ppp b / test / Frontend / embed - bitcode . swift <nl> <nl> / / RUN : llvm - objdump - macho - section = " __LLVM , __bitcode " % t . o | FileCheck - check - prefix = MARKER % s <nl> / / RUN : llvm - objdump - macho - section = " __LLVM , __swift_cmdline " % t . o | FileCheck - check - prefix = MARKER - CMD % s <nl> <nl> + / / This file tests Mach - O file output , but Linux variants do not produce Mach - O <nl> + / / files . <nl> / / UNSUPPORTED : OS = linux - gnu <nl> + / / UNSUPPORTED : OS = linux - gnueabihf <nl> + / / UNSUPPORTED : OS = freebsd <nl> <nl> / / MARKER : Contents of ( __LLVM , __bitcode ) section <nl> / / MARKER - NEXT : 00 <nl> mmm a / test / Interpreter / repl_autolinking . swift <nl> ppp b / test / Interpreter / repl_autolinking . swift <nl> <nl> <nl> / / REQUIRES : swift_repl <nl> / / UNSUPPORTED : OS = linux - gnu <nl> + / / UNSUPPORTED : OS = linux - gnueabihf <nl> + / / UNSUPPORTED : OS = freebsd <nl> <nl> / / This test checks that autolinking works in the REPL . <nl> <nl> mmm a / test / Serialization / autolinking . swift <nl> ppp b / test / Serialization / autolinking . swift <nl> <nl> / / RUN : % target - swift - frontend - emit - ir - parse - stdlib - module - name someModule - module - link - name module % S / . . / Inputs / empty . swift - autolink - force - load | FileCheck - - check - prefix = FORCE - LOAD % s <nl> / / RUN : % target - swift - frontend - emit - ir - parse - stdlib - module - name someModule - module - link - name 0module % S / . . / Inputs / empty . swift - autolink - force - load | FileCheck - - check - prefix = FORCE - LOAD - HEX % s <nl> <nl> + / / Linux uses a different autolinking mechanism , based on <nl> + / / swift - autolink - extract . This file tests the Darwin mechanism . <nl> / / UNSUPPORTED : OS = linux - gnu <nl> + / / UNSUPPORTED : OS = linux - gnueabihf <nl> + / / UNSUPPORTED : OS = freebsd <nl> <nl> import someModule <nl> <nl>
[ test ] Mark tests unsupported on all Linux flavors
apple/swift
2eb028b5ced187998f44282fbd5ed0212284e782
2016-01-25T16:57:14Z
mmm a / include / grpc + + / client_context . h <nl> ppp b / include / grpc + + / client_context . h <nl> class ClientContext { <nl> void set_absolute_deadline ( const system_clock : : time_point & deadline ) ; <nl> system_clock : : time_point absolute_deadline ( ) ; <nl> <nl> + void set_authority ( const grpc : : string & authority ) { <nl> + authority_ = authority ; <nl> + } <nl> + <nl> void TryCancel ( ) ; <nl> <nl> private : <nl> class ClientContext { <nl> <nl> gpr_timespec RawDeadline ( ) { return absolute_deadline_ ; } <nl> <nl> + grpc : : string authority ( ) { <nl> + return authority_ ; <nl> + } <nl> + <nl> bool initial_metadata_received_ = false ; <nl> grpc_call * call_ ; <nl> grpc_completion_queue * cq_ ; <nl> gpr_timespec absolute_deadline_ ; <nl> + grpc : : string authority_ ; <nl> std : : multimap < grpc : : string , grpc : : string > send_initial_metadata_ ; <nl> std : : multimap < grpc : : string , grpc : : string > recv_initial_metadata_ ; <nl> std : : multimap < grpc : : string , grpc : : string > trailing_metadata_ ; <nl> mmm a / src / cpp / client / channel . cc <nl> ppp b / src / cpp / client / channel . cc <nl> Channel : : ~ Channel ( ) { grpc_channel_destroy ( c_channel_ ) ; } <nl> Call Channel : : CreateCall ( const RpcMethod & method , ClientContext * context , <nl> CompletionQueue * cq ) { <nl> auto c_call = <nl> - grpc_channel_create_call ( c_channel_ , cq - > cq ( ) , method . name ( ) , <nl> - target_ . c_str ( ) , context - > RawDeadline ( ) ) ; <nl> + grpc_channel_create_call ( <nl> + c_channel_ , cq - > cq ( ) , method . name ( ) , <nl> + context - > authority ( ) . empty ( ) ? target_ . c_str ( ) <nl> + : context - > authority ( ) , <nl> + context - > RawDeadline ( ) ) ; <nl> context - > set_call ( c_call ) ; <nl> return Call ( c_call , this , cq ) ; <nl> } <nl>
Add setter to override authority header on ClientContext
grpc/grpc
f2c0ca4c6296dddfc46d84c8d2b422eff3531551
2015-02-17T18:21:31Z
mmm a / examples / image_c_api . c <nl> ppp b / examples / image_c_api . c <nl> int main ( ) { <nl> * / <nl> gs = wkhtmltoimage_create_global_settings ( ) ; <nl> <nl> - / * We want to convert to convert the qstring documentation page * / <nl> + / * We want to convert the qstring documentation page * / <nl> wkhtmltoimage_set_global_setting ( gs , " in " , " http : / / www . google . com / " ) ; <nl> wkhtmltoimage_set_global_setting ( gs , " fmt " , " jpeg " ) ; <nl> <nl>
doc nit
wkhtmltopdf/wkhtmltopdf
ffeeff51023a2ef234d528f055956b9e8c62da52
2018-02-09T18:31:19Z
mmm a / sw . cpp <nl> ppp b / sw . cpp <nl> void build ( Solution & s ) <nl> " src / api / renderer . h " , <nl> " tess_version . h " , <nl> <nl> - / / from arch / makefile . am <nl> - " src / arch / dotproduct . h " , <nl> - " src / arch / intsimdmatrix . h " , <nl> - " src / arch / simddetect . h " , <nl> - <nl> / / from ccmain / makefile . am <nl> " src / ccmain / thresholder . h " , <nl> " src / ccmain / ltrresultiterator . h " , <nl> void build ( Solution & s ) <nl> " src / ccstruct / publictypes . h " , <nl> <nl> / / from ccutil / makefile . am <nl> - " src / ccutil / errcode . h " , <nl> - " src / ccutil / fileerr . h " , <nl> " src / ccutil / genericvector . h " , <nl> " src / ccutil / helpers . h " , <nl> - " src / ccutil / params . h " , <nl> " src / ccutil / ocrclass . h " , <nl> " src / ccutil / platform . h " , <nl> " src / ccutil / serialis . h " , <nl> " src / ccutil / strngs . h " , <nl> " src / ccutil / unichar . h " , <nl> - " src / ccutil / unicharcompress . h " , <nl> - " src / ccutil / unicharmap . h " , <nl> - " src / ccutil / unicharset . h " , <nl> - <nl> - / / from lstm / makefile . am <nl> - " src / lstm / convolve . h " , <nl> - " src / lstm / fullyconnected . h " , <nl> - " src / lstm / functions . h " , <nl> - " src / lstm / input . h " , <nl> - " src / lstm / lstm . h " , <nl> - " src / lstm / lstmrecognizer . h " , <nl> - " src / lstm / maxpool . h " , <nl> - " src / lstm / network . h " , <nl> - " src / lstm / networkio . h " , <nl> - " src / lstm / networkscratch . h " , <nl> - " src / lstm / parallel . h " , <nl> - " src / lstm / plumbing . h " , <nl> - " src / lstm / recodebeam . h " , <nl> - " src / lstm / reconfig . h " , <nl> - " src / lstm / reversed . h " , <nl> - " src / lstm / series . h " , <nl> - " src / lstm / static_shape . h " , <nl> - " src / lstm / stridemap . h " , <nl> - " src / lstm / tfnetwork . h " , <nl> - " src / lstm / weightmatrix . h " , <nl> } ; <nl> <nl> auto d = libtesseract . BinaryDir / " tesseract " ; <nl>
Merge pull request from stweil / master
tesseract-ocr/tesseract
8b694b8a719ae0a3986ea62c81cea7829db5bd36
2019-10-06T21:16:12Z
mmm a / src / compiler / ppc / code - generator - ppc . cc <nl> ppp b / src / compiler / ppc / code - generator - ppc . cc <nl> CodeGenerator : : CodeGenResult CodeGenerator : : AssembleArchInstruction ( <nl> case kArchCallWasmFunction : { <nl> / / We must not share code targets for calls to builtins for wasm code , as <nl> / / they might need to be patched individually . <nl> - RelocInfo : : Mode rmode = RelocInfo : : JS_TO_WASM_CALL ; <nl> - if ( info ( ) - > IsWasm ( ) ) { <nl> - rmode = RelocInfo : : WASM_CALL ; <nl> - } <nl> - <nl> if ( instr - > InputAt ( 0 ) - > IsImmediate ( ) ) { <nl> + Constant constant = i . ToConstant ( instr - > InputAt ( 0 ) ) ; <nl> # ifdef V8_TARGET_ARCH_PPC64 <nl> - Address wasm_code = <nl> - static_cast < Address > ( i . ToConstant ( instr - > InputAt ( 0 ) ) . ToInt64 ( ) ) ; <nl> + Address wasm_code = static_cast < Address > ( constant . ToInt64 ( ) ) ; <nl> # else <nl> - Address wasm_code = <nl> - static_cast < Address > ( i . ToConstant ( instr - > InputAt ( 0 ) ) . ToInt32 ( ) ) ; <nl> + Address wasm_code = static_cast < Address > ( constant . ToInt32 ( ) ) ; <nl> # endif <nl> - __ Call ( wasm_code , rmode ) ; <nl> + __ Call ( wasm_code , constant . rmode ( ) ) ; <nl> } else { <nl> __ Call ( i . InputRegister ( 0 ) ) ; <nl> } <nl> CodeGenerator : : CodeGenResult CodeGenerator : : AssembleArchInstruction ( <nl> case kArchTailCallWasm : { <nl> / / We must not share code targets for calls to builtins for wasm code , as <nl> / / they might need to be patched individually . <nl> - RelocInfo : : Mode rmode = RelocInfo : : JS_TO_WASM_CALL ; <nl> - if ( info ( ) - > IsWasm ( ) ) { <nl> - rmode = RelocInfo : : WASM_CALL ; <nl> - } <nl> - <nl> if ( instr - > InputAt ( 0 ) - > IsImmediate ( ) ) { <nl> - Address wasm_code = <nl> - static_cast < Address > ( i . ToConstant ( instr - > InputAt ( 0 ) ) . ToInt32 ( ) ) ; <nl> - __ Jump ( wasm_code , rmode ) ; <nl> + Constant constant = i . ToConstant ( instr - > InputAt ( 0 ) ) ; <nl> + # ifdef V8_TARGET_ARCH_S390X <nl> + Address wasm_code = static_cast < Address > ( constant . ToInt64 ( ) ) ; <nl> + # else <nl> + Address wasm_code = static_cast < Address > ( constant . ToInt32 ( ) ) ; <nl> + # endif <nl> + __ Jump ( wasm_code , constant . rmode ( ) ) ; <nl> } else { <nl> __ Jump ( i . InputRegister ( 0 ) ) ; <nl> } <nl> mmm a / src / compiler / s390 / code - generator - s390 . cc <nl> ppp b / src / compiler / s390 / code - generator - s390 . cc <nl> CodeGenerator : : CodeGenResult CodeGenerator : : AssembleArchInstruction ( <nl> case kArchCallWasmFunction : { <nl> / / We must not share code targets for calls to builtins for wasm code , as <nl> / / they might need to be patched individually . <nl> - RelocInfo : : Mode rmode = RelocInfo : : JS_TO_WASM_CALL ; <nl> - if ( info ( ) - > IsWasm ( ) ) { <nl> - rmode = RelocInfo : : WASM_CALL ; <nl> - } <nl> - <nl> if ( instr - > InputAt ( 0 ) - > IsImmediate ( ) ) { <nl> + Constant constant = i . ToConstant ( instr - > InputAt ( 0 ) ) ; <nl> # ifdef V8_TARGET_ARCH_S390X <nl> - Address wasm_code = <nl> - static_cast < Address > ( i . ToConstant ( instr - > InputAt ( 0 ) ) . ToInt64 ( ) ) ; <nl> + Address wasm_code = static_cast < Address > ( constant . ToInt64 ( ) ) ; <nl> # else <nl> - Address wasm_code = <nl> - static_cast < Address > ( i . ToConstant ( instr - > InputAt ( 0 ) ) . ToInt32 ( ) ) ; <nl> + Address wasm_code = static_cast < Address > ( constant . ToInt32 ( ) ) ; <nl> # endif <nl> - __ Call ( wasm_code , rmode ) ; <nl> + __ Call ( wasm_code , constant . rmode ( ) ) ; <nl> } else { <nl> __ Call ( i . InputRegister ( 0 ) ) ; <nl> } <nl> CodeGenerator : : CodeGenResult CodeGenerator : : AssembleArchInstruction ( <nl> case kArchTailCallWasm : { <nl> / / We must not share code targets for calls to builtins for wasm code , as <nl> / / they might need to be patched individually . <nl> - RelocInfo : : Mode rmode = RelocInfo : : JS_TO_WASM_CALL ; <nl> - if ( info ( ) - > IsWasm ( ) ) { <nl> - rmode = RelocInfo : : WASM_CALL ; <nl> - } <nl> - <nl> if ( instr - > InputAt ( 0 ) - > IsImmediate ( ) ) { <nl> - Address wasm_code = <nl> - static_cast < Address > ( i . ToConstant ( instr - > InputAt ( 0 ) ) . ToInt32 ( ) ) ; <nl> - __ Jump ( wasm_code , rmode ) ; <nl> + Constant constant = i . ToConstant ( instr - > InputAt ( 0 ) ) ; <nl> + # ifdef V8_TARGET_ARCH_S390X <nl> + Address wasm_code = static_cast < Address > ( constant . ToInt64 ( ) ) ; <nl> + # else <nl> + Address wasm_code = static_cast < Address > ( constant . ToInt32 ( ) ) ; <nl> + # endif <nl> + __ Jump ( wasm_code , constant . rmode ( ) ) ; <nl> } else { <nl> __ Jump ( i . InputRegister ( 0 ) ) ; <nl> } <nl> mmm a / src / ppc / assembler - ppc . cc <nl> ppp b / src / ppc / assembler - ppc . cc <nl> bool RelocInfo : : IsInConstantPool ( ) { <nl> return false ; <nl> } <nl> <nl> - uint32_t RelocInfo : : embedded_size ( ) const { <nl> - return static_cast < uint32_t > ( <nl> - Assembler : : target_address_at ( pc_ , constant_pool_ ) ) ; <nl> - } <nl> - <nl> - void RelocInfo : : set_embedded_size ( uint32_t size , ICacheFlushMode flush_mode ) { <nl> - Assembler : : set_target_address_at ( pc_ , constant_pool_ , <nl> - static_cast < Address > ( size ) , flush_mode ) ; <nl> - } <nl> - <nl> void RelocInfo : : set_js_to_wasm_address ( Address address , <nl> ICacheFlushMode icache_flush_mode ) { <nl> DCHECK_EQ ( rmode_ , JS_TO_WASM_CALL ) ; <nl> Address RelocInfo : : js_to_wasm_address ( ) const { <nl> return Assembler : : target_address_at ( pc_ , constant_pool_ ) ; <nl> } <nl> <nl> + uint32_t RelocInfo : : wasm_stub_call_tag ( ) const { <nl> + DCHECK_EQ ( rmode_ , WASM_STUB_CALL ) ; <nl> + return static_cast < uint32_t > ( <nl> + Assembler : : target_address_at ( pc_ , constant_pool_ ) ) ; <nl> + } <nl> + <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> / / Implementation of Operand and MemOperand <nl> / / See assembler - ppc - inl . h for inlined constructors <nl> mmm a / src / s390 / assembler - s390 . cc <nl> ppp b / src / s390 / assembler - s390 . cc <nl> bool RelocInfo : : IsCodedSpecially ( ) { <nl> <nl> bool RelocInfo : : IsInConstantPool ( ) { return false ; } <nl> <nl> - uint32_t RelocInfo : : embedded_size ( ) const { <nl> - return static_cast < uint32_t > ( <nl> - Assembler : : target_address_at ( pc_ , constant_pool_ ) ) ; <nl> - } <nl> - <nl> - void RelocInfo : : set_embedded_size ( uint32_t size , ICacheFlushMode flush_mode ) { <nl> - Assembler : : set_target_address_at ( pc_ , constant_pool_ , <nl> - static_cast < Address > ( size ) , flush_mode ) ; <nl> - } <nl> - <nl> void RelocInfo : : set_js_to_wasm_address ( Address address , <nl> ICacheFlushMode icache_flush_mode ) { <nl> DCHECK_EQ ( rmode_ , JS_TO_WASM_CALL ) ; <nl> Address RelocInfo : : js_to_wasm_address ( ) const { <nl> return Assembler : : target_address_at ( pc_ , constant_pool_ ) ; <nl> } <nl> <nl> + uint32_t RelocInfo : : wasm_stub_call_tag ( ) const { <nl> + DCHECK_EQ ( rmode_ , WASM_STUB_CALL ) ; <nl> + return static_cast < uint32_t > ( <nl> + Assembler : : target_address_at ( pc_ , constant_pool_ ) ) ; <nl> + } <nl> + <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> / / Implementation of Operand and MemOperand <nl> / / See assembler - s390 - inl . h for inlined constructors <nl>
PPC / s390 : [ wasm ] Make stack check independent of the Isolate .
v8/v8
94aac0043408e4a2856abe87d8a3df45bd465461
2018-06-04T19:18:02Z
mmm a / xbmc / cores / omxplayer / OMXPlayerAudio . cpp <nl> ppp b / xbmc / cores / omxplayer / OMXPlayerAudio . cpp <nl> <nl> # include " utils / TimeUtils . h " <nl> <nl> # include " OMXPlayer . h " <nl> + # include " linux / RBP . h " <nl> <nl> # include < iostream > <nl> # include < sstream > <nl> OMXPlayerAudio : : OMXPlayerAudio ( OMXClock * av_clock , CDVDMessageQueue & parent ) <nl> m_bad_state = false ; <nl> m_hints_current . Clear ( ) ; <nl> <nl> - m_messageQueue . SetMaxDataSize ( 3 * 1024 * 1024 ) ; <nl> + bool small_mem = g_RBP . GetArmMem ( ) < 256 ; <nl> + m_messageQueue . SetMaxDataSize ( ( small_mem ? 3 : 6 ) * 1024 * 1024 ) ; <nl> + <nl> m_messageQueue . SetMaxTimeSize ( 8 . 0 ) ; <nl> m_use_passthrough = false ; <nl> m_passthrough = false ; <nl> mmm a / xbmc / cores / omxplayer / OMXPlayerVideo . cpp <nl> ppp b / xbmc / cores / omxplayer / OMXPlayerVideo . cpp <nl> <nl> # include " guilib / GraphicContext . h " <nl> <nl> # include " OMXPlayer . h " <nl> + # include " linux / RBP . h " <nl> <nl> class COMXMsgVideoCodecChange : public CDVDMsg <nl> { <nl> OMXPlayerVideo : : OMXPlayerVideo ( OMXClock * av_clock , <nl> m_iCurrentPts = DVD_NOPTS_VALUE ; <nl> m_iVideoDelay = 0 ; <nl> m_fForcedAspectRatio = 0 . 0f ; <nl> - m_messageQueue . SetMaxDataSize ( 10 * 1024 * 1024 ) ; <nl> + bool small_mem = g_RBP . GetArmMem ( ) < 256 ; <nl> + m_messageQueue . SetMaxDataSize ( ( small_mem ? 10 : 40 ) * 1024 * 1024 ) ; <nl> m_messageQueue . SetMaxTimeSize ( 8 . 0 ) ; <nl> <nl> m_dst_rect . SetRect ( 0 , 0 , 0 , 0 ) ; <nl> mmm a / xbmc / cores / omxplayer / OMXVideo . cpp <nl> ppp b / xbmc / cores / omxplayer / OMXVideo . cpp <nl> <nl> # include " settings / Settings . h " <nl> # include " utils / BitstreamConverter . h " <nl> <nl> + # include " linux / RBP . h " <nl> + <nl> # include < sys / time . h > <nl> # include < inttypes . h > <nl> <nl> bool COMXVideo : : Open ( CDVDStreamInfo & hints , OMXClock * clock , EDEINTERLACEMODE de <nl> } <nl> <nl> portParam . nPortIndex = m_omx_decoder . GetInputPort ( ) ; <nl> - portParam . nBufferCountActual = VIDEO_BUFFERS ; <nl> - <nl> + bool small_mem = g_RBP . GetArmMem ( ) < 256 ; <nl> + portParam . nBufferCountActual = small_mem ? VIDEO_BUFFERS : 2 * VIDEO_BUFFERS ; <nl> portParam . format . video . nFrameWidth = m_decoded_width ; <nl> portParam . format . video . nFrameHeight = m_decoded_height ; <nl> <nl> mmm a / xbmc / linux / RBP . cpp <nl> ppp b / xbmc / linux / RBP . cpp <nl> bool CRBP : : Initialize ( ) <nl> if ( ! m_omx_initialized ) <nl> return false ; <nl> <nl> + char response [ 80 ] = " " ; <nl> + m_arm_mem = 0 ; <nl> + m_gpu_mem = 0 ; <nl> + if ( vc_gencmd ( response , sizeof response , " get_mem arm " ) = = 0 ) <nl> + vc_gencmd_number_property ( response , " arm " , & m_arm_mem ) ; <nl> + if ( vc_gencmd ( response , sizeof response , " get_mem gpu " ) = = 0 ) <nl> + vc_gencmd_number_property ( response , " gpu " , & m_gpu_mem ) ; <nl> + <nl> return true ; <nl> } <nl> <nl> void CRBP : : LogFirmwareVerison ( ) <nl> m_DllBcmHost - > vc_gencmd ( response , sizeof response , " version " ) ; <nl> response [ sizeof ( response ) - 1 ] = ' \ 0 ' ; <nl> CLog : : Log ( LOGNOTICE , " Raspberry PI firmware version : % s " , response ) ; <nl> + CLog : : Log ( LOGNOTICE , " ARM mem : % dMB GPU mem : % dMB " , m_arm_mem , m_gpu_mem ) ; <nl> } <nl> <nl> void CRBP : : Deinitialize ( ) <nl> mmm a / xbmc / linux / RBP . h <nl> ppp b / xbmc / linux / RBP . h <nl> class CRBP <nl> bool Initialize ( ) ; <nl> void LogFirmwareVerison ( ) ; <nl> void Deinitialize ( ) ; <nl> + int GetArmMem ( ) { return m_arm_mem ; } <nl> + int GetGpuMem ( ) { return m_gpu_mem ; } <nl> <nl> private : <nl> DllBcmHost * m_DllBcmHost ; <nl> bool m_initialized ; <nl> bool m_omx_initialized ; <nl> + int m_arm_mem ; <nl> + int m_gpu_mem ; <nl> COMXCore * m_OMX ; <nl> } ; <nl> <nl>
Merge pull request from popcornmix / big_buffer
xbmc/xbmc
040633dccee7384b7320b07fb1d3e8ec8d57920a
2013-07-01T16:50:27Z
mmm a / tensorflow / python / ops / rnn_cell_impl . py <nl> ppp b / tensorflow / python / ops / rnn_cell_impl . py <nl> def zero_state ( self , batch_size , dtype ) : <nl> self . _last_zero_state = ( state_size , batch_size , dtype , output ) <nl> return output <nl> <nl> - <nl> - class BasicRNNCell ( RNNCell ) : <nl> - " " " The most basic RNN cell . <nl> - <nl> - Args : <nl> - num_units : int , The number of units in the RNN cell . <nl> - activation : Nonlinearity to use . Default : ` tanh ` . <nl> - reuse : ( optional ) Python boolean describing whether to reuse variables <nl> - in an existing scope . If not ` True ` , and the existing scope already has <nl> - the given variables , an error is raised . <nl> - " " " <nl> - <nl> - def __init__ ( self , num_units , activation = None , reuse = None ) : <nl> - super ( BasicRNNCell , self ) . __init__ ( _reuse = reuse ) <nl> - self . _num_units = num_units <nl> - self . _activation = activation or math_ops . tanh <nl> - self . _linear = None <nl> - <nl> - @ property <nl> - def state_size ( self ) : <nl> - return self . _num_units <nl> - <nl> - @ property <nl> - def output_size ( self ) : <nl> - return self . _num_units <nl> - <nl> - def call ( self , inputs , state ) : <nl> - " " " Most basic RNN : output = new_state = act ( W * input + U * state + B ) . " " " <nl> - if self . _linear is None : <nl> - self . _linear = _Linear ( [ inputs , state ] , self . _num_units , True ) <nl> - <nl> - output = self . _activation ( self . _linear ( [ inputs , state ] ) ) <nl> - return output , output <nl> - <nl> class _LayerRNNCell ( RNNCell ) : <nl> " " " Subclass of RNNCells that act like proper ` tf . Layer ` objects . <nl> <nl>
fix wrong merge
tensorflow/tensorflow
634ed487f078f6d62da9f47a6d7854d6d81b132e
2017-12-15T06:44:02Z
mmm a / src / compiler / graph - reducer . cc <nl> ppp b / src / compiler / graph - reducer . cc <nl> void GraphReducer : : ReduceTop ( ) { <nl> / / All inputs should be visited or on stack . Apply reductions to node . <nl> Reduction reduction = Reduce ( node ) ; <nl> <nl> + / / If there was no reduction , pop { node } and continue . <nl> + if ( ! reduction . Changed ( ) ) return Pop ( ) ; <nl> + <nl> + / / Check if the reduction is an in - place update of the { node } . <nl> + Node * const replacement = reduction . replacement ( ) ; <nl> + if ( replacement = = node ) { <nl> + / / In - place update of { node } , may need to recurse on an input . <nl> + for ( int i = 0 ; i < node - > InputCount ( ) ; + + i ) { <nl> + Node * input = node - > InputAt ( i ) ; <nl> + entry . input_index = i + 1 ; <nl> + if ( input ! = node & & Recurse ( input ) ) return ; <nl> + } <nl> + } <nl> + <nl> / / After reducing the node , pop it off the stack . <nl> Pop ( ) ; <nl> <nl> - / / If there was a reduction , revisit the uses and reduce the replacement . <nl> - if ( reduction . Changed ( ) ) { <nl> - for ( Node * const use : node - > uses ( ) ) { <nl> - / / Don ' t revisit this node if it refers to itself . <nl> - if ( use ! = node ) Revisit ( use ) ; <nl> - } <nl> - Node * const replacement = reduction . replacement ( ) ; <nl> - if ( replacement ! = node ) { <nl> - if ( node = = graph ( ) - > start ( ) ) graph ( ) - > SetStart ( replacement ) ; <nl> - if ( node = = graph ( ) - > end ( ) ) graph ( ) - > SetEnd ( replacement ) ; <nl> - / / If { node } was replaced by an old node , unlink { node } and assume that <nl> - / / { replacement } was already reduced and finish . <nl> - if ( replacement - > id ( ) < node_count ) { <nl> - node - > ReplaceUses ( replacement ) ; <nl> + / / Revisit all uses of the node . <nl> + for ( Node * const use : node - > uses ( ) ) { <nl> + / / Don ' t revisit this node if it refers to itself . <nl> + if ( use ! = node ) Revisit ( use ) ; <nl> + } <nl> + <nl> + / / Check if we have a new replacement . <nl> + if ( replacement ! = node ) { <nl> + if ( node = = graph ( ) - > start ( ) ) graph ( ) - > SetStart ( replacement ) ; <nl> + if ( node = = graph ( ) - > end ( ) ) graph ( ) - > SetEnd ( replacement ) ; <nl> + / / If { node } was replaced by an old node , unlink { node } and assume that <nl> + / / { replacement } was already reduced and finish . <nl> + if ( replacement - > id ( ) < node_count ) { <nl> + node - > ReplaceUses ( replacement ) ; <nl> + node - > Kill ( ) ; <nl> + } else { <nl> + / / Otherwise { node } was replaced by a new node . Replace all old uses of <nl> + / / { node } with { replacement } . New nodes created by this reduction can <nl> + / / use { node } . <nl> + node - > ReplaceUsesIf ( <nl> + [ node_count ] ( Node * const node ) { return node - > id ( ) < node_count ; } , <nl> + replacement ) ; <nl> + / / Unlink { node } if it ' s no longer used . <nl> + if ( node - > uses ( ) . empty ( ) ) { <nl> node - > Kill ( ) ; <nl> - } else { <nl> - / / Otherwise { node } was replaced by a new node . Replace all old uses of <nl> - / / { node } with { replacement } . New nodes created by this reduction can <nl> - / / use { node } . <nl> - node - > ReplaceUsesIf ( [ node_count ] ( Node * const node ) { <nl> - return node - > id ( ) < node_count ; <nl> - } , <nl> - replacement ) ; <nl> - / / Unlink { node } if it ' s no longer used . <nl> - if ( node - > uses ( ) . empty ( ) ) { <nl> - node - > Kill ( ) ; <nl> - } <nl> - <nl> - / / If there was a replacement , reduce it after popping { node } . <nl> - Recurse ( replacement ) ; <nl> } <nl> + <nl> + / / If there was a replacement , reduce it after popping { node } . <nl> + Recurse ( replacement ) ; <nl> } <nl> } <nl> } <nl>
[ turbofan ] Recursively reduce new inputs of changed nodes .
v8/v8
d0a7ef938ad54e5df867f14c27cb88a20786e573
2014-12-17T10:31:52Z
mmm a / cocos / 3d / CCMeshVertexIndexData . h <nl> ppp b / cocos / 3d / CCMeshVertexIndexData . h <nl> class MeshVertexData ; <nl> * @ js NA <nl> * @ lua NA <nl> * / <nl> - class MeshIndexData : public Ref <nl> + class CC_DLL MeshIndexData : public Ref <nl> { <nl> public : <nl> / * * create * / <nl> class MeshIndexData : public Ref <nl> * the MeshVertexData class . <nl> * @ brief the MeshIndexData contain all of the vertices data which mesh need . <nl> * / <nl> - class MeshVertexData : public Ref <nl> + class CC_DLL MeshVertexData : public Ref <nl> { <nl> friend class Sprite3D ; <nl> friend class Mesh ; <nl> mmm a / cocos / platform / desktop / CCGLViewImpl - desktop . cpp <nl> ppp b / cocos / platform / desktop / CCGLViewImpl - desktop . cpp <nl> static keyCodeItem g_keyCodeStructArray [ ] = { <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> <nl> <nl> - GLViewImpl : : GLViewImpl ( ) <nl> + GLViewImpl : : GLViewImpl ( bool initglfw ) <nl> : _captured ( false ) <nl> , _supportTouch ( false ) <nl> , _isInRetinaMonitor ( false ) <nl> GLViewImpl : : GLViewImpl ( ) <nl> } <nl> <nl> GLFWEventHandler : : setGLViewImpl ( this ) ; <nl> - <nl> - glfwSetErrorCallback ( GLFWEventHandler : : onGLFWError ) ; <nl> - glfwInit ( ) ; <nl> + if ( initglfw ) <nl> + { <nl> + glfwSetErrorCallback ( GLFWEventHandler : : onGLFWError ) ; <nl> + glfwInit ( ) ; <nl> + } <nl> } <nl> <nl> GLViewImpl : : ~ GLViewImpl ( ) <nl> mmm a / cocos / platform / desktop / CCGLViewImpl - desktop . h <nl> ppp b / cocos / platform / desktop / CCGLViewImpl - desktop . h <nl> class CC_DLL GLViewImpl : public GLView <nl> # endif / / # if ( CC_TARGET_PLATFORM = = CC_PLATFORM_MAC ) <nl> <nl> protected : <nl> - GLViewImpl ( ) ; <nl> + GLViewImpl ( bool initglfw = true ) ; <nl> virtual ~ GLViewImpl ( ) ; <nl> <nl> bool initWithRect ( const std : : string & viewName , Rect rect , float frameZoomFactor ) ; <nl> mmm a / cocos / renderer / CCGLProgram . cpp <nl> ppp b / cocos / renderer / CCGLProgram . cpp <nl> GLProgram : : ~ GLProgram ( ) <nl> { <nl> CCLOGINFO ( " % s % d deallocing GLProgram : % p " , __FUNCTION__ , __LINE__ , this ) ; <nl> <nl> - if ( _vertShader ) <nl> - { <nl> - glDeleteShader ( _vertShader ) ; <nl> - } <nl> - <nl> - if ( _fragShader ) <nl> - { <nl> - glDeleteShader ( _fragShader ) ; <nl> - } <nl> - <nl> - _vertShader = _fragShader = 0 ; <nl> + clearShader ( ) ; <nl> <nl> if ( _program ) <nl> { <nl> bool GLProgram : : link ( ) <nl> parseVertexAttribs ( ) ; <nl> parseUniforms ( ) ; <nl> <nl> - if ( _vertShader ) <nl> - { <nl> - glDeleteShader ( _vertShader ) ; <nl> - } <nl> - <nl> - if ( _fragShader ) <nl> - { <nl> - glDeleteShader ( _fragShader ) ; <nl> - } <nl> - <nl> - _vertShader = _fragShader = 0 ; <nl> + clearShader ( ) ; <nl> <nl> # if DEBUG | | ( CC_TARGET_PLATFORM = = CC_PLATFORM_WINRT ) <nl> glGetProgramiv ( _program , GL_LINK_STATUS , & status ) ; <nl> void GLProgram : : reset ( ) <nl> _hashForUniforms . clear ( ) ; <nl> } <nl> <nl> + inline void GLProgram : : clearShader ( ) <nl> + { <nl> + if ( _vertShader ) <nl> + { <nl> + glDeleteShader ( _vertShader ) ; <nl> + } <nl> + <nl> + if ( _fragShader ) <nl> + { <nl> + glDeleteShader ( _fragShader ) ; <nl> + } <nl> + <nl> + _vertShader = _fragShader = 0 ; <nl> + } <nl> + <nl> NS_CC_END <nl> <nl> mmm a / cocos / renderer / CCGLProgram . h <nl> ppp b / cocos / renderer / CCGLProgram . h <nl> class CC_DLL GLProgram : public Ref <nl> / * * Indicate whether it has a offline shader compiler or not . * / <nl> bool _hasShaderCompiler ; <nl> <nl> + inline void clearShader ( ) ; <nl> + <nl> struct flag_struct { <nl> unsigned int usesTime : 1 ; <nl> unsigned int usesNormal : 1 ; <nl> mmm a / cocos / renderer / CCVertexAttribBinding . h <nl> ppp b / cocos / renderer / CCVertexAttribBinding . h <nl> class VertexAttribValue ; <nl> * arrays , since it is slower than the server - side VAOs used by OpenGL <nl> * ( when creating a VertexAttribBinding between a Mesh and Effect ) . <nl> * / <nl> - class VertexAttribBinding : public Ref <nl> + class CC_DLL VertexAttribBinding : public Ref <nl> { <nl> public : <nl> <nl> mmm a / extensions / Particle3D / PU / CCPUScriptCompiler . h <nl> ppp b / extensions / Particle3D / PU / CCPUScriptCompiler . h <nl> class CC_DLL PUAbstractNode <nl> <nl> <nl> / * * This specific abstract node represents a script object * / <nl> - class PUObjectAbstractNode : public PUAbstractNode <nl> + class CC_DLL PUObjectAbstractNode : public PUAbstractNode <nl> { <nl> private : <nl> std : : map < std : : string , std : : string > _env ; <nl>
Merge pull request from xiaofeng11 / v3_combine_opengl
cocos2d/cocos2d-x
f6c275880157fe8c71146911004cc17a2b7144f5
2015-12-04T07:03:40Z
new file mode 100644 <nl> index 00000000000 . . 61fdbd36644 <nl> mmm / dev / null <nl> ppp b / test / js - perf - test / Strings / Strings . json <nl> <nl> + { <nl> + " path " : [ " . " ] , <nl> + " main " : " run . js " , <nl> + " flags " : [ " - - harmony - strings " ] , <nl> + " run_count " : 5 , <nl> + " units " : " score " , <nl> + " results_regexp " : " ^ % s \ \ - Strings \ \ ( Score \ \ ) : ( . + ) $ " , <nl> + " total " : true , <nl> + " tests " : [ <nl> + { " name " : " StringFunctions " } <nl> + ] <nl> + } <nl> new file mode 100644 <nl> index 00000000000 . . 1d401068c19 <nl> mmm / dev / null <nl> ppp b / test / js - perf - test / Strings / harmony - string . js <nl> <nl> + / / Copyright 2014 the V8 project authors . All rights reserved . <nl> + / / Use of this source code is governed by a BSD - style license that can be <nl> + / / found in the LICENSE file . <nl> + <nl> + new BenchmarkSuite ( ' StringFunctions ' , [ 1000 ] , [ <nl> + new Benchmark ( ' StringRepeat ' , false , false , 0 , <nl> + StringRepeat , StringRepeatSetup , StringRepeatTearDown ) , <nl> + new Benchmark ( ' StringStartsWith ' , false , false , 0 , <nl> + StringStartsWith , StringWithSetup , StringWithTearDown ) , <nl> + new Benchmark ( ' StringEndsWith ' , false , false , 0 , <nl> + StringEndsWith , StringWithSetup , StringWithTearDown ) , <nl> + new Benchmark ( ' StringContains ' , false , false , 0 , <nl> + StringContains , StringContainsSetup , StringWithTearDown ) , <nl> + ] ) ; <nl> + <nl> + <nl> + var result ; <nl> + <nl> + var stringRepeatSource = " abc " ; <nl> + <nl> + function StringRepeatSetup ( ) { <nl> + result = undefined ; <nl> + } <nl> + <nl> + function StringRepeat ( ) { <nl> + result = stringRepeatSource . repeat ( 500 ) ; <nl> + } <nl> + <nl> + function StringRepeatTearDown ( ) { <nl> + var expected = " " ; <nl> + for ( var i = 0 ; i < 1000 ; i + + ) { <nl> + expected + = stringRepeatSource ; <nl> + } <nl> + return result = = = expected ; <nl> + } <nl> + <nl> + <nl> + var str ; <nl> + var substr ; <nl> + <nl> + function StringWithSetup ( ) { <nl> + str = " abc " . repeat ( 500 ) ; <nl> + substr = " abc " . repeat ( 200 ) ; <nl> + result = undefined ; <nl> + } <nl> + <nl> + function StringWithTearDown ( ) { <nl> + return ! ! result ; <nl> + } <nl> + <nl> + function StringStartsWith ( ) { <nl> + result = str . startsWith ( substr ) ; <nl> + } <nl> + <nl> + function StringEndsWith ( ) { <nl> + result = str . endsWith ( substr ) ; <nl> + } <nl> + <nl> + function StringContainsSetup ( ) { <nl> + str = " def " . repeat ( 100 ) + " abc " . repeat ( 100 ) + " qqq " . repeat ( 100 ) ; <nl> + substr = " abc " . repeat ( 100 ) ; <nl> + } <nl> + <nl> + function StringContains ( ) { <nl> + result = str . contains ( substr ) ; <nl> + } <nl> new file mode 100644 <nl> index 00000000000 . . 79ca26e68a8 <nl> mmm / dev / null <nl> ppp b / test / js - perf - test / Strings / run . js <nl> <nl> + / / Copyright 2014 the V8 project authors . All rights reserved . <nl> + / / Use of this source code is governed by a BSD - style license that can be <nl> + / / found in the LICENSE file . <nl> + <nl> + <nl> + load ( ' . . / base . js ' ) ; <nl> + load ( ' harmony - string . js ' ) ; <nl> + <nl> + <nl> + var success = true ; <nl> + <nl> + function PrintResult ( name , result ) { <nl> + print ( name + ' - Strings ( Score ) : ' + result ) ; <nl> + } <nl> + <nl> + <nl> + function PrintError ( name , error ) { <nl> + PrintResult ( name , error ) ; <nl> + success = false ; <nl> + } <nl> + <nl> + <nl> + BenchmarkSuite . config . doWarmup = undefined ; <nl> + BenchmarkSuite . config . doDeterministic = undefined ; <nl> + <nl> + BenchmarkSuite . RunSuites ( { NotifyResult : PrintResult , <nl> + NotifyError : PrintError } ) ; <nl>
Perf tests for harmony string functions .
v8/v8
ac8b70cf2b91405f3be621460d300f371eb1c44f
2014-10-21T11:05:32Z
mmm a / src / mongo / shell / servers . js <nl> ppp b / src / mongo / shell / servers . js <nl> _parsePath = function ( ) { <nl> _parsePort = function ( ) { <nl> var port = " " ; <nl> for ( var i = 0 ; i < arguments . length ; + + i ) <nl> - if ( arguments [ i ] = = " - - port " ) <nl> - port = arguments [ i + 1 ] ; <nl> + if ( arguments [ i ] . startsWith ( " - - port " ) ) { <nl> + port = arguments [ i ] . split ( ' = ' ) [ 1 ] ; <nl> + } <nl> + <nl> <nl> if ( port = = " " ) <nl> throw " No port specified " ; <nl> MongoRunner . arrOptions = function ( binaryName , args ) { <nl> } <nl> else { <nl> if ( o [ k ] = = undefined | | o [ k ] = = null ) continue <nl> - fullArgs . push ( " - - " + k ) <nl> - if ( o [ k ] ! = " " ) <nl> - fullArgs . push ( " " + o [ k ] ) <nl> + var toPush = " - - " + k ; <nl> + if ( o [ k ] ! = " " ) { <nl> + toPush = toPush + " = " + o [ k ] ; <nl> + } <nl> + fullArgs . push ( toPush ) ; <nl> } <nl> } <nl> } <nl> MongoRunner . arrToOpts = function ( arr ) { <nl> for ( var i = 1 ; i < arr . length ; i + + ) { <nl> if ( arr [ i ] . startsWith ( " - " ) ) { <nl> var opt = arr [ i ] . replace ( / ^ - / , " " ) . replace ( / ^ - / , " " ) <nl> - <nl> - if ( arr . length > i + 1 & & ! arr [ i + 1 ] . startsWith ( " - " ) ) { <nl> - opts [ opt ] = arr [ i + 1 ] <nl> - i + + <nl> + <nl> + var eqIndex = opt . indexOf ( " = " ) ; <nl> + if ( eqIndex > 0 ) { <nl> + var key = opt . substring ( 0 , eqIndex ) ; <nl> + var value = opt . substring ( eqIndex + 1 ) ; <nl> + opts [ key ] = value ; <nl> } <nl> else { <nl> opts [ opt ] = " " <nl> mmm a / src / mongo / shell / shell_utils_launcher . cpp <nl> ppp b / src / mongo / shell / shell_utils_launcher . cpp <nl> <nl> # include < sys / wait . h > <nl> # endif <nl> <nl> + # include " mongo / base / parse_number . h " <nl> + # include " mongo / base / status . h " <nl> # include " mongo / client / clientOnly - private . h " <nl> # include " mongo / client / dbclientinterface . h " <nl> # include " mongo / scripting / engine . h " <nl> # include " mongo / shell / shell_utils . h " <nl> + # include " mongo / util / mongoutils / str . h " <nl> <nl> namespace mongo { <nl> <nl> namespace mongo { <nl> verify ( e . type ( ) = = mongo : : String ) ; <nl> str = e . valuestr ( ) ; <nl> } <nl> - if ( str = = " - - port " ) <nl> - _port = - 2 ; <nl> - else if ( _port = = - 2 ) <nl> - _port = strtol ( str . c_str ( ) , 0 , 10 ) ; <nl> + if ( mongoutils : : str : : startsWith ( str , " - - port = " ) ) { <nl> + std : : string portStr = mongoutils : : str : : after ( str , " - - port = " ) ; <nl> + Status status = parseNumberFromStringWithBase ( portStr , 10 , & _port ) ; <nl> + uassert ( 16561 , <nl> + mongoutils : : str : : stream ( ) < < " Invalid port : " < < portStr , <nl> + status . isOK ( ) ) ; <nl> + } <nl> + <nl> _argv . push_back ( str ) ; <nl> } <nl> <nl>
Change flag separator from space to equal sign for launching programs from shell
mongodb/mongo
b32467dcd74c741d833a9bb349b0c8a4f3ee8b50
2012-12-11T16:30:58Z
mmm a / doc / SUMMARY . md <nl> ppp b / doc / SUMMARY . md <nl> <nl> * [ Communications ] ( / syntax / comm . md ) <nl> * [ Page Config & Data ] ( / syntax / config - n - data . md ) <nl> * [ How - tos ] ( / how - to / main . md ) <nl> - * [ Require 3rd - party Libs ] ( / how - to / require - 3rd - party - libs . md ) <nl> * [ Preview In Browser ] ( / how - to / preview - in - browser . md ) <nl> * [ Preview in Native ] ( / how - to / preview - in - playground - app . md ) <nl> * [ Customize a native Component ] ( / how - to / customize - a - native - component . md ) <nl> <nl> * [ web ] ( / components / web . md ) <nl> * [ wxc - tabbar ] ( / components / wxc - tabbar . md ) <nl> * [ wxc - navpage ] ( / components / wxc - navpage . md ) <nl> - * [ Built - in Modules ] ( / modules / README . md ) <nl> + * [ Built - in Modules ] ( / modules / main . md ) <nl> * [ dom ] ( / modules / dom . md ) <nl> * [ stream ] ( / modules / stream . md ) <nl> * [ modal ] ( / modules / modal . md ) <nl> <nl> * [ JS Bundle Format ] ( / specs / js - bundle - format . md ) <nl> * [ JS Framework APIs ] ( / specs / js - framework - apis . md ) <nl> * [ Virtual DOM APIs ] ( / specs / virtual - dom - apis . md ) <nl> - * [ Examples ] ( demo / main . md ) <nl> + * Examples <nl> * [ Hello World ] ( demo / hello - world . md ) <nl> * [ Modal ] ( demo / modal . md ) <nl> * [ List ] ( demo / list . md ) <nl> * [ Slider ] ( demo / slider . md ) <nl> * [ Animation ] ( demo / animation . md ) <nl> * [ More ] ( https : / / github . com / alibaba / weex / tree / dev / examples ) <nl> - <nl> - * [ Service & Tools ] ( / tools / main . md ) <nl> + <nl> + * Service & Tools <nl> * [ CLI ] ( / tools / cli . md ) <nl> * [ Transformer ] ( / tools / transformer . md ) <nl> * [ Playground App ] ( / tools / playground - app . md ) <nl> deleted file mode 100644 <nl> index b59e0fe865 . . 0000000000 <nl> mmm a / doc / advanced / README . md <nl> ppp / dev / null <nl> <nl> - # Advanced <nl> - <nl> - * [ How It Works ] ( . / how - it - works . md ) <nl> - * [ How Data Binding Works ] ( . / how - data - binding - works . md ) <nl> - * [ Integrate to iOS ] ( . / integrate - to - ios . md ) <nl> - * [ Extend to iOS ] ( . / extend - to - ios . md ) <nl> - * [ Integrate to Android ] ( . / integrate - to - android . md ) <nl> - * [ Extend to Android ] ( . / extend - to - android . md ) <nl> mmm a / doc / advanced / main . md <nl> ppp b / doc / advanced / main . md <nl> <nl> # Advanced <nl> <nl> - * [ How It Works ] ( . / how - it - works . md ) <nl> - * [ How Data Binding Works ] ( . / how - data - binding - works . md ) <nl> - * [ Integrate to iOS ] ( . / integrate - to - ios . md ) <nl> - * [ Extend to iOS ] ( . / extend - to - ios . md ) <nl> - * [ Integrate to Android ] ( . / integrate - to - android . md ) <nl> - * [ Extend to Android ] ( . / extend - to - android . md ) <nl> + You will learn how Weex works and how to integrate and extend Weex . <nl> \ No newline at end of file <nl> deleted file mode 100644 <nl> index 9a4eff5b2a . . 0000000000 <nl> mmm a / doc / components / README . md <nl> ppp / dev / null <nl> <nl> - # Build - in Components <nl> - <nl> - Before see all built - in components , let ' s have a look at the common things about component . <nl> - <nl> - * [ Common Attributes ] ( . . / references / common - attrs . md ) <nl> - * [ Common Style ] ( . . / references / common - style . md ) <nl> - * [ Common Event ] ( . . / references / common - event . md ) <nl> - <nl> - * * Special Element * * <nl> - <nl> - * [ & lt ; content & gt ; / & lt ; slot & gt ; ] ( . / special - element . md ) <nl> - <nl> - * * Component List * * <nl> - <nl> - * [ & lt ; div & gt ; ] ( . / div . md ) <nl> - * [ & lt ; scroller & gt ; ] ( . / scroller . md ) <nl> - * [ & lt ; list & gt ; ] ( . / list . md ) <nl> - * [ & lt ; cell & gt ; ] ( . / cell . md ) <nl> - * [ & lt ; text & gt ; ] ( . / text . md ) <nl> - * [ & lt ; image & gt ; ] ( . / image . md ) <nl> - * [ & lt ; input & gt ; ] ( . / input . md ) <nl> - * [ & lt ; switch & gt ; ] ( . / switch . md ) <nl> - * [ & lt ; slider & gt ; ] ( . / slider . md ) <nl> - * [ & lt ; indicator & gt ; ] ( . / indicator . md ) <nl> - * [ & lt ; video & gt ; ] ( . / video . md ) <nl> - * [ & lt ; web & gt ; ] ( . / web . md ) <nl> - * [ & lt ; wxc - navpage & gt ; ] ( . / wxc - navpage . md ) <nl> - * [ & lt ; wxc - navbar & gt ; ] ( . / wxc - navbar . md ) <nl> \ No newline at end of file <nl> mmm a / doc / components / main . md <nl> ppp b / doc / components / main . md <nl> <nl> # Build - in Components <nl> <nl> - Before see all built - in components , let ' s have a look at the common things about component . <nl> - <nl> - * [ Common Attributes ] ( . . / references / common - attrs . md ) <nl> - * [ Common Style ] ( . . / references / common - style . md ) <nl> - * [ Common Event ] ( . . / references / common - event . md ) <nl> - <nl> - * * Special Element * * <nl> - <nl> - * [ & lt ; content & gt ; / & lt ; slot & gt ; ] ( . / special - element . md ) <nl> - <nl> - * * Component List * * <nl> - <nl> - * [ & lt ; div & gt ; ] ( . / div . md ) <nl> - * [ & lt ; scroller & gt ; ] ( . / scroller . md ) <nl> - * [ & lt ; list & gt ; ] ( . / list . md ) <nl> - * [ & lt ; cell & gt ; ] ( . / cell . md ) <nl> - * [ & lt ; text & gt ; ] ( . / text . md ) <nl> - * [ & lt ; image & gt ; ] ( . / image . md ) <nl> - * [ & lt ; input & gt ; ] ( . / input . md ) <nl> - * [ & lt ; switch & gt ; ] ( . / switch . md ) <nl> - * [ & lt ; slider & gt ; ] ( . / slider . md ) <nl> - * [ & lt ; indicator & gt ; ] ( . / indicator . md ) <nl> - * [ & lt ; video & gt ; ] ( . / video . md ) <nl> + Reference for builtin components and common attributes / style / events / text - style are also introduced . <nl> \ No newline at end of file <nl> mmm a / doc / demo / main . md <nl> ppp b / doc / demo / main . md <nl> <nl> # Examples <nl> <nl> - * [ Hello World ] ( . / hello - world . md ) <nl> + [ Weex examples ] ( https : / / github . com / alibaba / weex / tree / dev / examples ) . <nl> \ No newline at end of file <nl> mmm a / doc / guide . md <nl> ppp b / doc / guide . md <nl> <nl> # Guide <nl> - * [ Tutorial ] ( tutorial . md ) <nl> - * [ Syntax ] ( syntax / main . md ) <nl> - * [ Data Binding ] ( syntax / data - binding . md ) <nl> - * [ Style and Class ] ( syntax / style - n - class . md ) <nl> - * [ Events ] ( syntax / events . md ) <nl> - * [ Display Logic Control ] ( syntax / display - logic . md ) <nl> - * [ Render Logic Control ] ( syntax / render - logic . md ) <nl> - * [ Composed Component ] ( syntax / composed - component . md ) <nl> - * [ Find an Element ] ( syntax / id . md ) <nl> - * [ Communications ] ( syntax / comm . md ) <nl> - * [ Page Config & Data ] ( syntax / config - n - data . md ) <nl> - * [ How - tos ] ( how - to / main . md ) <nl> - * [ Manage Your File Structure ] ( how - to / manage - your - file - structure . md ) <nl> - * [ Maintain Your Component Code ] ( how - to / maintain - your - component - code . md ) <nl> - * [ Require 3rd - party Libs ] ( how - to / require - 3rd - party - libs . md ) <nl> - * [ Transform Code Into JS Bundle ] ( how - to / transform - code - into - js - bundle . md ) <nl> - * [ Preview in Browser ] ( how - to / preview - in - browser . md ) <nl> - * [ Preview in Playground App ] ( how - to / preview - in - playground - app . md ) <nl> - * [ Customize a Native Component ] ( how - to / customize - a - native - component . md ) <nl> - * [ Customize Native APIs ] ( how - to / cuszomize - native - apis . md ) <nl> - * [ Debug with HTML5 ] ( how - to / debug - with - html5 . md ) <nl> - * [ Debug with Native ] ( how - to / debug - with - native . md ) <nl> - * [ Debug with Remote Tools ] ( how - to / debug - with - remote - tools . md ) <nl> - * [ Manage Data with a High - level CMS ] ( how - to / manage - data - with - a - high - level - cms . md ) <nl> - * [ Advanced ] ( advanced / main . md ) <nl> - * [ How It Works ] ( advanced / how - it - works . md ) <nl> - * [ How Data Binding Works ] ( advanced / how - data - binding - works . md ) <nl> - * [ Integrate to iOS ] ( advanced / integrate - to - ios . md ) <nl> - * [ Extend to iOS ] ( advanced / extend - to - ios . md ) <nl> - * [ Integrate to Android ] ( advanced / integrate - to - android . md ) <nl> - * [ Extend to Android ] ( advanced / extend - to - android . md ) <nl> - * [ Integrate to HTML5 ] ( advanced / integrate - to - html5 . md ) <nl> - * [ Extend to HTML5 ] ( advanced / extend - to - html5 . md ) <nl> + <nl> + * * * Keep calm and code on . * * * <nl> deleted file mode 100644 <nl> index 00405933a5 . . 0000000000 <nl> mmm a / doc / how - to / README . md <nl> ppp / dev / null <nl> <nl> - # How - tos <nl> - <nl> - * [ Manage Your File Structure ] ( . / manage - your - file - structure . md ) <nl> - * [ Maintain Your Component Code ] ( . / maintain - your - component - code . md ) <nl> - * [ Require 3rd - party Libs ] ( . / require - 3rd - party - libs . md ) <nl> - * [ Transform Code Into JS Bundle ] ( . / transform - code - into - js - bundle . md ) <nl> - * [ Preview in Browser ] ( . / preview - in - browser . md ) <nl> - * [ Preview in Playground App ] ( . / preview - in - playground - app . md ) <nl> - * [ Customize a Native Component ] ( . / customize - a - native - component . md ) <nl> - * [ Customize Native APIs ] ( . / cuszomize - native - apis . md ) <nl> - * [ Debug with HTML5 ] ( . / debug - with - html5 . md ) <nl> - * [ Debug with Native ] ( . / debug - with - native . md ) <nl> - * [ Debug with Remote Tools ] ( . / debug - with - remote - tools . md ) <nl> - * [ Manage Data with a High - level CMS ] ( . / manage - data - with - a - high - level - cms . md ) <nl> \ No newline at end of file <nl> mmm a / doc / how - to / main . md <nl> ppp b / doc / how - to / main . md <nl> <nl> # How - tos <nl> <nl> - * [ Require 3rd - party Libs ] ( . / require - 3rd - party - libs . md ) <nl> - * [ Preview In Browser ] ( . / preview - in - browser . md ) <nl> - * [ Preview in Native ] ( . / preview - in - playground - app . md ) <nl> - * [ Customize a native Component ] ( . / customize - a - native - component . md ) <nl> - * [ Customize native APIs ] ( . / cuszomize - native - apis . md ) <nl> - * [ Debug in html5 renderer ] ( . / debug - with - html5 . md ) <nl> - * [ Require 3rd Party Libs ] ( . / require - 3rd - party - libs . md ) <nl> - * [ Transform Code Into JS Bundle ] ( . / transform - code - into - js - bundle . md ) <nl> + You will learn how to preview and debug in native and html5 , how to require external js libs and more . <nl> similarity index 62 % <nl> rename from doc / modules / README . md <nl> rename to doc / modules / main . md <nl> mmm a / doc / modules / README . md <nl> ppp b / doc / modules / main . md <nl> var dom = require ( ' @ weex - module / dom ' ) ; <nl> dom . scrollToElement ( this . $ el ( ' someIdForElement ' ) , { <nl> offset : 0 <nl> } ) ; <nl> - ` ` ` <nl> - <nl> - # # Table of Contents <nl> - <nl> - * [ dom ] ( . / dom . md ) <nl> - * [ stream ] ( . / stream . md ) <nl> - * [ modal ] ( . / modal . md ) <nl> - * [ animation ] ( . / animation . md ) <nl> - * [ navigator ] ( . / navigator . md ) <nl> - * [ webview ] ( . / webview . md ) <nl> + ` ` ` <nl> \ No newline at end of file <nl> deleted file mode 100644 <nl> index b963b6357f . . 0000000000 <nl> mmm a / doc / references / README . md <nl> ppp / dev / null <nl> <nl> - # References <nl> - <nl> - * [ Bootstrap ] ( . / bootstrap . md ) <nl> - * [ Component Definition ] ( . / component - defs . md ) <nl> - * [ Instance APIs ] ( . / api . md ) <nl> - * [ Built - in Components ] ( . . / components / README . md ) <nl> - * [ Common Attributes ] ( . / common - attrs . md ) <nl> - * [ Common Style ] ( . / common - style . md ) <nl> - * [ Common Event ] ( . / common - event . md ) <nl> - * [ Special Element ] ( . . / components / special - element . md ) <nl> - * [ & lt ; div & gt ; ] ( . . / components / div . md ) <nl> - * [ & lt ; scroller & gt ; ] ( . . / components / scroller . md ) <nl> - * [ & lt ; list & gt ; ] ( . . / components / list . md ) <nl> - * [ & lt ; cell & gt ; ] ( . . / components / cell . md ) <nl> - * [ & lt ; text & gt ; ] ( . . / components / text . md ) <nl> - * [ & lt ; image & gt ; ] ( . . / components / image . md ) <nl> - * [ & lt ; input & gt ; ] ( . . / components / input . md ) <nl> - * [ & lt ; switch & gt ; ] ( . . / components / switch . md ) <nl> - * [ & lt ; slider & gt ; ] ( . . / components / slider . md ) <nl> - * [ & lt ; indicator & gt ; ] ( . . / components / indicator . md ) <nl> - * [ & lt ; video & gt ; ] ( . . / components / video . md ) <nl> - * [ Built - in Modules ] ( . . / modules / README . md ) <nl> - * Low - level Specs <nl> - * [ JS Bundle Format ] ( . . / specs / js - bundle - format . md ) <nl> - * [ JS Framework APIs ] ( . . / specs / js - framework - apis . md ) <nl> - * [ Virtual DOM APIs ] ( . . / specs / virtual - dom - apis . md ) <nl> mmm a / doc / references / main . md <nl> ppp b / doc / references / main . md <nl> <nl> # References <nl> <nl> - * [ Bootstrap ] ( . / bootstrap . md ) <nl> - * [ Component Definition ] ( . / component - defs . md ) <nl> - * [ Instance APIs ] ( . / api . md ) <nl> - * [ Built - in Components ] ( . . / components / main . md ) <nl> - * [ Common Attributes ] ( . / common - attrs . md ) <nl> - * [ Common Style ] ( . / common - style . md ) <nl> - * [ Common Event ] ( . / common - event . md ) <nl> - * [ Special Element ] ( . . / components / special - element . md ) <nl> - * [ & lt ; div & gt ; ] ( . . / components / div . md ) <nl> - * [ & lt ; scroller & gt ; ] ( . . / components / scroller . md ) <nl> - * [ & lt ; list & gt ; ] ( . . / components / list . md ) <nl> - * [ & lt ; cell & gt ; ] ( . . / components / cell . md ) <nl> - * [ & lt ; text & gt ; ] ( . . / components / text . md ) <nl> - * [ & lt ; image & gt ; ] ( . . / components / image . md ) <nl> - * [ & lt ; input & gt ; ] ( . . / components / input . md ) <nl> - * [ & lt ; switch & gt ; ] ( . . / components / switch . md ) <nl> - * [ & lt ; slider & gt ; ] ( . . / components / slider . md ) <nl> - * [ & lt ; indicator & gt ; ] ( . . / components / indicator . md ) <nl> - * [ & lt ; video & gt ; ] ( . . / components / video . md ) <nl> - * [ Built - in Modules ] ( . . / modules / main . md ) <nl> - * Low - level Specs <nl> - * [ JS Bundle Format ] ( . . / specs / js - bundle - format . md ) <nl> - * [ JS Framework APIs ] ( . . / specs / js - framework - apis . md ) <nl> - * [ Virtual DOM APIs ] ( . . / specs / virtual - dom - apis . md ) <nl> + Code more . <nl> deleted file mode 100644 <nl> index fff6971cc9 . . 0000000000 <nl> mmm a / doc / syntax / README . md <nl> ppp / dev / null <nl> <nl> - # Syntax <nl> - <nl> - A simple Weex page sample is just a piece of ` < template > ` code , a piece of ` < style > ` code and a piece of ` < script > ` code . The three parts together describe a whole Weex page . <nl> - <nl> - - ` < template > ` : * required * . Just uses HTML syntax and describes the structure of a Weex page , which is build upon several tags . Each tag means a type of * component * . <nl> - - ` < style > ` : * optional * . Describes the presetation details , and the content is based on CSS syntax . <nl> - - ` < script > ` : * optional * . Describes the data and behaiver with JavaScript syntax . It defines data and how these data are processed etc . <nl> - <nl> - ` ` ` html <nl> - < template > <nl> - < ! - - ( required ) the structure of page - - > <nl> - < / template > <nl> - <nl> - < style > <nl> - / * ( optional ) stylesheet * / <nl> - < / style > <nl> - <nl> - < script > <nl> - / * ( optional ) the definition of data , methods and life - circle * / <nl> - < / script > <nl> - ` ` ` <nl> - <nl> - # # ` < template > ` <nl> - <nl> - We describe page structure in ` < template > ` tag like the following definition : <nl> - <nl> - ` ` ` html <nl> - < template > <nl> - < container > <nl> - < image style = " width : 200 ; height : 200 ; " src = " http : / / gtms02 . alicdn . com / tps / i2 / TB1QHKjMXXXXXadXVXX20ySQVXX - 512 - 512 . png " > < / image > <nl> - < text > Alibaba Weex Team < / text > <nl> - < / container > <nl> - < / template > <nl> - ` ` ` <nl> - <nl> - Here ` container ` tag is the root element of the component . ` image ` tag describes a picture , while ` text ` tag means a paragraph of text . <nl> - <nl> - Just similar to HTML , each component could have its own attributes , some components also have children as their sub components . <nl> - <nl> - The root element of template : In a ` template ` tag , there could be only one root component which has no display logics directive . Here are three types of root component we support now : <nl> - <nl> - - ` < container > ` : a common native container <nl> - - ` < scroller > ` : a native scroll view <nl> - - ` < list > ` : a native cell - reusable list view <nl> - <nl> - Only these type of components are allowed for root element . <nl> - <nl> - * [ See all built - in components ] ( . . / components / README . md ) . <nl> - <nl> - # # ` < style > ` <nl> - <nl> - You can consider the Weex style syntax is a subset of the CSS syntax , but there is still some differences . <nl> - <nl> - First we could write inline ` style ` attribute in ` < template > ` element . Second we could use the ` class ` attribute to apply stylesheets , which are defined with single - class selectors in ` < style > ` code . Here is an example : <nl> - <nl> - ` ` ` html <nl> - < template > <nl> - < container > <nl> - < text style = " font - size : 64 ; " > Alibaba < / text > <nl> - < text class = " large " > Weex Team < / text > <nl> - < / container > <nl> - < / template > <nl> - <nl> - < style > <nl> - . large { font - size : 64 ; } <nl> - < / style > <nl> - ` ` ` <nl> - <nl> - Both the two ` text ` components above have the same ` font - size ` , which is ` 64 ` pixel . <nl> - <nl> - * [ See common styles in Weex ] ( . . / references / common - style . md ) <nl> - <nl> - # # ` < script > ` <nl> - <nl> - The syntax is JavaScript ( ES5 ) and it describes data and behavior of a Weex page . Here we create three paragraphs : <nl> - <nl> - ` ` ` html <nl> - < template > <nl> - < container > <nl> - < text > The time is { { datetime } } < / text > <nl> - < text > { { title } } < / text > <nl> - < text > { { getTitle ( ) } } < / text > <nl> - < / container > <nl> - < / template > <nl> - <nl> - < script > <nl> - module . exports = { <nl> - data : { <nl> - title : ' Alibaba ' , <nl> - date : null <nl> - } , <nl> - methods : { <nl> - getTitle : function ( ) { <nl> - return ' Weex Team ' <nl> - } <nl> - } , <nl> - created : function ( ) { <nl> - this . datetime = new Date ( ) . toLocaleString ( ) <nl> - } <nl> - } <nl> - < / script > <nl> - ` ` ` <nl> - <nl> - This piece of ` < script > ` code will generate some component options and assign it to ` module . exports ` . The three text components above respectively shows the current datetime , ' Alibaba ' and ' Weex Team ' . The ` data ` in the ` < script > ` code stores component data which could be used for [ data - binding ] ( . / data - binding . md ) in the ` < template > ` . When data changes , the bound value will be updated automatically . Also it could be read and written by ` this . x ` in its methods . <nl> - <nl> - * [ See component definitions references ] ( . . / references / component - defs . md ) <nl> - <nl> - Next , let ' s have a look at [ data - binding ] ( . / data - binding . md ) . <nl> deleted file mode 100644 <nl> index 69900869f3 . . 0000000000 <nl> mmm a / doc / tools / README . md <nl> ppp / dev / null <nl> <nl> - # Service & Tools <nl> - <nl> - * [ CLI ] ( . / cli . md ) <nl> - * [ Transformer ] ( . / transformer . md ) <nl> - * [ Playground App ] ( . / playground - app . md ) <nl> mmm a / doc / tools / main . md <nl> ppp b / doc / tools / main . md <nl> <nl> # Service & Tools <nl> <nl> - * [ CLI ] ( . / cli . md ) <nl> - * [ Transformer ] ( . / transformer . md ) <nl> - * [ Playground App ] ( . / playground - app . md ) <nl> - * [ How - to - debug ] ( . / how - to - debug . md ) <nl> + Debug , playground app , transformer and more . <nl> \ No newline at end of file <nl>
Merge pull request from alibaba / doc - feature - reduce
apache/incubator-weex
af56c27a2b101bfa06991bc10b34d1899a341078
2016-06-27T02:26:55Z
mmm a / xbmc / utils / AddonManager . h <nl> ppp b / xbmc / utils / AddonManager . h <nl> namespace ADDON <nl> typedef std : : map < TYPE , VECADDONS > MAPADDONS ; <nl> <nl> const int ADDON_DIRSCAN_FREQ = 300 ; <nl> - const CStdString ADDON_XBMC_REPO_URL = " http : / / mirrors . xbmc . org / addons / addons . xml " ; <nl> + const CStdString ADDON_XBMC_REPO_URL = " " ; <nl> const CStdString ADDON_METAFILE = " description . xml " ; <nl> const CStdString ADDON_VIS_EXT = " * . vis " ; <nl> const CStdString ADDON_PYTHON_EXT = " * . py " ; <nl>
removed : temporary repo url
xbmc/xbmc
2facc63949b1e1b03dddfdbf50b5a17ebccbfb0f
2010-03-02T05:13:10Z
mmm a / hphp / hack / src / utils / hh_json / hh_json . ml <nl> ppp b / hphp / hack / src / utils / hh_json / hh_json . ml <nl> let get_number_exn = function <nl> | JSON_Number s - > s <nl> | _ - > assert false <nl> <nl> + let get_number_int_exn = function <nl> + | JSON_Number s - > int_of_string s <nl> + | _ - > assert false <nl> + <nl> let get_bool_exn = function <nl> | JSON_Bool b - > b <nl> | _ - > assert false <nl> type json_type = <nl> | Array_t <nl> | String_t <nl> | Number_t <nl> + | Integer_t <nl> | Bool_t <nl> <nl> let json_type_to_string = function <nl> let json_type_to_string = function <nl> | Array_t - > " Array " <nl> | String_t - > " String " <nl> | Number_t - > " Number " <nl> + | Integer_t - > " Integer " <nl> | Bool_t - > " Bool " <nl> <nl> module type Access = sig <nl> module type Access = sig <nl> val get_bool : string - > json * keytrace - > bool m <nl> val get_string : string - > json * keytrace - > string m <nl> val get_number : string - > json * keytrace - > string m <nl> + val get_number_int : string - > json * keytrace - > int m <nl> val get_array : string - > json * keytrace - > ( json list ) m <nl> val get_val : string - > json * keytrace - > json m <nl> end <nl> module Access = struct <nl> <nl> let catch_type_error exp f ( v , keytrace ) = <nl> try Result . Ok ( f v , keytrace ) with <nl> + | Failure msg when ( String . equal " int_of_string " msg ) - > <nl> + Result . Error ( Wrong_type_error ( keytrace , exp ) ) <nl> | Assert_failure _ - > <nl> Result . Error ( Wrong_type_error ( keytrace , exp ) ) <nl> <nl> module Access = struct <nl> let get_number k ( v , keytrace ) = <nl> get_val k ( v , keytrace ) > > = catch_type_error Number_t get_number_exn <nl> <nl> + let get_number_int k ( v , keytrace ) = <nl> + get_val k ( v , keytrace ) > > = catch_type_error Integer_t get_number_int_exn <nl> + <nl> let get_array k ( v , keytrace ) = <nl> get_val k ( v , keytrace ) > > = catch_type_error Array_t get_array_exn <nl> end <nl> mmm a / hphp / hack / src / utils / hh_json / hh_json . mli <nl> ppp b / hphp / hack / src / utils / hh_json / hh_json . mli <nl> val get_object_exn : json - > ( string * json ) list <nl> val get_array_exn : json - > json list <nl> val get_string_exn : json - > string <nl> val get_number_exn : json - > string <nl> + val get_number_int_exn : json - > int <nl> val get_bool_exn : json - > bool <nl> <nl> val opt_string_to_json : string option - > json <nl> type json_type = <nl> | Array_t <nl> | String_t <nl> | Number_t <nl> + | Integer_t <nl> | Bool_t <nl> <nl> ( * * <nl> type json_type = <nl> * with the appropriate error and the history of key accesses that arrived <nl> * there ( so you can trace how far it went successfully and exactly where the <nl> * error was encountered ) . <nl> + * <nl> + * Same goes for accessing multiple fields within one object . <nl> + * Suppose we have a record type : <nl> + * type fbz_record = { <nl> + * foo : bool ; <nl> + * bar : string ; <nl> + * baz : int ; <nl> + * } <nl> + * <nl> + * And we have JSON as a string : <nl> + * let data = <nl> + * " { \ n " ^ <nl> + * " \ " foo \ " : true , \ n " ^ <nl> + * " \ " bar \ " : \ " hello \ " , \ n " ^ <nl> + * " \ " baz \ " : 5 \ n " ^ <nl> + * " } " <nl> + * in <nl> + * <nl> + * We parse the JSON , monadically access the fields we want , and fill in the <nl> + * record by doing : <nl> + * <nl> + * let json = Hh_json_json_of_string data in <nl> + * let open Hh_json . Access in <nl> + * let accessor = return json in <nl> + * let result = <nl> + * accessor > > = get_bool " foo " > > = fun ( foo , _ ) - > <nl> + * accessor > > = get_string " bar " > > = fun ( bar , _ ) - > <nl> + * accessor > > = get_number_int " baz " > > = fun ( baz , _ ) - > <nl> + * return { <nl> + * foo ; <nl> + * bar ; <nl> + * baz ; <nl> + * } <nl> + * in <nl> + * <nl> + * The result will be the record type inside the Result monad . <nl> + * <nl> + * match result with <nl> + * | Result . Ok ( v , _ ) - > <nl> + * Printf . eprintf " Got baz : % d " v . baz <nl> + * | Result . Error access_failure - > <nl> + * Printf . eprintf " JSON failure : % s " <nl> + * ( access_failure_to_string access_failure ) <nl> + * <nl> + * See unit tests for more examples . <nl> * ) <nl> module type Access = sig <nl> type keytrace = string list <nl> module type Access = sig <nl> val get_bool : string - > json * keytrace - > bool m <nl> val get_string : string - > json * keytrace - > string m <nl> val get_number : string - > json * keytrace - > string m <nl> + val get_number_int : string - > json * keytrace - > int m <nl> val get_array : string - > json * keytrace - > ( json list ) m <nl> val get_val : string - > json * keytrace - > json m ( * any expected type * ) <nl> end <nl> mmm a / hphp / hack / test / unit / utils / hh_json_test . ml <nl> ppp b / hphp / hack / test / unit / utils / hh_json_test . ml <nl> let test_access_object_error_in_middle ( ) = <nl> | _ - > <nl> false <nl> <nl> + type fbz_record = { <nl> + foo : bool ; <nl> + bar : string ; <nl> + baz : int ; <nl> + } <nl> + <nl> + let test_access_3_keys_one_object ( ) = <nl> + let json = Hh_json . json_of_string ( <nl> + " { \ n " ^ <nl> + " \ " foo \ " : true , \ n " ^ <nl> + " \ " bar \ " : \ " hello \ " , \ n " ^ <nl> + " \ " baz \ " : 5 \ n " ^ <nl> + " } " <nl> + ) in <nl> + let open Hh_json . Access in <nl> + let accessor = return json in <nl> + let result = <nl> + accessor > > = get_bool " foo " > > = fun ( foo , _ ) - > <nl> + accessor > > = get_string " bar " > > = fun ( bar , _ ) - > <nl> + accessor > > = get_number_int " baz " > > = fun ( baz , _ ) - > <nl> + return { <nl> + foo ; <nl> + bar ; <nl> + baz ; <nl> + } <nl> + in <nl> + match result with <nl> + | Result . Error access_failure - > <nl> + Printf . eprintf " Error failed to parse . See : % s \ n " <nl> + ( access_failure_to_string access_failure ) ; <nl> + false <nl> + | Result . Ok ( v , _ ) - > <nl> + Asserter . Bool_asserter . assert_equals v . foo true " foo value mismatch " ; <nl> + Asserter . String_asserter . assert_equals v . bar " hello " " bar value mismatch " ; <nl> + Asserter . Int_asserter . assert_equals v . baz 5 " baz value mismatch " ; <nl> + true <nl> + <nl> + ( * * We access exactly as we do above , but " bar " actually is an array instead <nl> + * of a string , so we should expect to get a Result . Error . * ) <nl> + let test_access_3_keys_one_object_wrong_type_middle ( ) = <nl> + let json = Hh_json . json_of_string ( <nl> + " { \ n " ^ <nl> + " \ " foo \ " : true , \ n " ^ <nl> + " \ " bar \ " : [ ] , \ n " ^ <nl> + " \ " baz \ " : 5 \ n " ^ <nl> + " } " <nl> + ) in <nl> + let open Hh_json . Access in <nl> + let accessor = return json in <nl> + let result = <nl> + accessor > > = get_bool " foo " > > = fun ( foo , _ ) - > <nl> + accessor > > = get_string " bar " > > = fun ( bar , _ ) - > <nl> + accessor > > = get_number_int " baz " > > = fun ( baz , _ ) - > <nl> + return { <nl> + foo ; <nl> + bar ; <nl> + baz ; <nl> + } <nl> + in <nl> + match result with <nl> + | Result . Error access_failure - > <nl> + Asserter . String_asserter . assert_equals <nl> + " Value expected to be String ( at field [ bar ] ) " <nl> + ( access_failure_to_string access_failure ) <nl> + " Not the access failure we expected " ; <nl> + true <nl> + | Result . Ok ( v , _ ) - > <nl> + Printf . eprintf " Expected failure , but successfully traversed json . \ n " ; <nl> + false <nl> + <nl> let tests = [ <nl> " test_escape_unescape " , test_escape_unescape ; <nl> " test_empty_string " , test_empty_string ; <nl> let tests = [ <nl> " test_access_object_key_doesnt_exit " , test_access_object_key_doesnt_exist ; <nl> " test_access_object_type_invalid " , test_access_object_type_invalid ; <nl> " test_access_object_error_in_middle " , test_access_object_error_in_middle ; <nl> + " test_access_3_keys_on_object " , test_access_3_keys_one_object ; <nl> + " test_access_3_keys_one_object_wrong_type_middle " , <nl> + test_access_3_keys_one_object_wrong_type_middle ; <nl> ] <nl> <nl> let ( ) = <nl> mmm a / hphp / hack / test / utils / asserter / asserter . ml <nl> ppp b / hphp / hack / test / utils / asserter / asserter . ml <nl> module Int_comparator = struct <nl> end ; ; <nl> <nl> <nl> + module Bool_comparator = struct <nl> + type t = bool <nl> + let to_string x = string_of_bool x <nl> + let is_equal x y = match x , y with <nl> + | true , true - > true <nl> + | false , false - > true <nl> + | true , false - > false <nl> + | false , true - > false <nl> + end <nl> + <nl> + <nl> module Recorder_event_comparator = struct <nl> type t = Recorder_types . event <nl> let to_string x = Recorder_types . to_string x <nl> end ; ; <nl> <nl> <nl> module String_asserter = Make_asserter ( String_comparator ) ; ; <nl> + module Bool_asserter = Make_asserter ( Bool_comparator ) ; ; <nl> module Int_asserter = Make_asserter ( Int_comparator ) ; ; <nl> module Process_status_asserter = Make_asserter ( Process_status_comparator ) ; ; <nl> module Recorder_event_asserter = Make_asserter ( Recorder_event_comparator ) ; ; <nl>
More Hh_json . Access monad examples
facebook/hhvm
ad3711465d3d25bac6b9dfad35ca46497d233250
2017-04-07T01:45:24Z
new file mode 100644 <nl> index 000000000000 . . 726ad18e7828 <nl> mmm / dev / null <nl> ppp b / samples / Lua / TestLua / Resources / luaScript / IntervalTest / IntervalTest . lua <nl> <nl> + local scheduler = CCDirector : sharedDirector ( ) : getScheduler ( ) <nl> + local SID_STEP1 = 100 <nl> + local SID_STEP2 = 101 <nl> + local SID_STEP3 = 102 <nl> + local IDC_PAUSE = 200 <nl> + <nl> + local function IntervalLayer ( ) <nl> + local ret = CCLayer : create ( ) <nl> + local m_time0 = 0 <nl> + local m_time1 = 0 <nl> + local m_time2 = 0 <nl> + local m_time3 = 0 <nl> + local m_time4 = 0 <nl> + <nl> + local s = CCDirector : sharedDirector ( ) : getWinSize ( ) <nl> + - - sun <nl> + local sun = CCParticleSun : create ( ) <nl> + sun : setTexture ( CCTextureCache : sharedTextureCache ( ) : addImage ( " Images / fire . png " ) ) <nl> + sun : setPosition ( ccp ( VisibleRect : rightTop ( ) . x - 32 , VisibleRect : rightTop ( ) . y - 32 ) ) <nl> + <nl> + sun : setTotalParticles ( 130 ) <nl> + sun : setLife ( 0 . 6 ) <nl> + ret : addChild ( sun ) <nl> + <nl> + - - timers <nl> + m_label0 = CCLabelBMFont : create ( " 0 " , " fonts / bitmapFontTest4 . fnt " ) <nl> + m_label1 = CCLabelBMFont : create ( " 0 " , " fonts / bitmapFontTest4 . fnt " ) <nl> + m_label2 = CCLabelBMFont : create ( " 0 " , " fonts / bitmapFontTest4 . fnt " ) <nl> + m_label3 = CCLabelBMFont : create ( " 0 " , " fonts / bitmapFontTest4 . fnt " ) <nl> + m_label4 = CCLabelBMFont : create ( " 0 " , " fonts / bitmapFontTest4 . fnt " ) <nl> + <nl> + local function update ( dt ) <nl> + m_time0 = m_time0 + dt <nl> + local str = string . format ( " % 2 . 1f " , m_time0 ) <nl> + m_label0 : setString ( str ) <nl> + end <nl> + <nl> + ret : scheduleUpdateWithPriorityLua ( update , 0 ) <nl> + <nl> + local function step1 ( dt ) <nl> + m_time1 = m_time1 + dt <nl> + local str = string . format ( " % 2 . 1f " , m_time1 ) <nl> + m_label1 : setString ( str ) <nl> + end <nl> + <nl> + local function step2 ( dt ) <nl> + m_time2 = m_time2 + dt <nl> + local str = string . format ( " % 2 . 1f " , m_time2 ) <nl> + m_label2 : setString ( str ) <nl> + end <nl> + <nl> + local function step3 ( dt ) <nl> + m_time3 = m_time3 + dt <nl> + local str = string . format ( " % 2 . 1f " , m_time3 ) <nl> + m_label3 : setString ( str ) <nl> + end <nl> + <nl> + local function step4 ( dt ) <nl> + m_time4 = m_time4 + dt <nl> + local str = string . format ( " % 2 . 1f " , m_time4 ) <nl> + m_label4 : setString ( str ) <nl> + end <nl> + <nl> + local schedulerEntry1 = nil <nl> + local schedulerEntry2 = nil <nl> + local schedulerEntry3 = nil <nl> + local schedulerEntry4 = nil <nl> + <nl> + local function onNodeEvent ( event ) <nl> + if event = = " enter " then <nl> + schedulerEntry1 = scheduler : scheduleScriptFunc ( step1 , 0 , false ) <nl> + schedulerEntry2 = scheduler : scheduleScriptFunc ( step2 , 0 , false ) <nl> + schedulerEntry3 = scheduler : scheduleScriptFunc ( step3 , 1 . 0 , false ) <nl> + schedulerEntry4 = scheduler : scheduleScriptFunc ( step4 , 2 . 0 , false ) <nl> + elseif event = = " exit " then <nl> + scheduler : unscheduleScriptEntry ( schedulerEntry1 ) <nl> + scheduler : unscheduleScriptEntry ( schedulerEntry2 ) <nl> + scheduler : unscheduleScriptEntry ( schedulerEntry3 ) <nl> + scheduler : unscheduleScriptEntry ( schedulerEntry4 ) <nl> + if CCDirector : sharedDirector ( ) : isPaused ( ) then <nl> + CCDirector : sharedDirector ( ) : resume ( ) <nl> + end <nl> + end <nl> + end <nl> + <nl> + ret : registerScriptHandler ( onNodeEvent ) <nl> + <nl> + <nl> + m_label0 : setPosition ( ccp ( s . width * 1 / 6 , s . height / 2 ) ) <nl> + m_label1 : setPosition ( ccp ( s . width * 2 / 6 , s . height / 2 ) ) <nl> + m_label2 : setPosition ( ccp ( s . width * 3 / 6 , s . height / 2 ) ) <nl> + m_label3 : setPosition ( ccp ( s . width * 4 / 6 , s . height / 2 ) ) <nl> + m_label4 : setPosition ( ccp ( s . width * 5 / 6 , s . height / 2 ) ) <nl> + <nl> + ret : addChild ( m_label0 ) <nl> + ret : addChild ( m_label1 ) <nl> + ret : addChild ( m_label2 ) <nl> + ret : addChild ( m_label3 ) <nl> + ret : addChild ( m_label4 ) <nl> + <nl> + - - Sprite <nl> + local sprite = CCSprite : create ( s_pPathGrossini ) <nl> + sprite : setPosition ( ccp ( VisibleRect : left ( ) . x + 40 , VisibleRect : bottom ( ) . y + 50 ) ) <nl> + <nl> + local jump = CCJumpBy : create ( 3 , ccp ( s . width - 80 , 0 ) , 50 , 4 ) <nl> + <nl> + ret : addChild ( sprite ) <nl> + local arr = CCArray : create ( ) <nl> + arr : addObject ( jump ) <nl> + arr : addObject ( jump : reverse ( ) ) <nl> + sprite : runAction ( CCRepeatForever : create ( CCSequence : create ( arr ) ) ) <nl> + - - pause button <nl> + local item1 = CCMenuItemFont : create ( " Pause " ) <nl> + local function onPause ( tag , pSender ) <nl> + if CCDirector : sharedDirector ( ) : isPaused ( ) then <nl> + CCDirector : sharedDirector ( ) : resume ( ) <nl> + else <nl> + CCDirector : sharedDirector ( ) : pause ( ) <nl> + end <nl> + end <nl> + <nl> + item1 : registerScriptTapHandler ( onPause ) <nl> + local menu = CCMenu : createWithItem ( item1 ) <nl> + menu : setPosition ( ccp ( s . width / 2 , s . height - 50 ) ) <nl> + <nl> + ret : addChild ( menu ) <nl> + <nl> + return ret <nl> + end <nl> + <nl> + <nl> + function IntervalTestMain ( ) <nl> + cclog ( " IntervalTestMain " ) <nl> + local scene = CCScene : create ( ) <nl> + local layer = IntervalLayer ( ) <nl> + scene : addChild ( layer , 0 ) <nl> + scene : addChild ( CreateBackMenuItem ( ) ) <nl> + return scene <nl> + end <nl> + <nl> mmm a / samples / Lua / TestLua / Resources / luaScript / MenuTest / MenuTest . lua <nl> ppp b / samples / Lua / TestLua / Resources / luaScript / MenuTest / MenuTest . lua <nl> end <nl> <nl> function MenuTestMain ( ) <nl> cclog ( " MenuTestMain " ) <nl> - Helper . index = 1 <nl> - CCDirector : sharedDirector ( ) : setDepthTest ( true ) <nl> local scene = CCScene : create ( ) <nl> <nl> local pLayer1 = MenuLayerMainMenu ( ) <nl> mmm a / samples / Lua / TestLua / Resources / luaScript / mainMenu . lua <nl> ppp b / samples / Lua / TestLua / Resources / luaScript / mainMenu . lua <nl> local function CreateTestScene ( nIdx ) <nl> elseif nIdx = = Test_Table . TEST_TILE_MAP then <nl> scene = TileMapTestMain ( ) <nl> elseif nIdx = = Test_Table . TEST_INTERVAL then <nl> - scene = IntervalTest ( ) <nl> + scene = IntervalTestMain ( ) <nl> elseif nIdx = = Test_Table . TEST_CHIPMUNKACCELTOUCH then <nl> - - # if ( CC_TARGET_PLATFORM ! = CC_PLATFORM_MARMALADE ) <nl> - - pScene = new ChipmunkAccelTouchTestScene ( ) <nl> mmm a / samples / Lua / TestLua / Resources / luaScript / tests . lua <nl> ppp b / samples / Lua / TestLua / Resources / luaScript / tests . lua <nl> require " luaScript / ParallaxTest / ParallaxTest " <nl> require " luaScript / TileMapTest / TileMapTest " <nl> require " luaScript / ActionManagerTest / ActionManagerTest " <nl> require " luaScript / MenuTest / MenuTest " <nl> + require " luaScript / IntervalTest / IntervalTest " <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - - tests scene <nl> Test_Table = <nl> - - " TEST_SCENE " , <nl> " TEST_PARALLAX " , <nl> " TEST_TILE_MAP " , <nl> mmm " TEST_INTERVAL " , <nl> + " TEST_INTERVAL " , <nl> - - " TEST_CHIPMUNKACCELTOUCH " , <nl> " TEST_LABEL " , <nl> - - " TEST_TEXT_INPUT " , <nl> Test_Name = <nl> - - " SceneTest " , <nl> " ParallaxTest " , <nl> " TileMapTest " , <nl> mmm " IntervalTest " , <nl> + " IntervalTest " , <nl> - - " ChipmunkAccelTouchTest " , <nl> " LabelTest " , <nl> - - " TextInputTest " , <nl>
fixed : Adding IntervalTest for TestLua .
cocos2d/cocos2d-x
229d4329a50100d2c9107ad44492d80f5d6a0ec4
2013-04-03T09:00:05Z
mmm a / lib / ClangImporter / ImportDecl . cpp <nl> ppp b / lib / ClangImporter / ImportDecl . cpp <nl> static bool conformsToProtocolInOriginalModule ( NominalTypeDecl * nominal , <nl> <nl> for ( auto attr : nominal - > getAttrs ( ) . getAttributes < SynthesizedProtocolAttr > ( ) ) <nl> if ( auto * otherProto = ctx . getProtocol ( attr - > getProtocolKind ( ) ) ) <nl> - if ( otherProto = = proto ) <nl> + if ( otherProto = = proto | | otherProto - > inheritsFrom ( proto ) ) <nl> return true ; <nl> <nl> / / Only consider extensions from the original module . . . or from an overlay <nl> mmm a / test / IDE / newtype . swift <nl> ppp b / test / IDE / newtype . swift <nl> <nl> / / PRINT - NEXT : let Notification : String <nl> / / PRINT - NEXT : let swiftNamedNotification : String <nl> / / <nl> - / / PRINT - LABEL : struct CFNewType : _SwiftNewtypeWrapper , RawRepresentable { <nl> + / / PRINT - LABEL : struct CFNewType : Hashable , Equatable , _SwiftNewtypeWrapper , RawRepresentable { <nl> / / PRINT - NEXT : init ( _ rawValue : CFString ) <nl> / / PRINT - NEXT : init ( rawValue : CFString ) <nl> / / PRINT - NEXT : let rawValue : CFString <nl> <nl> / / PRINT - NEXT : func FooAudited ( ) - > CFNewType <nl> / / PRINT - NEXT : func FooUnaudited ( ) - > Unmanaged < CFString > <nl> / / <nl> - / / PRINT - LABEL : struct MyABINewType : _SwiftNewtypeWrapper , RawRepresentable { <nl> + / / PRINT - LABEL : struct MyABINewType : Hashable , Equatable , _SwiftNewtypeWrapper , RawRepresentable { <nl> / / PRINT - NEXT : init ( _ rawValue : CFString ) <nl> / / PRINT - NEXT : init ( rawValue : CFString ) <nl> / / PRINT - NEXT : let rawValue : CFString <nl>
[ ClangImporter ] swift_wrapper : transfer inherited synthesized protos ( )
apple/swift
75dcf27896ad27bffb2f77651918e1b7ac150760
2018-01-30T16:48:17Z
mmm a / build / deps / github_hashes / facebook / folly - rev . txt <nl> ppp b / build / deps / github_hashes / facebook / folly - rev . txt <nl> @ @ - 1 + 1 @ @ <nl> - Subproject commit 07f3b3df05f5b7fb7a9a42cf0bceaf0305fcafa5 <nl> + Subproject commit cf5b222827c41b464b512699920b0171263f38d3 <nl>
Updating submodules
facebook/watchman
50f1160c6ca3d8562e5cffa096ae1db06b31d607
2018-11-09T23:48:41Z
mmm a / extensions / GUI / CCScrollView / CCTableView . cpp <nl> ppp b / extensions / GUI / CCScrollView / CCTableView . cpp <nl> <nl> <nl> NS_CC_EXT_BEGIN <nl> <nl> + TableView * TableView : : create ( ) <nl> + { <nl> + return TableView : : create ( nullptr , Size : : ZERO ) ; <nl> + } <nl> <nl> TableView * TableView : : create ( TableViewDataSource * dataSource , Size size ) <nl> { <nl> bool TableView : : initWithViewSize ( Size size , Node * container / * = NULL * / ) <nl> { <nl> if ( ScrollView : : initWithViewSize ( size , container ) ) <nl> { <nl> + CC_SAFE_DELETE ( _indices ) ; <nl> _indices = new std : : set < ssize_t > ( ) ; <nl> _vordering = VerticalFillOrder : : BOTTOM_UP ; <nl> this - > setDirection ( Direction : : VERTICAL ) ; <nl> mmm a / extensions / GUI / CCScrollView / CCTableView . h <nl> ppp b / extensions / GUI / CCScrollView / CCTableView . h <nl> class TableView : public ScrollView , public ScrollViewDelegate <nl> TOP_DOWN , <nl> BOTTOM_UP <nl> } ; <nl> + <nl> + / * * Empty contructor of TableView * / <nl> + static TableView * create ( ) ; <nl> + <nl> / * * <nl> * An intialized table view object <nl> * <nl> mmm a / extensions / GUI / CCScrollView / CCTableViewCell . h <nl> ppp b / extensions / GUI / CCScrollView / CCTableViewCell . h <nl> NS_CC_EXT_BEGIN <nl> class TableViewCell : public Node <nl> { <nl> public : <nl> + CREATE_FUNC ( TableViewCell ) ; <nl> + <nl> TableViewCell ( ) { } <nl> / * * <nl> * The index used internally by SWTableView and its subclasses <nl>
Adds empty constructor for TableView and TableViewCell .
cocos2d/cocos2d-x
4bb091067f2c2b130159f6313f619237a35b39d0
2014-01-07T14:15:20Z
mmm a / src / video_core / engines / shader_bytecode . h <nl> ppp b / src / video_core / engines / shader_bytecode . h <nl> class OpCode { <nl> INST ( " 0011011 - 11110mmm " , Id : : BFI_IMM_R , Type : : Bfi , " BFI_IMM_R " ) , <nl> INST ( " 0100110001000mmm " , Id : : LOP_C , Type : : ArithmeticInteger , " LOP_C " ) , <nl> INST ( " 0101110001000mmm " , Id : : LOP_R , Type : : ArithmeticInteger , " LOP_R " ) , <nl> - INST ( " 0011100001000mmm " , Id : : LOP_IMM , Type : : ArithmeticInteger , " LOP_IMM " ) , <nl> + INST ( " 0011100 - 01000mmm " , Id : : LOP_IMM , Type : : ArithmeticInteger , " LOP_IMM " ) , <nl> INST ( " 000001mmmmmmmmm - " , Id : : LOP32I , Type : : ArithmeticIntegerImmediate , " LOP32I " ) , <nl> INST ( " 0000001mmmmmmmmm " , Id : : LOP3_C , Type : : ArithmeticInteger , " LOP3_C " ) , <nl> INST ( " 0101101111100mmm " , Id : : LOP3_R , Type : : ArithmeticInteger , " LOP3_R " ) , <nl>
Merge pull request from FernandoS27 / fix - lop
yuzu-emu/yuzu
088c7c1bb527197dc1ca16ce839778cea81cd98c
2019-04-09T21:19:56Z
mmm a / src / core / ext / transport / chttp2 / server / insecure / server_chttp2 . c <nl> ppp b / src / core / ext / transport / chttp2 / server / insecure / server_chttp2 . c <nl> <nl> # include " src / core / lib / surface / api_trace . h " <nl> # include " src / core / lib / surface / server . h " <nl> <nl> - static void setup_transport ( grpc_exec_ctx * exec_ctx , void * server , <nl> - grpc_transport * transport ) { <nl> - grpc_server_setup_transport ( exec_ctx , server , transport , <nl> - grpc_server_get_channel_args ( server ) ) ; <nl> - } <nl> - <nl> static void new_transport ( grpc_exec_ctx * exec_ctx , void * server , <nl> - grpc_endpoint * tcp , <nl> + grpc_endpoint * tcp , grpc_pollset * accepting_pollset , <nl> grpc_tcp_server_acceptor * acceptor ) { <nl> / * <nl> * Beware that the call to grpc_create_chttp2_transport ( ) has to happen before <nl> static void new_transport ( grpc_exec_ctx * exec_ctx , void * server , <nl> * / <nl> grpc_transport * transport = grpc_create_chttp2_transport ( <nl> exec_ctx , grpc_server_get_channel_args ( server ) , tcp , 0 ) ; <nl> - setup_transport ( exec_ctx , server , transport ) ; <nl> + grpc_server_setup_transport ( exec_ctx , server , transport , accepting_pollset , <nl> + grpc_server_get_channel_args ( server ) ) ; <nl> grpc_chttp2_transport_start_reading ( exec_ctx , transport , NULL , 0 ) ; <nl> } <nl> <nl> mmm a / src / core / lib / iomgr / tcp_server . h <nl> ppp b / src / core / lib / iomgr / tcp_server . h <nl> typedef struct grpc_tcp_server_acceptor { <nl> / * Called for newly connected TCP connections . * / <nl> typedef void ( * grpc_tcp_server_cb ) ( grpc_exec_ctx * exec_ctx , void * arg , <nl> grpc_endpoint * ep , <nl> + grpc_pollset * accepting_pollset , <nl> grpc_tcp_server_acceptor * acceptor ) ; <nl> <nl> / * Create a server , initially not bound to any ports . The caller owns one ref . <nl> mmm a / src / core / lib / iomgr / tcp_server_posix . c <nl> ppp b / src / core / lib / iomgr / tcp_server_posix . c <nl> static void on_read ( grpc_exec_ctx * exec_ctx , void * arg , bool success ) { <nl> sp - > server - > on_accept_cb ( <nl> exec_ctx , sp - > server - > on_accept_cb_arg , <nl> grpc_tcp_create ( fdobj , GRPC_TCP_DEFAULT_READ_SLICE_SIZE , addr_str ) , <nl> - & acceptor ) ; <nl> + read_notifier_pollset , & acceptor ) ; <nl> <nl> gpr_free ( name ) ; <nl> gpr_free ( addr_str ) ; <nl> mmm a / src / core / lib / surface / server . c <nl> ppp b / src / core / lib / surface / server . c <nl> struct channel_data { <nl> grpc_server * server ; <nl> grpc_connectivity_state connectivity_state ; <nl> grpc_channel * channel ; <nl> + size_t cq_idx ; <nl> / * linked list of all channels on a server * / <nl> channel_data * next ; <nl> channel_data * prev ; <nl> struct registered_method { <nl> char * host ; <nl> grpc_server_register_method_payload_handling payload_handling ; <nl> uint32_t flags ; <nl> - request_matcher request_matcher ; <nl> + / * one request matcher per method per cq * / <nl> + request_matcher * request_matchers ; <nl> registered_method * next ; <nl> } ; <nl> <nl> struct grpc_server { <nl> gpr_mu mu_call ; / * mutex for call - specific state * / <nl> <nl> registered_method * registered_methods ; <nl> - request_matcher unregistered_request_matcher ; <nl> + / * * one request matcher for unregistered methods per cq * / <nl> + request_matcher * unregistered_request_matchers ; <nl> / * * free list of available requested_calls indices * / <nl> gpr_stack_lockfree * request_freelist ; <nl> / * * requested call backing data * / <nl> static void server_delete ( grpc_exec_ctx * exec_ctx , grpc_server * server ) { <nl> gpr_mu_destroy ( & server - > mu_call ) ; <nl> while ( ( rm = server - > registered_methods ) ! = NULL ) { <nl> server - > registered_methods = rm - > next ; <nl> - request_matcher_destroy ( & rm - > request_matcher ) ; <nl> + for ( i = 0 ; i < server - > cq_count ; i + + ) { <nl> + request_matcher_destroy ( & rm - > request_matchers [ i ] ) ; <nl> + } <nl> gpr_free ( rm - > method ) ; <nl> gpr_free ( rm - > host ) ; <nl> gpr_free ( rm ) ; <nl> } <nl> for ( i = 0 ; i < server - > cq_count ; i + + ) { <nl> GRPC_CQ_INTERNAL_UNREF ( server - > cqs [ i ] , " server " ) ; <nl> + request_matcher_destroy ( & server - > unregistered_request_matchers [ i ] ) ; <nl> } <nl> - request_matcher_destroy ( & server - > unregistered_request_matcher ) ; <nl> gpr_stack_lockfree_destroy ( server - > request_freelist ) ; <nl> gpr_free ( server - > cqs ) ; <nl> gpr_free ( server - > pollsets ) ; <nl> static void start_new_rpc ( grpc_exec_ctx * exec_ctx , grpc_call_element * elem ) { <nl> if ( ( rm - > flags & GRPC_INITIAL_METADATA_IDEMPOTENT_REQUEST ) & & <nl> ! calld - > recv_idempotent_request ) <nl> continue ; <nl> - finish_start_new_rpc ( exec_ctx , server , elem , <nl> - & rm - > server_registered_method - > request_matcher , <nl> - rm - > server_registered_method - > payload_handling ) ; <nl> + finish_start_new_rpc ( <nl> + exec_ctx , server , elem , <nl> + & rm - > server_registered_method - > request_matchers [ chand - > cq_idx ] , <nl> + rm - > server_registered_method - > payload_handling ) ; <nl> return ; <nl> } <nl> / * check for a wildcard method definition ( no host set ) * / <nl> static void start_new_rpc ( grpc_exec_ctx * exec_ctx , grpc_call_element * elem ) { <nl> if ( ( rm - > flags & GRPC_INITIAL_METADATA_IDEMPOTENT_REQUEST ) & & <nl> ! calld - > recv_idempotent_request ) <nl> continue ; <nl> - finish_start_new_rpc ( exec_ctx , server , elem , <nl> - & rm - > server_registered_method - > request_matcher , <nl> - rm - > server_registered_method - > payload_handling ) ; <nl> + finish_start_new_rpc ( <nl> + exec_ctx , server , elem , <nl> + & rm - > server_registered_method - > request_matchers [ chand - > cq_idx ] , <nl> + rm - > server_registered_method - > payload_handling ) ; <nl> return ; <nl> } <nl> } <nl> finish_start_new_rpc ( exec_ctx , server , elem , <nl> - & server - > unregistered_request_matcher , <nl> + & server - > unregistered_request_matchers [ chand - > cq_idx ] , <nl> GRPC_SRM_PAYLOAD_NONE ) ; <nl> } <nl> <nl> static int num_channels ( grpc_server * server ) { <nl> <nl> static void kill_pending_work_locked ( grpc_exec_ctx * exec_ctx , <nl> grpc_server * server ) { <nl> - registered_method * rm ; <nl> - request_matcher_kill_requests ( exec_ctx , server , <nl> - & server - > unregistered_request_matcher ) ; <nl> - request_matcher_zombify_all_pending_calls ( <nl> - exec_ctx , & server - > unregistered_request_matcher ) ; <nl> - for ( rm = server - > registered_methods ; rm ; rm = rm - > next ) { <nl> - request_matcher_kill_requests ( exec_ctx , server , & rm - > request_matcher ) ; <nl> - request_matcher_zombify_all_pending_calls ( exec_ctx , & rm - > request_matcher ) ; <nl> + for ( size_t i = 0 ; i < server - > cq_count ; i + + ) { <nl> + request_matcher_kill_requests ( exec_ctx , server , <nl> + & server - > unregistered_request_matchers [ i ] ) ; <nl> + request_matcher_zombify_all_pending_calls ( <nl> + exec_ctx , & server - > unregistered_request_matchers [ i ] ) ; <nl> + for ( registered_method * rm = server - > registered_methods ; rm ; <nl> + rm = rm - > next ) { <nl> + request_matcher_kill_requests ( exec_ctx , server , & rm - > request_matchers [ i ] ) ; <nl> + request_matcher_zombify_all_pending_calls ( exec_ctx , <nl> + & rm - > request_matchers [ i ] ) ; <nl> + } <nl> } <nl> } <nl> <nl> void grpc_server_start ( grpc_server * server ) { <nl> <nl> void grpc_server_setup_transport ( grpc_exec_ctx * exec_ctx , grpc_server * s , <nl> grpc_transport * transport , <nl> + grpc_pollset * accepting_pollset , <nl> const grpc_channel_args * args ) { <nl> size_t num_registered_methods ; <nl> size_t alloc ; <nl> mmm a / src / core / lib / surface / server . h <nl> ppp b / src / core / lib / surface / server . h <nl> void grpc_server_add_listener ( <nl> server * / <nl> void grpc_server_setup_transport ( grpc_exec_ctx * exec_ctx , grpc_server * server , <nl> grpc_transport * transport , <nl> + grpc_pollset * accepting_pollset , <nl> const grpc_channel_args * args ) ; <nl> <nl> const grpc_channel_args * grpc_server_get_channel_args ( grpc_server * server ) ; <nl> mmm a / third_party / protobuf <nl> ppp b / third_party / protobuf <nl> @ @ - 1 + 1 @ @ <nl> - Subproject commit a1938b2aa9ca86ce7ce50c27ff9737c1008d2a03 <nl> + Subproject commit d5fb408ddc281ffcadeb08699e65bb694656d0bd <nl>
Begin sharding request queues per cq
grpc/grpc
418a82187ca4905dbbcdd05c3271022a74bda6e6
2016-05-16T23:27:51Z
mmm a / lib / Sema / TypeCheckDecl . cpp <nl> ppp b / lib / Sema / TypeCheckDecl . cpp <nl> class DeclChecker : public DeclVisitor < DeclChecker > { <nl> AccessScope desiredAccessScope = AccessScope : : getPublic ( ) ; <nl> switch ( access ) { <nl> case Accessibility : : Private : <nl> - assert ( ED - > getDeclContext ( ) - > isModuleScopeContext ( ) & & <nl> + assert ( ( ED - > isInvalid ( ) | | <nl> + ED - > getDeclContext ( ) - > isModuleScopeContext ( ) ) & & <nl> " non - top - level extensions make ' private ' ! = ' fileprivate ' " ) ; <nl> SWIFT_FALLTHROUGH ; <nl> case Accessibility : : FilePrivate : { <nl> similarity index 87 % <nl> rename from validation - test / compiler_crashers / 28495 - ed - getdeclcontext - ismodulescopecontext - non - top - level - extensions - make - private - fil . swift <nl> rename to validation - test / compiler_crashers_fixed / 28495 - ed - getdeclcontext - ismodulescopecontext - non - top - level - extensions - make - private - fil . swift <nl> mmm a / validation - test / compiler_crashers / 28495 - ed - getdeclcontext - ismodulescopecontext - non - top - level - extensions - make - private - fil . swift <nl> ppp b / validation - test / compiler_crashers_fixed / 28495 - ed - getdeclcontext - ismodulescopecontext - non - top - level - extensions - make - private - fil . swift <nl> <nl> / / See http : / / swift . org / LICENSE . txt for license information <nl> / / See http : / / swift . org / CONTRIBUTORS . txt for the list of Swift project authors <nl> <nl> - / / RUN : not - - crash % target - swift - frontend % s - emit - ir <nl> + / / RUN : not % target - swift - frontend % s - emit - ir <nl> / / REQUIRES : asserts <nl> if { enum a { private extension <nl>
Merge pull request from apple / ignore - invalid - ext
apple/swift
337c71d246976507fe936306f9b21698aa4690da
2016-11-15T00:07:52Z
mmm a / documentation / sphinx / source / downloads . rst <nl> ppp b / documentation / sphinx / source / downloads . rst <nl> macOS <nl> <nl> The macOS installation package is supported on macOS 10 . 7 + . It includes the client and ( optionally ) the server . <nl> <nl> - * ` FoundationDB - 5 . 2 . 6 . pkg < https : / / www . foundationdb . org / downloads / 5 . 2 . 6 / macOS / installers / FoundationDB - 5 . 2 . 6 . pkg > ` _ <nl> + * ` FoundationDB - 5 . 2 . 7 . pkg < https : / / www . foundationdb . org / downloads / 5 . 2 . 7 / macOS / installers / FoundationDB - 5 . 2 . 7 . pkg > ` _ <nl> <nl> Ubuntu <nl> mmmmmm <nl> <nl> The Ubuntu packages are supported on 64 - bit Ubuntu 12 . 04 + , but beware of the Linux kernel bug in Ubuntu 12 . x . <nl> <nl> - * ` foundationdb - clients - 5 . 2 . 6 - 1_amd64 . deb < https : / / www . foundationdb . org / downloads / 5 . 2 . 6 / ubuntu / installers / foundationdb - clients_5 . 2 . 6 - 1_amd64 . deb > ` _ <nl> - * ` foundationdb - server - 5 . 2 . 6 - 1_amd64 . deb < https : / / www . foundationdb . org / downloads / 5 . 2 . 6 / ubuntu / installers / foundationdb - server_5 . 2 . 6 - 1_amd64 . deb > ` _ ( depends on the clients package ) <nl> + * ` foundationdb - clients - 5 . 2 . 7 - 1_amd64 . deb < https : / / www . foundationdb . org / downloads / 5 . 2 . 7 / ubuntu / installers / foundationdb - clients_5 . 2 . 7 - 1_amd64 . deb > ` _ <nl> + * ` foundationdb - server - 5 . 2 . 7 - 1_amd64 . deb < https : / / www . foundationdb . org / downloads / 5 . 2 . 7 / ubuntu / installers / foundationdb - server_5 . 2 . 7 - 1_amd64 . deb > ` _ ( depends on the clients package ) <nl> <nl> RHEL / CentOS EL6 <nl> mmmmmmmmmmmmmmm <nl> <nl> The RHEL / CentOS EL6 packages are supported on 64 - bit RHEL / CentOS 6 . x . <nl> <nl> - * ` foundationdb - clients - 5 . 2 . 6 - 1 . el6 . x86_64 . rpm < https : / / www . foundationdb . org / downloads / 5 . 2 . 6 / rhel6 / installers / foundationdb - clients - 5 . 2 . 6 - 1 . el6 . x86_64 . rpm > ` _ <nl> - * ` foundationdb - server - 5 . 2 . 6 - 1 . el6 . x86_64 . rpm < https : / / www . foundationdb . org / downloads / 5 . 2 . 6 / rhel6 / installers / foundationdb - server - 5 . 2 . 6 - 1 . el6 . x86_64 . rpm > ` _ ( depends on the clients package ) <nl> + * ` foundationdb - clients - 5 . 2 . 7 - 1 . el6 . x86_64 . rpm < https : / / www . foundationdb . org / downloads / 5 . 2 . 7 / rhel6 / installers / foundationdb - clients - 5 . 2 . 7 - 1 . el6 . x86_64 . rpm > ` _ <nl> + * ` foundationdb - server - 5 . 2 . 7 - 1 . el6 . x86_64 . rpm < https : / / www . foundationdb . org / downloads / 5 . 2 . 7 / rhel6 / installers / foundationdb - server - 5 . 2 . 7 - 1 . el6 . x86_64 . rpm > ` _ ( depends on the clients package ) <nl> <nl> RHEL / CentOS EL7 <nl> mmmmmmmmmmmmmmm <nl> <nl> The RHEL / CentOS EL7 packages are supported on 64 - bit RHEL / CentOS 7 . x . <nl> <nl> - * ` foundationdb - clients - 5 . 2 . 6 - 1 . el7 . x86_64 . rpm < https : / / www . foundationdb . org / downloads / 5 . 2 . 6 / rhel7 / installers / foundationdb - clients - 5 . 2 . 6 - 1 . el7 . x86_64 . rpm > ` _ <nl> - * ` foundationdb - server - 5 . 2 . 6 - 1 . el7 . x86_64 . rpm < https : / / www . foundationdb . org / downloads / 5 . 2 . 6 / rhel7 / installers / foundationdb - server - 5 . 2 . 6 - 1 . el7 . x86_64 . rpm > ` _ ( depends on the clients package ) <nl> + * ` foundationdb - clients - 5 . 2 . 7 - 1 . el7 . x86_64 . rpm < https : / / www . foundationdb . org / downloads / 5 . 2 . 7 / rhel7 / installers / foundationdb - clients - 5 . 2 . 7 - 1 . el7 . x86_64 . rpm > ` _ <nl> + * ` foundationdb - server - 5 . 2 . 7 - 1 . el7 . x86_64 . rpm < https : / / www . foundationdb . org / downloads / 5 . 2 . 7 / rhel7 / installers / foundationdb - server - 5 . 2 . 7 - 1 . el7 . x86_64 . rpm > ` _ ( depends on the clients package ) <nl> <nl> Windows <nl> mmmmmm - <nl> <nl> The Windows installer is supported on 64 - bit Windows XP and later . It includes the client and ( optionally ) the server . <nl> <nl> - * ` foundationdb - 5 . 2 . 6 - x64 . msi < https : / / www . foundationdb . org / downloads / 5 . 2 . 6 / windows / installers / foundationdb - 5 . 2 . 6 - x64 . msi > ` _ <nl> + * ` foundationdb - 5 . 2 . 7 - x64 . msi < https : / / www . foundationdb . org / downloads / 5 . 2 . 7 / windows / installers / foundationdb - 5 . 2 . 7 - x64 . msi > ` _ <nl> <nl> API Language Bindings <nl> = = = = = = = = = = = = = = = = = = = = = <nl> On macOS and Windows , the FoundationDB Python API bindings are installed as part <nl> <nl> If you need to use the FoundationDB Python API from other Python installations or paths , download the Python package : <nl> <nl> - * ` foundationdb - 5 . 2 . 6 . tar . gz < https : / / www . foundationdb . org / downloads / 5 . 2 . 6 / bindings / python / foundationdb - 5 . 2 . 6 . tar . gz > ` _ <nl> + * ` foundationdb - 5 . 2 . 7 . tar . gz < https : / / www . foundationdb . org / downloads / 5 . 2 . 7 / bindings / python / foundationdb - 5 . 2 . 7 . tar . gz > ` _ <nl> <nl> Ruby 1 . 9 . 3 / 2 . 0 . 0 + <nl> mmmmmmmmmmmmmmm - - <nl> <nl> - * ` fdb - 5 . 2 . 6 . gem < https : / / www . foundationdb . org / downloads / 5 . 2 . 6 / bindings / ruby / fdb - 5 . 2 . 6 . gem > ` _ <nl> + * ` fdb - 5 . 2 . 7 . gem < https : / / www . foundationdb . org / downloads / 5 . 2 . 7 / bindings / ruby / fdb - 5 . 2 . 7 . gem > ` _ <nl> <nl> Java 8 + <nl> mmmmmm - <nl> <nl> - * ` fdb - java - 5 . 2 . 6 . jar < https : / / www . foundationdb . org / downloads / 5 . 2 . 6 / bindings / java / fdb - java - 5 . 2 . 6 . jar > ` _ <nl> - * ` fdb - java - 5 . 2 . 6 - javadoc . jar < https : / / www . foundationdb . org / downloads / 5 . 2 . 6 / bindings / java / fdb - java - 5 . 2 . 6 - javadoc . jar > ` _ <nl> + * ` fdb - java - 5 . 2 . 7 . jar < https : / / www . foundationdb . org / downloads / 5 . 2 . 7 / bindings / java / fdb - java - 5 . 2 . 7 . jar > ` _ <nl> + * ` fdb - java - 5 . 2 . 7 - javadoc . jar < https : / / www . foundationdb . org / downloads / 5 . 2 . 7 / bindings / java / fdb - java - 5 . 2 . 7 - javadoc . jar > ` _ <nl> <nl> Go 1 . 1 + <nl> mmmmmm - <nl> mmm a / packaging / msi / FDBInstaller . wxs <nl> ppp b / packaging / msi / FDBInstaller . wxs <nl> <nl> <nl> < Wix xmlns = ' http : / / schemas . microsoft . com / wix / 2006 / wi ' > <nl> < Product Name = ' $ ( var . Title ) ' <nl> - Id = ' { 17E755FF - 984D - 4794 - 9FB7 - F5EF61EFA6B6 } ' <nl> + Id = ' { FB340678 - 19AC - 4B09 - 8DFC - 4745F5BB244D } ' <nl> UpgradeCode = ' { A95EA002 - 686E - 4164 - 8356 - C715B7F8B1C8 } ' <nl> Version = ' $ ( var . Version ) ' <nl> Manufacturer = ' $ ( var . Manufacturer ) ' <nl> mmm a / versions . target <nl> ppp b / versions . target <nl> <nl> < ? xml version = " 1 . 0 " ? > <nl> < Project xmlns = " http : / / schemas . microsoft . com / developer / msbuild / 2003 " > <nl> < PropertyGroup > <nl> - < Version > 5 . 2 . 6 < / Version > <nl> + < Version > 5 . 2 . 7 < / Version > <nl> < PackageName > 5 . 2 < / PackageName > <nl> < / PropertyGroup > <nl> < / Project > <nl>
Merge pull request from brownleej / release - 5 . 2 . 7
apple/foundationdb
02cc2ada4ac09a362b2fae37def1424ccd8e897c
2018-07-30T19:58:24Z
mmm a / modules / gpu / include / opencv2 / gpu / gpu . hpp <nl> ppp b / modules / gpu / include / opencv2 / gpu / gpu . hpp <nl> CV_EXPORTS void graphcut ( GpuMat & terminals , GpuMat & leftTransp , GpuMat & rightTra <nl> GpuMat & labels , <nl> GpuMat & buf , Stream & stream = Stream : : Null ( ) ) ; <nl> <nl> + / / ! performs connected componnents labeling . <nl> + CV_EXPORTS void labelComponents ( const GpuMat & image , GpuMat & mask , GpuMat & components , const cv : : Scalar & lo , const cv : : Scalar & hi ) ; <nl> + <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / Histograms / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> <nl> / / ! Compute levels with even distribution . levels will have 1 row and nLevels cols and CV_32SC1 type . <nl> new file mode 100644 <nl> index 00000000000 . . 1ed5ebb0a2b <nl> mmm / dev / null <nl> ppp b / modules / gpu / src / cuda / ccomponetns . cu <nl> <nl> + / * M / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> + / / <nl> + / / IMPORTANT : READ BEFORE DOWNLOADING , COPYING , INSTALLING OR USING . <nl> + / / <nl> + / / By downloading , copying , installing or using the software you agree to this license . <nl> + / / If you do not agree to this license , do not download , install , <nl> + / / copy or use the software . <nl> + / / <nl> + / / <nl> + / / License Agreement <nl> + / / For Open Source Computer Vision Library <nl> + / / <nl> + / / Copyright ( C ) 2000 - 2008 , Intel Corporation , all rights reserved . <nl> + / / Copyright ( C ) 2008 - 2011 , Willow Garage Inc . , all rights reserved . <nl> + / / Third party copyrights are property of their respective owners . <nl> + / / <nl> + / / Redistribution and use in source and binary forms , with or without modification , <nl> + / / are permitted provided that the following conditions are met : <nl> + / / <nl> + / / * Redistributions of source code must retain the above copyright notice , <nl> + / / this list of conditions and the following disclaimer . <nl> + / / <nl> + / / * Redistributions in binary form must reproduce the above copyright notice , <nl> + / / this list of conditions and the following disclaimer in the documentation <nl> + / / and / or other materials provided with the distribution . <nl> + / / <nl> + / / * The name of the copyright holders may not be used to endorse or promote products <nl> + / / derived from this software without specific prior written permission . <nl> + / / <nl> + / / This software is provided by the copyright holders and contributors " as is " and <nl> + / / any express or implied warranties , including , but not limited to , the implied <nl> + / / warranties of merchantability and fitness for a particular purpose are disclaimed . <nl> + / / In no event shall the Intel Corporation or contributors be liable for any direct , <nl> + / / indirect , incidental , special , exemplary , or consequential damages <nl> + / / ( including , but not limited to , procurement of substitute goods or services ; <nl> + / / loss of use , data , or profits ; or business interruption ) however caused <nl> + / / and on any theory of liability , whether in contract , strict liability , <nl> + / / or tort ( including negligence or otherwise ) arising in any way out of <nl> + / / the use of this software , even if advised of the possibility of such damage . <nl> + / / M * / <nl> + <nl> + # include " opencv2 / gpu / device / common . hpp " <nl> + # include < iostream > <nl> + # include < stdio . h > <nl> + <nl> + namespace cv { namespace gpu { namespace device <nl> + { <nl> + namespace ccl <nl> + { <nl> + enum <nl> + { <nl> + WARP_SIZE = 32 , <nl> + WARP_LOG = 5 , <nl> + <nl> + CTA_SIZE_X = 32 , <nl> + CTA_SIZE_Y = 8 , <nl> + <nl> + STA_SIZE_MARGE_Y = 4 , <nl> + STA_SIZE_MARGE_X = 32 , <nl> + <nl> + TPB_X = 1 , <nl> + TPB_Y = 4 , <nl> + <nl> + TILE_COLS = CTA_SIZE_X * TPB_X , <nl> + TILE_ROWS = CTA_SIZE_Y * TPB_Y <nl> + } ; <nl> + <nl> + typedef unsigned char component ; <nl> + enum Edges { UP = 1 , DOWN = 2 , LEFT = 4 , RIGHT = 8 , EMPTY = 0xF0 } ; <nl> + <nl> + template < typename T > <nl> + struct InInterval <nl> + { <nl> + __host__ __device__ __forceinline__ InInterval ( const T & _lo , const T & _hi ) : lo ( - _lo ) , hi ( _hi ) { } ; <nl> + T lo , hi ; <nl> + <nl> + __device__ __forceinline__ bool operator ( ) ( const T & a , const T & b ) const <nl> + { <nl> + T d = a - b ; <nl> + return lo < = d & & d < = hi ; <nl> + } <nl> + <nl> + } ; <nl> + <nl> + template < typename F > <nl> + __global__ void computeComponents ( const DevMem2D image , DevMem2D components , F connected ) <nl> + { <nl> + int x = threadIdx . x + blockIdx . x * blockDim . x ; <nl> + int y = threadIdx . y + blockIdx . y * blockDim . y ; <nl> + <nl> + if ( x > = image . cols | | y > = image . rows ) return ; <nl> + <nl> + int intensity = image ( y , x ) ; <nl> + component c = 0 ; <nl> + <nl> + if ( x > 0 & & connected ( intensity , image ( y , x - 1 ) ) ) <nl> + c | = LEFT ; <nl> + <nl> + if ( y > 0 & & connected ( intensity , image ( y - 1 , x ) ) ) <nl> + c | = UP ; <nl> + <nl> + if ( x - 1 < image . cols & & connected ( intensity , image ( y , x + 1 ) ) ) <nl> + c | = RIGHT ; <nl> + <nl> + if ( y - 1 < image . rows & & connected ( intensity , image ( y + 1 , x ) ) ) <nl> + c | = DOWN ; <nl> + <nl> + components ( y , x ) = c ; <nl> + } <nl> + <nl> + void computeEdges ( const DevMem2D & image , DevMem2D components , const int lo , const int hi ) <nl> + { <nl> + dim3 block ( CTA_SIZE_X , CTA_SIZE_Y ) ; <nl> + dim3 grid ( divUp ( image . cols , block . x ) , divUp ( image . rows , block . y ) ) ; <nl> + InInterval < int > inInt ( lo , hi ) ; <nl> + computeComponents < InInterval < int > > < < < grid , block > > > ( image , components , inInt ) ; <nl> + <nl> + cudaSafeCall ( cudaGetLastError ( ) ) ; <nl> + cudaSafeCall ( cudaDeviceSynchronize ( ) ) ; <nl> + } <nl> + <nl> + __global__ void lableTiles ( const DevMem2D edges , DevMem2Di comps ) <nl> + { <nl> + int x = threadIdx . x + blockIdx . x * TILE_COLS ; <nl> + int y = threadIdx . y + blockIdx . y * TILE_ROWS ; <nl> + <nl> + if ( x > = edges . cols | | y > = edges . rows ) return ; <nl> + <nl> + / / currently x is 1 <nl> + int bounds = ( ( y + TPB_Y ) < edges . rows ) ; <nl> + <nl> + __shared__ int labelsTile [ TILE_ROWS ] [ TILE_COLS ] ; <nl> + __shared__ int edgesTile [ TILE_ROWS ] [ TILE_COLS ] ; <nl> + <nl> + int new_labels [ TPB_Y ] [ TPB_X ] ; <nl> + int old_labels [ TPB_Y ] [ TPB_X ] ; <nl> + <nl> + # pragma unroll <nl> + for ( int i = 0 ; i < TPB_Y ; + + i ) <nl> + # pragma unroll <nl> + for ( int j = 0 ; j < TPB_X ; + + j ) <nl> + { <nl> + int yloc = threadIdx . y + CTA_SIZE_Y * i ; <nl> + int xloc = threadIdx . x + CTA_SIZE_X * j ; <nl> + component c = edges ( bounds * ( y + CTA_SIZE_Y * i ) , x + CTA_SIZE_X * j ) ; <nl> + <nl> + if ( ! xloc ) c & = ~ LEFT ; <nl> + if ( ! yloc ) c & = ~ UP ; <nl> + <nl> + if ( xloc = = TILE_COLS - 1 ) c & = ~ RIGHT ; <nl> + if ( yloc = = TILE_ROWS - 1 ) c & = ~ DOWN ; <nl> + <nl> + new_labels [ i ] [ j ] = yloc * TILE_COLS + xloc ; <nl> + edgesTile [ yloc ] [ xloc ] = c ; <nl> + } <nl> + <nl> + <nl> + for ( int i = 0 ; ; + + i ) <nl> + { <nl> + / / 1 . backup <nl> + # pragma unroll <nl> + for ( int i = 0 ; i < TPB_Y ; + + i ) <nl> + # pragma unroll <nl> + for ( int j = 0 ; j < TPB_X ; + + j ) <nl> + { <nl> + int yloc = threadIdx . y + CTA_SIZE_Y * i ; <nl> + int xloc = threadIdx . x + CTA_SIZE_X * j ; <nl> + <nl> + old_labels [ i ] [ j ] = new_labels [ i ] [ j ] ; <nl> + labelsTile [ yloc ] [ xloc ] = new_labels [ i ] [ j ] ; <nl> + } <nl> + <nl> + __syncthreads ( ) ; <nl> + <nl> + / / 2 . compare local arrays <nl> + # pragma unroll <nl> + for ( int i = 0 ; i < TPB_Y ; + + i ) <nl> + # pragma unroll <nl> + for ( int j = 0 ; j < TPB_X ; + + j ) <nl> + { <nl> + int yloc = threadIdx . y + CTA_SIZE_Y * i ; <nl> + int xloc = threadIdx . x + CTA_SIZE_X * j ; <nl> + <nl> + component c = edgesTile [ yloc ] [ xloc ] ; <nl> + int label = new_labels [ i ] [ j ] ; <nl> + <nl> + if ( c & UP ) <nl> + label = min ( label , labelsTile [ yloc - 1 ] [ xloc ] ) ; <nl> + <nl> + if ( c & DOWN ) <nl> + label = min ( label , labelsTile [ yloc + 1 ] [ xloc ] ) ; <nl> + <nl> + if ( c & LEFT ) <nl> + label = min ( label , labelsTile [ yloc ] [ xloc - 1 ] ) ; <nl> + <nl> + if ( c & RIGHT ) <nl> + label = min ( label , labelsTile [ yloc ] [ xloc + 1 ] ) ; <nl> + <nl> + new_labels [ i ] [ j ] = label ; <nl> + } <nl> + <nl> + __syncthreads ( ) ; <nl> + <nl> + / / 3 . determine : Is any value changed ? <nl> + int changed = 0 ; <nl> + # pragma unroll <nl> + for ( int i = 0 ; i < TPB_Y ; + + i ) <nl> + # pragma unroll <nl> + for ( int j = 0 ; j < TPB_X ; + + j ) <nl> + { <nl> + if ( new_labels [ i ] [ j ] < old_labels [ i ] [ j ] ) <nl> + { <nl> + changed = 1 ; <nl> + atomicMin ( & labelsTile [ 0 ] [ 0 ] + old_labels [ i ] [ j ] , new_labels [ i ] [ j ] ) ; <nl> + } <nl> + } <nl> + <nl> + changed = __syncthreads_or ( changed ) ; <nl> + if ( ! changed ) <nl> + break ; <nl> + <nl> + / / 4 . Compact paths <nl> + const int * labels = & labelsTile [ 0 ] [ 0 ] ; <nl> + # pragma unroll <nl> + for ( int i = 0 ; i < TPB_Y ; + + i ) <nl> + # pragma unroll <nl> + for ( int j = 0 ; j < TPB_X ; + + j ) <nl> + { <nl> + int label = new_labels [ i ] [ j ] ; <nl> + <nl> + while ( labels [ label ] < label ) label = labels [ label ] ; <nl> + <nl> + new_labels [ i ] [ j ] = label ; <nl> + } <nl> + __syncthreads ( ) ; <nl> + } <nl> + <nl> + # pragma unroll <nl> + for ( int i = 0 ; i < TPB_Y ; + + i ) <nl> + # pragma unroll <nl> + for ( int j = 0 ; j < TPB_X ; + + j ) <nl> + { <nl> + int label = new_labels [ i ] [ j ] ; <nl> + int yloc = label / TILE_COLS ; <nl> + int xloc = label - yloc * TILE_COLS ; <nl> + <nl> + xloc + = blockIdx . x * TILE_COLS ; <nl> + yloc + = blockIdx . y * TILE_ROWS ; <nl> + <nl> + label = yloc * edges . cols + xloc ; <nl> + / / do it for x too . <nl> + if ( y + CTA_SIZE_Y * i < comps . rows ) comps ( y + CTA_SIZE_Y * i , x + CTA_SIZE_X * j ) = label ; <nl> + } <nl> + } <nl> + <nl> + __device__ __forceinline__ int root ( const DevMem2Di & comps , int label ) <nl> + { <nl> + while ( 1 ) <nl> + { <nl> + int y = label / comps . cols ; <nl> + int x = label - y * comps . cols ; <nl> + <nl> + int parent = comps ( y , x ) ; <nl> + <nl> + if ( label = = parent ) break ; <nl> + <nl> + label = parent ; <nl> + } <nl> + return label ; <nl> + } <nl> + <nl> + __device__ __forceinline__ void isConnected ( DevMem2Di & comps , int l1 , int l2 , bool & changed ) <nl> + { <nl> + int r1 = root ( comps , l1 ) ; <nl> + int r2 = root ( comps , l2 ) ; <nl> + <nl> + if ( r1 = = r2 ) return ; <nl> + <nl> + int mi = min ( r1 , r2 ) ; <nl> + int ma = max ( r1 , r2 ) ; <nl> + <nl> + int y = ma / comps . cols ; <nl> + int x = ma - y * comps . cols ; <nl> + <nl> + atomicMin ( & comps . ptr ( y ) [ x ] , mi ) ; <nl> + changed = true ; <nl> + } <nl> + <nl> + __global__ void crossMerge ( const int tilesNumY , const int tilesNumX , int tileSizeY , int tileSizeX , <nl> + const DevMem2D edges , DevMem2Di comps , const int yIncomplete , int xIncomplete ) <nl> + { <nl> + int tid = threadIdx . y * blockDim . x + threadIdx . x ; <nl> + int stride = blockDim . y * blockDim . x ; <nl> + <nl> + int ybegin = blockIdx . y * ( tilesNumY * tileSizeY ) ; <nl> + int yend = ybegin + tilesNumY * tileSizeY ; <nl> + <nl> + if ( blockIdx . y = = gridDim . y - 1 ) <nl> + { <nl> + yend - = yIncomplete * tileSizeY ; <nl> + yend - = tileSizeY ; <nl> + tileSizeY = ( edges . rows % tileSizeY ) ; <nl> + <nl> + yend + = tileSizeY ; <nl> + } <nl> + <nl> + int xbegin = blockIdx . x * tilesNumX * tileSizeX ; <nl> + int xend = xbegin + tilesNumX * tileSizeX ; <nl> + <nl> + if ( blockIdx . x = = gridDim . x - 1 ) <nl> + { <nl> + if ( xIncomplete ) yend = ybegin ; <nl> + xend - = xIncomplete * tileSizeX ; <nl> + xend - = tileSizeX ; <nl> + tileSizeX = ( edges . cols % tileSizeX ) ; <nl> + <nl> + xend + = tileSizeX ; <nl> + } <nl> + <nl> + if ( blockIdx . y = = ( gridDim . y - 1 ) & & yIncomplete ) <nl> + { <nl> + xend = xbegin ; <nl> + } <nl> + <nl> + int tasksV = ( tilesNumX - 1 ) * ( yend - ybegin ) ; <nl> + int tasksH = ( tilesNumY - 1 ) * ( xend - xbegin ) ; <nl> + <nl> + int total = tasksH + tasksV ; <nl> + <nl> + bool changed ; <nl> + do <nl> + { <nl> + changed = false ; <nl> + for ( int taskIdx = tid ; taskIdx < total ; taskIdx + = stride ) <nl> + { <nl> + if ( taskIdx < tasksH ) <nl> + { <nl> + int indexH = taskIdx ; <nl> + <nl> + int row = indexH / ( xend - xbegin ) ; <nl> + int col = indexH - row * ( xend - xbegin ) ; <nl> + <nl> + int y = ybegin + ( row + 1 ) * tileSizeY ; <nl> + int x = xbegin + col ; <nl> + <nl> + component e = edges ( x , y ) ; <nl> + if ( e & UP ) <nl> + { <nl> + int lc = comps ( y , x ) ; <nl> + int lu = comps ( y - 1 , x ) ; <nl> + <nl> + isConnected ( comps , lc , lu , changed ) ; <nl> + } <nl> + } <nl> + else <nl> + { <nl> + int indexV = taskIdx - tasksH ; <nl> + <nl> + int col = indexV / ( yend - ybegin ) ; <nl> + int row = indexV - col * ( yend - ybegin ) ; <nl> + <nl> + int x = xbegin + ( col + 1 ) * tileSizeX ; <nl> + int y = ybegin + row ; <nl> + <nl> + component e = edges ( x , y ) ; <nl> + if ( e & LEFT ) <nl> + { <nl> + int lc = comps ( y , x ) ; <nl> + int ll = comps ( y , x - 1 ) ; <nl> + <nl> + isConnected ( comps , lc , ll , changed ) ; <nl> + } <nl> + } <nl> + } <nl> + } while ( __syncthreads_or ( changed ) ) ; <nl> + } <nl> + <nl> + __global__ void flatten ( const DevMem2D edges , DevMem2Di comps ) <nl> + { <nl> + int x = threadIdx . x + blockIdx . x * blockDim . x ; <nl> + int y = threadIdx . y + blockIdx . y * blockDim . y ; <nl> + <nl> + if ( x < comps . cols & & y < comps . rows ) <nl> + comps ( y , x ) = root ( comps , comps ( y , x ) ) ; <nl> + } <nl> + <nl> + void labelComponents ( const DevMem2D & edges , DevMem2Di comps ) <nl> + { <nl> + dim3 block ( CTA_SIZE_X , CTA_SIZE_Y ) ; <nl> + dim3 grid ( divUp ( edges . cols , TILE_COLS ) , divUp ( edges . rows , TILE_ROWS ) ) ; <nl> + <nl> + lableTiles < < < grid , block > > > ( edges , comps ) ; <nl> + cudaSafeCall ( cudaGetLastError ( ) ) ; <nl> + <nl> + int tileSizeX = TILE_COLS , tileSizeY = TILE_ROWS ; <nl> + <nl> + cudaSafeCall ( cudaGetLastError ( ) ) ; <nl> + cudaSafeCall ( cudaDeviceSynchronize ( ) ) ; <nl> + <nl> + while ( grid . x > 1 | | grid . y > 1 ) <nl> + { <nl> + dim3 mergeGrid ( ceilf ( grid . x / 2 . 0 ) , ceilf ( grid . y / 2 . 0 ) ) ; <nl> + dim3 mergeBlock ( STA_SIZE_MARGE_X , STA_SIZE_MARGE_Y ) ; <nl> + std : : cout < < " merging : " < < grid . y < < " x " < < grid . x < < " mmm > " < < mergeGrid . y < < " x " < < mergeGrid . x < < " for tiles : " < < tileSizeY < < " x " < < tileSizeX < < std : : endl ; <nl> + crossMerge < < < mergeGrid , mergeBlock > > > ( 2 , 2 , tileSizeY , tileSizeX , edges , comps , ceilf ( grid . y / 2 . 0 ) - grid . y / 2 , ceilf ( grid . x / 2 . 0 ) - grid . x / 2 ) ; <nl> + tileSizeX < < = 1 ; <nl> + tileSizeY < < = 1 ; <nl> + grid = mergeGrid ; <nl> + <nl> + cudaSafeCall ( cudaGetLastError ( ) ) ; <nl> + } <nl> + <nl> + grid . x = divUp ( edges . cols , block . x ) ; <nl> + grid . y = divUp ( edges . rows , block . y ) ; <nl> + flatten < < < grid , block > > > ( edges , comps ) ; <nl> + cudaSafeCall ( cudaGetLastError ( ) ) ; <nl> + cudaSafeCall ( cudaDeviceSynchronize ( ) ) ; <nl> + } <nl> + } <nl> + } } } <nl> \ No newline at end of file <nl> mmm a / modules / gpu / src / graphcuts . cpp <nl> ppp b / modules / gpu / src / graphcuts . cpp <nl> <nl> void cv : : gpu : : graphcut ( GpuMat & , GpuMat & , GpuMat & , GpuMat & , GpuMat & , GpuMat & , GpuMat & , Stream & ) { throw_nogpu ( ) ; } <nl> void cv : : gpu : : graphcut ( GpuMat & , GpuMat & , GpuMat & , GpuMat & , GpuMat & , GpuMat & , GpuMat & , GpuMat & , GpuMat & , GpuMat & , GpuMat & , Stream & ) { throw_nogpu ( ) ; } <nl> <nl> + void cv : : gpu : : labelComponents ( const GpuMat & image , GpuMat & mask , GpuMat & components , const cv : : Scalar & lo , const cv : : Scalar & hi ) { throw_nogpu ( ) ; } <nl> + <nl> # else / * ! defined ( HAVE_CUDA ) * / <nl> <nl> + namespace cv { namespace gpu { namespace device <nl> + { <nl> + namespace ccl <nl> + { <nl> + void labelComponents ( const DevMem2D & edges , DevMem2Di comps ) ; <nl> + void computeEdges ( const DevMem2D & image , DevMem2D edges , const int lo , const int hi ) ; <nl> + } <nl> + } } } <nl> + <nl> + void cv : : gpu : : labelComponents ( const GpuMat & image , GpuMat & mask , GpuMat & components , const cv : : Scalar & lo , const cv : : Scalar & hi ) <nl> + { <nl> + device : : ccl : : computeEdges ( image , mask , lo [ 0 ] , hi [ 0 ] ) ; <nl> + device : : ccl : : labelComponents ( mask , components ) ; <nl> + } <nl> + <nl> + <nl> namespace <nl> { <nl> typedef NppStatus ( * init_func_t ) ( NppiSize oSize , NppiGraphcutState * * ppState , Npp8u * pDeviceMem ) ; <nl> new file mode 100644 <nl> index 00000000000 . . 1c0f2acd0d0 <nl> mmm / dev / null <nl> ppp b / modules / gpu / test / test_labeling . cpp <nl> <nl> + / * M / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> + / / <nl> + / / IMPORTANT : READ BEFORE DOWNLOADING , COPYING , INSTALLING OR USING . <nl> + / / <nl> + / / By downloading , copying , installing or using the software you agree to this license . <nl> + / / If you do not agree to this license , do not download , install , <nl> + / / copy or use the software . <nl> + / / <nl> + / / <nl> + / / License Agreement <nl> + / / For Open Source Computer Vision Library <nl> + / / <nl> + / / Copyright ( C ) 2000 - 2008 , Intel Corporation , all rights reserved . <nl> + / / Copyright ( C ) 2008 - 2011 , Willow Garage Inc . , all rights reserved . <nl> + / / Third party copyrights are property of their respective owners . <nl> + / / <nl> + / / Redistribution and use in source and binary forms , with or without modification , <nl> + / / are permitted provided that the following conditions are met : <nl> + / / <nl> + / / * Redistributions of source code must retain the above copyright notice , <nl> + / / this list of conditions and the following disclaimer . <nl> + / / <nl> + / / * Redistributions in binary form must reproduce the above copyright notice , <nl> + / / this list of conditions and the following disclaimer in the documentation <nl> + / / and / or other materials provided with the distribution . <nl> + / / <nl> + / / * The name of the copyright holders may not be used to endorse or promote products <nl> + / / derived from this software without specific prior written permission . <nl> + / / <nl> + / / This software is provided by the copyright holders and contributors " as is " and <nl> + / / any express or implied warranties , including , but not limited to , the implied <nl> + / / warranties of merchantability and fitness for a particular purpose are disclaimed . <nl> + / / In no event shall the Intel Corporation or contributors be liable for any direct , <nl> + / / indirect , incidental , special , exemplary , or consequential damages <nl> + / / ( including , but not limited to , procurement of substitute goods or services ; <nl> + / / loss of use , data , or profits ; or business interruption ) however caused <nl> + / / and on any theory of liability , whether in contract , strict liability , <nl> + / / or tort ( including negligence or otherwise ) arising in any way out of <nl> + / / the use of this software , even if advised of the possibility of such damage . <nl> + / / M * / <nl> + <nl> + # include " precomp . hpp " <nl> + # include < string > <nl> + # include < iostream > <nl> + <nl> + struct Labeling : testing : : TestWithParam < cv : : gpu : : DeviceInfo > <nl> + { <nl> + cv : : gpu : : DeviceInfo devInfo ; <nl> + <nl> + virtual void SetUp ( ) <nl> + { <nl> + devInfo = GetParam ( ) ; <nl> + cv : : gpu : : setDevice ( devInfo . deviceID ( ) ) ; <nl> + } <nl> + <nl> + cv : : Mat loat_image ( ) <nl> + { <nl> + return cv : : imread ( std : : string ( cvtest : : TS : : ptr ( ) - > get_data_path ( ) ) + " labeling / label . png " ) ; <nl> + } <nl> + } ; <nl> + <nl> + TEST_P ( Labeling , ConnectedComponents ) <nl> + { <nl> + cv : : Mat image ; <nl> + cvtColor ( loat_image ( ) , image , CV_BGR2GRAY ) ; <nl> + cv : : Mat image_cpu = image . clone ( ) ; <nl> + <nl> + / / cv : : floodFill ( image , cv : : Point ( 1 , 1 ) , cv : : Scalar : : all ( 64 ) , 0 , cv : : Scalar : : all ( 0 ) , cv : : Scalar : : all ( 256 ) ) ; <nl> + <nl> + cv : : gpu : : GpuMat mask ; <nl> + mask . create ( image . rows , image . cols , CV_8UC1 ) ; <nl> + <nl> + cv : : gpu : : GpuMat components ; <nl> + components . create ( image . rows , image . cols , CV_32SC1 ) ; <nl> + <nl> + std : : cout < < " summary : " < < image . cols < < " " < < image . rows < < " " <nl> + < < cv : : gpu : : GpuMat ( image ) . cols < < " " < < cv : : gpu : : GpuMat ( image ) . rows < < " " <nl> + < < mask . cols < < " " < < mask . rows < < " " <nl> + < < components . cols < < " " < < components . rows < < std : : endl ; <nl> + <nl> + <nl> + cv : : gpu : : labelComponents ( cv : : gpu : : GpuMat ( image ) , mask , components , cv : : Scalar : : all ( 0 ) , cv : : Scalar : : all ( 2 ) ) ; <nl> + <nl> + / / / / for ( int i = 0 ; i + 32 < image . rows ; i + = 32 ) <nl> + / / / / for ( int j = 0 ; j + 32 < image . cols ; j + = 32 ) <nl> + / / / / { <nl> + / / / / std : : cout < < cv : : Mat ( cv : : Mat ( mask ) , cv : : Rect ( j , i , 32 , 32 ) ) < < std : : endl ; <nl> + / / / / std : : cout < < cv : : Mat ( cv : : Mat ( components ) , cv : : Rect ( j , i , 32 , 32 ) ) < < std : : endl ; <nl> + / / / / } <nl> + <nl> + / / std : : cout < < cv : : Mat ( components ) < < std : : endl ; <nl> + / / cv : : imshow ( " test " , image ) ; <nl> + / / cv : : waitKey ( 0 ) ; <nl> + <nl> + / / for ( int i = 0 ; i + 32 < image . rows ; i + = 32 ) <nl> + / / for ( int j = 0 ; j + 32 < image . cols ; j + = 32 ) <nl> + / / cv : : rectangle ( image , cv : : Rect ( j , i , 32 , 32 ) , CV_RGB ( 255 , 255 , 255 ) ) ; <nl> + <nl> + cv : : imshow ( " test " , image ) ; <nl> + cv : : waitKey ( 0 ) ; <nl> + cv : : imshow ( " test " , cv : : Mat ( mask ) * 10 ) ; <nl> + cv : : waitKey ( 0 ) ; <nl> + cv : : imshow ( " test " , cv : : Mat ( components ) * 2 ) ; <nl> + cv : : waitKey ( 0 ) ; <nl> + std : : cout < < " test ! " < < image . cols < < std : : endl ; <nl> + } <nl> + <nl> + INSTANTIATE_TEST_CASE_P ( ConnectedComponents , Labeling , ALL_DEVICES ) ; <nl> \ No newline at end of file <nl>
connected components labeling
opencv/opencv
350621057f0f292a40452119e95a5ab625457d2d
2012-08-07T09:22:41Z
mmm a / Marlin / src / lcd / language / language_en . h <nl> ppp b / Marlin / src / lcd / language / language_en . h <nl> <nl> # ifndef MSG_PREHEAT_2_SETTINGS <nl> # define MSG_PREHEAT_2_SETTINGS MSG_PREHEAT_2 _UxGT ( " conf " ) <nl> # endif <nl> + # ifndef MSG_PREHEAT_CUSTOM <nl> + # define MSG_PREHEAT_CUSTOM _UxGT ( " Preheat Custom " ) <nl> + # endif <nl> # ifndef MSG_COOLDOWN <nl> # define MSG_COOLDOWN _UxGT ( " Cooldown " ) <nl> # endif <nl> mmm a / Marlin / src / lcd / ultralcd . cpp <nl> ppp b / Marlin / src / lcd / ultralcd . cpp <nl> void lcd_quick_feedback ( const bool clear_buttons ) { <nl> return PSTR ( MSG_FILAMENTCHANGE ) ; <nl> } <nl> <nl> - void _change_filament_temp ( const uint8_t index ) { <nl> + void _change_filament_temp ( const uint16_t temperature ) { <nl> char cmd [ 11 ] ; <nl> sprintf_P ( cmd , _change_filament_temp_command ( ) , _change_filament_temp_extruder ) ; <nl> - thermalManager . setTargetHotend ( index = = 1 ? PREHEAT_1_TEMP_HOTEND : PREHEAT_2_TEMP_HOTEND , _change_filament_temp_extruder ) ; <nl> + thermalManager . setTargetHotend ( temperature , _change_filament_temp_extruder ) ; <nl> lcd_enqueue_command ( cmd ) ; <nl> } <nl> - void _lcd_change_filament_temp_1_menu ( ) { _change_filament_temp ( 1 ) ; } <nl> - void _lcd_change_filament_temp_2_menu ( ) { _change_filament_temp ( 2 ) ; } <nl> + void _lcd_change_filament_temp_1_menu ( ) { _change_filament_temp ( PREHEAT_1_TEMP_HOTEND ) ; } <nl> + void _lcd_change_filament_temp_2_menu ( ) { _change_filament_temp ( PREHEAT_2_TEMP_HOTEND ) ; } <nl> + void _lcd_change_filament_temp_custom_menu ( ) { _change_filament_temp ( thermalManager . target_temperature [ _change_filament_temp_extruder ] ) ; } <nl> <nl> static const char * change_filament_header ( const AdvancedPauseMode mode ) { <nl> switch ( mode ) { <nl> void lcd_quick_feedback ( const bool clear_buttons ) { <nl> MENU_BACK ( MSG_FILAMENTCHANGE ) ; <nl> MENU_ITEM ( submenu , MSG_PREHEAT_1 , _lcd_change_filament_temp_1_menu ) ; <nl> MENU_ITEM ( submenu , MSG_PREHEAT_2 , _lcd_change_filament_temp_2_menu ) ; <nl> + uint16_t max_temp ; <nl> + switch ( extruder ) { <nl> + default : max_temp = HEATER_0_MAXTEMP ; <nl> + # if HOTENDS > 1 <nl> + case 1 : max_temp = HEATER_1_MAXTEMP ; break ; <nl> + # if HOTENDS > 2 <nl> + case 2 : max_temp = HEATER_2_MAXTEMP ; break ; <nl> + # if HOTENDS > 3 <nl> + case 3 : max_temp = HEATER_3_MAXTEMP ; break ; <nl> + # if HOTENDS > 4 <nl> + case 4 : max_temp = HEATER_4_MAXTEMP ; break ; <nl> + # endif <nl> + # endif <nl> + # endif <nl> + # endif <nl> + } <nl> + MENU_MULTIPLIER_ITEM_EDIT_CALLBACK ( int3 , MSG_PREHEAT_CUSTOM , & thermalManager . target_temperature [ _change_filament_temp_extruder ] , EXTRUDE_MINTEMP , max_temp - 15 , _lcd_change_filament_temp_custom_menu ) ; <nl> END_MENU ( ) ; <nl> } <nl> void lcd_temp_menu_e0_filament_change ( ) { _lcd_temp_menu_filament_op ( ADVANCED_PAUSE_MODE_PAUSE_PRINT , 0 ) ; } <nl>
Add custom preheat temp to filament change ( )
MarlinFirmware/Marlin
2ebfe90be964e321ee222c25eb4b15a392543f85
2018-09-10T07:51:46Z
mmm a / modules / highgui / CMakeLists . txt <nl> ppp b / modules / highgui / CMakeLists . txt <nl> set ( high_gui_android_srcs src / bitstrm . cpp <nl> src / utils . cpp <nl> src / grfmt_sunras . cpp <nl> src / grfmt_pxm . cpp <nl> - src / window . cpp ) <nl> + src / window . cpp <nl> + src / cap_images . cpp ) <nl> define_android_manual ( opencv_highgui " $ { high_gui_android_srcs } " " $ ( LOCAL_PATH ) / src $ ( OPENCV_INCLUDES ) " ) <nl> endif ( ) <nl>
adding cap_images . cpp to android build , may fix link error , but not really address issue of reading video files on android
opencv/opencv
58cb6c268ec06b08595a04738158606d84ccf2c5
2011-02-20T18:53:14Z
mmm a / android / sdk / src / main / java / com / taobao / weex / ui / view / border / BorderDrawable . java <nl> ppp b / android / sdk / src / main / java / com / taobao / weex / ui / view / border / BorderDrawable . java <nl> <nl> import android . graphics . PathEffect ; <nl> import android . graphics . Rect ; <nl> import android . graphics . RectF ; <nl> + import android . graphics . Shader ; <nl> import android . graphics . drawable . Drawable ; <nl> import android . os . Build ; <nl> import android . support . annotation . NonNull ; <nl> public void draw ( Canvas canvas ) { <nl> if ( ( useColor > > > 24 ) ! = 0 ) { <nl> mPaint . setStyle ( Paint . Style . FILL ) ; <nl> mPaint . setColor ( useColor ) ; <nl> + mPaint . setShader ( null ) ; <nl> canvas . drawPath ( mPathForBorderOutline , mPaint ) ; <nl> } <nl> } <nl> mPaint . setStyle ( Paint . Style . STROKE ) ; <nl> mPaint . setStrokeJoin ( Paint . Join . ROUND ) ; <nl> drawBorders ( canvas ) ; <nl> + mPaint . setShader ( null ) ; <nl> canvas . restore ( ) ; <nl> } <nl> <nl> private void drawOneSide ( Canvas canvas , @ NonNull BorderEdge borderEdge ) { <nl> <nl> private void preparePaint ( int side ) { <nl> float borderWidth = getBorderWidth ( side ) ; <nl> - int color = getBorderColor ( side ) ; <nl> + int color = WXViewUtils . multiplyColorAlpha ( getBorderColor ( side ) , mAlpha ) ; <nl> BorderStyle borderStyle = BorderStyle . values ( ) [ getBorderStyle ( side ) ] ; <nl> - PathEffect pathEffect = borderStyle . getPathEffect ( borderWidth ) ; <nl> - mPaint . setColor ( WXViewUtils . multiplyColorAlpha ( color , mAlpha ) ) ; <nl> + Shader shader ; <nl> + <nl> + if ( side = = Spacing . TOP | | side = = Spacing . BOTTOM ) { <nl> + shader = borderStyle . getLineShader ( borderWidth , color , false ) ; <nl> + } else if ( side = = Spacing . LEFT | | side = = Spacing . RIGHT ) { <nl> + shader = borderStyle . getLineShader ( borderWidth , color , true ) ; <nl> + } else { <nl> + shader = null ; <nl> + } <nl> + <nl> + mPaint . setShader ( shader ) ; <nl> + mPaint . setColor ( color ) ; <nl> mPaint . setStrokeWidth ( borderWidth ) ; <nl> - mPaint . setPathEffect ( pathEffect ) ; <nl> } <nl> <nl> private int getBorderColor ( int position ) { <nl> mmm a / android / sdk / src / main / java / com / taobao / weex / ui / view / border / BorderEdge . java <nl> ppp b / android / sdk / src / main / java / com / taobao / weex / ui / view / border / BorderEdge . java <nl> void drawEdge ( @ NonNull Canvas canvas , @ NonNull Paint paint ) { <nl> PointF lineStart = mPreCorner . getCornerEnd ( ) ; <nl> Path path ; <nl> if ( mPreCorner . hasOuterCorner ( ) ) { <nl> - path = new Path ( ) ; <nl> + path = new Path ( ) ; <nl> if ( mPreCorner . hasInnerCorner ( ) ) { <nl> path . addArc ( mPreCorner . getOvalIfInnerCornerExist ( ) , <nl> mPreCorner . getAngleBisectorDegree ( ) , <nl> void drawEdge ( @ NonNull Canvas canvas , @ NonNull Paint paint ) { <nl> mPreCorner . getAngleBisectorDegree ( ) , <nl> BorderCorner . SWEEP_ANGLE ) ; <nl> } <nl> - canvas . drawPath ( path , paint ) ; <nl> + canvas . drawPath ( path , paint ) ; <nl> } else { <nl> PointF actualStart = mPreCorner . getSharpCornerStart ( ) ; <nl> canvas . drawLine ( actualStart . x , actualStart . y , lineStart . x , lineStart . y , paint ) ; <nl> void drawEdge ( @ NonNull Canvas canvas , @ NonNull Paint paint ) { <nl> <nl> paint . setStrokeWidth ( mBorderWidth ) ; <nl> PointF lineEnd = mPostCorner . getCornerStart ( ) ; <nl> - path = new Path ( ) ; <nl> - path . moveTo ( lineStart . x , lineStart . y ) ; <nl> - path . lineTo ( lineEnd . x , lineEnd . y ) ; <nl> - canvas . drawPath ( path , paint ) ; <nl> + canvas . drawLine ( lineStart . x , lineStart . y , lineEnd . x , lineEnd . y , paint ) ; <nl> <nl> if ( mPostCorner . hasOuterCorner ( ) ) { <nl> - path = new Path ( ) ; <nl> + path = new Path ( ) ; <nl> if ( mPostCorner . hasInnerCorner ( ) ) { <nl> path . addArc ( mPostCorner . getOvalIfInnerCornerExist ( ) , <nl> mPostCorner . getAngleBisectorDegree ( ) - BorderCorner . SWEEP_ANGLE , <nl> void drawEdge ( @ NonNull Canvas canvas , @ NonNull Paint paint ) { <nl> mPostCorner . getAngleBisectorDegree ( ) - BorderCorner . SWEEP_ANGLE , <nl> BorderCorner . SWEEP_ANGLE ) ; <nl> } <nl> - canvas . drawPath ( path , paint ) ; <nl> + canvas . drawPath ( path , paint ) ; <nl> } else { <nl> PointF actualEnd = mPostCorner . getSharpCornerEnd ( ) ; <nl> canvas . drawLine ( lineEnd . x , lineEnd . y , actualEnd . x , actualEnd . y , paint ) ; <nl> mmm a / android / sdk / src / main / java / com / taobao / weex / ui / view / border / BorderStyle . java <nl> ppp b / android / sdk / src / main / java / com / taobao / weex / ui / view / border / BorderStyle . java <nl> <nl> * / <nl> package com . taobao . weex . ui . view . border ; <nl> <nl> + import android . graphics . Color ; <nl> import android . graphics . DashPathEffect ; <nl> + import android . graphics . LinearGradient ; <nl> import android . graphics . PathEffect ; <nl> + import android . graphics . Shader ; <nl> + import android . support . annotation . NonNull ; <nl> import android . support . annotation . Nullable ; <nl> <nl> enum BorderStyle { <nl> <nl> DOTTED ; <nl> <nl> @ Nullable <nl> - PathEffect getPathEffect ( float borderWidth ) { <nl> + Shader getLineShader ( float borderWidth , int borderColor , boolean vertical ) { <nl> switch ( this ) { <nl> - case SOLID : <nl> - return null ; <nl> - case DASHED : <nl> - return new DashPathEffect ( <nl> - new float [ ] { borderWidth * 3 , borderWidth * 3 , borderWidth * 3 , borderWidth * 3 } , 0 ) ; <nl> case DOTTED : <nl> - return new DashPathEffect ( <nl> - new float [ ] { borderWidth , borderWidth , borderWidth , borderWidth } , 0 ) ; <nl> + if ( vertical ) { <nl> + return new LinearGradient ( 0 , 0 , 0 , borderWidth * 2 , new int [ ] { borderColor , Color <nl> + . TRANSPARENT } , new float [ ] { 0 . 5f , 0 . 5f } , Shader . TileMode . REPEAT ) ; <nl> + } else { <nl> + return new LinearGradient ( 0 , 0 , borderWidth * 2 , 0 , new int [ ] { borderColor , Color <nl> + . TRANSPARENT } , new float [ ] { 0 . 5f , 0 . 5f } , Shader . TileMode . REPEAT ) ; <nl> + } <nl> + case DASHED : <nl> + if ( vertical ) { <nl> + return new LinearGradient ( 0 , 0 , 0 , borderWidth * 6 , new int [ ] { borderColor , Color <nl> + . TRANSPARENT } , new float [ ] { 0 . 5f , 0 . 5f } , Shader . TileMode . REPEAT ) ; <nl> + } else { <nl> + return new LinearGradient ( 0 , 0 , borderWidth * 6 , 0 , new int [ ] { borderColor , Color <nl> + . TRANSPARENT } , new float [ ] { 0 . 5f , 0 . 5f } , Shader . TileMode . REPEAT ) ; <nl> + } <nl> default : <nl> return null ; <nl> } <nl>
* [ Android ] Use shader to implement PathEffect in order to avoid " android Path too large to be rendered into a texture "
apache/incubator-weex
16de5892e4ac0dad252197fc58129cf987054553
2016-08-10T10:00:39Z
mmm a / README . md <nl> ppp b / README . md <nl> You can ask for help in : <nl> <nl> # # Authors <nl> <nl> - * [ David Capello ] ( https : / / github . com / dacap ) : Lead developer , bug fixing , new features , designer , and maintainer . <nl> + * [ David Capello ] ( https : / / davidcapello . com / ) : Lead developer , bug fixing , new features , designer , and maintainer . <nl> * [ Gaspar Capello ] ( https : / / github . com / Gasparoken ) : Developer , bug fixing . <nl> <nl> # # Credits <nl> <nl> The default Aseprite theme was introduced in v0 . 8 , created by : <nl> <nl> - * [ Ilija Melentijevic ] ( https : / / twitter . com / ilkkke ) <nl> + * [ Ilija Melentijevic ] ( https : / / ilkke . net / ) <nl> <nl> Aseprite includes color palettes created by : <nl> <nl> mmm a / data / widgets / about . xml <nl> ppp b / data / widgets / about . xml <nl> <nl> < label text = " Animated sprite editor & amp ; & amp ; pixel art tool " / > <nl> < separator text = " Authors : " horizontal = " true " / > <nl> < grid columns = " 2 " > <nl> - < link text = " David Capello " url = " https : / / github . com / dacap " / > <nl> + < link text = " David Capello " url = " https : / / davidcapello . com / " / > <nl> < label text = " - Lead developer , graphics & amp ; & amp ; maintainer " / > <nl> < link text = " Gaspar Capello " url = " https : / / github . com / Gasparoken " / > <nl> < label text = " - Programmer , bug fixing " / > <nl>
Update website links
aseprite/aseprite
8b44411f87a1b3464ee20da0d45b2d40daaa55e4
2018-06-19T14:05:40Z
mmm a / table / block_based_table_reader . cc <nl> ppp b / table / block_based_table_reader . cc <nl> void BlockBasedTable : : SetupForCompaction ( ) { <nl> default : <nl> assert ( false ) ; <nl> } <nl> - compaction_optimized_ = true ; <nl> } <nl> <nl> std : : shared_ptr < const TableProperties > BlockBasedTable : : GetTableProperties ( ) <nl> mmm a / table / block_based_table_reader . h <nl> ppp b / table / block_based_table_reader . h <nl> class BlockBasedTable : public TableReader { <nl> struct CachableEntry ; <nl> struct Rep ; <nl> Rep * rep_ ; <nl> - explicit BlockBasedTable ( Rep * rep ) <nl> - : rep_ ( rep ) , compaction_optimized_ ( false ) { } <nl> + explicit BlockBasedTable ( Rep * rep ) : rep_ ( rep ) { } <nl> <nl> private : <nl> - bool compaction_optimized_ ; <nl> - <nl> / / input_iter : if it is not null , update this one and return it as Iterator <nl> static InternalIterator * NewDataBlockIterator ( Rep * rep , const ReadOptions & ro , <nl> const Slice & index_value , <nl>
Remoe unused BlockBasedTable : : compaction_optimized_
facebook/rocksdb
9bbba4fec16a1d32af44c4fa395b2b849f3eee08
2017-05-18T13:41:23Z