Skip to content

Resolve user-defined filters before intrinsics#13

Merged
wader merged 4 commits intowader:masterfrom
thaliaarchi:shadowing
Sep 12, 2023
Merged

Resolve user-defined filters before intrinsics#13
wader merged 4 commits intowader:masterfrom
thaliaarchi:shadowing

Conversation

@thaliaarchi
Copy link
Collaborator

This first tries to resolve a filter from the environment before checking if it's an instrinsic. If you want to verify this change, it can be observed that this is a simple swap of the branches, keeping the common $name setup.

I also added debug/1, as defined in builtin.jq, which replaces a manual definition.

Fixes #11.

@thaliaarchi
Copy link
Collaborator Author

thaliaarchi commented Sep 11, 2023

I'm exploring rewriting the environment to use de Bruijn levels and this fix is a nice, safe first step before that.

Copy link
Owner

@wader wader 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! had a suggestion about one additional test

@thaliaarchi
Copy link
Collaborator Author

I added tests as suggested

@wader wader merged commit e4d3596 into wader:master Sep 12, 2023
@wader
Copy link
Owner

wader commented Sep 12, 2023

Thanks again!

@wader
Copy link
Owner

wader commented Sep 12, 2023

btw i can add you as a collaborator for the repo if you want? you seem to have good judgement :)

@wader
Copy link
Owner

wader commented Sep 12, 2023

also 🥳

Screenshot 2023-09-12 at 09 28 06

@wader
Copy link
Owner

wader commented Sep 12, 2023

@thaliaarchi
Copy link
Collaborator Author

I'd love to be a collaborator! I'll accept, once you add me in the UI.

@thaliaarchi
Copy link
Collaborator Author

Glad to help reach 99%! If I revamp the bash CLI, I'll also be its undoing 😈

Actually, jq could handle the parsing, instead of bash! An auxilliary cli.jq could be made, that parses bash's $@ from a minimal shell script, then gives back the shell commands to run jqjq with. cli.jq could then control the flags to jq or switch to gojq or jaq.

@thaliaarchi thaliaarchi deleted the shadowing branch September 12, 2023 08:19
@wader
Copy link
Owner

wader commented Sep 12, 2023

Glad to help reach 99%! If I revamp the bash CLI, I'll also be its undoing 😈

All methods allowed! 😬

Actually, jq could handle the parsing, instead of bash! An auxilliary cli.jq could be made, that parses bash's $@ from a minimal shell script, then gives back the shell commands to run jqjq with. cli.jq could then control the flags to jq or switch to gojq or jaq.

Aha yes that is an interesting idea 🤔

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.

Intrinsics take precedence over user-overloaded filters

2 participants