This commit is contained in:
Hackerpilot 2013-01-27 14:22:09 +00:00
parent 9a6e765335
commit e7555b2f05
1 changed files with 3 additions and 3 deletions

View File

@ -235,9 +235,9 @@ immutable string VENDOR = "std.d.lexer";
TokenRange!(R) byToken(R)(R range, string fileName = "", TokenRange!(R) byToken(R)(R range, string fileName = "",
const IterationStyle iterationStyle = IterationStyle.CodeOnly, const IterationStyle iterationStyle = IterationStyle.CodeOnly,
const TokenStyle stringStyle = TokenStyle.Default, string vendor = VENDOR, const TokenStyle stringStyle = TokenStyle.Default, string vendor = VENDOR,
string ver = VERSION) if (isForwardRange!(R) && isSomeChar!(ElementType!(R))) string ver = VERSION) if (isForwardRange!(R) && is(ElementType!(R) == char))
{ {
auto r = new TokenRange!(R)(range); auto r = TokenRange!(R)(range);
r.stringStyle = stringStyle; r.stringStyle = stringStyle;
r.iterStyle = iterationStyle; r.iterStyle = iterationStyle;
r.lineNumber = 1; r.lineNumber = 1;
@ -248,7 +248,7 @@ TokenRange!(R) byToken(R)(R range, string fileName = "",
/** /**
* Range of tokens. Use byToken$(LPAREN)$(RPAREN) to instantiate. * Range of tokens. Use byToken$(LPAREN)$(RPAREN) to instantiate.
*/ */
class TokenRange(R) : InputRange!(Token) struct TokenRange(R) if (isForwardRange!(R) && is(ElementType!(R) == char))
{ {
/** /**
* Returns: true if the range is empty * Returns: true if the range is empty