protected Expression mapExpression ( AST mapNode ) { List expressions = new ArrayList ( ) ; AST elist = mapNode . getFirstChild ( ) ; if ( elist != null ) { // totally empty in the case of [:] assertNodeType ( ELIST , elist ) ; for ( AST node = elist . getFirstChild ( ) ; node != null ; node = node . getNextSibling ( ) ) { switch ( node . getType ( ) ) { case LABELED_ARG : case SPREAD_MAP_ARG : break ; // legal cases case SPREAD_ARG : assertNodeType ( SPREAD_MAP_ARG , node ) ; break ; // helpful error default : assertNodeType ( LABELED_ARG , node ) ; break ; // helpful error } expressions . add ( mapEntryExpression ( node ) ) ; } } MapExpression mapExpression = new MapExpression ( expressions ) ; configureAST ( mapExpression , mapNode ) ; return mapExpression ; }
Typically only used for map constructors I think?