 |
Changeset 3894
- Timestamp:
- 08/19/08 13:11:02
(4 months ago)
- Author:
- keinfarbton
- Message:
all compiles now for DMD 2.018 on linux
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r3893 |
r3894 |
|
| 1160 | 1160 | |
|---|
| 1161 | 1161 | // We have to sniff this... :/. |
|---|
| 1162 | | switch (! Text.contains ("0123456789", line[0])) |
|---|
| | 1162 | switch (! Text.contains !(char)("0123456789", line[0])) |
|---|
| 1163 | 1163 | { |
|---|
| 1164 | 1164 | // Not a number; this is UNIX format. |
|---|
| r3893 |
r3894 |
|
| 82 | 82 | |
|---|
| 83 | 83 | // rifle through the path (after converting to standard format) |
|---|
| 84 | | foreach (pe; Text.patterns (standard(get("PATH")), FileConst.SystemPathString )) |
|---|
| | 84 | foreach (pe; Text.patterns (standard(get("PATH")), FileConst.SystemPathString )) |
|---|
| 85 | 85 | if (bin.path(pe).exists) |
|---|
| 86 | 86 | version (Windows) |
|---|
| r3893 |
r3894 |
|
| 282 | 282 | ******************************************************************************/ |
|---|
| 283 | 283 | |
|---|
| 284 | | bool contains(T) (T[] source, T match) |
|---|
| | 284 | bool contains(T) (const(T)[] source, T match) |
|---|
| 285 | 285 | { |
|---|
| 286 | 286 | return indexOf!(T) (source.ptr, match, source.length) != source.length; |
|---|
| … | … | |
| 331 | 331 | ******************************************************************************/ |
|---|
| 332 | 332 | |
|---|
| 333 | | uint locatePrior(T, U=uint) (T[] source, T match, U start=uint.max) |
|---|
| | 333 | uint locatePrior(T, U=uint) (const(T)[] source, T match, U start=uint.max) |
|---|
| 334 | 334 | {return locatePrior!(T)(source, match, start);} |
|---|
| 335 | 335 | |
|---|
| 336 | | uint locatePrior(T) (T[] source, T match, uint start=uint.max) |
|---|
| | 336 | uint locatePrior(T) (const(T)[] source, T match, uint start=uint.max) |
|---|
| 337 | 337 | { |
|---|
| 338 | 338 | if (start > source.length) |
|---|
| … | … | |
| 365 | 365 | if (match.length && extent <= source.length) |
|---|
| 366 | 366 | while (extent) |
|---|
| 367 | | if ((idx = indexOf (p, match[0], extent)) is extent) |
|---|
| | 367 | if ((idx = indexOf !(T)(p, match[0], extent)) is extent) |
|---|
| 368 | 368 | break; |
|---|
| 369 | 369 | else |
|---|
| … | … | |
| 472 | 472 | ******************************************************************************/ |
|---|
| 473 | 473 | |
|---|
| 474 | | T[][] delimit(T) (T[] src, T[] set) |
|---|
| 475 | | { |
|---|
| 476 | | T[][] result; |
|---|
| | 474 | const(T)[][] delimit(T) (const(T)[] src, const(T)[] set) |
|---|
| | 475 | { |
|---|
| | 476 | const(T)[][] result; |
|---|
| 477 | 477 | |
|---|
| 478 | 478 | foreach (segment; delimiters!(T) (src, set)) |
|---|
| … | … | |
| 511 | 511 | ******************************************************************************/ |
|---|
| 512 | 512 | |
|---|
| 513 | | T[][] splitLines(T) (T[] src) |
|---|
| | 513 | const(T)[][] splitLines(T) (const(T)[] src) |
|---|
| 514 | 514 | { |
|---|
| 515 | 515 | int count; |
|---|
| … | … | |
| 518 | 518 | ++count; |
|---|
| 519 | 519 | |
|---|
| 520 | | T[][] result = new T[][count]; |
|---|
| | 520 | const(T)[][] result = new const(T)[][count]; |
|---|
| 521 | 521 | |
|---|
| 522 | 522 | count = 0; |
|---|
| … | … | |
| 693 | 693 | ******************************************************************************/ |
|---|
| 694 | 694 | |
|---|
| 695 | | uint indexOf(T, U=uint) (T* str, T match, U length) |
|---|
| | 695 | uint indexOf(T, U=uint) (const(T)* str, T match, U length) |
|---|
| 696 | 696 | {return indexOf!(T) (str, match, length);} |
|---|
| 697 | 697 | |
|---|
| … | … | |
| 892 | 892 | ******************************************************************************/ |
|---|
| 893 | 893 | |
|---|
| 894 | | LineFruct!(T) lines(T) (T[] src) |
|---|
| | 894 | LineFruct!(T) lines(T) (const(T)[] src) |
|---|
| 895 | 895 | { |
|---|
| 896 | 896 | LineFruct!(T) lines; |
|---|
| … | … | |
| 918 | 918 | ******************************************************************************/ |
|---|
| 919 | 919 | |
|---|
| 920 | | DelimFruct!(T) delimiters(T) (T[] src, T[] set) |
|---|
| | 920 | DelimFruct!(T) delimiters(T) (const(T)[] src, const(T)[] set) |
|---|
| 921 | 921 | { |
|---|
| 922 | 922 | DelimFruct!(T) elements; |
|---|
| … | … | |
| 1237 | 1237 | private struct LineFruct(T) |
|---|
| 1238 | 1238 | { |
|---|
| 1239 | | private T[] src; |
|---|
| 1240 | | |
|---|
| 1241 | | int opApply (int delegate ( ref T[] line) dg) |
|---|
| | 1239 | private const(T)[] src; |
|---|
| | 1240 | |
|---|
| | 1241 | int opApply (int delegate ( ref const(T)[] line) dg) |
|---|
| 1242 | 1242 | { |
|---|
| 1243 | 1243 | uint ret, |
|---|
| 1244 | 1244 | pos, |
|---|
| 1245 | 1245 | mark; |
|---|
| 1246 | | T[] line; |
|---|
| | 1246 | const(T)[] line; |
|---|
| 1247 | 1247 | |
|---|
| 1248 | 1248 | const T nl = '\n'; |
|---|
| … | … | |
| 1286 | 1286 | private struct DelimFruct(T) |
|---|
| 1287 | 1287 | { |
|---|
| 1288 | | private T[] src; |
|---|
| 1289 | | private T[] set; |
|---|
| 1290 | | |
|---|
| 1291 | | int opApply (int delegate (ref T[] token) dg) |
|---|
| | 1288 | private const(T)[] src; |
|---|
| | 1289 | private const(T)[] set; |
|---|
| | 1290 | |
|---|
| | 1291 | int opApply (int delegate (ref const(T)[] token) dg) |
|---|
| 1292 | 1292 | { |
|---|
| 1293 | 1293 | uint ret, |
|---|
| 1294 | 1294 | pos, |
|---|
| 1295 | 1295 | mark; |
|---|
| 1296 | | T[] token; |
|---|
| | 1296 | const(T)[] token; |
|---|
| 1297 | 1297 | |
|---|
| 1298 | 1298 | // optimize for single delimiter case |
|---|
Download in other formats:
|
 |
 |
|
 |
Copyright © 2006-2008 Tango. All Rights Reserved. | Page Width:
Static or
Dynamic