Use regexp to build the symbols list defined in GAP and its plugin packages.

5 views
Skip to first unread message

hongy...@gmail.com

unread,
May 9, 2022, 4:34:01 AMMay 9
to
I noticed this file [1] includes almost all the symbols defined in GAP [2] and its plugin packages. But I think this should be created by searching gap source code using some complex regular expressions. I try to figure out the regex, but in vain.

Any tips and tricks will be highly appreciated.

[1] https://github.com/feisele/vscode-gap-language-support/blob/master/src/symbols.ts
[2] https://www.gap-system.org/

Regards,
HZ

Janis Papanagnou

unread,
May 9, 2022, 5:55:32 AMMay 9
to
On 09.05.2022 10:33, hongy...@gmail.com wrote:
> I noticed this file [1] includes almost all the symbols defined in
> GAP [2] and its plugin packages. But I think this should be created
> by searching gap source code using some complex regular expressions.

Why do you think these data haven't already been collected by a regexp
search?

That's at least what I regularly do; filter data (including source code)
to extract data that I comprise in some other context, often manually
adding the surrounding context code (like the "export const GVars = ["
in the current example), where in specific cases of continuous code
generation processes that prefix/postfix handling can also be automated
trivially.

> I try to figure out the regex, but in vain.

And what is/was your concrete question/problem finding that regexp?

Or do you want (as so often) that we do your job?

hongy...@gmail.com

unread,
May 9, 2022, 9:00:42 AMMay 9
to
On Monday, May 9, 2022 at 5:55:32 PM UTC+8, Janis Papanagnou wrote:
> On 09.05.2022 10:33, hongy...@gmail.com wrote:
> > I noticed this file [1] includes almost all the symbols defined in
> > GAP [2] and its plugin packages. But I think this should be created
> > by searching gap source code using some complex regular expressions.
> Why do you think these data haven't already been collected by a regexp
> search?
>
> That's at least what I regularly do; filter data (including source code)
> to extract data that I comprise in some other context, often manually
> adding the surrounding context code (like the "export const GVars = ["
> in the current example), where in specific cases of continuous code
> generation processes that prefix/postfix handling can also be automated
> trivially.

Got it. In fact, it's done by using the gap language itself [1].

[1] https://github.com/feisele/vscode-gap-language-support/issues/2#issuecomment-1120965434

Regards,
HZ
Reply all
Reply to author
Forward
0 new messages