lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On 15/06/2022 20:07, Flyer31 Test wrote:
Though from MS, the free available Visual Studio Code together with
Sumneco Lua extension is really VERY VERY perfect (do not mixup with
VS Studio, which is NOT free available, and has NOT as good editor as
VS Code strangely...).

You get autohelp and autocompletion for all Lua functions (except if
you use the : operator for meta references, this does not work ... so
e.g. instead of "str:sub(1,5 )" you should better code "string.sub(
str, 1, 5)" if you want autocomplete/autohelp support ... but this
really is the only negative thing I could find there.

You can also quite easily add own help files, if you have own
libraries, and such help files are simple ascii/unicode text files
supporting markup language (for e. g. italic / bold font of title
lines...). And these help files are Lua files and really nice to edit
... . After this you will see autocomplete/autohelp for your own
library functions - really quite amazing.

(I have tried also SciTE and Notepad++ before I then chose VS Studio Code...).

On Wed, Jun 15, 2022 at 6:55 AM Lorenzo Donati
<lorenzodonatibz@tiscali.it> wrote:
Unfortunately that can't be useful for me. I'm on Windows and use
another editor: SciTE, which  (BTW) embeds Lua.

Sorry, but You seem to have misunderstood my needs. I don't need an editor plugin for parsing expression and getting help.

I need a Lua library (or piece of code) that can parse expressions in different languages (at least C, C++, Lua, LaTex) because I need the result of the parsing (some kind of easily modifiable representation, e.g. an AST) to rebuild the expressions using a different syntax and/or after altering them in some ways.

Use case:

I have this expression from a C code snippet:

"(a + b) & (1u << 5)"

*Using Lua code° I need to transform it in an equivalent Lua form to calculate its value (in this case it is sufficient to remove the "u" from 1u), AND I need to transform it to a LaTeX math mode expression
to typeset it in a document.

The net result is that I can create a PDF using PDFlatex from a LaTeX source generated using a Lua program. And this PDF will show a replica of the C expression but will also show its value (calculated using its Lua equivalent expression).

All this without entering 3 different expressions and avoiding
having to keep them in sync (Multiply that use case for 10 or 20 for each document I need to produce, and it would be a nightmare to keep in sync manually).

I already have lots of ad-hoc solutions, hence I needed a more general approach (applicable to other languages as-well, hence the configurability of the parser).

I also have some different but similar use cases, but I hope this clarifies the problem.


Cheers!

-- Lorenzo