From 4268ec187d401b9b132afa1a13c73e0026a53c5d Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Fri, 7 Jun 2019 11:29:36 -0600 Subject: Recognize _ in attribute names Ada attribute names can contain "_", but the lexer currently does not allow this -- even though the "attributes" array lists some attributes spelled this way. This patch fixes the bug and adds test cases for the existing attributes. This was reviewed off-list by Joel. I'm checking it in. gdb/ChangeLog 2019-06-14 Tom Tromey * ada-lex.l: Allow "_" in attribute names. gdb/testsuite/ChangeLog 2019-06-14 Tom Tromey * gdb.ada/formatted_ref.exp (test_p_x_addr): Check 'unchecked_access and 'unrestricted_access as well. --- gdb/ada-lex.l | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gdb/ada-lex.l') diff --git a/gdb/ada-lex.l b/gdb/ada-lex.l index 8ce7c3a99a9..35db478baaa 100644 --- a/gdb/ada-lex.l +++ b/gdb/ada-lex.l @@ -216,7 +216,7 @@ false { return FALSEKEYWORD; } /* ATTRIBUTES */ -{TICK}[a-zA-Z][a-zA-Z]+ { BEGIN INITIAL; return processAttribute (yytext+1); } +{TICK}[a-zA-Z][a-zA-Z_]+ { BEGIN INITIAL; return processAttribute (yytext+1); } /* PUNCTUATION */ -- cgit v1.2.1