diff --git a/driver/normalizer/normalizer.go b/driver/normalizer/normalizer.go index 2ac1214..91a0bb0 100644 --- a/driver/normalizer/normalizer.go +++ b/driver/normalizer/normalizer.go @@ -37,9 +37,12 @@ var Preprocessors = []Mapping{ Part("_", Obj{ uast.KeyType: String("StringLiteral"), "value": AnyNode(nil), - "extra": Obj{ - "raw": Var("raw"), - "rawValue": AnyNode(nil), + "extra": Fields{ + {Name: "raw", Op: Var("raw")}, + {Name: "rawValue", Op: Any()}, + //FIXME(bzz): map parenthesis + {Name: "parenthesized", Drop: true, Op: Any()}, + {Name: "parenStart", Drop: true, Op: Any()}, }, }), Part("_", Obj{ @@ -50,8 +53,11 @@ var Preprocessors = []Mapping{ Map( Part("_", Obj{ uast.KeyType: String("RegExpLiteral"), - "extra": Obj{ - "raw": Var("raw"), + "extra": Fields{ + {Name: "raw", Op: Var("raw")}, + //FIXME(bzz): map parenthesis + {Name: "parenthesized", Drop: true, Op: Any()}, + {Name: "parenStart", Drop: true, Op: Any()}, }, }), Part("_", Obj{ @@ -61,7 +67,7 @@ var Preprocessors = []Mapping{ ), // drop extra info for other nodes (it duplicates other node fields) Map( - Part("_", Obj{"extra": AnyNode(nil)}), + Part("_", Obj{"extra": Any()}), Part("_", Obj{}), ), // FIXME(bzz): make sure such comments are mapped properly diff --git a/fixtures/issue56.js b/fixtures/issue56.js new file mode 100644 index 0000000..dbfdb52 --- /dev/null +++ b/fixtures/issue56.js @@ -0,0 +1,3 @@ +this._dayOfMonthOrdinalParseLenient = new RegExp( + (this._dayOfMonthOrdinalParse.source || this._ordinalParse.source) + + '|' + (/\d{1,2}/).source); diff --git a/fixtures/issue56.js.native b/fixtures/issue56.js.native new file mode 100644 index 0000000..92f7ba7 --- /dev/null +++ b/fixtures/issue56.js.native @@ -0,0 +1,437 @@ +{ + comments: [], + end: 158, + loc: { + end: { + column: 0, + line: 4, + }, + start: { + column: 0, + line: 1, + }, + }, + program: { + body: [ + { + end: 157, + expression: { + end: 156, + left: { + computed: false, + end: 35, + loc: { + end: { + column: 35, + line: 1, + }, + start: { + column: 0, + line: 1, + }, + }, + object: { + end: 4, + loc: { + end: { + column: 4, + line: 1, + }, + start: { + column: 0, + line: 1, + }, + }, + start: 0, + type: "ThisExpression", + }, + property: { + end: 35, + loc: { + end: { + column: 35, + line: 1, + }, + identifierName: "_dayOfMonthOrdinalParseLenient", + start: { + column: 5, + line: 1, + }, + }, + name: "_dayOfMonthOrdinalParseLenient", + start: 5, + type: "Identifier", + }, + start: 0, + type: "MemberExpression", + }, + loc: { + end: { + column: 33, + line: 3, + }, + start: { + column: 0, + line: 1, + }, + }, + operator: "=", + right: { + arguments: [ + { + end: 155, + left: { + end: 134, + left: { + end: 119, + extra: { + parenStart: 54, + parenthesized: true, + }, + left: { + computed: false, + end: 90, + loc: { + end: { + column: 40, + line: 2, + }, + start: { + column: 5, + line: 2, + }, + }, + object: { + computed: false, + end: 83, + loc: { + end: { + column: 33, + line: 2, + }, + start: { + column: 5, + line: 2, + }, + }, + object: { + end: 59, + loc: { + end: { + column: 9, + line: 2, + }, + start: { + column: 5, + line: 2, + }, + }, + start: 55, + type: "ThisExpression", + }, + property: { + end: 83, + loc: { + end: { + column: 33, + line: 2, + }, + identifierName: "_dayOfMonthOrdinalParse", + start: { + column: 10, + line: 2, + }, + }, + name: "_dayOfMonthOrdinalParse", + start: 60, + type: "Identifier", + }, + start: 55, + type: "MemberExpression", + }, + property: { + end: 90, + loc: { + end: { + column: 40, + line: 2, + }, + identifierName: "source", + start: { + column: 34, + line: 2, + }, + }, + name: "source", + start: 84, + type: "Identifier", + }, + start: 55, + type: "MemberExpression", + }, + loc: { + end: { + column: 69, + line: 2, + }, + start: { + column: 5, + line: 2, + }, + }, + operator: "||", + right: { + computed: false, + end: 119, + loc: { + end: { + column: 69, + line: 2, + }, + start: { + column: 44, + line: 2, + }, + }, + object: { + computed: false, + end: 112, + loc: { + end: { + column: 62, + line: 2, + }, + start: { + column: 44, + line: 2, + }, + }, + object: { + end: 98, + loc: { + end: { + column: 48, + line: 2, + }, + start: { + column: 44, + line: 2, + }, + }, + start: 94, + type: "ThisExpression", + }, + property: { + end: 112, + loc: { + end: { + column: 62, + line: 2, + }, + identifierName: "_ordinalParse", + start: { + column: 49, + line: 2, + }, + }, + name: "_ordinalParse", + start: 99, + type: "Identifier", + }, + start: 94, + type: "MemberExpression", + }, + property: { + end: 119, + loc: { + end: { + column: 69, + line: 2, + }, + identifierName: "source", + start: { + column: 63, + line: 2, + }, + }, + name: "source", + start: 113, + type: "Identifier", + }, + start: 94, + type: "MemberExpression", + }, + start: 55, + type: "LogicalExpression", + }, + loc: { + end: { + column: 11, + line: 3, + }, + start: { + column: 4, + line: 2, + }, + }, + operator: "+", + right: { + end: 134, + extra: { + raw: "'|'", + rawValue: "|", + }, + loc: { + end: { + column: 11, + line: 3, + }, + start: { + column: 8, + line: 3, + }, + }, + start: 131, + type: "StringLiteral", + value: "|", + }, + start: 54, + type: "BinaryExpression", + }, + loc: { + end: { + column: 32, + line: 3, + }, + start: { + column: 4, + line: 2, + }, + }, + operator: "+", + right: { + computed: false, + end: 155, + loc: { + end: { + column: 32, + line: 3, + }, + start: { + column: 14, + line: 3, + }, + }, + object: { + end: 147, + extra: { + parenStart: 137, + parenthesized: true, + raw: "/\\d{1,2}/", + }, + flags: "", + loc: { + end: { + column: 24, + line: 3, + }, + start: { + column: 15, + line: 3, + }, + }, + pattern: "\\d{1,2}", + start: 138, + type: "RegExpLiteral", + }, + property: { + end: 155, + loc: { + end: { + column: 32, + line: 3, + }, + identifierName: "source", + start: { + column: 26, + line: 3, + }, + }, + name: "source", + start: 149, + type: "Identifier", + }, + start: 137, + type: "MemberExpression", + }, + start: 54, + type: "BinaryExpression", + }, + ], + callee: { + end: 48, + loc: { + end: { + column: 48, + line: 1, + }, + identifierName: "RegExp", + start: { + column: 42, + line: 1, + }, + }, + name: "RegExp", + start: 42, + type: "Identifier", + }, + end: 156, + loc: { + end: { + column: 33, + line: 3, + }, + start: { + column: 38, + line: 1, + }, + }, + start: 38, + type: "NewExpression", + }, + start: 0, + type: "AssignmentExpression", + }, + loc: { + end: { + column: 34, + line: 3, + }, + start: { + column: 0, + line: 1, + }, + }, + start: 0, + type: "ExpressionStatement", + }, + ], + directives: [], + end: 158, + loc: { + end: { + column: 0, + line: 4, + }, + start: { + column: 0, + line: 1, + }, + }, + sourceType: "module", + start: 0, + type: "Program", + }, + start: 0, + type: "File", +} \ No newline at end of file diff --git a/fixtures/issue56.js.sem.uast b/fixtures/issue56.js.sem.uast new file mode 100644 index 0000000..ece2680 --- /dev/null +++ b/fixtures/issue56.js.sem.uast @@ -0,0 +1,424 @@ +{ '@type': "javascript:File", + '@role': [File], + '@pos': { '@type': "uast:Positions", + start: { '@type': "uast:Position", + offset: 0, + line: 1, + col: 1, + }, + end: { '@type': "uast:Position", + offset: 158, + line: 4, + col: 1, + }, + }, + comments: [], + program: { '@type': "javascript:Program", + '@role': [Module], + '@pos': { '@type': "uast:Positions", + start: { '@type': "uast:Position", + offset: 0, + line: 1, + col: 1, + }, + end: { '@type': "uast:Position", + offset: 158, + line: 4, + col: 1, + }, + }, + body: [ + { '@type': "javascript:ExpressionStatement", + '@role': [Statement], + '@pos': { '@type': "uast:Positions", + start: { '@type': "uast:Position", + offset: 0, + line: 1, + col: 1, + }, + end: { '@type': "uast:Position", + offset: 157, + line: 3, + col: 35, + }, + }, + expression: { '@type': "javascript:AssignmentExpression", + '@role': [Assignment, Binary, Expression, Operator], + '@pos': { '@type': "uast:Positions", + start: { '@type': "uast:Position", + offset: 0, + line: 1, + col: 1, + }, + end: { '@type': "uast:Position", + offset: 156, + line: 3, + col: 34, + }, + }, + left: { '@type': "javascript:MemberExpression", + '@role': [Assignment, Binary, Expression, Identifier, Left, Qualified], + '@pos': { '@type': "uast:Positions", + start: { '@type': "uast:Position", + offset: 0, + line: 1, + col: 1, + }, + end: { '@type': "uast:Position", + offset: 35, + line: 1, + col: 36, + }, + }, + computed: false, + object: { '@type': "javascript:ThisExpression", + '@role': [Expression, This], + '@pos': { '@type': "uast:Positions", + start: { '@type': "uast:Position", + offset: 0, + line: 1, + col: 1, + }, + end: { '@type': "uast:Position", + offset: 4, + line: 1, + col: 5, + }, + }, + }, + property: { '@type': "uast:Identifier", + '@pos': { '@type': "uast:Positions", + start: { '@type': "uast:Position", + offset: 5, + line: 1, + col: 6, + }, + end: { '@type': "uast:Position", + offset: 35, + line: 1, + col: 36, + }, + }, + Name: "_dayOfMonthOrdinalParseLenient", + }, + }, + operator: { '@type': "uast:Operator", + '@token': "=", + '@role': [Assignment, Binary, Expression, Operator], + }, + right: { '@type': "javascript:NewExpression", + '@role': [Assignment, Binary, Call, Expression, Instance, Right], + '@pos': { '@type': "uast:Positions", + start: { '@type': "uast:Position", + offset: 38, + line: 1, + col: 39, + }, + end: { '@type': "uast:Position", + offset: 156, + line: 3, + col: 34, + }, + }, + arguments: [ + { '@type': "javascript:BinaryExpression", + '@role': [Add, Arithmetic, Binary, Expression, Operator], + '@pos': { '@type': "uast:Positions", + start: { '@type': "uast:Position", + offset: 54, + line: 2, + col: 5, + }, + end: { '@type': "uast:Position", + offset: 155, + line: 3, + col: 33, + }, + }, + left: { '@type': "javascript:BinaryExpression", + '@role': [Add, Arithmetic, Binary, Expression, Left, Operator], + '@pos': { '@type': "uast:Positions", + start: { '@type': "uast:Position", + offset: 54, + line: 2, + col: 5, + }, + end: { '@type': "uast:Position", + offset: 134, + line: 3, + col: 12, + }, + }, + left: { '@type': "javascript:LogicalExpression", + '@role': [Binary, Boolean, Expression, Left, Operator, Or], + '@pos': { '@type': "uast:Positions", + start: { '@type': "uast:Position", + offset: 55, + line: 2, + col: 6, + }, + end: { '@type': "uast:Position", + offset: 119, + line: 2, + col: 70, + }, + }, + left: { '@type': "javascript:MemberExpression", + '@role': [Binary, Boolean, Expression, Identifier, Left, Qualified], + '@pos': { '@type': "uast:Positions", + start: { '@type': "uast:Position", + offset: 55, + line: 2, + col: 6, + }, + end: { '@type': "uast:Position", + offset: 90, + line: 2, + col: 41, + }, + }, + computed: false, + object: { '@type': "javascript:MemberExpression", + '@role': [Expression, Identifier, Qualified], + '@pos': { '@type': "uast:Positions", + start: { '@type': "uast:Position", + offset: 55, + line: 2, + col: 6, + }, + end: { '@type': "uast:Position", + offset: 83, + line: 2, + col: 34, + }, + }, + computed: false, + object: { '@type': "javascript:ThisExpression", + '@role': [Expression, This], + '@pos': { '@type': "uast:Positions", + start: { '@type': "uast:Position", + offset: 55, + line: 2, + col: 6, + }, + end: { '@type': "uast:Position", + offset: 59, + line: 2, + col: 10, + }, + }, + }, + property: { '@type': "uast:Identifier", + '@pos': { '@type': "uast:Positions", + start: { '@type': "uast:Position", + offset: 60, + line: 2, + col: 11, + }, + end: { '@type': "uast:Position", + offset: 83, + line: 2, + col: 34, + }, + }, + Name: "_dayOfMonthOrdinalParse", + }, + }, + property: { '@type': "uast:Identifier", + '@pos': { '@type': "uast:Positions", + start: { '@type': "uast:Position", + offset: 84, + line: 2, + col: 35, + }, + end: { '@type': "uast:Position", + offset: 90, + line: 2, + col: 41, + }, + }, + Name: "source", + }, + }, + operator: { '@type': "uast:Operator", + '@token': "||", + '@role': [Binary, Boolean, Expression, Operator, Or], + }, + right: { '@type': "javascript:MemberExpression", + '@role': [Binary, Boolean, Expression, Identifier, Qualified, Right], + '@pos': { '@type': "uast:Positions", + start: { '@type': "uast:Position", + offset: 94, + line: 2, + col: 45, + }, + end: { '@type': "uast:Position", + offset: 119, + line: 2, + col: 70, + }, + }, + computed: false, + object: { '@type': "javascript:MemberExpression", + '@role': [Expression, Identifier, Qualified], + '@pos': { '@type': "uast:Positions", + start: { '@type': "uast:Position", + offset: 94, + line: 2, + col: 45, + }, + end: { '@type': "uast:Position", + offset: 112, + line: 2, + col: 63, + }, + }, + computed: false, + object: { '@type': "javascript:ThisExpression", + '@role': [Expression, This], + '@pos': { '@type': "uast:Positions", + start: { '@type': "uast:Position", + offset: 94, + line: 2, + col: 45, + }, + end: { '@type': "uast:Position", + offset: 98, + line: 2, + col: 49, + }, + }, + }, + property: { '@type': "uast:Identifier", + '@pos': { '@type': "uast:Positions", + start: { '@type': "uast:Position", + offset: 99, + line: 2, + col: 50, + }, + end: { '@type': "uast:Position", + offset: 112, + line: 2, + col: 63, + }, + }, + Name: "_ordinalParse", + }, + }, + property: { '@type': "uast:Identifier", + '@pos': { '@type': "uast:Positions", + start: { '@type': "uast:Position", + offset: 113, + line: 2, + col: 64, + }, + end: { '@type': "uast:Position", + offset: 119, + line: 2, + col: 70, + }, + }, + Name: "source", + }, + }, + }, + operator: { '@type': "uast:Operator", + '@token': "+", + '@role': [Add, Arithmetic, Binary, Expression, Operator], + }, + right: { '@type': "uast:String", + '@role': [Binary, Right], + '@pos': { '@type': "uast:Positions", + start: { '@type': "uast:Position", + offset: 131, + line: 3, + col: 9, + }, + end: { '@type': "uast:Position", + offset: 134, + line: 3, + col: 12, + }, + }, + Format: "single", + Value: "|", + }, + }, + operator: { '@type': "uast:Operator", + '@token': "+", + '@role': [Add, Arithmetic, Binary, Expression, Operator], + }, + right: { '@type': "javascript:MemberExpression", + '@role': [Binary, Expression, Identifier, Qualified, Right], + '@pos': { '@type': "uast:Positions", + start: { '@type': "uast:Position", + offset: 137, + line: 3, + col: 15, + }, + end: { '@type': "uast:Position", + offset: 155, + line: 3, + col: 33, + }, + }, + computed: false, + object: { '@type': "javascript:RegExpLiteral", + '@token': "/\\d{1,2}/", + '@role': [Expression, Literal, Regexp], + '@pos': { '@type': "uast:Positions", + start: { '@type': "uast:Position", + offset: 138, + line: 3, + col: 16, + }, + end: { '@type': "uast:Position", + offset: 147, + line: 3, + col: 25, + }, + }, + flags: "", + pattern: "\\d{1,2}", + }, + property: { '@type': "uast:Identifier", + '@pos': { '@type': "uast:Positions", + start: { '@type': "uast:Position", + offset: 149, + line: 3, + col: 27, + }, + end: { '@type': "uast:Position", + offset: 155, + line: 3, + col: 33, + }, + }, + Name: "source", + }, + }, + }, + ], + callee: { '@type': "uast:Identifier", + '@pos': { '@type': "uast:Positions", + start: { '@type': "uast:Position", + offset: 42, + line: 1, + col: 43, + }, + end: { '@type': "uast:Position", + offset: 48, + line: 1, + col: 49, + }, + }, + Name: "RegExp", + }, + }, + }, + }, + ], + directives: [], + sourceType: "module", + }, +} \ No newline at end of file diff --git a/fixtures/issue56.js.uast b/fixtures/issue56.js.uast new file mode 100644 index 0000000..67e643c --- /dev/null +++ b/fixtures/issue56.js.uast @@ -0,0 +1,430 @@ +{ '@type': "File", + '@role': [File], + '@pos': { '@type': "uast:Positions", + start: { '@type': "uast:Position", + offset: 0, + line: 1, + col: 1, + }, + end: { '@type': "uast:Position", + offset: 158, + line: 4, + col: 1, + }, + }, + comments: [], + program: { '@type': "Program", + '@role': [Module], + '@pos': { '@type': "uast:Positions", + start: { '@type': "uast:Position", + offset: 0, + line: 1, + col: 1, + }, + end: { '@type': "uast:Position", + offset: 158, + line: 4, + col: 1, + }, + }, + body: [ + { '@type': "ExpressionStatement", + '@role': [Statement], + '@pos': { '@type': "uast:Positions", + start: { '@type': "uast:Position", + offset: 0, + line: 1, + col: 1, + }, + end: { '@type': "uast:Position", + offset: 157, + line: 3, + col: 35, + }, + }, + expression: { '@type': "AssignmentExpression", + '@role': [Assignment, Binary, Expression, Operator], + '@pos': { '@type': "uast:Positions", + start: { '@type': "uast:Position", + offset: 0, + line: 1, + col: 1, + }, + end: { '@type': "uast:Position", + offset: 156, + line: 3, + col: 34, + }, + }, + left: { '@type': "MemberExpression", + '@role': [Assignment, Binary, Expression, Identifier, Left, Qualified], + '@pos': { '@type': "uast:Positions", + start: { '@type': "uast:Position", + offset: 0, + line: 1, + col: 1, + }, + end: { '@type': "uast:Position", + offset: 35, + line: 1, + col: 36, + }, + }, + computed: false, + object: { '@type': "ThisExpression", + '@role': [Expression, This], + '@pos': { '@type': "uast:Positions", + start: { '@type': "uast:Position", + offset: 0, + line: 1, + col: 1, + }, + end: { '@type': "uast:Position", + offset: 4, + line: 1, + col: 5, + }, + }, + }, + property: { '@type': "Identifier", + '@token': "_dayOfMonthOrdinalParseLenient", + '@role': [Expression, Identifier], + '@pos': { '@type': "uast:Positions", + start: { '@type': "uast:Position", + offset: 5, + line: 1, + col: 6, + }, + end: { '@type': "uast:Position", + offset: 35, + line: 1, + col: 36, + }, + }, + }, + }, + operator: { '@type': "uast:Operator", + '@token': "=", + '@role': [Assignment, Binary, Expression, Operator], + }, + right: { '@type': "NewExpression", + '@role': [Assignment, Binary, Call, Expression, Instance, Right], + '@pos': { '@type': "uast:Positions", + start: { '@type': "uast:Position", + offset: 38, + line: 1, + col: 39, + }, + end: { '@type': "uast:Position", + offset: 156, + line: 3, + col: 34, + }, + }, + arguments: [ + { '@type': "BinaryExpression", + '@role': [Add, Arithmetic, Binary, Expression, Operator], + '@pos': { '@type': "uast:Positions", + start: { '@type': "uast:Position", + offset: 54, + line: 2, + col: 5, + }, + end: { '@type': "uast:Position", + offset: 155, + line: 3, + col: 33, + }, + }, + left: { '@type': "BinaryExpression", + '@role': [Add, Arithmetic, Binary, Expression, Left, Operator], + '@pos': { '@type': "uast:Positions", + start: { '@type': "uast:Position", + offset: 54, + line: 2, + col: 5, + }, + end: { '@type': "uast:Position", + offset: 134, + line: 3, + col: 12, + }, + }, + left: { '@type': "LogicalExpression", + '@role': [Binary, Boolean, Expression, Left, Operator, Or], + '@pos': { '@type': "uast:Positions", + start: { '@type': "uast:Position", + offset: 55, + line: 2, + col: 6, + }, + end: { '@type': "uast:Position", + offset: 119, + line: 2, + col: 70, + }, + }, + left: { '@type': "MemberExpression", + '@role': [Binary, Boolean, Expression, Identifier, Left, Qualified], + '@pos': { '@type': "uast:Positions", + start: { '@type': "uast:Position", + offset: 55, + line: 2, + col: 6, + }, + end: { '@type': "uast:Position", + offset: 90, + line: 2, + col: 41, + }, + }, + computed: false, + object: { '@type': "MemberExpression", + '@role': [Expression, Identifier, Qualified], + '@pos': { '@type': "uast:Positions", + start: { '@type': "uast:Position", + offset: 55, + line: 2, + col: 6, + }, + end: { '@type': "uast:Position", + offset: 83, + line: 2, + col: 34, + }, + }, + computed: false, + object: { '@type': "ThisExpression", + '@role': [Expression, This], + '@pos': { '@type': "uast:Positions", + start: { '@type': "uast:Position", + offset: 55, + line: 2, + col: 6, + }, + end: { '@type': "uast:Position", + offset: 59, + line: 2, + col: 10, + }, + }, + }, + property: { '@type': "Identifier", + '@token': "_dayOfMonthOrdinalParse", + '@role': [Expression, Identifier], + '@pos': { '@type': "uast:Positions", + start: { '@type': "uast:Position", + offset: 60, + line: 2, + col: 11, + }, + end: { '@type': "uast:Position", + offset: 83, + line: 2, + col: 34, + }, + }, + }, + }, + property: { '@type': "Identifier", + '@token': "source", + '@role': [Expression, Identifier], + '@pos': { '@type': "uast:Positions", + start: { '@type': "uast:Position", + offset: 84, + line: 2, + col: 35, + }, + end: { '@type': "uast:Position", + offset: 90, + line: 2, + col: 41, + }, + }, + }, + }, + operator: { '@type': "uast:Operator", + '@token': "||", + '@role': [Binary, Boolean, Expression, Operator, Or], + }, + right: { '@type': "MemberExpression", + '@role': [Binary, Boolean, Expression, Identifier, Qualified, Right], + '@pos': { '@type': "uast:Positions", + start: { '@type': "uast:Position", + offset: 94, + line: 2, + col: 45, + }, + end: { '@type': "uast:Position", + offset: 119, + line: 2, + col: 70, + }, + }, + computed: false, + object: { '@type': "MemberExpression", + '@role': [Expression, Identifier, Qualified], + '@pos': { '@type': "uast:Positions", + start: { '@type': "uast:Position", + offset: 94, + line: 2, + col: 45, + }, + end: { '@type': "uast:Position", + offset: 112, + line: 2, + col: 63, + }, + }, + computed: false, + object: { '@type': "ThisExpression", + '@role': [Expression, This], + '@pos': { '@type': "uast:Positions", + start: { '@type': "uast:Position", + offset: 94, + line: 2, + col: 45, + }, + end: { '@type': "uast:Position", + offset: 98, + line: 2, + col: 49, + }, + }, + }, + property: { '@type': "Identifier", + '@token': "_ordinalParse", + '@role': [Expression, Identifier], + '@pos': { '@type': "uast:Positions", + start: { '@type': "uast:Position", + offset: 99, + line: 2, + col: 50, + }, + end: { '@type': "uast:Position", + offset: 112, + line: 2, + col: 63, + }, + }, + }, + }, + property: { '@type': "Identifier", + '@token': "source", + '@role': [Expression, Identifier], + '@pos': { '@type': "uast:Positions", + start: { '@type': "uast:Position", + offset: 113, + line: 2, + col: 64, + }, + end: { '@type': "uast:Position", + offset: 119, + line: 2, + col: 70, + }, + }, + }, + }, + }, + operator: { '@type': "uast:Operator", + '@token': "+", + '@role': [Add, Arithmetic, Binary, Expression, Operator], + }, + right: { '@type': "StringLiteral", + '@token': "'|'", + '@role': [Binary, Expression, Literal, Right, String], + '@pos': { '@type': "uast:Positions", + start: { '@type': "uast:Position", + offset: 131, + line: 3, + col: 9, + }, + end: { '@type': "uast:Position", + offset: 134, + line: 3, + col: 12, + }, + }, + }, + }, + operator: { '@type': "uast:Operator", + '@token': "+", + '@role': [Add, Arithmetic, Binary, Expression, Operator], + }, + right: { '@type': "MemberExpression", + '@role': [Binary, Expression, Identifier, Qualified, Right], + '@pos': { '@type': "uast:Positions", + start: { '@type': "uast:Position", + offset: 137, + line: 3, + col: 15, + }, + end: { '@type': "uast:Position", + offset: 155, + line: 3, + col: 33, + }, + }, + computed: false, + object: { '@type': "RegExpLiteral", + '@token': "/\\d{1,2}/", + '@role': [Expression, Literal, Regexp], + '@pos': { '@type': "uast:Positions", + start: { '@type': "uast:Position", + offset: 138, + line: 3, + col: 16, + }, + end: { '@type': "uast:Position", + offset: 147, + line: 3, + col: 25, + }, + }, + flags: "", + pattern: "\\d{1,2}", + }, + property: { '@type': "Identifier", + '@token': "source", + '@role': [Expression, Identifier], + '@pos': { '@type': "uast:Positions", + start: { '@type': "uast:Position", + offset: 149, + line: 3, + col: 27, + }, + end: { '@type': "uast:Position", + offset: 155, + line: 3, + col: 33, + }, + }, + }, + }, + }, + ], + callee: { '@type': "Identifier", + '@token': "RegExp", + '@role': [Expression, Identifier], + '@pos': { '@type': "uast:Positions", + start: { '@type': "uast:Position", + offset: 42, + line: 1, + col: 43, + }, + end: { '@type': "uast:Position", + offset: 48, + line: 1, + col: 49, + }, + }, + }, + }, + }, + }, + ], + directives: [], + sourceType: "module", + }, +} \ No newline at end of file