From owner-p4-projects@FreeBSD.ORG Fri Jul 18 19:16:32 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id B55D61065681; Fri, 18 Jul 2008 19:16:32 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7750A106567E for ; Fri, 18 Jul 2008 19:16:32 +0000 (UTC) (envelope-from konrad@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 6CE9D8FC0A for ; Fri, 18 Jul 2008 19:16:32 +0000 (UTC) (envelope-from konrad@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id m6IJGW8w029295 for ; Fri, 18 Jul 2008 19:16:32 GMT (envelope-from konrad@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.2/8.14.1/Submit) id m6IJGWjg029293 for perforce@freebsd.org; Fri, 18 Jul 2008 19:16:32 GMT (envelope-from konrad@FreeBSD.org) Date: Fri, 18 Jul 2008 19:16:32 GMT Message-Id: <200807181916.m6IJGWjg029293@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to konrad@FreeBSD.org using -f From: Konrad Jankowski To: Perforce Change Reviews Cc: Subject: PERFORCE change 145445 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jul 2008 19:16:33 -0000 http://perforce.freebsd.org/chv.cgi?CH=145445 Change 145445 by konrad@vspredator on 2008/07/18 19:15:44 Incremental changes to make 'collating-element' work again. Affected files ... .. //depot/projects/soc2008/konrad_collation/colldef.apple/scan.l#6 edit Differences ... ==== //depot/projects/soc2008/konrad_collation/colldef.apple/scan.l#6 (text+ko) ==== @@ -1,4 +1,4 @@ -%x string s_name charmap defn nchar subs subs2 ldef elem +%x string s_name charmap defn nchar subs subs2 ldef elem order elem2 %{ /*- * Copyright (c) 1995 Alex Tatmanjants @@ -59,9 +59,9 @@ static int orderpass = 0; %} %% -[ \t]+ ; -\" { ptr = buf; BEGIN(string); } -\" return EXPAND; +[ \t]+ ; +\" { ptr = buf; BEGIN(string); } +\" return EXPAND; \< { if(localedefmode) { ptrsave = ptr; @@ -75,21 +75,23 @@ } } \< { ptr = buf; fromsubs = 1; BEGIN(s_name); } -[,;] return *yytext; -forward { yylval.ch = DIRECTIVE_FORWARD; return ORDER_DIRECTIVE; } -backward { yylval.ch = DIRECTIVE_BACKWARD; return ORDER_DIRECTIVE; } -position { yylval.ch = DIRECTIVE_POSITION; return ORDER_DIRECTIVE; } +[,;] return *yytext; +forward { yylval.ch = DIRECTIVE_FORWARD; return ORDER_DIRECTIVE; } +backward { yylval.ch = DIRECTIVE_BACKWARD; return ORDER_DIRECTIVE; } +position { yylval.ch = DIRECTIVE_POSITION; return ORDER_DIRECTIVE; } collating[-_]element return COLLATING_ELEMENT; collating[-_]symbol return COLLATING_SYMBOL; from return FROM; -\.\.\. return ELLIPSIS; -IGNORE return IGNORE; -UNDEFINED return UNDEFINED; -order[-_]start return ORDER_START; -order[-_]end { +\.\.\. return ELLIPSIS; +IGNORE return IGNORE; +UNDEFINED return UNDEFINED; +order[-_]start { BEGIN(order); return ORDER_START; } +order[-_]end { char line[YY_BUF_SIZE]; - if (orderpass) + if (orderpass) { + BEGIN(ldef); return ORDER_END; + } /* The first pass only defined the left-most symbol. We reread the * order lines, and forward references should now be resolved. */ orderpass++; @@ -105,14 +107,16 @@ if (strstr(line, "order_start") != NULL) break; } + BEGIN(order); return ORDER_SECOND_PASS; } END[ \t]+LC_COLLATE return END_LC_COLLATE; -\n { +\n { line_no++; return '\n'; } -\< { ptr = buf; BEGIN(elem); } +\< { ptr = buf; BEGIN(elem); } +\< { ptr = buf; BEGIN(elem2); } \< { ptr = buf; fromsubs = 0; @@ -213,13 +217,13 @@ BEGIN(nchar); return DEFN; } -\/\/ { +\/\/ { if(ptr >= buf + BUFSIZE - 1) errx(EX_UNAVAILABLE, "name buffer overflow near line %u, character '/'", line_no); *ptr++ = '/'; } -\/\> { +\/\> { if(ptr >= buf + BUFSIZE - 1) errx(EX_UNAVAILABLE, "name buffer overflow near line %u, character '>'", line_no); @@ -240,6 +244,15 @@ BEGIN(ldef); return ELEM; } +\> { + if (ptr == buf) + errx(EX_UNAVAILABLE, "non-empty name expected near line %u", + line_no); + *ptr = 0; + wcscpy(yylval.str, buf); + BEGIN(order); + return ELEM; +} \> { struct symbol *s; @@ -287,7 +300,7 @@ BEGIN(subs2); return STRING; } -. { +. { const char *s = (map_fp != NULL) ? map_name : "input"; if (!isascii(*yytext) || !isprint(*yytext)) @@ -340,7 +353,7 @@ line_no); *ptr++ = '\a'; } -\n { +\n { const char *s = (map_fp != NULL) ? map_name : "input"; if (charmap_cmdline) @@ -348,7 +361,7 @@ errx(EX_UNAVAILABLE, "unterminated map/name/string near line %u of %s (ptr-buf=%d)", line_no, s, ptr - buf); } -<> { +<> { const char *s = (map_fp != NULL) ? map_name : "input"; errx(EX_UNAVAILABLE, "premature EOF in the name/string/char near line %u of %s", line_no, s);