diff mbox

gengtype parsing member fns

Message ID 2e5fb6dc-8203-7db2-03b9-dfb2703911d5@acm.org
State New
Headers show

Commit Message

Nathan Sidwell Feb. 10, 2017, 8:55 p.m. UTC
I happened to write an inline member fn containing a '/' operator.  That 
caused gengtype to complain about an unexpected '/' character.  I 
thought I'd gone crazy until I determined it was gengtype complaining 
not cc1plus!

Anyway, this patch adds '/' to the set of single char tokens permitted 
inside a structure definition.  I guess it was missed, what with / being 
rare and also involved with /* and // comments.

I'll commit next week unless someone points out an error, and this isn't 
obvious after all.

nathan

Comments

Jeff Law Feb. 10, 2017, 11:11 p.m. UTC | #1
On 02/10/2017 01:55 PM, Nathan Sidwell wrote:
> I happened to write an inline member fn containing a '/' operator.  That
> caused gengtype to complain about an unexpected '/' character.  I
> thought I'd gone crazy until I determined it was gengtype complaining
> not cc1plus!
>
> Anyway, this patch adds '/' to the set of single char tokens permitted
> inside a structure definition.  I guess it was missed, what with / being
> rare and also involved with /* and // comments.
>
> I'll commit next week unless someone points out an error, and this isn't
> obvious after all.
Seems reasonable to me.

Jeff
diff mbox

Patch

2017-02-10  Nathan Sidwell  <nathan@acm.org>

	* gengtype-lex.l (<in_struct>): Add '/'.

Index: gengtype-lex.l
===================================================================
--- gengtype-lex.l	(revision 245341)
+++ gengtype-lex.l	(working copy)
@@ -159,7 +159,7 @@  CXX_KEYWORD inline|public:|private:|prot
 }
 
 "..."				{ return ELLIPSIS; }
-[(){},*:<>;=%|+\!\?\.-]		{ return yytext[0]; }
+[(){},*:<>;=%/|+\!\?\.-]	{ return yytext[0]; }
 
    /* ignore pp-directives */
 ^{HWS}"#"{HWS}[a-z_]+[^\n]*\n   {lexer_line.line++;}