diff --git a/driver/normalizer/normalizer.go b/driver/normalizer/normalizer.go index 4fd3375..f4e891a 100644 --- a/driver/normalizer/normalizer.go +++ b/driver/normalizer/normalizer.go @@ -136,7 +136,9 @@ var Normalizers = []Mapping{ Fields{ {Name: "body", Op: Var("stmts")}, {Name: "directives", Op: Arr()}, // TODO: find an example - //FIXME(bzz): save this once we agree how + // FIXME(bzz): make sure such comments are linked properly + {Name: "innerComments", Drop: true, Op: Any()}, + {Name: "leadingComments", Drop: true, Op: Any()}, {Name: "trailingComments", Drop: true, Op: Any()}, }, Obj{ diff --git a/fixtures/comment.js b/fixtures/comment.js index 92ceb6a..a15dc43 100644 --- a/fixtures/comment.js +++ b/fixtures/comment.js @@ -1,3 +1,10 @@ // This a comment /* Another comment */ /** Yet another comment */ + +// Create dest - leadingComment +try { + fs.mkdirSync(dest, parseInt('0777', 8)); +} catch (e) { + // like Unix's cp, keep going even if we can't create dest dir - innerComment +} diff --git a/fixtures/comment.js.native b/fixtures/comment.js.native index 9f50d05..57698f0 100644 --- a/fixtures/comment.js.native +++ b/fixtures/comment.js.native @@ -48,12 +48,44 @@ type: "CommentBlock", value: "* Yet another comment ", }, + { + end: 99, + loc: { + end: { + column: 31, + line: 5, + }, + start: { + column: 0, + line: 5, + }, + }, + start: 68, + type: "CommentLine", + value: " Create dest - leadingComment", + }, + { + end: 246, + loc: { + end: { + column: 81, + line: 9, + }, + start: { + column: 4, + line: 9, + }, + }, + start: 169, + type: "CommentLine", + value: " like Unix's cp, keep going even if we can't create dest dir - innerComment", + }, ], - end: 67, + end: 249, loc: { end: { column: 0, - line: 4, + line: 11, }, start: { column: 0, @@ -61,64 +93,361 @@ }, }, program: { - body: [], - directives: [], - end: 67, - innerComments: [ + body: [ { - end: 17, - loc: { - end: { - column: 17, - line: 1, - }, - start: { - column: 0, - line: 1, + block: { + body: [ + { + end: 150, + expression: { + arguments: [ + { + end: 127, + loc: { + end: { + column: 21, + line: 7, + }, + identifierName: "dest", + start: { + column: 17, + line: 7, + }, + }, + name: "dest", + start: 123, + type: "Identifier", + }, + { + arguments: [ + { + end: 144, + extra: { + raw: "'0777'", + rawValue: "0777", + }, + loc: { + end: { + column: 38, + line: 7, + }, + start: { + column: 32, + line: 7, + }, + }, + start: 138, + type: "StringLiteral", + value: "0777", + }, + { + end: 147, + extra: { + raw: "8", + rawValue: 8, + }, + loc: { + end: { + column: 41, + line: 7, + }, + start: { + column: 40, + line: 7, + }, + }, + start: 146, + type: "NumericLiteral", + value: 8, + }, + ], + callee: { + end: 137, + loc: { + end: { + column: 31, + line: 7, + }, + identifierName: "parseInt", + start: { + column: 23, + line: 7, + }, + }, + name: "parseInt", + start: 129, + type: "Identifier", + }, + end: 148, + loc: { + end: { + column: 42, + line: 7, + }, + start: { + column: 23, + line: 7, + }, + }, + start: 129, + type: "CallExpression", + }, + ], + callee: { + computed: false, + end: 122, + leadingComments: ~, + loc: { + end: { + column: 16, + line: 7, + }, + start: { + column: 4, + line: 7, + }, + }, + object: { + end: 112, + leadingComments: ~, + loc: { + end: { + column: 6, + line: 7, + }, + identifierName: "fs", + start: { + column: 4, + line: 7, + }, + }, + name: "fs", + start: 110, + type: "Identifier", + }, + property: { + end: 122, + loc: { + end: { + column: 16, + line: 7, + }, + identifierName: "mkdirSync", + start: { + column: 7, + line: 7, + }, + }, + name: "mkdirSync", + start: 113, + type: "Identifier", + }, + start: 110, + type: "MemberExpression", + }, + end: 149, + leadingComments: ~, + loc: { + end: { + column: 43, + line: 7, + }, + start: { + column: 4, + line: 7, + }, + }, + start: 110, + type: "CallExpression", + }, + leadingComments: ~, + loc: { + end: { + column: 44, + line: 7, + }, + start: { + column: 4, + line: 7, + }, + }, + start: 110, + type: "ExpressionStatement", + }, + ], + directives: [], + end: 152, + leadingComments: ~, + loc: { + end: { + column: 1, + line: 8, + }, + start: { + column: 4, + line: 6, + }, }, + start: 104, + type: "BlockStatement", }, - start: 0, - type: "CommentLine", - value: " This a comment", - }, - { - end: 39, - loc: { - end: { - column: 21, - line: 2, + end: 248, + finalizer: ~, + guardedHandlers: [], + handler: { + body: { + body: [], + directives: [], + end: 248, + innerComments: [ + { + end: 246, + loc: { + end: { + column: 81, + line: 9, + }, + start: { + column: 4, + line: 9, + }, + }, + start: 169, + type: "CommentLine", + value: " like Unix's cp, keep going even if we can't create dest dir - innerComment", + }, + ], + leadingComments: ~, + loc: { + end: { + column: 1, + line: 10, + }, + start: { + column: 12, + line: 8, + }, + }, + start: 163, + type: "BlockStatement", }, - start: { - column: 0, - line: 2, + end: 248, + loc: { + end: { + column: 1, + line: 10, + }, + start: { + column: 2, + line: 8, + }, + }, + param: { + end: 161, + loc: { + end: { + column: 10, + line: 8, + }, + identifierName: "e", + start: { + column: 9, + line: 8, + }, + }, + name: "e", + start: 160, + type: "Identifier", }, + start: 153, + type: "CatchClause", }, - start: 18, - type: "CommentBlock", - value: " Another comment ", - }, - { - end: 66, + leadingComments: [ + { + end: 17, + loc: { + end: { + column: 17, + line: 1, + }, + start: { + column: 0, + line: 1, + }, + }, + start: 0, + type: "CommentLine", + value: " This a comment", + }, + { + end: 39, + loc: { + end: { + column: 21, + line: 2, + }, + start: { + column: 0, + line: 2, + }, + }, + start: 18, + type: "CommentBlock", + value: " Another comment ", + }, + { + end: 66, + loc: { + end: { + column: 26, + line: 3, + }, + start: { + column: 0, + line: 3, + }, + }, + start: 40, + type: "CommentBlock", + value: "* Yet another comment ", + }, + { + end: 99, + loc: { + end: { + column: 31, + line: 5, + }, + start: { + column: 0, + line: 5, + }, + }, + start: 68, + type: "CommentLine", + value: " Create dest - leadingComment", + }, + ], loc: { end: { - column: 26, - line: 3, + column: 1, + line: 10, }, start: { column: 0, - line: 3, + line: 6, }, }, - start: 40, - type: "CommentBlock", - value: "* Yet another comment ", + start: 100, + type: "TryStatement", }, ], - leadingComments: ~, + directives: [], + end: 249, loc: { end: { column: 0, - line: 4, + line: 11, }, start: { column: 0, diff --git a/fixtures/comment.js.sem.uast b/fixtures/comment.js.sem.uast index 7115805..6ecfb5e 100644 --- a/fixtures/comment.js.sem.uast +++ b/fixtures/comment.js.sem.uast @@ -7,8 +7,8 @@ col: 1, }, end: { '@type': "uast:Position", - offset: 67, - line: 4, + offset: 249, + line: 11, col: 1, }, }, @@ -70,6 +70,44 @@ Tab: "", Text: "* Yet another comment", }, + { '@type': "uast:Comment", + '@pos': { '@type': "uast:Positions", + start: { '@type': "uast:Position", + offset: 68, + line: 5, + col: 1, + }, + end: { '@type': "uast:Position", + offset: 99, + line: 5, + col: 32, + }, + }, + Block: false, + Prefix: " ", + Suffix: "", + Tab: "", + Text: "Create dest - leadingComment", + }, + { '@type': "uast:Comment", + '@pos': { '@type': "uast:Positions", + start: { '@type': "uast:Position", + offset: 169, + line: 9, + col: 5, + }, + end: { '@type': "uast:Position", + offset: 246, + line: 9, + col: 82, + }, + }, + Block: false, + Prefix: " ", + Suffix: "", + Tab: "", + Text: "like Unix's cp, keep going even if we can't create dest dir - innerComment", + }, ], program: { '@type': "javascript:Program", '@role': [Module], @@ -80,73 +118,333 @@ col: 1, }, end: { '@type': "uast:Position", - offset: 67, - line: 4, + offset: 249, + line: 11, col: 1, }, }, - body: [], - directives: [], - innerComments: [ - { '@type': "uast:Comment", + body: [ + { '@type': "javascript:TryStatement", + '@role': [Statement, Try], '@pos': { '@type': "uast:Positions", start: { '@type': "uast:Position", - offset: 0, - line: 1, + offset: 100, + line: 6, col: 1, }, end: { '@type': "uast:Position", - offset: 17, - line: 1, - col: 18, + offset: 248, + line: 10, + col: 2, }, }, - Block: false, - Prefix: " ", - Suffix: "", - Tab: "", - Text: "This a comment", - }, - { '@type': "uast:Comment", - '@pos': { '@type': "uast:Positions", - start: { '@type': "uast:Position", - offset: 18, - line: 2, - col: 1, - }, - end: { '@type': "uast:Position", - offset: 39, - line: 2, - col: 22, + block: { '@type': "uast:Block", + '@pos': { '@type': "uast:Positions", + start: { '@type': "uast:Position", + offset: 104, + line: 6, + col: 5, + }, + end: { '@type': "uast:Position", + offset: 152, + line: 8, + col: 2, + }, }, + Statements: [ + { '@type': "javascript:ExpressionStatement", + '@role': [Statement], + '@pos': { '@type': "uast:Positions", + start: { '@type': "uast:Position", + offset: 110, + line: 7, + col: 5, + }, + end: { '@type': "uast:Position", + offset: 150, + line: 7, + col: 45, + }, + }, + expression: { '@type': "javascript:CallExpression", + '@role': [Call, Expression], + '@pos': { '@type': "uast:Positions", + start: { '@type': "uast:Position", + offset: 110, + line: 7, + col: 5, + }, + end: { '@type': "uast:Position", + offset: 149, + line: 7, + col: 44, + }, + }, + arguments: [ + { '@type': "uast:Identifier", + '@role': [Argument, Call], + '@pos': { '@type': "uast:Positions", + start: { '@type': "uast:Position", + offset: 123, + line: 7, + col: 18, + }, + end: { '@type': "uast:Position", + offset: 127, + line: 7, + col: 22, + }, + }, + Name: "dest", + }, + { '@type': "javascript:CallExpression", + '@role': [Argument, Call, Expression], + '@pos': { '@type': "uast:Positions", + start: { '@type': "uast:Position", + offset: 129, + line: 7, + col: 24, + }, + end: { '@type': "uast:Position", + offset: 148, + line: 7, + col: 43, + }, + }, + arguments: [ + { '@type': "uast:String", + '@role': [Argument, Call], + '@pos': { '@type': "uast:Positions", + start: { '@type': "uast:Position", + offset: 138, + line: 7, + col: 33, + }, + end: { '@type': "uast:Position", + offset: 144, + line: 7, + col: 39, + }, + }, + Format: "single", + Value: "0777", + }, + { '@type': "javascript:NumericLiteral", + '@token': 8, + '@role': [Argument, Call, Expression, Literal, Number], + '@pos': { '@type': "uast:Positions", + start: { '@type': "uast:Position", + offset: 146, + line: 7, + col: 41, + }, + end: { '@type': "uast:Position", + offset: 147, + line: 7, + col: 42, + }, + }, + }, + ], + callee: { '@type': "uast:Identifier", + '@role': [Call, Callee], + '@pos': { '@type': "uast:Positions", + start: { '@type': "uast:Position", + offset: 129, + line: 7, + col: 24, + }, + end: { '@type': "uast:Position", + offset: 137, + line: 7, + col: 32, + }, + }, + Name: "parseInt", + }, + }, + ], + callee: { '@type': "javascript:MemberExpression", + '@role': [Call, Callee, Expression, Identifier, Qualified], + '@pos': { '@type': "uast:Positions", + start: { '@type': "uast:Position", + offset: 110, + line: 7, + col: 5, + }, + end: { '@type': "uast:Position", + offset: 122, + line: 7, + col: 17, + }, + }, + computed: false, + leadingComments: ~, + object: { '@type': "uast:Identifier", + '@pos': { '@type': "uast:Positions", + start: { '@type': "uast:Position", + offset: 110, + line: 7, + col: 5, + }, + end: { '@type': "uast:Position", + offset: 112, + line: 7, + col: 7, + }, + }, + Name: "fs", + }, + property: { '@type': "uast:Identifier", + '@pos': { '@type': "uast:Positions", + start: { '@type': "uast:Position", + offset: 113, + line: 7, + col: 8, + }, + end: { '@type': "uast:Position", + offset: 122, + line: 7, + col: 17, + }, + }, + Name: "mkdirSync", + }, + }, + leadingComments: ~, + }, + leadingComments: ~, + }, + ], }, - Block: true, - Prefix: " ", - Suffix: " ", - Tab: "", - Text: "Another comment", - }, - { '@type': "uast:Comment", - '@pos': { '@type': "uast:Positions", - start: { '@type': "uast:Position", - offset: 40, - line: 3, - col: 1, + finalizer: ~, + guardedHandlers: [], + handler: { '@type': "javascript:CatchClause", + '@role': [Catch, Statement, Try], + '@pos': { '@type': "uast:Positions", + start: { '@type': "uast:Position", + offset: 153, + line: 8, + col: 3, + }, + end: { '@type': "uast:Position", + offset: 248, + line: 10, + col: 2, + }, }, - end: { '@type': "uast:Position", - offset: 66, - line: 3, - col: 27, + body: { '@type': "uast:Block", + '@pos': { '@type': "uast:Positions", + start: { '@type': "uast:Position", + offset: 163, + line: 8, + col: 13, + }, + end: { '@type': "uast:Position", + offset: 248, + line: 10, + col: 2, + }, + }, + Statements: [], + }, + param: { '@type': "uast:Identifier", + '@pos': { '@type': "uast:Positions", + start: { '@type': "uast:Position", + offset: 160, + line: 8, + col: 10, + }, + end: { '@type': "uast:Position", + offset: 161, + line: 8, + col: 11, + }, + }, + Name: "e", }, }, - Block: true, - Prefix: "", - Suffix: " ", - Tab: "", - Text: "* Yet another comment", + leadingComments: [ + { '@type': "uast:Comment", + '@pos': { '@type': "uast:Positions", + start: { '@type': "uast:Position", + offset: 0, + line: 1, + col: 1, + }, + end: { '@type': "uast:Position", + offset: 17, + line: 1, + col: 18, + }, + }, + Block: false, + Prefix: " ", + Suffix: "", + Tab: "", + Text: "This a comment", + }, + { '@type': "uast:Comment", + '@pos': { '@type': "uast:Positions", + start: { '@type': "uast:Position", + offset: 18, + line: 2, + col: 1, + }, + end: { '@type': "uast:Position", + offset: 39, + line: 2, + col: 22, + }, + }, + Block: true, + Prefix: " ", + Suffix: " ", + Tab: "", + Text: "Another comment", + }, + { '@type': "uast:Comment", + '@pos': { '@type': "uast:Positions", + start: { '@type': "uast:Position", + offset: 40, + line: 3, + col: 1, + }, + end: { '@type': "uast:Position", + offset: 66, + line: 3, + col: 27, + }, + }, + Block: true, + Prefix: "", + Suffix: " ", + Tab: "", + Text: "* Yet another comment", + }, + { '@type': "uast:Comment", + '@pos': { '@type': "uast:Positions", + start: { '@type': "uast:Position", + offset: 68, + line: 5, + col: 1, + }, + end: { '@type': "uast:Position", + offset: 99, + line: 5, + col: 32, + }, + }, + Block: false, + Prefix: " ", + Suffix: "", + Tab: "", + Text: "Create dest - leadingComment", + }, + ], }, ], - leadingComments: ~, + directives: [], sourceType: "module", }, } \ No newline at end of file diff --git a/fixtures/comment.js.uast b/fixtures/comment.js.uast index 0cd4e94..a504c87 100644 --- a/fixtures/comment.js.uast +++ b/fixtures/comment.js.uast @@ -7,8 +7,8 @@ col: 1, }, end: { '@type': "uast:Position", - offset: 67, - line: 4, + offset: 249, + line: 11, col: 1, }, }, @@ -61,6 +61,38 @@ }, }, }, + { '@type': "CommentLine", + '@token': " Create dest - leadingComment", + '@role': [Comment, Noop], + '@pos': { '@type': "uast:Positions", + start: { '@type': "uast:Position", + offset: 68, + line: 5, + col: 1, + }, + end: { '@type': "uast:Position", + offset: 99, + line: 5, + col: 32, + }, + }, + }, + { '@type': "CommentLine", + '@token': " like Unix's cp, keep going even if we can't create dest dir - innerComment", + '@role': [Comment, Noop], + '@pos': { '@type': "uast:Positions", + start: { '@type': "uast:Position", + offset: 169, + line: 9, + col: 5, + }, + end: { '@type': "uast:Position", + offset: 246, + line: 9, + col: 82, + }, + }, + }, ], program: { '@type': "Program", '@role': [Module], @@ -71,64 +103,348 @@ col: 1, }, end: { '@type': "uast:Position", - offset: 67, - line: 4, + offset: 249, + line: 11, col: 1, }, }, - body: [], - directives: [], - innerComments: [ - { '@type': "CommentLine", - '@token': " This a comment", - '@role': [Comment, Noop], + body: [ + { '@type': "TryStatement", + '@role': [Statement, Try], '@pos': { '@type': "uast:Positions", start: { '@type': "uast:Position", - offset: 0, - line: 1, + offset: 100, + line: 6, col: 1, }, end: { '@type': "uast:Position", - offset: 17, - line: 1, - col: 18, + offset: 248, + line: 10, + col: 2, }, }, - }, - { '@type': "CommentBlock", - '@token': " Another comment ", - '@role': [Block, Comment, Noop], - '@pos': { '@type': "uast:Positions", - start: { '@type': "uast:Position", - offset: 18, - line: 2, - col: 1, - }, - end: { '@type': "uast:Position", - offset: 39, - line: 2, - col: 22, + block: { '@type': "BlockStatement", + '@role': [Block, Scope, Statement], + '@pos': { '@type': "uast:Positions", + start: { '@type': "uast:Position", + offset: 104, + line: 6, + col: 5, + }, + end: { '@type': "uast:Position", + offset: 152, + line: 8, + col: 2, + }, }, + body: [ + { '@type': "ExpressionStatement", + '@role': [Statement], + '@pos': { '@type': "uast:Positions", + start: { '@type': "uast:Position", + offset: 110, + line: 7, + col: 5, + }, + end: { '@type': "uast:Position", + offset: 150, + line: 7, + col: 45, + }, + }, + expression: { '@type': "CallExpression", + '@role': [Call, Expression], + '@pos': { '@type': "uast:Positions", + start: { '@type': "uast:Position", + offset: 110, + line: 7, + col: 5, + }, + end: { '@type': "uast:Position", + offset: 149, + line: 7, + col: 44, + }, + }, + arguments: [ + { '@type': "Identifier", + '@token': "dest", + '@role': [Argument, Call, Expression, Identifier], + '@pos': { '@type': "uast:Positions", + start: { '@type': "uast:Position", + offset: 123, + line: 7, + col: 18, + }, + end: { '@type': "uast:Position", + offset: 127, + line: 7, + col: 22, + }, + }, + }, + { '@type': "CallExpression", + '@role': [Argument, Call, Expression], + '@pos': { '@type': "uast:Positions", + start: { '@type': "uast:Position", + offset: 129, + line: 7, + col: 24, + }, + end: { '@type': "uast:Position", + offset: 148, + line: 7, + col: 43, + }, + }, + arguments: [ + { '@type': "StringLiteral", + '@token': "'0777'", + '@role': [Argument, Call, Expression, Literal, String], + '@pos': { '@type': "uast:Positions", + start: { '@type': "uast:Position", + offset: 138, + line: 7, + col: 33, + }, + end: { '@type': "uast:Position", + offset: 144, + line: 7, + col: 39, + }, + }, + }, + { '@type': "NumericLiteral", + '@token': 8, + '@role': [Argument, Call, Expression, Literal, Number], + '@pos': { '@type': "uast:Positions", + start: { '@type': "uast:Position", + offset: 146, + line: 7, + col: 41, + }, + end: { '@type': "uast:Position", + offset: 147, + line: 7, + col: 42, + }, + }, + }, + ], + callee: { '@type': "Identifier", + '@token': "parseInt", + '@role': [Call, Callee, Expression, Identifier], + '@pos': { '@type': "uast:Positions", + start: { '@type': "uast:Position", + offset: 129, + line: 7, + col: 24, + }, + end: { '@type': "uast:Position", + offset: 137, + line: 7, + col: 32, + }, + }, + }, + }, + ], + callee: { '@type': "MemberExpression", + '@role': [Call, Callee, Expression, Identifier, Qualified], + '@pos': { '@type': "uast:Positions", + start: { '@type': "uast:Position", + offset: 110, + line: 7, + col: 5, + }, + end: { '@type': "uast:Position", + offset: 122, + line: 7, + col: 17, + }, + }, + computed: false, + leadingComments: ~, + object: { '@type': "Identifier", + '@token': "fs", + '@role': [Expression, Identifier], + '@pos': { '@type': "uast:Positions", + start: { '@type': "uast:Position", + offset: 110, + line: 7, + col: 5, + }, + end: { '@type': "uast:Position", + offset: 112, + line: 7, + col: 7, + }, + }, + leadingComments: ~, + }, + property: { '@type': "Identifier", + '@token': "mkdirSync", + '@role': [Expression, Identifier], + '@pos': { '@type': "uast:Positions", + start: { '@type': "uast:Position", + offset: 113, + line: 7, + col: 8, + }, + end: { '@type': "uast:Position", + offset: 122, + line: 7, + col: 17, + }, + }, + }, + }, + leadingComments: ~, + }, + leadingComments: ~, + }, + ], + directives: [], + leadingComments: ~, }, - }, - { '@type': "CommentBlock", - '@token': "* Yet another comment ", - '@role': [Block, Comment, Noop], - '@pos': { '@type': "uast:Positions", - start: { '@type': "uast:Position", - offset: 40, - line: 3, - col: 1, + finalizer: ~, + guardedHandlers: [], + handler: { '@type': "CatchClause", + '@role': [Catch, Statement, Try], + '@pos': { '@type': "uast:Positions", + start: { '@type': "uast:Position", + offset: 153, + line: 8, + col: 3, + }, + end: { '@type': "uast:Position", + offset: 248, + line: 10, + col: 2, + }, }, - end: { '@type': "uast:Position", - offset: 66, - line: 3, - col: 27, + body: { '@type': "BlockStatement", + '@role': [Block, Scope, Statement], + '@pos': { '@type': "uast:Positions", + start: { '@type': "uast:Position", + offset: 163, + line: 8, + col: 13, + }, + end: { '@type': "uast:Position", + offset: 248, + line: 10, + col: 2, + }, + }, + body: [], + directives: [], + innerComments: [ + { '@type': "CommentLine", + '@token': " like Unix's cp, keep going even if we can't create dest dir - innerComment", + '@role': [Comment, Noop], + '@pos': { '@type': "uast:Positions", + start: { '@type': "uast:Position", + offset: 169, + line: 9, + col: 5, + }, + end: { '@type': "uast:Position", + offset: 246, + line: 9, + col: 82, + }, + }, + }, + ], + leadingComments: ~, + }, + param: { '@type': "Identifier", + '@token': "e", + '@role': [Expression, Identifier], + '@pos': { '@type': "uast:Positions", + start: { '@type': "uast:Position", + offset: 160, + line: 8, + col: 10, + }, + end: { '@type': "uast:Position", + offset: 161, + line: 8, + col: 11, + }, + }, }, }, + leadingComments: [ + { '@type': "CommentLine", + '@token': " This a comment", + '@role': [Comment, Noop], + '@pos': { '@type': "uast:Positions", + start: { '@type': "uast:Position", + offset: 0, + line: 1, + col: 1, + }, + end: { '@type': "uast:Position", + offset: 17, + line: 1, + col: 18, + }, + }, + }, + { '@type': "CommentBlock", + '@token': " Another comment ", + '@role': [Block, Comment, Noop], + '@pos': { '@type': "uast:Positions", + start: { '@type': "uast:Position", + offset: 18, + line: 2, + col: 1, + }, + end: { '@type': "uast:Position", + offset: 39, + line: 2, + col: 22, + }, + }, + }, + { '@type': "CommentBlock", + '@token': "* Yet another comment ", + '@role': [Block, Comment, Noop], + '@pos': { '@type': "uast:Positions", + start: { '@type': "uast:Position", + offset: 40, + line: 3, + col: 1, + }, + end: { '@type': "uast:Position", + offset: 66, + line: 3, + col: 27, + }, + }, + }, + { '@type': "CommentLine", + '@token': " Create dest - leadingComment", + '@role': [Comment, Noop], + '@pos': { '@type': "uast:Positions", + start: { '@type': "uast:Position", + offset: 68, + line: 5, + col: 1, + }, + end: { '@type': "uast:Position", + offset: 99, + line: 5, + col: 32, + }, + }, + }, + ], }, ], - leadingComments: ~, + directives: [], sourceType: "module", }, } \ No newline at end of file