Branch: Tag:

2010-01-09

2010-01-09 01:00:31 by Stephen R. van den Berg <srb@cuci.nl>

Generate whitespace list from UnicodeData.txt

Rev: bin/getwhitespace.sh:1.1
Rev: src/MANIFEST:1.7
Rev: src/Makefile.in:1.481
Rev: src/builtin.cmod:1.249
Rev: src/whitespace.h:1.1

2:   || 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.248 2010/01/08 22:08:42 srb Exp $ + || $Id: builtin.cmod,v 1.249 2010/01/09 01:00:31 srb Exp $   */      #include "global.h"
821:    }   #define SPACECASE8 \    case ' ':case '\t':case '\r':case '\n':case '\v':case '\f': \ -  case 0x85:case 0xa0 - #define SPACECASE16 \ -  SPACECASE8:case 0x1680:case 0x180e: \ -  case 0x2000:case 0x2001:case 0x2002:case 0x2003:case 0x2004: \ -  case 0x2005:case 0x2006:case 0x2007:case 0x2008:case 0x2009: \ -  case 0x200a:case 0x2028:case 0x2029:case 0x202f:case 0x205f: \ -  case 0x3000 /* FIXME generate list from UnicodeData.txt */ +  case 0x85:case 0xa0: + #include "whitespace.h" +     switch (shift) {   #define NORMALISE_TIGHT_LOOP(TYPE,CASE) \    { \
836:    TYPE *dst = (void*)sb.s->str; \    for (; start < end; start++) { \    switch(*start) { \ -  CASE: \ +  CASE \    continue; \    } \    break; \
844:    for (; start < end; start++) { \    if(*start<=' ' || *start>=0x85) /* optimise common case */ \    switch(*start) { \ -  CASE: \ +  CASE \    if (foundspace) \    continue; \    foundspace=1; *dst++ = ' '; \