SmaCC icon indicating copy to clipboard operation
SmaCC copied to clipboard

SmaCC Python, management of dictionary creation

Open jecisc opened this issue 2 weeks ago • 0 comments

Hi,

I'm parsing some python code and I found this:

{p: eval(f"e{p}", dict(e=e, p=p)) for p in paths}

From what I understood it is to create a dictionary with the values of paths as keys and the result of the eval as values.

The SmaCC parser is generating in this a FunctionCallExpression with (f"e{p}", dict(e=e, p=p)) as arguments and p: eval as receiver.

I have the impression that the receiver is wrong and should just be eval? Maybe I'm wrong but it's my impression

jecisc avatar Feb 11 '25 16:02 jecisc