Skip to content

Commit

Permalink
added test for record and tuple bar syntax with flow typings
Browse files Browse the repository at this point in the history
  • Loading branch information
rickbutton committed Dec 18, 2019
1 parent 565c2dc commit 4002948
Show file tree
Hide file tree
Showing 3 changed files with 254 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
var a: {| x: number |} = {| x: 2 |}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"plugins": [
["recordAndTuple", { "syntaxType": "bar" }],
["flow"]
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,247 @@
{
"type": "File",
"start": 0,
"end": 35,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 35
}
},
"program": {
"type": "Program",
"start": 0,
"end": 35,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 35
}
},
"sourceType": "script",
"interpreter": null,
"body": [
{
"type": "VariableDeclaration",
"start": 0,
"end": 35,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 35
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 4,
"end": 35,
"loc": {
"start": {
"line": 1,
"column": 4
},
"end": {
"line": 1,
"column": 35
}
},
"id": {
"type": "Identifier",
"start": 4,
"end": 22,
"loc": {
"start": {
"line": 1,
"column": 4
},
"end": {
"line": 1,
"column": 22
},
"identifierName": "a"
},
"name": "a",
"typeAnnotation": {
"type": "TypeAnnotation",
"start": 5,
"end": 22,
"loc": {
"start": {
"line": 1,
"column": 5
},
"end": {
"line": 1,
"column": 22
}
},
"typeAnnotation": {
"type": "ObjectTypeAnnotation",
"start": 7,
"end": 22,
"loc": {
"start": {
"line": 1,
"column": 7
},
"end": {
"line": 1,
"column": 22
}
},
"callProperties": [],
"properties": [
{
"type": "ObjectTypeProperty",
"start": 10,
"end": 19,
"loc": {
"start": {
"line": 1,
"column": 10
},
"end": {
"line": 1,
"column": 19
}
},
"key": {
"type": "Identifier",
"start": 10,
"end": 11,
"loc": {
"start": {
"line": 1,
"column": 10
},
"end": {
"line": 1,
"column": 11
},
"identifierName": "x"
},
"name": "x"
},
"static": false,
"proto": false,
"kind": "init",
"method": false,
"value": {
"type": "NumberTypeAnnotation",
"start": 13,
"end": 19,
"loc": {
"start": {
"line": 1,
"column": 13
},
"end": {
"line": 1,
"column": 19
}
}
},
"variance": null,
"optional": false
}
],
"indexers": [],
"internalSlots": [],
"exact": true,
"inexact": false
}
}
},
"init": {
"type": "RecordExpression",
"start": 25,
"end": 35,
"loc": {
"start": {
"line": 1,
"column": 25
},
"end": {
"line": 1,
"column": 35
}
},
"properties": [
{
"type": "ObjectProperty",
"start": 28,
"end": 32,
"loc": {
"start": {
"line": 1,
"column": 28
},
"end": {
"line": 1,
"column": 32
}
},
"method": false,
"key": {
"type": "Identifier",
"start": 28,
"end": 29,
"loc": {
"start": {
"line": 1,
"column": 28
},
"end": {
"line": 1,
"column": 29
},
"identifierName": "x"
},
"name": "x"
},
"computed": false,
"shorthand": false,
"value": {
"type": "NumericLiteral",
"start": 31,
"end": 32,
"loc": {
"start": {
"line": 1,
"column": 31
},
"end": {
"line": 1,
"column": 32
}
},
"extra": {
"rawValue": 2,
"raw": "2"
},
"value": 2
}
}
]
}
}
],
"kind": "var"
}
],
"directives": []
}
}

0 comments on commit 4002948

Please sign in to comment.