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

Made HCL AST on records #7097

Merged
merged 1 commit into from
Mar 18, 2024
Merged

Conversation

lkishalmi
Copy link
Contributor

Well,

I've been waiting for this. I think this is an improvement comparing to the previous version at least for reading. The implementation is more safe.

Performance vise it might be worse than before, though I have no tests to prove that.

Anyway, tests are passing.

Now I'm waiting for Java 21 and it's record patterns.

Copy link
Contributor

@matthiasblaesing matthiasblaesing left a comment

Choose a reason for hiding this comment

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

I only eyeballed this and I might not agree with everything, but in general this looks fine.

It will be interesting how records fit into APIs, but that case is not here and so I think this is good to go.

@lkishalmi
Copy link
Contributor Author

@matthiasblaesing could you share your opinions? I've always valued your wisdom. This Java 17 and records a bit new to me, so I'm eager to see other opinions as well.

Copy link
Contributor

@matthiasblaesing matthiasblaesing left a comment

Choose a reason for hiding this comment

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

Second pass 😀

@lkishalmi lkishalmi force-pushed the languages.hcl-ast-take-2 branch from f016a1b to a4d90c8 Compare March 10, 2024 04:34
Copy link
Member

@mbien mbien left a comment

Choose a reason for hiding this comment

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

looked through it in NB (which is so much nicer than here on github), looks good overall, left some comments.

a jackpot rule matched at SourceRef L74-75 which is outside the area github lets me comment on. It can be simplified to:

        for (Map.Entry<OffsetRange, HCLElement> e : elementAt.entrySet()) {

Comment on lines +36 to 37
public List<? extends HCLExpression> elements() {
return Arrays.asList(condition, trueValue, falseValue);
Copy link
Member

@mbien mbien Mar 13, 2024

Choose a reason for hiding this comment

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

List.ofwould make this immutable and better compatible with List.copyOf which I saw somewhere else. Another match would be in HCLLanguage L236.

Copy link
Member

@mbien mbien left a comment

Choose a reason for hiding this comment

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

looks good!

@lkishalmi lkishalmi force-pushed the languages.hcl-ast-take-2 branch 2 times, most recently from cd0c2d2 to 34f49d7 Compare March 17, 2024 06:24
Use TextBlocks in formatting test, minor enhancements
@lkishalmi lkishalmi force-pushed the languages.hcl-ast-take-2 branch from 34f49d7 to 4e52a8d Compare March 17, 2024 14:31
@lkishalmi lkishalmi merged commit b1f2e5b into apache:master Mar 18, 2024
35 checks passed
@mbien
Copy link
Member

mbien commented Mar 18, 2024

this is causing graal tests to fail since they run on EOL JDK 11 graalvm, but I think i found a way to temp fix this without revert. Testing it locally atm.

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.

3 participants