Last updated
Was this helpful?
Last updated
Was this helpful?
Deparsing is the reverse process of parsing, which translates the AST back into code. Currently, Sidef supports deparsing into two languages with the -R lang
command-line switch:
-R perl
Deparses the AST into valid Perl code.
-R sidef
Deparses the AST into valid Sidef code.
Example:
The -Rsidef
switch (or simply -r
) is useful for verifying how the code is parsed.
Example:
Outputs:
Deparsing can also be enabled in interactive mode: