DocBlock identification
See original GitHub issueDocBlock seem to be identified by the starting /**
and following whitespace. This leads to the following edge case (from https://github.com/prettier/prettier-php/issues/30):
/**************
* test *
**************/
is parsed as
{
"kind": "doc",
"isDoc": false,
"lines": [
"*************\n * test *\n *************"
]
}
and
// a
// b
becomes
{
"kind": "doc",
"isDoc": false,
"lines": [
"a",
"b"
]
}
Which makes it hard to re-print them the way they were found. Similarly, i can also not tell the difference between /* a */
and // a
in the AST.
Maybe it would make sense to change the isDoc
flag to just return true whenever /* ... */
syntax is used? Or add another flag?
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Sample File (including Docblock Comment standards) - PHP
Each docblock in the example contains many details about writing Docblock Comments. Following those instructions is ... @version SVN: $Id$
Read more >phpDocumentor Tutorial
A DocBlock is an extended C++-style PHP comment that begins with "/**" and has an "*" at the beginning of every line. DocBlocks...
Read more >DocBlocks - Joomla! Coding Standards
Whereas normal code indenting uses real tabs, all whitespace in a Docblock uses real spaces. This provides better readability in source code browsers....
Read more >How to Document Your Code Properly - OpenEMR Project Wiki
A DocBlock is format that evolved from C++. It is a clean, standards compliant way of documenting your code, which allows for easy...
Read more >DocBlock Standard | Commerce PHP Extensions
Identify the details a developer needs to work with your code. Ignore the implementation details (i.e. private methods/properties and method ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @mgrip,
This will be fixed in the next release. The
isDoc
was removed, and I’ve introduced 2 new nodesCommentLine
orCommentBlock
.I stopped to trim them, so you will have the raw comment node
/** foo **/
or# single line comment
…For more details take a look at https://github.com/glayzzle/php-parser/issues/126#issuecomment-370268380
Thank you! 🙏