[Issue 5785] Lexing or Parsing issue with UFCS

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Apr 8 00:21:08 PDT 2011


http://d.puremagic.com/issues/show_bug.cgi?id=5785


Rainer Schuetze <r.sagitario at gmx.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch


--- Comment #4 from Rainer Schuetze <r.sagitario at gmx.de> 2011-04-08 00:17:27 PDT ---
Here is a patch that allows to deal with this without creating new tokens:

diff --git a/src/parse.c b/src/parse.c
index 162fa85..199cf89 100644
--- a/src/parse.c
+++ b/src/parse.c
@@ -5380,9 +5380,10 @@ Expression *Parser::parsePostExp(Expression *e)
                 nextToken();
                 if (token.value == TOKidentifier)
                 {   Identifier *id = token.ident;
+                    enum TOK save;

                     nextToken();
-                    if (token.value == TOKnot && peekNext() != TOKis)
+                    if (token.value == TOKnot && (save = peekNext()) != TOKis
&& save != TOKin)
                     {   // identifier!(template-argument-list)
                         TemplateInstance *tempinst = new TemplateInstance(loc,
id);
                         Objects *tiargs;

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list