From 0b653ab9539140bb04941de9a36c03cf10bfc28b Mon Sep 17 00:00:00 2001 From: Gareth Daniel Smith Date: Sat, 30 Jun 2012 11:54:54 +0100 Subject: initial draft of fix for issue #2498: 1. make /// ... and //! ... and /** ... */ and /*! ... */ into sugar for #[doc = ...] attributes. 2. add a script in etc/ to help converting doc-attributes to doc-comments 3. add some functions to core::str to help with (1) --- src/libsyntax/parse/token.rs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/libsyntax/parse/token.rs') diff --git a/src/libsyntax/parse/token.rs b/src/libsyntax/parse/token.rs index 8ab37e95d21..b3db69b5be6 100644 --- a/src/libsyntax/parse/token.rs +++ b/src/libsyntax/parse/token.rs @@ -80,6 +80,7 @@ enum token { //ACTUALLY(whole_nonterminal), + DOC_COMMENT(str_num), EOF, } @@ -170,11 +171,15 @@ fn to_str(in: interner<@str>, t: token) -> str { + str::escape_default(*interner::get(in, s)) + "\"" } + /* Name components */ IDENT(s, _) { *interner::get(in, s) } UNDERSCORE { "_" } + + /* Other */ + DOC_COMMENT(s) { *interner::get(in, s) } EOF { "" } } } -- cgit 1.4.1-3-g733a5