From 3c03f893f0087dbfa2563d1e9a0d6834c1c67d3b Mon Sep 17 00:00:00 2001 From: Denys Smirnov Date: Mon, 8 Apr 2019 20:57:23 +0300 Subject: [PATCH] update sdk version and add unicode fixture Signed-off-by: Denys Smirnov --- Gopkg.lock | 4 +- fixtures/unicode.go | 3 + fixtures/unicode.go.native | 140 +++++++++++++++++++++++++++++++++ fixtures/unicode.go.sem.uast | 128 +++++++++++++++++++++++++++++++ fixtures/unicode.go.uast | 145 +++++++++++++++++++++++++++++++++++ 5 files changed, 418 insertions(+), 2 deletions(-) create mode 100644 fixtures/unicode.go create mode 100644 fixtures/unicode.go.native create mode 100644 fixtures/unicode.go.sem.uast create mode 100644 fixtures/unicode.go.uast diff --git a/Gopkg.lock b/Gopkg.lock index 1b9c571..4c7563b 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -377,8 +377,8 @@ "uast/viewer", "uast/yaml" ] - revision = "82ab50025f39a4d522a9124f69bd9cf5220ed6b9" - version = "v2.16.0" + revision = "a7cb6c25d2968d3f254149b7b878c4f5270dd1b6" + version = "v2.16.4" [[projects]] name = "gopkg.in/src-d/go-errors.v1" diff --git a/fixtures/unicode.go b/fixtures/unicode.go new file mode 100644 index 0000000..34f3660 --- /dev/null +++ b/fixtures/unicode.go @@ -0,0 +1,3 @@ +package unicode + +const v = "𝓏" diff --git a/fixtures/unicode.go.native b/fixtures/unicode.go.native new file mode 100644 index 0000000..f9f6211 --- /dev/null +++ b/fixtures/unicode.go.native @@ -0,0 +1,140 @@ +{ '@type': "File", + '@pos': { '@type': "uast:Positions", + start: { '@type': "uast:Position", + offset: 0, + line: 1, + col: 1, + }, + end: { '@type': "uast:Position", + offset: 33, + line: 3, + col: 17, + }, + Package: { '@type': "uast:Position", + offset: 0, + line: 1, + col: 1, + }, + }, + Comments: ~, + Decls: [ + { '@type': "GenDecl", + '@pos': { '@type': "uast:Positions", + start: { '@type': "uast:Position", + offset: 17, + line: 3, + col: 1, + }, + end: { '@type': "uast:Position", + offset: 33, + line: 3, + col: 17, + }, + Lparen: { '@type': "uast:Position", + offset: 0, + line: 0, + col: 0, + }, + Rparen: { '@type': "uast:Position", + offset: 0, + line: 0, + col: 0, + }, + TokPos: { '@type': "uast:Position", + offset: 17, + line: 3, + col: 1, + }, + }, + Doc: ~, + Specs: [ + { '@type': "ValueSpec", + '@pos': { '@type': "uast:Positions", + start: { '@type': "uast:Position", + offset: 23, + line: 3, + col: 7, + }, + end: { '@type': "uast:Position", + offset: 33, + line: 3, + col: 17, + }, + }, + Comment: ~, + Doc: ~, + Names: [ + { '@type': "Ident", + '@pos': { '@type': "uast:Positions", + start: { '@type': "uast:Position", + offset: 23, + line: 3, + col: 7, + }, + end: { '@type': "uast:Position", + offset: 24, + line: 3, + col: 8, + }, + NamePos: { '@type': "uast:Position", + offset: 23, + line: 3, + col: 7, + }, + }, + Name: "v", + }, + ], + Type: ~, + Values: [ + { '@type': "BasicLit", + '@pos': { '@type': "uast:Positions", + start: { '@type': "uast:Position", + offset: 27, + line: 3, + col: 11, + }, + end: { '@type': "uast:Position", + offset: 33, + line: 3, + col: 17, + }, + ValuePos: { '@type': "uast:Position", + offset: 27, + line: 3, + col: 11, + }, + }, + Kind: "STRING", + Value: "\"𝓏\"", + }, + ], + }, + ], + Tok: "const", + }, + ], + Doc: ~, + Imports: ~, + Name: { '@type': "Ident", + '@pos': { '@type': "uast:Positions", + start: { '@type': "uast:Position", + offset: 8, + line: 1, + col: 9, + }, + end: { '@type': "uast:Position", + offset: 15, + line: 1, + col: 16, + }, + NamePos: { '@type': "uast:Position", + offset: 8, + line: 1, + col: 9, + }, + }, + Name: "unicode", + }, + Unresolved: ~, +} \ No newline at end of file diff --git a/fixtures/unicode.go.sem.uast b/fixtures/unicode.go.sem.uast new file mode 100644 index 0000000..7dd1745 --- /dev/null +++ b/fixtures/unicode.go.sem.uast @@ -0,0 +1,128 @@ +{ '@type': "go:File", + '@role': [File], + '@pos': { '@type': "uast:Positions", + start: { '@type': "uast:Position", + offset: 0, + line: 1, + col: 1, + }, + end: { '@type': "uast:Position", + offset: 33, + line: 3, + col: 17, + }, + Package: { '@type': "uast:Position", + offset: 0, + line: 1, + col: 1, + }, + }, + Comments: ~, + Decls: [ + { '@type': "go:GenDecl", + '@role': [Declaration, Incomplete], + '@pos': { '@type': "uast:Positions", + start: { '@type': "uast:Position", + offset: 17, + line: 3, + col: 1, + }, + end: { '@type': "uast:Position", + offset: 33, + line: 3, + col: 17, + }, + Lparen: { '@type': "uast:Position", + offset: 0, + line: 0, + col: 0, + }, + Rparen: { '@type': "uast:Position", + offset: 0, + line: 0, + col: 0, + }, + TokPos: { '@type': "uast:Position", + offset: 17, + line: 3, + col: 1, + }, + }, + Doc: ~, + Specs: [ + { '@type': "go:ValueSpec", + '@role': [Declaration], + '@pos': { '@type': "uast:Positions", + start: { '@type': "uast:Position", + offset: 23, + line: 3, + col: 7, + }, + end: { '@type': "uast:Position", + offset: 33, + line: 3, + col: 17, + }, + }, + Comment: ~, + Doc: ~, + Names: [ + { '@type': "uast:Identifier", + '@role': [Name], + '@pos': { '@type': "uast:Positions", + start: { '@type': "uast:Position", + offset: 23, + line: 3, + col: 7, + }, + end: { '@type': "uast:Position", + offset: 24, + line: 3, + col: 8, + }, + }, + Name: "v", + }, + ], + Type: ~, + Values: [ + { '@type': "uast:String", + '@pos': { '@type': "uast:Positions", + start: { '@type': "uast:Position", + offset: 27, + line: 3, + col: 11, + }, + end: { '@type': "uast:Position", + offset: 33, + line: 3, + col: 17, + }, + }, + Format: "", + Value: "𝓏", + }, + ], + }, + ], + Tok: "const", + }, + ], + Doc: ~, + Imports: ~, + Name: { '@type': "uast:Identifier", + '@pos': { '@type': "uast:Positions", + start: { '@type': "uast:Position", + offset: 8, + line: 1, + col: 9, + }, + end: { '@type': "uast:Position", + offset: 15, + line: 1, + col: 16, + }, + }, + Name: "unicode", + }, +} \ No newline at end of file diff --git a/fixtures/unicode.go.uast b/fixtures/unicode.go.uast new file mode 100644 index 0000000..b262787 --- /dev/null +++ b/fixtures/unicode.go.uast @@ -0,0 +1,145 @@ +{ '@type': "File", + '@role': [File], + '@pos': { '@type': "uast:Positions", + start: { '@type': "uast:Position", + offset: 0, + line: 1, + col: 1, + }, + end: { '@type': "uast:Position", + offset: 33, + line: 3, + col: 17, + }, + Package: { '@type': "uast:Position", + offset: 0, + line: 1, + col: 1, + }, + }, + Comments: ~, + Decls: [ + { '@type': "GenDecl", + '@role': [Declaration, Incomplete], + '@pos': { '@type': "uast:Positions", + start: { '@type': "uast:Position", + offset: 17, + line: 3, + col: 1, + }, + end: { '@type': "uast:Position", + offset: 33, + line: 3, + col: 17, + }, + Lparen: { '@type': "uast:Position", + offset: 0, + line: 0, + col: 0, + }, + Rparen: { '@type': "uast:Position", + offset: 0, + line: 0, + col: 0, + }, + TokPos: { '@type': "uast:Position", + offset: 17, + line: 3, + col: 1, + }, + }, + Doc: ~, + Specs: [ + { '@type': "ValueSpec", + '@role': [Declaration], + '@pos': { '@type': "uast:Positions", + start: { '@type': "uast:Position", + offset: 23, + line: 3, + col: 7, + }, + end: { '@type': "uast:Position", + offset: 33, + line: 3, + col: 17, + }, + }, + Comment: ~, + Doc: ~, + Names: [ + { '@type': "Ident", + '@token': "v", + '@role': [Expression, Identifier, Name], + '@pos': { '@type': "uast:Positions", + start: { '@type': "uast:Position", + offset: 23, + line: 3, + col: 7, + }, + end: { '@type': "uast:Position", + offset: 24, + line: 3, + col: 8, + }, + NamePos: { '@type': "uast:Position", + offset: 23, + line: 3, + col: 7, + }, + }, + }, + ], + Type: ~, + Values: [ + { '@type': "BasicLit", + '@token': "\"𝓏\"", + '@role': [Expression, Literal, Primitive, String], + '@pos': { '@type': "uast:Positions", + start: { '@type': "uast:Position", + offset: 27, + line: 3, + col: 11, + }, + end: { '@type': "uast:Position", + offset: 33, + line: 3, + col: 17, + }, + ValuePos: { '@type': "uast:Position", + offset: 27, + line: 3, + col: 11, + }, + }, + Kind: "STRING", + }, + ], + }, + ], + Tok: "const", + }, + ], + Doc: ~, + Imports: ~, + Name: { '@type': "Ident", + '@token': "unicode", + '@role': [Expression, Identifier], + '@pos': { '@type': "uast:Positions", + start: { '@type': "uast:Position", + offset: 8, + line: 1, + col: 9, + }, + end: { '@type': "uast:Position", + offset: 15, + line: 1, + col: 16, + }, + NamePos: { '@type': "uast:Position", + offset: 8, + line: 1, + col: 9, + }, + }, + }, +} \ No newline at end of file