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

Enable extensions for REPL #653

Merged
merged 3 commits into from
Mar 17, 2023

Conversation

l46kok
Copy link
Collaborator

@l46kok l46kok commented Mar 8, 2023

This allows the usage of all extensions in REPL.

Example:

cel-repl> %option --extension 'strings'
cel-repl> 'hello world'.substring(6)
world : string

Available extension options:

%option --extension 'strings'
%option --extension 'math'
%option --extension 'protos'
%option --extension 'encoders'
%option --extension 'all' (adds all 4 above)

@l46kok l46kok requested a review from jnthntatum March 8, 2023 19:13
@jnthntatum
Copy link
Collaborator

jnthntatum commented Mar 8, 2023

can you check on the cloud build failure? maybe the build files need to be fixed.

repl/evaluator.go Outdated Show resolved Hide resolved
repl/evaluator.go Outdated Show resolved Hide resolved
@l46kok l46kok force-pushed the repl/include-extensions branch 4 times, most recently from cef2c86 to 181b468 Compare March 8, 2023 21:43
@l46kok
Copy link
Collaborator Author

l46kok commented Mar 8, 2023

PTAL

jnthntatum
jnthntatum previously approved these changes Mar 8, 2023
@TristonianJones
Copy link
Collaborator

TristonianJones commented Mar 14, 2023

@l46kok as a convenience could you add --extension 'all'

Also, is it possible to disable the extensions once set?

@l46kok l46kok force-pushed the repl/include-extensions branch from 78d7ef0 to 73f902c Compare March 14, 2023 18:27
@l46kok
Copy link
Collaborator Author

l46kok commented Mar 14, 2023

@l46kok as a convenience could you add --extension 'all'

Also, is it possible to disable the extensions once set?

Done

The extensions can be disabled by %reset, which resets the environment to initial state.

repl/evaluator.go Outdated Show resolved Hide resolved
repl/evaluator.go Show resolved Hide resolved
@TristonianJones TristonianJones merged commit 79b4240 into google:master Mar 17, 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.

3 participants