[opengtl-commits] [640] support for identifier starting with '_'

[ Thread Index | Date Index | More lists.tuxfamily.org/opengtl-commits Archives ]


Revision: 640
Author:   cyrille
Date:     2009-03-16 17:51:19 +0100 (Mon, 16 Mar 2009)

Log Message:
-----------
support for identifier starting with '_'

Modified Paths:
--------------
    trunk/OpenGTL/OpenCTL/OpenCTL/compiler/LexerNG.cpp
    trunk/OpenGTL/OpenShiva/OpenShiva/Lexer_p.cpp


Modified: trunk/OpenGTL/OpenCTL/OpenCTL/compiler/LexerNG.cpp
===================================================================
--- trunk/OpenGTL/OpenCTL/OpenCTL/compiler/LexerNG.cpp	2009-03-16 16:47:02 UTC (rev 639)
+++ trunk/OpenGTL/OpenCTL/OpenCTL/compiler/LexerNG.cpp	2009-03-16 16:51:19 UTC (rev 640)
@@ -47,7 +47,7 @@
     return commentToken;
   }
   // if it is alpha, it's an identifier or a keyword
-  if(isalpha(lastChar))
+  if(isalpha(lastChar) or lastChar == '_')
   {
     identifierStr = getIdentifier(lastChar);
     IDENTIFIER_IS_KEYWORD( "bool", BOOL );

Modified: trunk/OpenGTL/OpenShiva/OpenShiva/Lexer_p.cpp
===================================================================
--- trunk/OpenGTL/OpenShiva/OpenShiva/Lexer_p.cpp	2009-03-16 16:47:02 UTC (rev 639)
+++ trunk/OpenGTL/OpenShiva/OpenShiva/Lexer_p.cpp	2009-03-16 16:51:19 UTC (rev 640)
@@ -47,7 +47,7 @@
     return commentToken;
   }
   // if it is alpha, it's an identifier or a keyword
-  if(isalpha(lastChar))
+  if(isalpha(lastChar) or lastChar == '_')
   {
     identifierStr = getIdentifier(lastChar);
     IDENTIFIER_IS_KEYWORD( "and", AND );


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/