Advertisement
Guest User

Untitled

a guest
May 30th, 2013
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 27.05 KB | None | 0 0
  1. constfold.c:1542:/* Set a slice of string 'existingSE' from a string 'newstr'.
  2. constfold.c:1545:void sliceAssignStringFromString(StringExp *existingSE, StringExp *newstr, size_t firstIndex)
  3. constfold.c:1553:/* Compare a string slice with another string slice.
  4. constfold.c:1556:int sliceCmpStringWithString(StringExp *se1, StringExp *se2, size_t lo1, size_t lo2, size_t len)
  5. constfold.c:1566:/* Compare a string slice with an array literal slice
  6. constfold.c:1569:int sliceCmpStringWithArray(StringExp *se1, ArrayLiteralExp *ae2, size_t lo1, size_t lo2, size_t len)
  7. constfold.c:1716: sliceAssignArrayLiteralFromString(dest, es, ea->elements->dim);
  8. constfold.c:1734: sliceAssignArrayLiteralFromString(dest, es, 0);
  9. ctfeexpr.c:204: case TOKslice:
  10. ctfeexpr.c:289: if (m->op == TOKslice)
  11. ctfeexpr.c:290: m = resolveSlice(m);
  12. ctfeexpr.c:342: else if (e->op == TOKslice)
  13. ctfeexpr.c:343: { // Array slices only do a shallow copy
  14. ctfeexpr.c:344: Expression *r = new SliceExp(e->loc, ((SliceExp *)e)->e1,
  15. ctfeexpr.c:345: ((SliceExp *)e)->lwr, ((SliceExp *)e)->upr);
  16. ctfeexpr.c:370: if (lit->op == TOKslice)
  17. ctfeexpr.c:372: SliceExp *se = (SliceExp *)lit;
  18. ctfeexpr.c:373: e = new SliceExp(lit->loc, se->e1, se->lwr, se->upr);
  19. ctfeexpr.c:382: e = new SliceExp(lit->loc, lit,
  20. ctfeexpr.c:388: e = new SliceExp(lit->loc, lit,
  21. ctfeexpr.c:412:Expression *resolveSlice(Expression *e)
  22. ctfeexpr.c:414: if ( ((SliceExp *)e)->e1->op == TOKnull)
  23. ctfeexpr.c:415: return ((SliceExp *)e)->e1;
  24. ctfeexpr.c:416: return Slice(e->type, ((SliceExp *)e)->e1,
  25. ctfeexpr.c:417: ((SliceExp *)e)->lwr, ((SliceExp *)e)->upr);
  26. ctfeexpr.c:421: * e must be an array literal, or a slice
  27. ctfeexpr.c:422: * It's very wasteful to resolve the slice when we only
  28. ctfeexpr.c:429: if (e->op == TOKslice)
  29. ctfeexpr.c:430: { uinteger_t ilo = ((SliceExp *)e)->lwr->toInteger();
  30. ctfeexpr.c:431: uinteger_t iup = ((SliceExp *)e)->upr->toInteger();
  31. ctfeexpr.c:1086: if (x->op == TOKslice)
  32. ctfeexpr.c:1087: x = ((SliceExp *)e)->e1;
  33. ctfeexpr.c:1232: * e1 and e2 may be strings, arrayliterals, or slices.
  34. ctfeexpr.c:1238: // Resolve slices, if necessary
  35. ctfeexpr.c:1243: if (x->op == TOKslice)
  36. ctfeexpr.c:1244: { lo1 = ((SliceExp *)x)->lwr->toInteger();
  37. ctfeexpr.c:1245: x = ((SliceExp*)x)->e1;
  38. ctfeexpr.c:1251: if (x->op == TOKslice)
  39. ctfeexpr.c:1252: { lo2 = ((SliceExp *)x)->lwr->toInteger();
  40. ctfeexpr.c:1253: x = ((SliceExp*)x)->e1;
  41. ctfeexpr.c:1260: return sliceCmpStringWithString(se1, se2, lo1, lo2, len);
  42. ctfeexpr.c:1262: return sliceCmpStringWithArray(se1, ae2, lo1, lo2, len);
  43. ctfeexpr.c:1264: return -sliceCmpStringWithArray(se2, ae1, lo2, lo1, len);
  44. ctfeexpr.c:1292: e->op == TOKslice || e->op == TOKnull;
  45. ctfeexpr.c:1411:/// Evaluate ==, !=. Resolves slices before comparing. Returns 0 or 1
  46. ctfeexpr.c:1421:/// Evaluate is, !is. Resolves slices before comparing. Returns 0 or 1
  47. ctfeexpr.c:1458:/// Evaluate >,<=, etc. Resolves slices before comparing. Returns 0 or 1
  48. ctfeexpr.c:1679: sliceAssignStringFromString((StringExp *)dest, (StringExp *)src, 0);
  49. ctfeexpr.c:1684: sliceAssignArrayLiteralFromString((ArrayLiteralExp *)dest, (StringExp *)src, 0);
  50. ctfeexpr.c:1689: sliceAssignStringFromArrayLiteral((StringExp *)dest, (ArrayLiteralExp *)src, 0);
  51. ctfeexpr.c:1816: // Resolve slices
  52. ctfeexpr.c:1818: if (oldval->op == TOKslice)
  53. ctfeexpr.c:1819: { indxlo = ((SliceExp *)oldval)->lwr->toInteger();
  54. ctfeexpr.c:1820: oldval = ((SliceExp *)oldval)->e1;
  55. ctfeexpr.c:1896: if (newval->type->nextOf()->ty == Tarray && newval->op == TOKslice)
  56. ctfeexpr.c:1967: if (newval->op == TOKslice)
  57. ctfeexpr.c:1969: SliceExp *se = (SliceExp *)newval;
  58. ctfeexpr.c:2019: else if (e->op == TOKslice)
  59. ctfeexpr.c:2021: printf("SLICE %p: %s\n", e, e->toChars());
  60. ctfeexpr.c:2022: showCtfeExpr(((SliceExp *)e)->e1, level + 1);
  61. declaration.c:1464: e1 = new SliceExp(loc, e1, NULL, NULL);
  62. delegatize.c:89: case TOKslice:
  63. delegatize.c:90: { SliceExp *se = (SliceExp *)e;
  64. dsymbol.c:1248: assert(e->op == TOKindex || e->op == TOKslice || e->op == TOKarray);
  65. dsymbol.c:1312: else if (exp->op == TOKslice)
  66. dsymbol.c:1315: SliceExp *se = (SliceExp *)exp;
  67. dsymbol.c:1369: assert(exp->op == TOKarray || exp->op == TOKslice);
  68. dsymbol.c:1392: * ce.opSlice( ... use of $ ... )
  69. dsymbol.c:1395: * (ref __dop = ce, __dop).opSlice( ... __dop.opDollar ...)
  70. dsymbol.c:1419: else if (exp->op == TOKslice)
  71. dsymbol.c:1421: dim = 0; // slices are currently always one-dimensional
  72. dump.c:93:void SliceExp::dump(int i)
  73. e2ir.c:2726: if (e1->op == TOKslice)
  74. e2ir.c:2728: SliceExp *are = (SliceExp *)(e1);
  75. e2ir.c:3009: (e2->op == TOKslice && ((UnaExp *)e2)->e1->isLvalue() ||
  76. e2ir.c:3011: e2->op != TOKslice && e2->isLvalue()))
  77. e2ir.c:4751:elem *SliceExp::toElem(IRState *irs)
  78. e2ir.c:4753: //printf("SliceExp::toElem()\n");
  79. expression.c:6857: else if (e1->op == TOKslice)
  80. expression.c:7876: * The offending code is the return type from std.typecons.Tuple.slice:
  81. expression.c:7877: * ref Tuple!(Types[from .. to]) slice(uint from, uint to)()
  82. expression.c:7882: * auto s = a.slice!(1, 3);
  83. expression.c:9730:SliceExp::SliceExp(Loc loc, Expression *e1, Expression *lwr, Expression *upr)
  84. expression.c:9731: : UnaExp(loc, TOKslice, sizeof(SliceExp), e1)
  85. expression.c:9738:Expression *SliceExp::syntaxCopy()
  86. expression.c:9748: SliceExp *se = new SliceExp(loc, e1->syntaxCopy(), lwr, upr);
  87. expression.c:9753:Expression *SliceExp::semantic(Scope *sc)
  88. expression.c:9760: printf("SliceExp::semantic('%s')\n", toChars());
  89. expression.c:9772: error("cannot slice type '%s'", e1->toChars());
  90. expression.c:9791: if (e1->op == TOKslice)
  91. expression.c:9793: SliceExp *se = (SliceExp *)e1;
  92. expression.c:9805: { error("need upper and lower bound to slice pointer");
  93. expression.c:9825: if (search_function(ad, Id::slice))
  94. expression.c:9827: // Rewrite as e1.slice(lwr, upr)
  95. expression.c:9828: SliceExp *se = resolveOpDollar(sc, this);
  96. expression.c:9835: e = new DotIdExp(loc, se->e1, Id::slice);
  97. expression.c:9854: { error("need upper and lower bound to slice tuple");
  98. expression.c:9948: error("string slice [%llu .. %llu] is out of bounds", i1, i2);
  99. expression.c:9969: error("%s cannot be sliced with []", s);
  100. expression.c:9975:void SliceExp::checkEscape()
  101. expression.c:9980:void SliceExp::checkEscapeRef()
  102. expression.c:9985:int SliceExp::checkModifiable(Scope *sc, int flag)
  103. expression.c:9987: //printf("SliceExp::checkModifiable %s\n", toChars());
  104. expression.c:9990: e1->op == TOKslice)
  105. expression.c:9997:int SliceExp::isLvalue()
  106. expression.c:9999: /* slice expression is rvalue in default, but
  107. expression.c:10005:Expression *SliceExp::toLvalue(Scope *sc, Expression *e)
  108. expression.c:10007: //printf("SliceExp::toLvalue(%s) type = %s\n", toChars(), type ? type->toChars() : NULL);
  109. expression.c:10012:Expression *SliceExp::modifiableLvalue(Scope *sc, Expression *e)
  110. expression.c:10014: error("slice expression %s is not a modifiable lvalue", toChars());
  111. expression.c:10018:int SliceExp::isBool(int result)
  112. expression.c:10023:void SliceExp::toCBuffer(OutBuffer *buf, HdrGenState *hgs)
  113. expression.c:10489: e1->op == TOKslice)
  114. expression.c:10545: if (e1->op == TOKslice)
  115. expression.c:10548: error("cannot post-%s array slice '%s', use pre-%s instead", s, e1->toChars(), s);
  116. expression.c:10736: * converted to a.opSlice() already.
  117. expression.c:10738: if (e1->op == TOKslice)
  118. expression.c:10740: SliceExp *ae = (SliceExp *)e1;
  119. expression.c:10757: // Rewrite (a[i..j] = value) to (a.opSliceAssign(value, i, j))
  120. expression.c:10758: if (search_function(ad, Id::sliceass))
  121. expression.c:10768: Expression *e = new DotIdExp(loc, e1, Id::sliceass);
  122. expression.c:10775: // No opSliceAssign found yet, but there might be an alias this to try.
  123. expression.c:11051: e2 = new SliceExp(e2->loc, e2, NULL, NULL);
  124. expression.c:11060: if (e2->op == TOKslice || t2->implicitConvTo(t1->nextOf()))
  125. expression.c:11070: Expression *e = new SliceExp(e2->loc, e2, NULL, NULL);
  126. expression.c:11076: Expression *e = new SliceExp(e1->loc, e1, NULL, NULL);
  127. expression.c:11090: else if (e1->op == TOKslice)
  128. expression.c:11094: { error("slice %s is not mutable", e1->toChars());
  129. expression.c:11118: if (e1->op == TOKslice &&
  130. expression.c:11139: else if (e1->op == TOKslice &&
  131. expression.c:11143: SliceExp *se1 = (SliceExp *)e1;
  132. expression.c:11148: if (e2->op == TOKslice && ((SliceExp *)e2)->lwr == NULL)
  133. expression.c:11149: tx2 = ((SliceExp *)e2)->e1->type->toBasetype();
  134. expression.c:11170: (e2->op == TOKslice && ((UnaExp *)e2)->e1->isLvalue() ||
  135. expression.c:11172: e2->op != TOKslice && e2->isLvalue()))
  136. expression.c:11177: e2->op != TOKslice && e2->op != TOKassign &&
  137. expression.c:11202: e2->op != TOKslice && //e2->op != TOKarrayliteral &&
  138. expression.c:11209: e1->op == TOKslice ? "element-wise" : "slice",
  139. expression.c:11219: if (e1->op == TOKslice && !ismemset &&
  140. expression.c:11295: if (e1->op == TOKslice)
  141. expression.c:11296: { SliceExp *se = (SliceExp *)e1;
  142. expression.c:11444: if (e1->op == TOKslice)
  143. expression.c:12017: if (e1->op == TOKslice)
  144. expression.c:12551: if (e1->op == TOKslice && t1->ty == Tarray && e2->implicitConvTo(t1->nextOf()) ||
  145. expression.c:12552: e2->op == TOKslice && t2->ty == Tarray && e1->implicitConvTo(t2->nextOf()))
  146. expression.c:12727: if (e1->op == TOKslice && t1->ty == Tarray && e2->implicitConvTo(t1->nextOf()) ||
  147. expression.c:12728: e2->op == TOKslice && t2->ty == Tarray && e1->implicitConvTo(t2->nextOf()))
  148. expression.c:13204:SliceExp *resolveOpDollar(Scope *sc, SliceExp *se)
  149. gluestub.c:922:elem *SliceExp::toElem(IRState *irs)
  150. id.c:176:Identifier *Id::slice;
  151. id.c:177:Identifier *Id::sliceass;
  152. id.c:190:Identifier *Id::opSliceUnary;
  153. id.c:195:Identifier *Id::opSliceOpAssign;
  154. id.c:459: slice = Lexer::idPool("opSlice");
  155. id.c:460: sliceass = Lexer::idPool("opSliceAssign");
  156. id.c:473: opSliceUnary = Lexer::idPool("opSliceUnary");
  157. id.c:478: opSliceOpAssign = Lexer::idPool("opSliceOpAssign");
  158. idgen.c:213: { "slice", "opSlice" },
  159. idgen.c:214: { "sliceass", "opSliceAssign" },
  160. idgen.c:227: { "opSliceUnary" },
  161. idgen.c:232: { "opSliceOpAssign" },
  162. inline.c:827:Expression *SliceExp::doInline(InlineDoState *ids)
  163. inline.c:829: SliceExp *are = (SliceExp *)copy();
  164. inline.c:1334:Expression *SliceExp::inlineScan(InlineScanState *iss)
  165. interpret.c:752: * In particular, all slices must be resolved.
  166. interpret.c:774: if (e->op == TOKslice)
  167. interpret.c:776: e = resolveSlice(e);
  168. interpret.c:1545: else if (val->op == TOKslice)
  169. interpret.c:1547: aggregate = ((SliceExp *)val)->e1;
  170. interpret.c:1548: Expression *lwr = ((SliceExp *)val)->lwr->interpret(istate);
  171. interpret.c:1599:// The variable used in a dotvar, index, or slice expression,
  172. interpret.c:1623: if (val && (val->op == TOKslice))
  173. interpret.c:1625: SliceExp *se = (SliceExp *)val;
  174. interpret.c:1739: || e->op == TOKassocarrayliteral || e->op == TOKslice
  175. interpret.c:2490: else if (e->op == TOKslice)
  176. interpret.c:2491: e = ((SliceExp*)e)->e1;
  177. interpret.c:2515: * Determining this for slice assignments are tricky: we need to know
  178. interpret.c:2516: * if it is a block assignment (a[] = e) rather than a direct slice
  179. interpret.c:2522: if (e1->op == TOKslice)
  180. interpret.c:2549: // slice are duplicated)
  181. interpret.c:2578: // slice assignment of static arrays is not reference assignment
  182. interpret.c:2579: if ((e1->op==TOKslice) && ((SliceExp *)e1)->e1->type->ty == Tsarray)
  183. interpret.c:2628: // f() = e2, when f returns an array, is always a slice assignment.
  184. interpret.c:2630: e1 = new SliceExp(loc, e1,
  185. interpret.c:2642: || e1->op == TOKslice))
  186. interpret.c:2651: || e1->op == TOKindex || e1->op == TOKslice))
  187. interpret.c:2674: // Also determine the return value (except for slice
  188. interpret.c:2701: if (newval->op == TOKslice)
  189. interpret.c:2702: newval = resolveSlice(newval);
  190. interpret.c:2706: if (oldval->op == TOKslice)
  191. interpret.c:2707: oldval = resolveSlice(oldval);
  192. interpret.c:2782: else if (!wantRef && e1->op != TOKslice)
  193. interpret.c:2889: if (index->op == TOKslice) // only happens with AA assignment
  194. interpret.c:2890: index = resolveSlice(index);
  195. interpret.c:2901: if (indx->op == TOKslice) // only happens with AA assignment
  196. interpret.c:2902: indx = resolveSlice(indx);
  197. interpret.c:2937: if (index->op == TOKslice) // only happens with AA assignment
  198. interpret.c:2938: index = resolveSlice(index);
  199. interpret.c:3100: && oldval->op != TOKslice)
  200. interpret.c:3120: assert (index->op != TOKslice); // only happens with AA assignment
  201. interpret.c:3148: if (aggregate->op != TOKslice && aggregate->op != TOKstring &&
  202. interpret.c:3178: * slices of array literals.
  203. interpret.c:3181: aggregate->op == TOKslice || aggregate->op == TOKcall ||
  204. interpret.c:3216: if (aggregate->op == TOKslice)
  205. interpret.c:3218: SliceExp *sexp = (SliceExp *)aggregate;
  206. interpret.c:3232: if (!wantRef && newval->op == TOKslice)
  207. interpret.c:3234: newval = resolveSlice(newval);
  208. interpret.c:3282: else if (e1->op == TOKslice)
  209. interpret.c:3288: SliceExp * sexp = (SliceExp *)e1;
  210. interpret.c:3291: bool assignmentToSlicedPointer = false;
  211. interpret.c:3299: assignmentToSlicedPointer = true;
  212. interpret.c:3304: && oldval->op != TOKslice && oldval->op != TOKnull)
  213. interpret.c:3308: error("pointer %s cannot be sliced at compile time (it points to a static variable)", sexp->e1->toChars());
  214. interpret.c:3311: if (assignmentToSlicedPointer)
  215. interpret.c:3313: error("pointer %s cannot be sliced at compile time (it does not point to an array)",
  216. interpret.c:3349: if (!assignmentToSlicedPointer && (((int)lowerbound < 0) || (upperbound > dim)))
  217. interpret.c:3351: error("Array bounds [0..%d] exceeded in slice [%d..%d]",
  218. interpret.c:3358: Expression *aggregate = resolveReferences(((SliceExp *)e1)->e1);
  219. interpret.c:3365: * and slices of array literals.
  220. interpret.c:3369: aggregate->op == TOKslice ||
  221. interpret.c:3397: if (aggregate->op == TOKslice)
  222. interpret.c:3398: { // Slice of a slice --> change the bounds
  223. interpret.c:3399: SliceExp *sexpold = (SliceExp *)aggregate;
  224. interpret.c:3404: error("slice [%d..%d] exceeds array bounds [0..%lld]",
  225. interpret.c:3418: error("cannot slice null pointer %s", sexp->e1->toChars());
  226. interpret.c:3425: error("slice [lld..%lld] exceeds memory block bounds [0..%lld]",
  227. interpret.c:3439: if (!wantRef && newval->op == TOKslice)
  228. interpret.c:3441: newval = resolveSlice(newval);
  229. interpret.c:3444: error("Compiler error: CTFE slice %s", toChars());
  230. interpret.c:3454: // For slice assignment, we check that the lengths match.
  231. interpret.c:3478: sliceAssignStringFromString((StringExp *)existingSE, (StringExp *)newval, firstIndex);
  232. interpret.c:3483: { /* Mixed slice: it was initialized as an array literal of chars.
  233. interpret.c:3484: * Now a slice of it is being set with a string.
  234. interpret.c:3486: sliceAssignArrayLiteralFromString(existingAE, (StringExp *)newval, firstIndex);
  235. interpret.c:3490: { /* Mixed slice: it was initialized as a string literal.
  236. interpret.c:3491: * Now a slice of it is being set with an array literal.
  237. interpret.c:3493: sliceAssignStringFromArrayLiteral(existingSE, (ArrayLiteralExp *)newval, firstIndex);
  238. interpret.c:3497: { // String literal block slice assign
  239. interpret.c:3514: SliceExp *retslice = new SliceExp(loc, existingSE,
  240. interpret.c:3517: retslice->type = this->type;
  241. interpret.c:3518: return retslice->interpret(istate);
  242. interpret.c:3554: SliceExp *retslice = new SliceExp(loc, existingAE,
  243. interpret.c:3557: retslice->type = this->type;
  244. interpret.c:3558: return retslice->interpret(istate);
  245. interpret.c:3561: error("Slice operation %s cannot be evaluated at compile time", toChars());
  246. interpret.c:4099: if (e->op == TOKslice)
  247. interpret.c:4100: e= resolveSlice(e);
  248. interpret.c:4237: if (e1->op == TOKstring || e1->op == TOKarrayliteral || e1->op == TOKslice
  249. interpret.c:4324: || e1->op == TOKslice))
  250. interpret.c:4337: if (e1->op == TOKslice && e2->op == TOKint64)
  251. interpret.c:4339: // Simplify index of slice: agg[lwr..upr][indx] --> agg[indx']
  252. interpret.c:4341: uinteger_t ilo = ((SliceExp *)e1)->lwr->toInteger();
  253. interpret.c:4342: uinteger_t iup = ((SliceExp *)e1)->upr->toInteger();
  254. interpret.c:4350: e1 = ((SliceExp *)e1)->e1;
  255. interpret.c:4365: if (e2->op == TOKslice)
  256. interpret.c:4366: e2 = resolveSlice(e2);
  257. interpret.c:4386: if (goal == ctfeNeedRvalue && (e->op == TOKslice || e->op == TOKdotvar))
  258. interpret.c:4399:Expression *SliceExp::interpret(InterState *istate, CtfeGoal goal)
  259. interpret.c:4406: printf("%s SliceExp::interpret() %s\n", loc.toChars(), toChars());
  260. interpret.c:4417: error("cannot slice invalid pointer %s of value %s",
  261. interpret.c:4422: /* Evaluate lower and upper bounds of slice
  262. interpret.c:4447: error("cannot slice null pointer %s", this->e1->toChars());
  263. interpret.c:4457: error("pointer %s cannot be sliced at compile time (it does not point to an array)",
  264. interpret.c:4466: error("pointer slice [%lld..%lld] exceeds allocated memory block [0..%lld]",
  265. interpret.c:4474: e = new SliceExp(loc, agg, lwr, upr);
  266. interpret.c:4497: e1->op != TOKnull && e1->op != TOKslice)
  267. interpret.c:4510: /* Evaluate lower and upper bounds of slice
  268. interpret.c:4534: e1->error("slice [%llu..%llu] is out of bounds", ilwr, iupr);
  269. interpret.c:4537: if (e1->op == TOKslice)
  270. interpret.c:4539: SliceExp *se = (SliceExp *)e1;
  271. interpret.c:4540: // Simplify slice of slice:
  272. interpret.c:4546: error("slice[%llu..%llu] exceeds array bounds[%llu..%llu]",
  273. interpret.c:4552: e = new SliceExp(loc, se->e1,
  274. interpret.c:4563: error("slice [%lld..%lld] exceeds array bounds [0..%lld]",
  275. interpret.c:4568: e = new SliceExp(loc, e1, lwr, upr);
  276. interpret.c:4592: if (e1->op == TOKslice)
  277. interpret.c:4593: e1 = resolveSlice(e1);
  278. interpret.c:4615: if (e1->op == TOKslice)
  279. interpret.c:4617: e1 = resolveSlice(e1);
  280. interpret.c:4622: if (e2->op == TOKslice)
  281. interpret.c:4623: e2 = resolveSlice(e2);
  282. interpret.c:4670: // For slices, we need the type being sliced,
  283. interpret.c:4673: if (e1->op == TOKslice)
  284. interpret.c:4674: elemtype = ((SliceExp *)e1)->e1->type->nextOf();
  285. interpret.c:4698: if (e1->op == TOKslice)
  286. interpret.c:4700: if ( ((SliceExp *)e1)->e1->op == TOKnull)
  287. interpret.c:4702: return paintTypeOntoLiteral(type, ((SliceExp *)e1)->e1);
  288. interpret.c:4704: e = new IndexExp(loc, ((SliceExp *)e1)->e1, ((SliceExp *)e1)->lwr);
  289. interpret.c:4783: if (to->ty == Tarray && e1->op == TOKslice)
  290. interpret.c:4784: { // Note that the slice may be void[], so when checking for dangerous
  291. interpret.c:4786: SliceExp *se = (SliceExp *)e1;
  292. interpret.c:4793: e1 = new SliceExp(e1->loc, se->e1, se->lwr, se->upr);
  293. interpret.c:4806: if (to->ty == Tsarray && e1->op == TOKslice)
  294. interpret.c:4807: e1 = resolveSlice(e1);
  295. interpret.c:4950: || e->op == TOKslice || e->op == TOKaddress))
  296. interpret.c:5095: e->op == TOKclassreference || e->op == TOKslice))
  297. interpret.c:5341: if (str->op == TOKslice)
  298. interpret.c:5342: str = resolveSlice(str);
  299. json.c:604:void TypeSlice::toJson(JsonOut *json)
  300. lexer.c:929: t->value = TOKslice;
  301. lexer.c:3009: Token::tochars[TOKslice] = "..";
  302. mtype.c:207: sizeTy[Tslice] = sizeof(TypeSlice);
  303. mtype.c:256: mangleChar[Tslice] = '@';
  304. mtype.c:3763: * is a slice [d..d+1] out of the old one.
  305. mtype.c:4194: { // It's really a slice expression
  306. mtype.c:4197: *pe = new SliceExp(loc, *pe, NULL, NULL);
  307. mtype.c:5894: else if (arg->op == TOKslice && tprmb->ty == Tsarray)
  308. mtype.c:9020:/***************************** TypeSlice *****************************/
  309. mtype.c:9022:/* This is so we can slice a TypeTuple */
  310. mtype.c:9024:TypeSlice::TypeSlice(Type *next, Expression *lwr, Expression *upr)
  311. mtype.c:9025: : TypeNext(Tslice, next)
  312. mtype.c:9027: //printf("TypeSlice[%s .. %s]\n", lwr->toChars(), upr->toChars());
  313. mtype.c:9032:const char *TypeSlice::kind()
  314. mtype.c:9034: return "slice";
  315. mtype.c:9037:Type *TypeSlice::syntaxCopy()
  316. mtype.c:9039: Type *t = new TypeSlice(next->syntaxCopy(), lwr->syntaxCopy(), upr->syntaxCopy());
  317. mtype.c:9044:Type *TypeSlice::semantic(Loc loc, Scope *sc)
  318. mtype.c:9046: //printf("TypeSlice::semantic() %s\n", toChars());
  319. mtype.c:9053: { error(loc, "can only slice tuple types, not %s", tbn->toChars());
  320. mtype.c:9067: { error(loc, "slice [%llu..%llu] is out of range of [0..%u]", i1, i2, tt->arguments->dim);
  321. mtype.c:9082:void TypeSlice::resolve(Loc loc, Scope *sc, Expression **pe, Type **pt, Dsymbol **ps)
  322. mtype.c:9086: { // It's really a slice expression
  323. mtype.c:9089: *pe = new SliceExp(loc, *pe, lwr, upr);
  324. mtype.c:9096: /* It's a slice of a TupleDeclaration
  325. mtype.c:9113: { error(loc, "slice [%llu..%llu] is out of range of [0..%u]", i1, i2, td->objects->dim);
  326. mtype.c:9124: * is a slice [i1..i2] out of the old one.
  327. mtype.c:9146:void TypeSlice::toCBuffer2(OutBuffer *buf, HdrGenState *hgs, int mod)
  328. opover.c:265: else if (e1->op == TOKslice)
  329. opover.c:267: SliceExp *se = (SliceExp *)e1;
  330. opover.c:275: * a.opSliceUnary!("+")(lwr, upr);
  331. opover.c:277: Dsymbol *fd = search_function(ad, Id::opSliceUnary);
  332. opover.c:301: ((SliceExp *)e1)->e1 = new DotIdExp(loc, se->e1, ad->aliasthis->ident);
  333. opover.c:1045: else if (e1->op == TOKslice)
  334. opover.c:1047: SliceExp *se = (SliceExp *)e1;
  335. opover.c:1055: * a.opSliceOpAssign!("+")(e2, lwr, upr);
  336. opover.c:1057: Dsymbol *fd = search_function(ad, Id::opSliceOpAssign);
  337. opover.c:1083: ((SliceExp *)e1)->e1 = new DotIdExp(loc, se->e1, ad->aliasthis->ident);
  338. opover.c:1286: int sliced = 0;
  339. opover.c:1324: if (!sliced)
  340. opover.c:1332: Dsymbol *s = search_function(ad, Id::slice);
  341. opover.c:1334: { Expression *rinit = new SliceExp(aggr->loc, aggr, NULL, NULL);
  342. opover.c:1338: sliced = 1;
  343. optimize.c:1061:Expression *SliceExp::optimize(int result, bool keepLvalue)
  344. optimize.c:1064: //printf("SliceExp::optimize(result = %d) %s\n", result, toChars());
  345. optimize.c:1069: { // Convert slice of string literal into dynamic array
  346. optimize.c:1081: e = Slice(type, e1, lwr, upr);
  347. optimize.c:1084: //printf("-SliceExp::optimize() %s\n", e->toChars());
  348. parse.c:2643: if (token.value == TOKslice)
  349. parse.c:2647: t = new TypeSlice(t, e, e2);
  350. parse.c:4176: if (token.value == TOKslice && arguments->dim == 1)
  351. parse.c:4428: if (token.value == TOKslice)
  352. parse.c:5057: if (t->value == TOKslice)
  353. parse.c:5349: case TOKslice:
  354. parse.c:5566: error("'$' is valid only inside [] of index or slice");
  355. parse.c:6138: e = new SliceExp(loc, e, NULL, NULL);
  356. parse.c:6144: if (token.value == TOKslice)
  357. parse.c:6148: e = new SliceExp(loc, e, index, upr);
  358. parse.c:7063: precedence[TOKslice] = PREC_primary;
  359. statement.c:1711: ExpInitializer *ie = new ExpInitializer(loc, new SliceExp(loc, aggr, NULL, NULL));
  360. template.c:1545: else if (farg->op == TOKslice)
  361. template.c:1546: { SliceExp *se = (SliceExp *)farg;
  362. template.c:1648: else if (farg->op == TOKslice && argtype->ty == Tsarray)
  363. template.c:3446: /* Slice off the .foo in S!(T).foo
  364. template.c:3590: /* Slice off the .foo in S!(T).foo
  365. ctfe.h:120:/// Convert from a CTFE-internal slice, into a normal Expression
  366. ctfe.h:121:Expression *resolveSlice(Expression *e);
  367. ctfe.h:236:/// Evaluate ==, !=. Resolves slices before comparing. Returns 0 or 1
  368. ctfe.h:239:/// Evaluate is, !is. Resolves slices before comparing. Returns 0 or 1
  369. ctfe.h:242:/// Evaluate >,<=, etc. Resolves slices before comparing. Returns 0 or 1
  370. ctfe.h:245:/// Returns e1 ~ e2. Resolves slices before concatenation.
  371. dsymbol.h:309:// Array Index/Slice scope
  372. dsymbol.h:314: Expression *exp; // IndexExp or SliceExp
  373. expression.h:52:class SliceExp;
  374. expression.h:91:SliceExp *resolveOpDollar(Scope *sc, SliceExp *se);
  375. expression.h:1221:class SliceExp : public UnaExp
  376. expression.h:1228: SliceExp(Loc loc, Expression *e1, Expression *lwr, Expression *upr);
  377. expression.h:1877:Expression *Slice(Type *type, Expression *e1, Expression *lwr, Expression *upr);
  378. expression.h:1881:void sliceAssignArrayLiteralFromString(ArrayLiteralExp *existingAE, StringExp *newval, size_t firstIndex);
  379. expression.h:1882:void sliceAssignStringFromArrayLiteral(StringExp *existingSE, ArrayLiteralExp *newae, size_t firstIndex);
  380. expression.h:1883:void sliceAssignStringFromString(StringExp *existingSE, StringExp *newstr, size_t firstIndex);
  381. expression.h:1885:int sliceCmpStringWithString(StringExp *se1, StringExp *se2, size_t lo1, size_t lo2, size_t len);
  382. expression.h:1886:int sliceCmpStringWithArray(StringExp *se1, ArrayLiteralExp *ae2, size_t lo1, size_t lo2, size_t len);
  383. id.h:178: static Identifier *slice;
  384. id.h:179: static Identifier *sliceass;
  385. id.h:192: static Identifier *opSliceUnary;
  386. id.h:197: static Identifier *opSliceOpAssign;
  387. lexer.h:61: TOKdottype, TOKslice,
  388. mtype.h:56: Tarray, // slice array, aka T[]
  389. mtype.h:98: Tslice,
  390. mtype.h:1033:class TypeSlice : public TypeNext
  391. mtype.h:1039: TypeSlice(Type *next, Expression *lwr, Expression *upr);
  392. parse.h:69: int inBrackets; // inside [] of array index or slice
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement