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

Commit

Permalink
sem: add new fixture for #69
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Bezzubov <[email protected]>
  • Loading branch information
bzz committed Mar 20, 2019
1 parent a2c2f75 commit 07e7b51
Show file tree
Hide file tree
Showing 4 changed files with 411 additions and 0 deletions.
1 change: 1 addition & 0 deletions fixtures/issue65-op.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
var a = 0 + 1;
141 changes: 141 additions & 0 deletions fixtures/issue65-op.js.native
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
{
comments: [],
end: 15,
loc: {
end: {
column: 0,
line: 2,
},
start: {
column: 0,
line: 1,
},
},
program: {
body: [
{
declarations: [
{
end: 13,
id: {
end: 5,
loc: {
end: {
column: 5,
line: 1,
},
identifierName: "a",
start: {
column: 4,
line: 1,
},
},
name: "a",
start: 4,
type: "Identifier",
},
init: {
end: 13,
left: {
end: 9,
extra: {
raw: "0",
rawValue: 0,
},
loc: {
end: {
column: 9,
line: 1,
},
start: {
column: 8,
line: 1,
},
},
start: 8,
type: "NumericLiteral",
value: 0,
},
loc: {
end: {
column: 13,
line: 1,
},
start: {
column: 8,
line: 1,
},
},
operator: "+",
right: {
end: 13,
extra: {
raw: "1",
rawValue: 1,
},
loc: {
end: {
column: 13,
line: 1,
},
start: {
column: 12,
line: 1,
},
},
start: 12,
type: "NumericLiteral",
value: 1,
},
start: 8,
type: "BinaryExpression",
},
loc: {
end: {
column: 13,
line: 1,
},
start: {
column: 4,
line: 1,
},
},
start: 4,
type: "VariableDeclarator",
},
],
end: 14,
kind: "var",
loc: {
end: {
column: 14,
line: 1,
},
start: {
column: 0,
line: 1,
},
},
start: 0,
type: "VariableDeclaration",
},
],
directives: [],
end: 15,
loc: {
end: {
column: 0,
line: 2,
},
start: {
column: 0,
line: 1,
},
},
sourceType: "module",
start: 0,
type: "Program",
},
start: 0,
type: "File",
}
134 changes: 134 additions & 0 deletions fixtures/issue65-op.js.sem.uast
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
{ '@type': "javascript:File",
'@role': [File],
'@pos': { '@type': "uast:Positions",
start: { '@type': "uast:Position",
offset: 0,
line: 1,
col: 1,
},
end: { '@type': "uast:Position",
offset: 15,
line: 2,
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: 15,
line: 2,
col: 1,
},
},
body: [
{ '@type': "javascript:VariableDeclaration",
'@role': [Declaration, Statement, Variable],
'@pos': { '@type': "uast:Positions",
start: { '@type': "uast:Position",
offset: 0,
line: 1,
col: 1,
},
end: { '@type': "uast:Position",
offset: 14,
line: 1,
col: 15,
},
},
declarations: [
{ '@type': "javascript:VariableDeclarator",
'@role': [Declaration, Variable],
'@pos': { '@type': "uast:Positions",
start: { '@type': "uast:Position",
offset: 4,
line: 1,
col: 5,
},
end: { '@type': "uast:Position",
offset: 13,
line: 1,
col: 14,
},
},
id: { '@type': "uast:Identifier",
'@pos': { '@type': "uast:Positions",
start: { '@type': "uast:Position",
offset: 4,
line: 1,
col: 5,
},
end: { '@type': "uast:Position",
offset: 5,
line: 1,
col: 6,
},
},
Name: "a",
},
init: { '@type': "javascript:BinaryExpression",
'@role': [Add, Arithmetic, Binary, Expression, Initialization, Operator],
'@pos': { '@type': "uast:Positions",
start: { '@type': "uast:Position",
offset: 8,
line: 1,
col: 9,
},
end: { '@type': "uast:Position",
offset: 13,
line: 1,
col: 14,
},
},
left: { '@type': "javascript:NumericLiteral",
'@token': 0,
'@role': [Binary, Expression, Left, Literal, Number],
'@pos': { '@type': "uast:Positions",
start: { '@type': "uast:Position",
offset: 8,
line: 1,
col: 9,
},
end: { '@type': "uast:Position",
offset: 9,
line: 1,
col: 10,
},
},
},
operator: { '@type': "uast:Operator",
'@token': "+",
'@role': [Add, Arithmetic, Binary, Expression, Operator],
},
right: { '@type': "javascript:NumericLiteral",
'@token': 1,
'@role': [Binary, Expression, Literal, Number, Right],
'@pos': { '@type': "uast:Positions",
start: { '@type': "uast:Position",
offset: 12,
line: 1,
col: 13,
},
end: { '@type': "uast:Position",
offset: 13,
line: 1,
col: 14,
},
},
},
},
},
],
kind: "var",
},
],
directives: [],
sourceType: "module",
},
}
Loading

0 comments on commit 07e7b51

Please sign in to comment.