[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: syntax error reported in maintain/generate_code_convert_data.pl
From: |
Patrice Dumas |
Subject: |
Re: syntax error reported in maintain/generate_code_convert_data.pl |
Date: |
Mon, 21 Oct 2024 18:47:16 +0200 |
On Mon, Oct 21, 2024 at 03:28:35PM +0100, Gavin Smith wrote:
> For shorter files like default_special_unit_info.csv and
> default_direction_strings.csv it is less clear that it offers a net
> benefit. To be honest, the function of these files is not particularly
> clear to me other than one of them is something to do with node direction
> pointers. I don't someone looking at these files for the first time
> would have an easy time figuring out what they are for.
Indeed. In those cases, the code generated is not much better in term
of figuring what it is for...
> Obviously, I don't know everything you were considering when you
> changed the code to use these files, so it is possible you have
> already considered the trade-offs.
The main objective was to avoid the possibility to have a divergence of
the Perl and C code and a secondary objective is to make it easy to
change the data.
> One suggestion I have is that Data.pm is a rather non-descriptive name.
> Could this be better named as something like HTMLData.pm, or generated
I prefer HTMLData.pm.
> > Is the design ok? If so, I could add more, converting Perl structures
> > to CSV files and previous code generating C from Perl to code generating
> > both C and Perl.
>
> As I said above, it depends on what it is for.
>
> You say that it is replacing generating C code from Perl although
> I couldn't tell which scripts it was replacing. (I looked at
> the output of "git log maintain/generate_code_convert_data.pl" but
> nothing jumped out at me.)
This is new, but what I was trying to say is that there is
tp/maintain/setup_converters_code_tables.pl that read Perl code to
output the corresponding C code, instead the data that is in Perl code,
such as Texinfo::Common::text_brace_no_arg_commands or
Texinfo::Convert::Unicode::unicode_character_brace_no_arg_commands could
be in a CSV data file and be processed by a script similar to
maintain/generate_code_convert_data.pl to become C and Perl code.
> Is this replacing generating C code from Perl, or is it new generated
> code that was previously duplicated between C and Perl?
It is new generated code that was previously in Perl only.
--
Pat