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

Commit bfada45

Browse files
author
Juanjo Alvarez
committed
Feedback from review
Signed-off-by: Juanjo Alvarez <[email protected]> Add PreprocessCode transform Signed-off-by: Juanjo Alvarez <[email protected]> Update Gopkg.lock Signed-off-by: Juanjo Alvarez <[email protected]>
1 parent b5e842c commit bfada45

File tree

4 files changed

+53
-39
lines changed

4 files changed

+53
-39
lines changed

Gopkg.lock

Lines changed: 43 additions & 32 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Gopkg.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
[[constraint]]
55
name = "gopkg.in/bblfsh/sdk.v2"
6-
version = "2.13.x"
6+
version = "2.13.4"
77

88
[prune]
99
go-tests = true

driver/normalizer/normalizer.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ var Preprocess = Transformers([][]Transformer{
1010
{Mappings(Preprocessors...)},
1111
}...)
1212

13+
var PreprocessCode = []CodeTransformer{}
14+
1315
var Preprocessors = []Mapping{
1416
ObjectToNode{
1517
InternalTypeKey: "ast_type",
@@ -72,7 +74,7 @@ func identifierWithPos(nameVar string) ObjectOp {
7274
})
7375
}
7476

75-
// Common for string types (Byte, Str, StrLiteral)
77+
// mapStr factorizes the common annotation for string types (Byte, Str, StrLiteral)
7678
func mapStr(nativeType string) Mapping {
7779
return Map(
7880
Part("_", Fields{

driver/normalizer/transforms.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@ package normalizer
33
import "gopkg.in/bblfsh/sdk.v2/driver"
44

55
var Transforms = driver.Transforms{
6-
Namespace: "python",
7-
Preprocess: Preprocess,
8-
Normalize: Normalize,
9-
Annotations: Native,
10-
Code: Code,
6+
Namespace: "python",
7+
Preprocess: Preprocess,
8+
PreprocessCode: PreprocessCode,
9+
Normalize: Normalize,
10+
Annotations: Native,
11+
Code: Code,
1112
}

0 commit comments

Comments
 (0)