MCPcopy Index your code
hub / github.com/antlr/codebuff / rot_map

Method rot_map

output/java8/1.4.17/Interpreter.java:787–812  ·  view source on GitHub ↗

Renders expressions of the form or .

(InstanceScope scope, Object attr, List<ST> prototypes)

Source from the content-addressed store, hash-verified

785 */
786
787 protected void rot_map(InstanceScope scope, Object attr, List<ST> prototypes) {
788 if ( attr==null ) {
789 operands[++sp] = null;
790 return;
791 }
792 attr = convertAnythingIteratableToIterator(scope, attr);
793 if ( attr instanceof Iterator ) {
794 List<ST> mapped = rot_map_iterator(scope, (Iterator)attr, prototypes);
795 operands[++sp] = mapped;
796 }
797 else { // if only single value, just apply first template to sole value
798 ST proto = prototypes.get(0);
799 ST st = group.createStringTemplateInternally(proto);
800 if ( st!=null ) {
801 setFirstArgument(scope, st, attr);
802 if ( st.impl.isAnonSubtemplate ) {
803 st.rawSetAttribute("i0", 0);
804 st.rawSetAttribute("i", 1);
805 }
806 operands[++sp] = st;
807 }
808 else {
809 operands[++sp] = null;
810 }
811 }
812 }
813
814 protected List<ST> rot_map_iterator(InstanceScope scope, Iterator<?> attr, List<ST> prototypes) {
815 List<ST> mapped = new ArrayList<ST>();

Callers 2

_execMethod · 0.95
mapMethod · 0.95

Calls 6

rot_map_iteratorMethod · 0.95
setFirstArgumentMethod · 0.95
rawSetAttributeMethod · 0.95
getMethod · 0.65

Tested by

no test coverage detected