Bo Peng wrote:

> Seriously, tex2lyx is rarely used (so speed is not an issue) and
> involves a lot of string handling. Python seems to be a much better
> language for this purpose than C++.

That is not the question. Speed is really not an issue (and tex2lyx is slow
for large documents because of the string handling, so I would not expect a
big difference here). The questions are

a) How much existing code can be reused? Think of the
textclass/layout/counter stuff.
b) Since we are not starting fom scratch: Would the implementation in python
be so much better that it justifies to throw away the C++ version?

I know that python has better string handling, but unless parsing is done by
regexes (which does not work - see reLyX) you would end up with something
pretty similar to what we have. The difficult stuff is not string
manipulation, but translating between the different nesting concepts in
LaTeX and LyX, or deciding when to output a space or not. And of course we
have some nice string manipulation functions in src/support.

> I have not used tex2lyx for while, 
> but it did fail to import a SWP generated tex file last time, without
> proper error messages.

Did you file a bug report with a test case?


Georg

Reply via email to