Mercurial > projects > dil
comparison trunk/src/cmd/DDoc.d @ 772:f0efbcb49248
Removed method writeFuncHeader().
author | Aziz K?ksal <aziz.koeksal@gmail.com> |
---|---|
date | Mon, 18 Feb 2008 03:51:45 +0100 |
parents | 26d8ed59806d |
children | 6dbbb403fc58 |
comparison
equal
deleted
inserted
replaced
771:ef9bee5a2d61 | 772:f0efbcb49248 |
---|---|
429 if (basesBegin.kind == TOK.Colon) | 429 if (basesBegin.kind == TOK.Colon) |
430 basesBegin = bases[0].begin; | 430 basesBegin = bases[0].begin; |
431 text ~= " : " ~ escape(textSpan(basesBegin, bases[$-1].end)); | 431 text ~= " : " ~ escape(textSpan(basesBegin, bases[$-1].end)); |
432 } | 432 } |
433 | 433 |
434 void writeFuncHeader(Declaration d, FuncBodyStatement s) | |
435 { | |
436 auto begin = d.begin; | |
437 auto end = d.end.prevNWS; | |
438 if (!s.isEmpty) | |
439 end = s.begin.prevNWS; | |
440 text ~= textSpan(begin, end); | |
441 } | |
442 | |
443 void write(char[][] strings...) | 434 void write(char[][] strings...) |
444 { | 435 { |
445 foreach (s; strings) | 436 foreach (s; strings) |
446 text ~= s; | 437 text ~= s; |
447 } | 438 } |
642 | 633 |
643 D visit(ConstructorDeclaration d) | 634 D visit(ConstructorDeclaration d) |
644 { | 635 { |
645 if (!ddoc(d)) | 636 if (!ddoc(d)) |
646 return d; | 637 return d; |
647 DECL({ write("this"); writeParams(d.params); }); | 638 DECL({ SYMBOL("this", d); writeParams(d.params); }); |
648 DESC({ writeComment(); }); | 639 DESC({ writeComment(); }); |
649 return d; | 640 return d; |
650 } | 641 } |
651 | 642 |
652 D visit(StaticConstructorDeclaration d) | 643 D visit(StaticConstructorDeclaration d) |
653 { | 644 { |
654 if (!ddoc(d)) | 645 if (!ddoc(d)) |
655 return d; | 646 return d; |
656 DECL({ writeFuncHeader(d, d.funcBody); }); | 647 DECL({ write("static "); SYMBOL("this", d); write("()"); }); |
657 DESC({ writeComment(); }); | 648 DESC({ writeComment(); }); |
658 return d; | 649 return d; |
659 } | 650 } |
660 | 651 |
661 D visit(DestructorDeclaration d) | 652 D visit(DestructorDeclaration d) |
662 { | 653 { |
663 if (!ddoc(d)) | 654 if (!ddoc(d)) |
664 return d; | 655 return d; |
665 DECL({ writeFuncHeader(d, d.funcBody); }); | 656 DECL({ write("~"); SYMBOL("this", d); write("()"); }); |
666 DESC({ writeComment(); }); | 657 DESC({ writeComment(); }); |
667 return d; | 658 return d; |
668 } | 659 } |
669 | 660 |
670 D visit(StaticDestructorDeclaration d) | 661 D visit(StaticDestructorDeclaration d) |
671 { | 662 { |
672 if (!ddoc(d)) | 663 if (!ddoc(d)) |
673 return d; | 664 return d; |
674 DECL({ writeFuncHeader(d, d.funcBody); }); | 665 DECL({ write("static ~"); SYMBOL("this", d); write("()"); }); |
675 DESC({ writeComment(); }); | 666 DESC({ writeComment(); }); |
676 return d; | 667 return d; |
677 } | 668 } |
678 | 669 |
679 D visit(FunctionDeclaration d) | 670 D visit(FunctionDeclaration d) |
693 | 684 |
694 D visit(NewDeclaration d) | 685 D visit(NewDeclaration d) |
695 { | 686 { |
696 if (!ddoc(d)) | 687 if (!ddoc(d)) |
697 return d; | 688 return d; |
698 DECL({ write("new"); writeParams(d.params); }); | 689 DECL({ SYMBOL("new", d); writeParams(d.params); }); |
699 DESC({ writeComment(); }); | 690 DESC({ writeComment(); }); |
700 return d; | 691 return d; |
701 } | 692 } |
702 | 693 |
703 D visit(DeleteDeclaration d) | 694 D visit(DeleteDeclaration d) |
704 { | 695 { |
705 if (!ddoc(d)) | 696 if (!ddoc(d)) |
706 return d; | 697 return d; |
707 DECL({ writeFuncHeader(d, d.funcBody); }); | 698 DECL({ SYMBOL("delete", d); writeParams(d.params); }); |
708 DESC({ writeComment(); }); | 699 DESC({ writeComment(); }); |
709 return d; | 700 return d; |
710 } | 701 } |
711 | 702 |
712 D visit(VariablesDeclaration d) | 703 D visit(VariablesDeclaration d) |