gettext
a1557049 - xgettext: Refactor the formatstring code.

Commit
1 year ago
xgettext: Refactor the formatstring code. Use "regions" instead of "contexts" to keep track of the flags and data that is specific to a (usually parenthesized) block in an input file. * gettext-tools/src/xg-arglist-context.h (null_context, passthrough_context, inherited_context): Remove declarations. (struct formatstring_region_ty, struct flag_region_ty): New types. (null_context_region, inheriting_region, ref_region, unref_region): New declarations. (assign_region, assign_new_region): New macros. * gettext-tools/src/xg-arglist-context.c: Include attribute.h. (null_context): Make static. (passthrough_context): Make static. Mark as MAYBE_UNUSED. (inherited_context): Remove function. (the_null_context_region): New variable. (null_context_region, inheriting_region, ref_region, unref_region): New functions. * gettext-tools/src/xg-arglist-parser.h (struct partial_call, arglist_parser_remember, arglist_parser_remember_msgctxt): Use 'flag_region_ty *' instead of flag_context_ty. * gettext-tools/src/xg-arglist-parser.c (arglist_parser_alloc, arglist_parser_clone, arglist_parser_remember): Update. (arglist_parser_remember_msgctxt, arglist_parser_done): Use 'flag_region_ty *' instead of flag_context_ty. * gettext-tools/src/xg-message.h (remember_a_message, remember_a_message_plural): Use 'flag_region_ty *' instead of flag_context_ty. * gettext-tools/src/xg-message.c (set_format_flags_from_context, remember_a_message, remember_a_message_plural): Use 'flag_region_ty *' instead of flag_context_ty. * gettext-tools/src/x-awk.c (extract_parenthesized): Use 'flag_region_ty *' instead of flag_context_ty. (extract_awk): Update. * gettext-tools/src/x-c.c (extract_parenthesized): Use 'flag_region_ty *' instead of flag_context_ty. (extract_whole_file): Update. * gettext-tools/src/x-csharp.c (extract_parenthesized): Use 'flag_region_ty *' instead of flag_context_ty. (extract_csharp): Update. * gettext-tools/src/x-desktop.c (extract_desktop_handle_pair): Update. * gettext-tools/src/x-elisp.c (read_object): Use 'flag_region_ty *' instead of flag_context_ty. (extract_elisp): Update. * gettext-tools/src/x-java.c (extract_parenthesized): Use 'flag_region_ty *' instead of flag_context_ty. (extract_java): Update. * gettext-tools/src/x-javascript.c (extract_balanced): Use 'flag_region_ty *' instead of flag_context_ty. (extract_javascript): Update. * gettext-tools/src/x-librep.c (read_object): Use 'flag_region_ty *' instead of flag_context_ty. (extract_librep): Update. * gettext-tools/src/x-lisp.c (read_object): Use 'flag_region_ty *' instead of flag_context_ty. (extract_lisp): Update. * gettext-tools/src/x-lua.c (extract_balanced): Use 'flag_region_ty *' instead of flag_context_ty. (extract_lua): Update. * gettext-tools/src/x-perl.c (extract_variable, interpolate_keywords, extract_balanced): Use 'flag_region_ty *' instead of flag_context_ty. (extract_perl): Update. * gettext-tools/src/x-php.c (extract_balanced): Use 'flag_region_ty *' instead of flag_context_ty. (extract_php): Update. * gettext-tools/src/x-python.c (extract_balanced): Use 'flag_region_ty *' instead of flag_context_ty. (extract_python): Update. * gettext-tools/src/x-rst.c (extract_rst, extract_rsj): Update. * gettext-tools/src/x-scheme.c (read_object): Use 'flag_region_ty *' instead of flag_context_ty. (extract_scheme): Update. * gettext-tools/src/x-sh.c (read_word, read_command, read_command_list): Use 'flag_region_ty *' instead of flag_context_ty. (extract_sh): Update. * gettext-tools/src/x-smalltalk.c (extract_smalltalk): Update. * gettext-tools/src/x-tcl.c (accumulate_word, read_word, read_command, read_command_list): Use 'flag_region_ty *' instead of flag_context_ty. (extract_tcl): Update. * gettext-tools/src/x-vala.c (extract_balanced): Use 'flag_region_ty *' instead of flag_context_ty. (extract_vala): Update. * gettext-tools/src/x-ycp.c (extract_parenthesized): Use 'flag_region_ty *' instead of flag_context_ty. (extract_ycp): Update. * gettext-tools/src/xgettext.c (xgettext_its_extract_callback): Update.
Author
Committer
Parents
Loading