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

find first valid deferred words #1173

Merged
merged 3 commits into from
Apr 19, 2024
Merged

find first valid deferred words #1173

merged 3 commits into from
Apr 19, 2024

Conversation

boulter
Copy link
Contributor

@boulter boulter commented Apr 15, 2024

We end up with a lot blank deferred words when they are attributes of array values.

For example, {{ deferred.results[0].attribute }} will return the used tokens deferred and .attribute. .attribute is treated a value of attribute with a base of (blank) because it splits on periods. This cleans up the general case, but the evaluated eager expressions could also be improved so we don't end up with words with leading periods.

@boulter boulter requested a review from jasmith-hs April 15, 2024 21:40
@@ -413,10 +418,19 @@ private static CallStack acquireMacroStack() {
.orElse(null);
}

private static String getFirstNonEmptyToken(List<String> strings) {
return Strings.isNullOrEmpty(strings.get(0)) ? strings.get(1) : strings.get(0);
Copy link
Contributor

Choose a reason for hiding this comment

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

I think that you need to split more if you're going to take the part after a . because you could have .bar.foobar and you want bar not bar.foobar

@boulter boulter merged commit 024dde3 into master Apr 19, 2024
5 checks passed
@boulter boulter deleted the parse-valid-deferred branch April 19, 2024 19:37
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