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

Commit 8bca174

Browse files
author
Juanjo Alvarez
committed
Migration to the new DSL.
Updated python skeleton driver to the latest changes Completed covering all the node types, added some missing tokens Fixed the problem with comment annotations Remove some outdates FIXME reminders and other unneeded stuff Address some issues from review Add the Unannotated transformer. Fix some unannotated nodes Fix import and alias tokens, add more synth tokens. Signed-off-by: Juanjo Alvarez <[email protected]>
1 parent 6629fad commit 8bca174

File tree

110 files changed

+29832
-25336
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

110 files changed

+29832
-25336
lines changed

driver/fixtures/fixtures_test.go

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
package fixtures
2+
3+
import (
4+
"path/filepath"
5+
"testing"
6+
7+
"github.com/bblfsh/python-driver/driver/normalizer"
8+
"gopkg.in/bblfsh/sdk.v1/sdk/driver"
9+
"gopkg.in/bblfsh/sdk.v1/sdk/driver/fixtures"
10+
)
11+
12+
const projectRoot = "../../"
13+
14+
var Suite = &fixtures.Suite{
15+
Lang: "python",
16+
Ext: ".py",
17+
Path: filepath.Join(projectRoot, fixtures.Dir),
18+
NewDriver: func() driver.BaseDriver {
19+
return driver.NewExecDriverAt(filepath.Join(projectRoot, "build/bin/native"))
20+
},
21+
Transforms: driver.Transforms{
22+
Native: normalizer.Native,
23+
Code: normalizer.Code,
24+
},
25+
BenchName: "issue_server101",
26+
}
27+
28+
func TestPythonDriver(t *testing.T) {
29+
Suite.RunTests(t)
30+
}
31+
32+
func BenchmarkPythonDriver(b *testing.B) {
33+
Suite.RunBenchmarks(b)
34+
}

driver/impl/impl.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package impl
2+
3+
import "gopkg.in/bblfsh/sdk.v1/sdk/driver"
4+
5+
func init() {
6+
// Can be overridden to link a native driver into a Go driver server.
7+
driver.DefaultDriver = driver.NewExecDriver()
8+
}

driver/main.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
package main
22

33
import (
4+
_ "github.com/bblfsh/python-driver/driver/impl"
45
"github.com/bblfsh/python-driver/driver/normalizer"
56

67
"gopkg.in/bblfsh/sdk.v1/sdk/driver"
78
)
89

910
func main() {
10-
driver.Run(normalizer.ToNode, normalizer.Transformers)
11+
driver.Run(driver.Transforms{
12+
Native: normalizer.Native,
13+
Code: normalizer.Code,
14+
})
1115
}

driver/normalizer/annotation.go

Lines changed: 525 additions & 336 deletions
Large diffs are not rendered by default.

driver/normalizer/annotation_test.go

Lines changed: 0 additions & 113 deletions
This file was deleted.

driver/normalizer/pyast/pyast.go

Lines changed: 0 additions & 172 deletions
This file was deleted.

0 commit comments

Comments
 (0)