Return a reference to a new list cell whose head is value and whose tail is this list.
value
165166167168169170171172173174175
IPersistentCollection set = (IPersistentCollection) ipm.valAt(key); ESeq res = ERT.NIL; if (set == null) return res; for(ISeq s = set.seq(); s != null; s = s.next()) { res = res.cons((EObject) s.first()); } return res.reverse(); } @Override
166167168169170171172173174175176
ESeq list; if (o2.capture_spec == am_all) { ESeq l = ERT.NIL; for (int i = mr.groupCount(); i >= 0; i--) { l = l.cons( capture (subject, mr, i, o2) ); } result = result.cons(l); } else if ((list = o2.capture_spec.testSeq()) != null) { ESeq l = ERT.NIL;
179180181182183184185186187188189
ESmall num; EAtom nam; EString nam2; if ((num=group.testSmall()) != null) { l = l.cons( capture (subject, mr, num.value, o2 )); } else if ((nam=group.testAtom()) != null) { Integer groupNo = o2.named_groups.get(nam.getName()); if (groupNo != null) { l = l.cons( capture (subject, mr, groupNo.intValue(), o2 )); }
183184185186187188189190191192193
{ l = l.cons( capture (subject, mr, num.value, o2 )); } else if ((nam=group.testAtom()) != null) { Integer groupNo = o2.named_groups.get(nam.getName()); if (groupNo != null) { l = l.cons( capture (subject, mr, groupNo.intValue(), o2 )); } } else if ((nam2=group.testString()) != null) { Integer groupNo = o2.named_groups.get(nam2.stringValue()); if (groupNo != null) { l = l.cons( capture (subject, mr, groupNo.intValue(), o2 ));
188189190191192193194195196197198
l = l.cons( capture (subject, mr, groupNo.intValue(), o2 )); } } else if ((nam2=group.testString()) != null) { Integer groupNo = o2.named_groups.get(nam2.stringValue()); if (groupNo != null) { l = l.cons( capture (subject, mr, groupNo.intValue(), o2 )); } } else { throw new NotImplemented("named capture groups"); } list = list.tail();
226227228229230231232233234235236
ESeq il; if (o2.capture_spec == am_all) { ESeq l = ERT.NIL; for (int i = max; i >= 0; i--) { l = l.cons( capture (subject, mr, i, o2) ); } return new ETuple2(am_match, l); } else if (o2.capture_spec == am_all_but_first) { ESeq l = ERT.NIL;
233234235236237238239240241242243
return new ETuple2(am_match, l); } else if (o2.capture_spec == am_all_but_first) { ESeq l = ERT.NIL; for (int i = max; i > 0; i--) { l = l.cons( capture (subject, mr, i, o2) ); } return new ETuple2(am_match, l); } else if (o2.capture_spec == am_first) { EObject l = capture (subject, mr, 0, o2);
251252253254255256257258259260261
EObject what = il.head(); ESmall idx = what.testSmall(); EAtom nam; if (idx != null && mr.start(idx.value) != -1) { EObject val = capture (subject, mr, idx.value, o2); out = out.cons(val); } else if ((nam=what.testAtom())!=null) { Integer idx2 = o2.named_groups.get(nam.getName()); if (idx2 != null) { EObject val = capture (subject, mr, idx2, o2); out = out.cons(val);
256257258259260261262263264265266
out = out.cons(val); } else if ((nam=what.testAtom())!=null) { Integer idx2 = o2.named_groups.get(nam.getName()); if (idx2 != null) { EObject val = capture (subject, mr, idx2, o2); out = out.cons(val); } else { // badarg? } } else { out = out.cons(nocapture(o2));
261262263264265266267268269270271
out = out.cons(val); } else { // badarg? } } else { out = out.cons(nocapture(o2)); } } return new ETuple2(am_match, out.reverse());