Re: Use "simple parsers" for translations again?

2023-11-25 Thread Gavin Smith
On Sat, Nov 25, 2023 at 09:35:28AM +0100, Patrice Dumas wrote: > > It seems that we could stop these structures being modified with the > > addition of a flag on the parser (e.g. $parser->{'locked'} or > > $parser->{'simple'}). Then check this flag any time: > > > > * A new Texinfo command is to

[PATCH 3/3] * tp/Texinfo/ParserNonXS.pm (_new_macro), (_parse_line_command_args) <@alias, @definfoenclose> <@defindex, @defcodeindex>: Do nothing if 'restricted' flag set.

2023-11-25 Thread Gavin Smith
* tp/t/init_files_tests.t (macro_defined_txiinternalvalue_in_translation): Remove test, as @macro no longer works inside a translated string. --- ChangeLog | 10 ++ tp/Makefile.tres | 1 - tp/Texinfo/ParserNonXS.pm

[PATCH 2/3] Parser 'restricted' flag

2023-11-25 Thread Gavin Smith
* tp/Texinfo/ParserNonXS.pm (simple_parser): Add 'restricted' flag on parser. (_enter_index_entry): Do nothing if flag is set. This prevents index information leaking among simple_parser objects. (simple_parser): Re-use indices information. * tp/t/init/translation_in_parser_in_translation.pm: Do

[PATCH 1/3] Re-add simple_parser

2023-11-25 Thread Gavin Smith
* tp/Texinfo/ParserNonXS.pm, tp/Texinfo/XS/parsetexi/Parsetexi.pm (parser, simple_parser): Re-add simple_parser, used for document translations. The only difference from before is that we do not share the indices between parsers. * tp/Texinfo/Translations.pm (replace_convert_substrings): Call

Re: Use "simple parsers" for translations again?

2023-11-25 Thread Gavin Smith
On Sat, Nov 25, 2023 at 09:35:28AM +0100, Patrice Dumas wrote: > On Fri, Nov 24, 2023 at 11:24:55PM +, Gavin Smith wrote: > > As I understand it, it is not any part of the state that is problematic > > to modify for simple_parser. It is only the structures that are referred > > to when

Re: Use "simple parsers" for translations again?

2023-11-25 Thread Patrice Dumas
On Fri, Nov 24, 2023 at 11:24:55PM +, Gavin Smith wrote: > As I understand it, it is not any part of the state that is problematic > to modify for simple_parser. It is only the structures that are referred > to when creating the simple parser: I think so too. > Many of these relate to the