Skip to content

Commit e07955a

Browse files
committed
Remove info about marshaling of program
Currently this is not possible. Maybe in future such functionality will be available. For now you should save original source and compile in before running.
1 parent 8712824 commit e07955a

File tree

1 file changed

+0
-21
lines changed

1 file changed

+0
-21
lines changed

docs/Usage.md

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -164,27 +164,6 @@ program, err := expr.Compile(`IsMore(City.Population)`, expr.Env(&EnvContextTwo{
164164
output, err := expr.Run(program, &EnvContextTwo{...})
165165
```
166166

167-
## Marshaling program
168-
169-
Compiled program is possible to marshal and unmarshal before running.
170-
171-
```go
172-
env := map[string]int{
173-
"foo": 1,
174-
"bar": 2,
175-
}
176-
177-
program, err := expr.Compile("foo + bar", expr.Env(env))
178-
b, err := json.Marshal(program)
179-
180-
unmarshaledProgram := &vm.Program{}
181-
err = json.Unmarshal(b, unmarshaledProgram)
182-
183-
output, err := expr.Run(unmarshaledProgram, env)
184-
185-
fmt.Printf("%v", output) // outputs 3
186-
```
187-
188167
## Visitor
189168

190169
[ast](https://godoc.org/github.com/antonmedv/expr/ast) package provides `Visitor` interface and `BaseVisitor` implementation.

0 commit comments

Comments
 (0)