Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion common/env/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ func (c *Config) AddVariableDecls(vars ...*decls.VariableDecl) *Config {
return c.AddVariables(convVars...)
}

// AddVariables adds one or more vairables to the config.
// AddVariables adds one or more variables to the config.
func (c *Config) AddVariables(vars ...*Variable) *Config {
c.Variables = append(c.Variables, vars...)
return c
Expand Down
3 changes: 3 additions & 0 deletions repl/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ go_library(
"//cel:go_default_library",
"//checker:go_default_library",
"//checker/decls:go_default_library",
"//common/env:go_default_library",
"//common/functions:go_default_library",
"//common/types:go_default_library",
"//common/types/ref:go_default_library",
Expand All @@ -39,6 +40,7 @@ go_library(
"@com_github_antlr4_go_antlr_v4//:go_default_library",
"@dev_cel_expr//conformance/proto2:go_default_library",
"@dev_cel_expr//conformance/proto3:go_default_library",
"@in_yaml_go_yaml_v3//:go_default_library",
"@org_golang_google_genproto_googleapis_api//expr/v1alpha1:go_default_library",
"@org_golang_google_genproto_googleapis_rpc//context/attribute_context:go_default_library",
"@org_golang_google_protobuf//encoding/prototext:go_default_library",
Expand All @@ -62,6 +64,7 @@ go_test(
deps = [
"//cel:go_default_library",
"//test/proto2pb:go_default_library",
"@com_github_google_go_cmp//cmp:go_default_library",
"@org_golang_google_genproto_googleapis_api//expr/v1alpha1:go_default_library",
"@org_golang_google_protobuf//proto:go_default_library",
],
Expand Down
10 changes: 10 additions & 0 deletions repl/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,14 @@ from disk or from a predefined package. Supported packages are "cel-spec-test-ty

helpUsage = `Help prints usage information for the commands supported by the REPL.
%help`

statusUsage = `Status prints the current state of the REPL session
%status
%status --yaml`

configUsage = `Config loads a canned REPL state from a config file
%configure """%let foo : int = 42"""
%configure --yaml --file 'path/to/env.yaml'`
)

type letVarCmd struct {
Expand Down Expand Up @@ -201,6 +209,8 @@ func Parse(line string) (Cmder, error) {
declareUsage,
deleteUsage,
letUsage,
statusUsage,
configUsage,
optionUsage,
loadDescriptorsUsage,
helpUsage,
Expand Down
10 changes: 9 additions & 1 deletion repl/commands_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,15 @@ func TestParse(t *testing.T) {
Let introduces a variable or function defined by a sub-CEL expression.
%let <identifier> (: <type>)? = <expr>
%let <identifier> (<param_identifier> : <param_type>, ...) : <result-type> -> <expr>


Status prints the current state of the REPL session
%status
%status --yaml

Config loads a canned REPL state from a config file
%configure """%let foo : int = 42"""
%configure --yaml --file 'path/to/env.yaml'

Option enables a CEL environment option which enables configuration and
optional language features.
%option --container 'google.protobuf'
Expand Down
Loading