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

Method rot_map

output/java8/1.4.13/Interpreter.java:764–789  ·  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

762 */
763
764 protected void rot_map(InstanceScope scope, Object attr, List<ST> prototypes) {
765 if ( attr==null ) {
766 operands[++sp] = null;
767 return;
768 }
769 attr = convertAnythingIteratableToIterator(scope, attr);
770 if ( attr instanceof Iterator ) {
771 List<ST> mapped = rot_map_iterator(scope, (Iterator)attr, prototypes);
772 operands[++sp] = mapped;
773 }
774 else { // if only single value, just apply first template to sole value
775 ST proto = prototypes.get(0);
776 ST st = group.createStringTemplateInternally(proto);
777 if ( st!=null ) {
778 setFirstArgument(scope, st, attr);
779 if ( st.impl.isAnonSubtemplate ) {
780 st.rawSetAttribute("i0", 0);
781 st.rawSetAttribute("i", 1);
782 }
783 operands[++sp] = st;
784 }
785 else {
786 operands[++sp] = null;
787 }
788 }
789 }
790
791 protected List<ST> rot_map_iterator(InstanceScope scope, Iterator<?> attr, List<ST> prototypes) {
792 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