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

Record fixity of call type in flags #124

Merged
merged 2 commits into from
Oct 14, 2022
Merged

Record fixity of call type in flags #124

merged 2 commits into from
Oct 14, 2022

Conversation

c42f
Copy link
Member

@c42f c42f commented Oct 14, 2022

We now record which precise call syntax was used out of the four options:

  • Prefix calls with parens
  • Prefix operator calls
  • Infix operator calls
  • Postfix operator calls

This allows us to distinguish keyword arguments from assignment, fixing several bugs with = to kw conversion.

Fixes #113
Close #99

We now record which precise call syntax was used out of the four
options:
* Prefix calls with parens
* Prefix operator calls
* Infix operator calls
* Postfix operator calls

This allows us to distinguish keyword arguments from assignment, fixing
several bugs with = to kw conversion.
@c42f c42f force-pushed the c42f/refactor-call-heads branch from 24c5840 to 0bb5ec7 Compare October 14, 2022 10:34
Comment on lines 87 to 88
is_prefix_op_call(head) && (str = str*"h")
is_suffix_op_call(head) && (str = str*"j")
Copy link
Member

Choose a reason for hiding this comment

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

We're not limited to one-char suffixes here, right? So -pre/-suf or -pre/-post would probably be the more obvious choices.

Copy link
Member Author

@c42f c42f Oct 14, 2022

Choose a reason for hiding this comment

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

Flags can be combined (eg raw and triple string), so I did limit it to one char suffixes on purpose.

Could be a good idea though to make these clearer. But if we do, let's do all the flags at once.

Copy link
Member Author

Choose a reason for hiding this comment

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

(ie, in a separate PR)

Copy link
Member Author

Choose a reason for hiding this comment

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

Actually I'll do this now after all: These particular flags aren't combined with others so this will be clearer and the lack of consistency shouldn't be a big deal.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

@c42f c42f merged commit 700101e into main Oct 14, 2022
@c42f c42f deleted the c42f/refactor-call-heads branch October 14, 2022 20:03
@c42f c42f mentioned this pull request Oct 14, 2022
33 tasks
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.

Incorrect parsing of -(a=2) AST inconsistency between parsing of = vs kw
2 participants