Differences From Artifact [ad028a2a26b6c7bc]:
- File
polemy/lex.d
- 2010-11-21 14:24:33 - part of checkin [3995a5eb6a] on branch trunk - added iikagen pattern match (user: kinaba) [annotate]
To Artifact [b98d4e6a5ceb6fb9]:
- File
polemy/lex.d
- 2010-11-23 10:37:54 - part of checkin [5e924caac9] on branch trunk - added AST-rewriting macro sample. (user: kinaba) [annotate]
379 } 379 }
380 } 380 }
381 381
382 unittest 382 unittest
383 { 383 {
384 assert( isForwardRange!(PositionedReader!string) ); 384 assert( isForwardRange!(PositionedReader!string) );
385 assert( is(ElementType!(PositionedReader!string) == dchar) ); 385 assert( is(ElementType!(PositionedReader!string) == dchar) );
> 386 {
> 387 auto pr = PositionedReader!string("abc","",1,1);
> 388 assert_eq(pr.currentPosition().column, 1); pr.popFront;
> 389 assert_eq(pr.currentPosition().column, 2); pr.popFront;
> 390 assert_eq(pr.currentPosition().column, 3); pr.popFront;
> 391 }
> 392 {
> 393 auto pr = PositionedReader!string("\n\r\n\n","",1,1);
> 394 assert_eq(pr.currentPosition().lineno, 1); pr.popFront;
> 395 assert_eq(pr.currentPosition().lineno, 2); pr.popFront;
> 396 assert_eq(pr.currentPosition().lineno, 3); pr.popFront;
> 397 }
386 } 398 }