-
Notifications
You must be signed in to change notification settings - Fork 157
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Differentiate documentation from triple slashes and doc attribute #3196
Comments
MajoraSans
added a commit
to MajoraSans/gccrs
that referenced
this issue
Oct 17, 2024
gcc/rust/ChangeLog: * ast/rust-ast-collector.cc (TokenCollector::visit): * ast/rust-ast.h: * lex/rust-token.cc (Token::as_string): * lex/rust-token.h (enum PrimitiveCoreType): * parse/rust-parse-impl.h (Parser::parse_inner_attribute): (Parser::parse_outer_attribute): Signed-off-by: lucas.plantrose <[email protected]>
MajoraSans
added a commit
to MajoraSans/gccrs
that referenced
this issue
Oct 17, 2024
gcc/rust/ChangeLog: * ast/rust-ast-collector.cc (TokenCollector::visit): * ast/rust-ast.h: * lex/rust-token.cc (Token::as_string): * lex/rust-token.h (enum PrimitiveCoreType): * parse/rust-parse-impl.h (Parser::parse_inner_attribute): (Parser::parse_outer_attribute): Signed-off-by: lucas.plantrose <[email protected]>
MajoraSans
added a commit
to MajoraSans/gccrs
that referenced
this issue
Oct 18, 2024
gcc/rust/ChangeLog: * ast/rust-ast-collector.cc (TokenCollector::visit): Add behaviour. In Attribute visitor, recognize doc from comment and handle it. * ast/rust-ast.h: Changes Attribute constructor and add a boolean in the class for doc comments. * lex/rust-token.cc (Token::as_string): Return the correct string for the new DOC_STRING_LITERAL token. * lex/rust-token.h (enum PrimitiveCoreType): Add two tokens : DOC_STRING_LITERAL and DOC_END, for pretty-printing purposes. Also modify the string of two previous tokens. * parse/rust-parse-impl.h (Parser::parse_inner_attribute): Updates the Attribute constructor call. (Parser::parse_outer_attribute): Same as above. Signed-off-by: lucas.plantrose <[email protected]>
@MajoraSans is this also done in |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The goal is to keep track of where a line of documentation is coming from, for various purposes.
For now, we lose whether the doc is from slashes or an attribute, and I will try to make gccrs do a better job a that,
whether it's for pretty-printing or other matter.
The text was updated successfully, but these errors were encountered: