Enlightenment CVS committal

Author  : tsauerbeck
Project : e17
Module  : libs/embryo

Dir     : e17/libs/embryo/src/bin


Modified Files:
        embryo_cc_sc2.c 


Log Message:
Implemented string concatenation.
For example, "pants""off" becomes "pantsoff".

===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/embryo/src/bin/embryo_cc_sc2.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -3 -r1.12 -r1.13
--- embryo_cc_sc2.c     9 Sep 2004 00:48:12 -0000       1.12
+++ embryo_cc_sc2.c     11 Oct 2004 17:49:59 -0000      1.13
@@ -1,4 +1,7 @@
-/*  Small compiler - File input, preprocessing and lexical analysis functions
+/*
+ *  vim:ts=8:sw=3:sts=3:noexpandtab
+ *
+ *  Small compiler - File input, preprocessing and lexical analysis functions
  *
  *  Copyright (c) ITB CompuPhase, 1997-2003
  *
@@ -18,7 +21,7 @@
  *      misrepresented as being the original software.
  *  3.  This notice may not be removed or altered from any source distribution.
  *
- *  Version: $Id: embryo_cc_sc2.c,v 1.12 2004/09/09 00:48:12 raster Exp $
+ *  Version: $Id: embryo_cc_sc2.c,v 1.13 2004/10/11 17:49:59 tsauerbeck Exp $
  */
 #include <assert.h>
 #include <stdio.h>
@@ -1738,8 +1741,21 @@
 static char        *
 unpackedstring(char *lptr, int rawstring)
 {
-   while (*lptr != '\"' && *lptr != '\0')
+   while (*lptr != '\0')
      {
+       /* check for doublequotes indicating the end of the string */
+       if (*lptr == '\"')
+       {
+          /* check whether there's another pair of quotes following.
+           * If so, paste the two strings together, thus
+           * "pants""off" becomes "pantsoff"
+           */
+          if (*(lptr + 1) == '\"')
+             lptr += 2;
+          else
+             break;
+       }
+
        if (*lptr == '\a')
          {                     /* ignore '\a' (which was inserted at a line 
concatenation) */
             lptr++;
@@ -1759,8 +1775,21 @@
 
    i = sizeof(ucell) - (charbits / 8); /* start at most significant byte */
    val = 0;
-   while (*lptr != '\"' && *lptr != '\0')
+   while (*lptr != '\0')
      {
+       /* check for doublequotes indicating the end of the string */
+       if (*lptr == '\"')
+       {
+          /* check whether there's another pair of quotes following.
+           * If so, paste the two strings together, thus
+           * "pants""off" becomes "pantsoff"
+           */
+          if (*(lptr + 1) == '\"')
+             lptr += 2;
+          else
+             break;
+       }
+
        if (*lptr == '\a')
          {                     /* ignore '\a' (which was inserted at a line 
concatenation) */
             lptr++;




-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to