Skip to content

WIP: Add support for function #262

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft

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