summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/CommentLexer.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Comment parsing: don't parse whitespace before \endverbatim as a separate ↵Dmitri Gribenko2012-07-181-0/+10
| | | | | | line of whitespace. llvm-svn: 160464
* Comment parsing: repaint the bikesched: rename 'HTML open tags' to 'HTML ↵Dmitri Gribenko2012-07-131-17/+17
| | | | | | start tags' and 'HTML close tags' to 'HTML end tags' according to HTML spec. llvm-svn: 160153
* Enable comment parsing and semantic analysis to emit diagnostics. A fewDmitri Gribenko2012-07-111-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | diagnostics implemented -- see testcases. I created a new TableGen file for comment diagnostics, DiagnosticCommentKinds.td, because comment diagnostics don't logically fit into AST diagnostics file. But I don't feel strongly about it. This also implements support for self-closing HTML tags in comment lexer and parser (for example, <br />). In order to issue precise diagnostics CommentSema needs to know the declaration the comment is attached to. There is no easy way to find a decl by comment, so we match comments and decls in lockstep: after parsing one declgroup we check if we have any new, not yet attached comments. If we do -- then we do the usual comment-finding process. It is interesting that this automatically handles trailing comments. We pick up not only comments that precede the declaration, but also comments that *follow* the declaration -- thanks to the lookahead in the lexer: after parsing the declgroup we've consumed the semicolon and looked ahead through comments. Added -Wdocumentation-html flag for semantic HTML errors to allow the user to disable only HTML warnings (but not HTML parse errors, which we emit as warnings in -Wdocumentation). llvm-svn: 160078
* Comment lexing: fix lexing to actually work in non-error cases.Dmitri Gribenko2012-07-091-13/+18
| | | | llvm-svn: 159963
* Implement AST classes for comments, a real parser for Doxygen comments and aDmitri Gribenko2012-07-061-8/+36
| | | | | | | | | | | | | | very simple semantic analysis that just builds the AST; minor changes for lexer to pick up source locations I didn't think about before. Comments AST is modelled along the ideas of HTML AST: block and inline content. * Block content is a paragraph or a command that has a paragraph as an argument or verbatim command. * Inline content is placed within some block. Inline content includes plain text, inline commands and HTML as tag soup. llvm-svn: 159790
* Fix an infinite loop in comment lexer: we were not advancing in the input ↵Dmitri Gribenko2012-06-271-0/+5
| | | | | | character stream when we saw a '<' that is not a start of an HTML tag. llvm-svn: 159303
* Remove unsigned and a pointer from a comment token (so that each token can ↵Dmitri Gribenko2012-06-271-8/+19
| | | | | | have only one semantic string value attached to it), at a cost of adding an additional token. llvm-svn: 159270
* Comment lexer: counting backwards from token end is thought to be confusing. ↵Dmitri Gribenko2012-06-271-14/+20
| | | | | | We already have a pointer to the beginning of the token, so use it to extract the text instead. llvm-svn: 159269
* Implement a lexer for structured comments.Dmitri Gribenko2012-06-261-0/+676
llvm-svn: 159223
OpenPOWER on IntegriCloud