[PATCH] rust: Support raw identifiers

Tom Tromey tom@tromey.com
Sat Jul 11 22:05:42 GMT 2020


>>>>> "Daniel" == Daniel Xu <dxu@dxuuu.xyz> writes:

Daniel> This patch adds rust raw identifier support. Raw identifiers are
Daniel> detailed here: https://doc.rust-lang.org/reference/identifiers.html .

Daniel>         PR 23427

This should be mentioned in both ChangeLog files, and should read
"PR rust/23427" -- the parser is a bit picky.

Daniel> @@ -1402,6 +1402,8 @@ rust_parser::lex_identifier (YYSTYPE *lvalp)
Daniel>    while ((pstate->lexptr[0] >= 'a' && pstate->lexptr[0] <= 'z')
Daniel>  	 || (pstate->lexptr[0] >= 'A' && pstate->lexptr[0] <= 'Z')
Daniel>  	 || pstate->lexptr[0] == '_'
Daniel> +	 || (pstate->lexptr[0] == '#' && pstate->lexptr - start == 1
Daniel> +             && *start == 'r')

This seems maybe a little roundabout, but OTOH the convenience variable
code isn't any better.

This patch is ok.  I think given the size we will need copyright
paperwork before we can check it in.  Do you have that?  If not, contact
me off-list and I will get you started.

thanks,
Tom


More information about the Gdb-patches mailing list