Skip to content

Conversation

kp992
Copy link
Contributor

@kp992 kp992 commented Mar 25, 2025

This PR aims to add support for function.

@@ -378,10 +378,14 @@ binary_posix_conditional_op = !{
while_clause = !{ While ~ conditional_expression ~ do_group }
until_clause = !{ Until ~ conditional_expression ~ do_group }

function_definition = !{ fname ~ "(" ~ ")" ~ linebreak ~ function_body }
function_definition = {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@prsabahrami Does this grammar look fine?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO it looks good and adheres to the docs.
Thank you!

@certik
Copy link
Collaborator

certik commented Mar 26, 2025

Thanks for working on functions!

@kp992
Copy link
Contributor Author

kp992 commented Apr 2, 2025

The shellState update seems a bit tricky here. I update the shellState to contain the function definition but it comes as empty during execute command where we find if the given word is a function or not. Any pointers on how to fix that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants