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

AST: represent concatenation and (dis)equality operators just like in the syntax. #7248

Merged
merged 6 commits into from
Jan 15, 2025

Conversation

cristianoc
Copy link
Collaborator

@cristianoc cristianoc commented Jan 14, 2025

Concatenation: ++ instead of ^.
Disequality: != and !== instead of <> and !=.
Equality: == and === instead of = and ==.

@cristianoc cristianoc changed the title AST: represent concatenation internally as "++" instead of "^". AST: represent concatenation and (dis)equality operators just like in the syntax. Jan 14, 2025
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'Syntax Benchmarks'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.05.

Benchmark suite Current: 68a9bb4 Previous: e1b7fb7 Ratio
Print RedBlackTreeNoComments.res - time/run 2.2259943 ms 2.10057036 ms 1.06
Print Napkinscript.res - time/run 83.59990272666666 ms 77.00100409999999 ms 1.09
Print HeroGraphic.res - time/run 9.245741866666666 ms 8.775952553333333 ms 1.05

This comment was automatically generated by workflow using github-action-benchmark.

@cristianoc cristianoc requested review from cknitt and zth January 14, 2025 13:34
Copy link
Member

@cknitt cknitt left a comment

Choose a reason for hiding this comment

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

Awesome! 🎉 But:

But this function argument is expecting: string
But it's expected to have type: string
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is that still a function argument at that pos? If so we're probably missing something minor here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

That's an interesting case.
1 The logic to recognise string concatenation was already using "++", so it was never firing.
2 Now it fires, but there's no error message for the recognised StringConcat so it falls back to the default.

Added a specific message for string concatenation now, how does it look?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Oh haha... 😄 My bad. Go for it, we can rephrase later if wanted.

@cristianoc cristianoc merged commit 52d1cfb into master Jan 15, 2025
20 checks passed
@cristianoc cristianoc deleted the ast-binary-ops branch January 15, 2025 16:52
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