-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Parse doc comments on mapping clauses
Allows round-tripping mapping doc comments through the pretty-printer Previously, some doc comments would be silently stripped by descattering as there is nowhere for them to go. While this patch and previous ones address some of these issues there are still a few places where this is unavoidable, so warn when that occurs. Adjust the syntax of doc comments slightly to address formatting issues: * Nested comments are now preserved in the documentation string * We allow doc comments to be written with leading asterisks, i.e. /*! * Some doc comment * with leading asterisks */ These asterisks (and a space on each side) will be stripped out, so the above is equivalent to: /*! Some doc comment with leading asterisks */ In order for an asterisk to be recognized, it must now be preceded by a newline, then 1 or more whitespace characters, and followed by exactly 1 whitespace character, before the comment continues. This sequence will be replaced by a newline followed by the whitespace with the final " * " sequence removed. Previously it was 0 or more whitespace characters before the asterisk, and the whitespace after was optional.
- Loading branch information
Showing
9 changed files
with
82 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
default Order dec | ||
|
||
$include <prelude.sail> | ||
|
||
enum E = A | B | C | ||
|
||
/*! Documentation | ||
* comment | ||
* with | ||
* asterisks | ||
*/ | ||
val foo : E <-> int | ||
|
||
scattered mapping foo | ||
|
||
/*! Mapping clause doc comment /* nested */ */ | ||
mapping clause foo = A <-> 3 | ||
|
||
/*! Mapping clause | ||
* box style | ||
* comment */ | ||
mapping clause foo = B <-> 2 | ||
|
||
$[some_attribute] | ||
mapping clause foo = C <-> 1 |