Skip to content
This repository has been archived by the owner on Mar 8, 2020. It is now read-only.

Commit

Permalink
update the example
Browse files Browse the repository at this point in the history
Signed-off-by: Denys Smirnov <[email protected]>
  • Loading branch information
Denys Smirnov authored and dennwc committed May 28, 2019
1 parent 5a6083b commit e6b1433
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,23 +30,26 @@ Go to the [quick start](https://github.com/bblfsh/bblfshd#quick-start) to discov
package main

import (
"context"
"fmt"

"github.com/bblfsh/go-client/v4"
"github.com/bblfsh/go-client/v4/tools"

"github.com/bblfsh/sdk/v3/uast/nodes"
"github.com/bblfsh/sdk/v3/uast/yaml"
"github.com/bblfsh/sdk/v3/uast/uastyaml"
)

func main() {
client, err := bblfsh.NewClient("0.0.0.0:9432")
ctx := context.Background()
client, err := bblfsh.NewClientContext(ctx, "0.0.0.0:9432")
if err != nil {
panic(err)
}

python := "import foo"
res, _, err := client.NewParseRequest().Language("python").Content(python).UAST()
res, _, err := client.NewParseRequest().Context(ctx).
Language("python").Content(python).UAST()
if err != nil {
panic(err)
}
Expand All @@ -71,7 +74,7 @@ func main() {
// ...
// }
//
data, err := uastyml.Marshal(nodeAr)
data, err := uastyaml.Marshal(nodeAr)
if err != nil {
panic(err)
}
Expand Down

0 comments on commit e6b1433

Please sign in to comment.