From: Bruno Haible Date: Fri, 9 Nov 2001 10:31:29 +0000 (+0000) Subject: Support Smalltalk format strings. X-Git-Tag: v0.11~316 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4f6a77f6053ab69c0a1bef8161fcbc05f7ccd42b;p=thirdparty%2Fgettext.git Support Smalltalk format strings. --- diff --git a/src/ChangeLog b/src/ChangeLog index 670bbdd53..5874879ae 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,12 @@ +2001-11-08 Bruno Haible + + * message.h: New enum value format_smalltalk. + * message.c (format_language): Add value for format_smalltalk. + (format_language_pretty): Likewise. + * format.h (formatstring_smalltalk): New declaration. + * format-ycp.c (formatstring_smalltalk): New variable. + * format.c (formatstring_parsers): Add value for format_smalltalk. + 2001-11-05 Bruno Haible * format-lisp.c (parse_upto): Remove 'base' argument. It is always 0. diff --git a/src/format-ycp.c b/src/format-ycp.c index 2d79c186e..dd4b7089a 100644 --- a/src/format-ycp.c +++ b/src/format-ycp.c @@ -1,4 +1,4 @@ -/* YCP format strings. +/* YCP and Smalltalk format strings. Copyright (C) 2001 Free Software Foundation, Inc. Written by Bruno Haible , 2001. @@ -34,6 +34,8 @@ /* YCP sformat strings are described in libycp documentation YCP-builtins.html. A directive starts with '%' and is followed by '%' or a nonzero digit ('1' to '9'). + GNU Smalltalk format strings are described in the CharArray documentation, + methods 'bindWith:' and 'bindWithArguments:'. They have the same syntax. */ struct spec @@ -154,6 +156,15 @@ struct formatstring_parser formatstring_ycp = }; +struct formatstring_parser formatstring_smalltalk = +{ + format_parse, + format_free, + format_get_number_of_directives, + format_check +}; + + #ifdef TEST /* Test program: Print the argument list specification returned by diff --git a/src/format.c b/src/format.c index 30b54f8c2..1658b7493 100644 --- a/src/format.c +++ b/src/format.c @@ -26,10 +26,11 @@ /* Table of all format string parsers. */ struct formatstring_parser *formatstring_parsers[NFORMATS] = { - /* format_c */ &formatstring_c, - /* format_python */ &formatstring_python, - /* format_lisp */ &formatstring_lisp, - /* format_java */ &formatstring_java, - /* format_pascal */ &formatstring_pascal, - /* format_ycp */ &formatstring_ycp + /* format_c */ &formatstring_c, + /* format_python */ &formatstring_python, + /* format_lisp */ &formatstring_lisp, + /* format_smalltalk */ &formatstring_smalltalk, + /* format_java */ &formatstring_java, + /* format_pascal */ &formatstring_pascal, + /* format_ycp */ &formatstring_ycp }; diff --git a/src/format.h b/src/format.h index 2d338534a..58e730ee2 100644 --- a/src/format.h +++ b/src/format.h @@ -52,6 +52,7 @@ struct formatstring_parser extern struct formatstring_parser formatstring_c; extern struct formatstring_parser formatstring_python; extern struct formatstring_parser formatstring_lisp; +extern struct formatstring_parser formatstring_smalltalk; extern struct formatstring_parser formatstring_java; extern struct formatstring_parser formatstring_pascal; extern struct formatstring_parser formatstring_ycp; diff --git a/src/message.c b/src/message.c index e9fe122d8..6b60c8d5a 100644 --- a/src/message.c +++ b/src/message.c @@ -41,22 +41,24 @@ static message_ty *message_list_search_fuzzy_inner PARAMS (( const char *const format_language[NFORMATS] = { - /* format_c */ "c", - /* format_python */ "python", - /* format_lisp */ "lisp", - /* format_java */ "java", - /* format_pascal */ "object-pascal", - /* format_ycp */ "ycp" + /* format_c */ "c", + /* format_python */ "python", + /* format_lisp */ "lisp", + /* format_smalltalk */ "smalltalk", + /* format_java */ "java", + /* format_pascal */ "object-pascal", + /* format_ycp */ "ycp" }; const char *const format_language_pretty[NFORMATS] = { - /* format_c */ "C", - /* format_python */ "Python", - /* format_lisp */ "Lisp", - /* format_java */ "Java", - /* format_pascal */ "Object Pascal", - /* format_ycp */ "YCP" + /* format_c */ "C", + /* format_python */ "Python", + /* format_lisp */ "Lisp", + /* format_smalltalk */ "Smalltalk", + /* format_java */ "Java", + /* format_pascal */ "Object Pascal", + /* format_ycp */ "YCP" }; diff --git a/src/message.h b/src/message.h index 8634507de..db3ea1734 100644 --- a/src/message.h +++ b/src/message.h @@ -36,6 +36,7 @@ enum format_type format_c, format_python, format_lisp, + format_smalltalk, format_java, format_pascal, format_ycp