summaryrefslogtreecommitdiffstats
path: root/clang/unittests/AST/CommentParser.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [unittests][AST] CommentParser: don't name variable 'DEBUG'Roman Lebedev2019-09-021-2/+2
| | | | | | | It's may be an already-defined macro name, resulting in compilation errors. llvm-svn: 370650
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* [NFC] Header cleanupMehdi Amini2016-07-181-1/+0
| | | | | | | | | | Summary: Removed unused headers, replaced some headers with forward class declarations Patch by: Eugene <claprix@yandex.ru> Differential Revision: https://reviews.llvm.org/D20100 llvm-svn: 275882
* unique_ptrify SourceManager::createFileIDDavid Blaikie2014-08-291-1/+1
| | | | llvm-svn: 216715
* Update for LLVM api change.Rafael Espindola2014-08-271-2/+2
| | | | llvm-svn: 216585
* [C++11] Use 'nullptr'. Unittests edition.Craig Topper2014-06-081-2/+2
| | | | llvm-svn: 210423
* Rename SourceManager::createFileIDForMemBuffer()Alp Toker2014-05-161-1/+1
| | | | | | | | It makes more sense to just overload createFileID(). Gardening only. llvm-svn: 209002
* Comment parsing: don't crash while parsing \deprecated in a standalone commentDmitri Gribenko2014-01-271-0/+20
| | | | | | | | | | | (comment without a decl). I think this can not happen during normal compilation with -Wdocumentation, only while using Clang APIs to parse comments outside of a source file. Based on a patch by Olivier Goffart. llvm-svn: 200230
* Comment parsing: fix a bug where a line with whitespace between two paragraphsDmitri Gribenko2013-08-231-5/+30
| | | | | | | | | | would cause us to concatenate these paragraphs into a single one. The no-op whitespace churn in test/Index test happened because these tests don't use the correct approach for testing and are more strict than required for they are testing. llvm-svn: 189126
* [Doc parsing] Provide diagnostics for unknown documentation Fariborz Jahanian2013-05-031-1/+1
| | | | | | commands. // rdar://12381408 llvm-svn: 181071
* Comment parsing: add CommentOptions to allow specifying custom comment block ↵Dmitri Gribenko2013-02-221-1/+2
| | | | | | | | | | | | | | | | commands Add an ability to specify custom documentation block comment commands via a new class CommentOptions. The intention is that this class will hold future customizations for comment parsing, including defining documentation comments with specific numbers of parameters, etc. CommentOptions instance is a member of LangOptions. CommentOptions is controlled by a new command-line parameter -fcomment-block-commands=Foo,Bar,Baz. llvm-svn: 175892
* Really sort the #include lines in unittests/...Chandler Carruth2012-12-041-1/+1
| | | | | | I forgot to re-sort after fixing main module headers. llvm-svn: 169244
* Sort the #include lines for unittests/...Chandler Carruth2012-12-041-7/+6
| | | | | | I've tried to place sensible headers at the top as main-module headers. llvm-svn: 169243
* More unit-test fixesDouglas Gregor2012-10-231-0/+1
| | | | llvm-svn: 166511
* Fixup unit tests for DiagnosticOptions changeDouglas Gregor2012-10-231-1/+1
| | | | llvm-svn: 166509
* [doc parsing] use getParamName to access parameter Fariborz Jahanian2012-10-181-2/+2
| | | | | | | for current(rewritten) comment and getParamNameAsWritten to access param name coming with \param marker. llvm-svn: 166231
* structured document comment: patch to provide comment for overriding functionFariborz Jahanian2012-10-151-1/+1
| | | | | | | template when comment is comming from overridden declaration. // rdar://12378793 llvm-svn: 165953
* [Doc parsing] This patch searches overridden objc/c++Fariborz Jahanian2012-10-101-1/+1
| | | | | | | | | | methods looking for documentation on a particular base class inherited by any method that overrides the base class. In case of redeclaration, as when objc method is defined in the implementation, it also looks up for documentation in class/class extension being redeclared. llvm-svn: 165643
* Move the 'find macro by spelling' infrastructure to the Preprocessor class andDmitri Gribenko2012-09-291-1/+1
| | | | | | | use it to suggest appropriate macro for __attribute__((deprecated)) in -Wdocumentation-deprecated-sync. llvm-svn: 164892
* Comment AST: TableGen'ize all command lists in CommentCommandTraits.cpp.Dmitri Gribenko2012-09-101-50/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now we have a list of all commands. This is a good thing in itself, but it also enables us to easily implement typo correction for command names. With this change we have objects that contain information about each command, so it makes sense to resolve command name just once during lexing (currently we store command names as strings and do a linear search every time some property value is needed). Thus comment token and AST nodes were changed to contain a command ID -- index into a tables of builtin and registered commands. Unknown commands are registered during parsing and thus are also uniformly assigned an ID. Using an ID instead of a StringRef is also a nice memory optimization since ID is a small integer that fits into a common bitfield in Comment class. This change implies that to get any information about a command (even a command name) we need a CommandTraits object to resolve the command ID to CommandInfo*. Currently a fresh temporary CommandTraits object is created whenever it is needed since it does not have any state. But with this change it has state -- new commands can be registered, so a CommandTraits object was added to ASTContext. Also, in libclang CXComment has to be expanded to include a CXTranslationUnit so that all functions working on comment AST nodes can get a CommandTraits object. This breaks binary compatibility of CXComment APIs. Now clang_FullComment_getAsXML(CXTranslationUnit TU, CXComment CXC) doesn't need TU parameter anymore, so it was removed. This is a source-incompatible change for this C API. llvm-svn: 163540
* Remove the useless CommentOptions class.Dmitri Gribenko2012-08-311-1/+1
| | | | llvm-svn: 162986
* Comment parsing: extract TableGen'able pieces into new CommandTraits class.Dmitri Gribenko2012-08-091-3/+5
| | | | llvm-svn: 161548
* Comment parsing: fix crash on \tparam followed immediately by another blockDmitri Gribenko2012-08-061-8/+56
| | | | | | command, for example: \tparam\brief. llvm-svn: 161361
* Comment parser tests: test that we allow placing no whitespace between \paramDmitri Gribenko2012-08-011-0/+3
| | | | | | and [direction]. llvm-svn: 161146
* Comment parsing: add support for \tparam command on all levels.Dmitri Gribenko2012-07-311-0/+60
| | | | | | | | | | The only caveat is renumbering CXCommentKind enum for aesthetic reasons -- this breaks libclang binary compatibility, but should not be a problem since API is so new. This also fixes PR13372 as a side-effect. llvm-svn: 161087
* Comment parser: add one more testDmitri Gribenko2012-07-301-4/+23
| | | | llvm-svn: 160965
* Implement resolving of HTML character references (named: &amp;, decimal: &#42;,Dmitri Gribenko2012-07-271-1/+1
| | | | | | | | | hex: &#x1a;) during comment parsing. Now internal representation of plain text in comment AST does not contain character references, but the characters themselves. llvm-svn: 160891
* Comment parsing: allow newlines between \param, direction specification (e.g.,Dmitri Gribenko2012-07-241-44/+82
| | | | | | [in]), parameter name and description paragraph. llvm-svn: 160682
* Comment parsing: retokenized text tokens are now pushed back in correct (notDmitri Gribenko2012-07-241-0/+25
| | | | | | reverse) order llvm-svn: 160675
* Comment parser unit tests: split a huge test caseDmitri Gribenko2012-07-231-34/+51
| | | | llvm-svn: 160649
* Comment parser unit tests: reduce code duplicationDmitri Gribenko2012-07-231-122/+45
| | | | llvm-svn: 160647
* Fix PR13411: Comment parsing: failed assertion on unterminated verbatim block.Dmitri Gribenko2012-07-201-15/+58
| | | | | | | | | | The assertion was wrong in case we have a verbatim block without a closing command. Also add tests for closing command name in a verbatim block, since now it can be empty in such cases. llvm-svn: 160568
* Comment parsing: don't parse whitespace before \endverbatim as a separate ↵Dmitri Gribenko2012-07-181-18/+48
| | | | | | line of whitespace. llvm-svn: 160464
* Comment AST nodes: rename getXXXCount() methods to getNumXXXs() to be in ↵Dmitri Gribenko2012-07-131-15/+15
| | | | | | line with Statement AST nodes. llvm-svn: 160182
* Comment parsing: repaint the bikesched: rename 'HTML open tags' to 'HTML ↵Dmitri Gribenko2012-07-131-61/+61
| | | | | | 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-5/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Implement AST classes for comments, a real parser for Doxygen comments and aDmitri Gribenko2012-07-061-0/+1126
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
OpenPOWER on IntegriCloud