pike.git / src / builtin.cmod

version» Context lines:

pike.git/src/builtin.cmod:1:   /* -*- c -*-   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: builtin.cmod,v 1.250 2010/01/09 01:14:11 srb Exp $ + || $Id: builtin.cmod,v 1.251 2010/01/09 13:49:05 srb Exp $   */      #include "global.h"   #include "interpret.h"   #include "svalue.h"   #include "pike_macros.h"   #include "object.h"   #include "program.h"   #include "array.h"   #include "pike_error.h"
pike.git/src/builtin.cmod:839:    switch(*start) { \    CASE \    continue; \    } \    break; \    } \    for (; start < end; start++) { \    if(*start<=' ' || *start>=0x85) /* optimise common case */ \    switch(*start) { \    CASE \ -  if (foundspace) \ +  if (!foundspace) \ +  *dst++ = ' ', foundspace=1; \    continue; \ -  foundspace=1; *dst++ = ' '; \ -  continue; \ +     default:goto found##TYPE; \    } \    else \   found##TYPE: \    foundspace=0; \    *dst++ = *start; \    } \    sb.s->len = dst - (TYPE*)sb.s->str; \    } else { \    const TYPE*ps = (const TYPE*)ws+wlen; \    for (; start < end; start++) { \    size_t clen = wlen; \    do { \    if (ps[-clen] == *start) \    goto lead##TYPE; \    } while(--clen); \    break; \   lead##TYPE:; \    } \    for (; start < end; start++) { \ -  unsigned chr = *start; \ +  TYPE chr = *start; \    size_t clen = wlen; \    do \    if (ps[-clen] == chr) { \ -  if (foundspace) \ -  goto skip##TYPE; \ -  foundspace=1;chr=replspace; \ -  goto copy##TYPE; \ +  if (!foundspace) \ +  string_builder_putchar(&sb, replspace), foundspace=1; \ +  goto skip##TYPE; \    } \    while(--clen); \    if (foundspace && (chr=='\n' || chr=='\r')) { \    sb.s->len--; string_builder_putchar(&sb, chr); \    foundspace=0; \    goto lead##TYPE; \    } \ -  foundspace=0; \ - copy##TYPE: \ -  string_builder_putchar(&sb, chr); \ +  string_builder_putchar(&sb, chr); foundspace=0; \   skip##TYPE:; \    } \    } \    }    case 0: NORMALISE_TIGHT_LOOP (p_wchar0,SPACECASE8); break;    case 1: NORMALISE_TIGHT_LOOP (p_wchar1,SPACECASE16); break;    case 2: NORMALISE_TIGHT_LOOP (p_wchar2,SPACECASE16); break;   #undef NORMALISE_TIGHT_LOOP   #undef SPACECASE8   #undef SPACECASE16