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

Allow default value expression starting with operators #42

Merged
merged 1 commit into from
Feb 3, 2023

Conversation

neiser
Copy link
Contributor

@neiser neiser commented Feb 2, 2023

Fixes #41

I hope that I got the lexing right and I think (according to the added test cases) that it actually fixes the issue without introducing new bugs. The trick was to only lex the any subsitition operator first and then continue with anything after the subsitution (such as constant text or another variable, which may in turn contain a substitution I suppose).

Copy link
Owner

@a8m a8m left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution, @neiser.

@a8m a8m merged commit 4932428 into a8m:master Feb 3, 2023
@neiser
Copy link
Contributor Author

neiser commented Feb 4, 2023

@a8m thanks for merging! Do you have any plans to release this fix soon? My actual goal is to get it fixed in yq as well which uses this library AFAIK.

@neiser neiser deleted the fix-gh-issue-41 branch February 4, 2023 08:25
@a8m
Copy link
Owner

a8m commented Feb 7, 2023

@a8m thanks for merging! Do you have any plans to release this fix soon? My actual goal is to get it fixed in yq as well which uses this library AFAIK.

yq uses envsubst as a package, which means it can be updated as follows:

go get github.com/a8m/envsubst@master

But I'll tag master anyway. Thanks again for the contribution.

neiser added a commit to neiser/envsubst that referenced this pull request Feb 8, 2023
a8m pushed a commit that referenced this pull request Feb 8, 2023
@neiser neiser mentioned this pull request Feb 9, 2023
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.

Default values starting with - (dash/minus sign) do not work
3 participants