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

Remove invalid mutations to invalid syntax #1255

Merged
merged 1 commit into from
Aug 29, 2021
Merged

Remove invalid mutations to invalid syntax #1255

merged 1 commit into from
Aug 29, 2021

Conversation

mbj
Copy link
Owner

@mbj mbj commented Aug 29, 2021

  • Rubies syntax is not easily composable in all cases.
  • Unparser should NOT make up for cases where mutant emits invalid AST
    (that on the first glance should be valid, as its just promoting
    expressions).

emit_left_mutations

emit_left_mutations do |mutation|
!(n_irange?(mutation) || n_erange?(mutation)) || !mutation.children.fetch(1).nil?
Copy link
Owner Author

Choose a reason for hiding this comment

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

Endless ranges to the left of an || are invalid syntax. Welcome to ruby syntax design.

[Fix #1244]

* Rubies syntax is not easily composable in all cases.
* Unparser should NOT make up for cases where mutant emits invalid AST
  (that on the first glance should be valid, as its just promoting
  expressions).
@mbj mbj merged commit cfda1f7 into main Aug 29, 2021
@mbj mbj deleted the fix/invalid-mutation branch August 29, 2021 23:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant