diff options
author | Chris Lattner <sabre@nondot.org> | 2008-04-16 23:06:45 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-04-16 23:06:45 +0000 |
commit | 9402b57a0dca4058fe56d7fd84e97fc496421125 (patch) | |
tree | 53725e43fd7bd39ef01b234911eb20104ab88533 /include/clang/Rewrite/HTMLRewrite.h | |
parent | 6b31e8ed11721505645860f40486e091ecd23dd0 (diff) |
Make HighlightRange correctly handle multi-line ranges. This causes us to
correctly handle multi-line comments.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49827 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Rewrite/HTMLRewrite.h')
-rw-r--r-- | include/clang/Rewrite/HTMLRewrite.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/include/clang/Rewrite/HTMLRewrite.h b/include/clang/Rewrite/HTMLRewrite.h index 69afa1caac..ded431f156 100644 --- a/include/clang/Rewrite/HTMLRewrite.h +++ b/include/clang/Rewrite/HTMLRewrite.h @@ -24,7 +24,7 @@ class Rewriter; class Preprocessor; namespace html { - + /// HighlightRange - Highlight a range in the source code with the specified /// start/end tags. B/E must be in the same file. This ensures that /// start/end tags are placed at the start/end of each line if the range is @@ -32,6 +32,15 @@ namespace html { void HighlightRange(Rewriter &R, SourceLocation B, SourceLocation E, const char *StartTag, const char *EndTag); + /// HighlightRange - Highlight a range in the source code with the specified + /// start/end tags. The Start/end of the range must be in the same file. + /// This ensures that start/end tags are placed at the start/end of each line + /// if the range is multiline. + inline void HighlightRange(Rewriter &R, SourceRange Range, + const char *StartTag, const char *EndTag) { + HighlightRange(R, Range.getBegin(), Range.getEnd(), StartTag, EndTag); + } + /// HighlightRange - This is the same as the above method, but takes /// decomposed file locations. void HighlightRange(RewriteBuffer &RB, unsigned B, unsigned E, |