Skip to content
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

revamp juxtaposed function call parsing #33

Open
wants to merge 21 commits into
base: main
Choose a base branch
from

Conversation

janw4ld
Copy link
Contributor

@janw4ld janw4ld commented Jan 15, 2025

hellooo, regarding #5, i got juxtaposed function calls working more robustly by

  • adding a new expression kind for those that can be juxtaposed callees
  • modifying the precedence of almost everything🫣
  • adding a not really valid assumption that all non-builtin type identifiers start with a capital letter. this is only true by convention, but i really think there's no other way for determining if string hello is a declaration or function call before run time

the current issue with this refactor thing is that it parses regular function calls with one argument print("hello") as a juxt function call with one parenthesized argument instead of a regular function call. i'll have another try with it to make sure parenthesized_expression is never the argument of a juxt call but wanted to share the news / have you as a second pair of fresh eyes
image

@janw4ld janw4ld marked this pull request as draft January 15, 2025 10:48
@janw4ld
Copy link
Contributor Author

janw4ld commented Jan 15, 2025

not very sure what cases this does and doesn't cover, but it passes the parser's tests (except for the issue above), and detects these calls as such (they and others are incorrectly marked as declarations instead of juxt function calls in test snapshots).

@janw4ld janw4ld changed the title wip: fix juxtaposed function calls wip: improve juxtaposed function calls Jan 15, 2025
@murtaza64
Copy link
Owner

Really happy that you're working on this! Can't promise that I'll have time to take a look this weekend, but if you get too stuck I might be able to spend some time investigating next week

@janw4ld janw4ld marked this pull request as ready for review January 16, 2025 08:21
@janw4ld
Copy link
Contributor Author

janw4ld commented Jan 16, 2025

@murtaza64 this works really well now. please note that this PR contains #32's commits too, and a bunch of miscellaneous fixes to uncommon syntax i personally use in my jenkins libraries. i've validated every node in the new test i added and i'm sure it's parsed correctly.

@janw4ld janw4ld changed the title wip: improve juxtaposed function calls revamp juxtaposed function call parsing Jan 16, 2025
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.

2 participants