{
"type": "Program",
"statements": [
{
"type": "TSInterfaceDeclaration",
"body": {
"type": "TSInterfaceBody",
"body": [
{
"type": "MethodDefinition",
"key": {
"type": "Identifier",
"name": "localeCompare",
"loc": {
"start": {
"line": 17,
"column": 3,
"program": "generic_function.ets"
},
"end": {
"line": 17,
"column": 16,
"program": "generic_function.ets"
}
}
},
"kind": "method",
"accessibility": "public",
"static": false,
"optional": false,
"computed": false,
"value": {
"type": "FunctionExpression",
"function": {
"type": "ScriptFunction",
"id": {
"type": "Identifier",
"name": "localeCompare",
"loc": {
"start": {
"line": 17,
"column": 3,
"program": "generic_function.ets"
},
"end": {
"line": 17,
"column": 16,
"program": "generic_function.ets"
}
}
},
"generator": false,
"async": false,
"expression": false,
"params": [
{
"type": "ETSParameterExpression",
"name": {
"type": "Identifier",
"name": "other",
"typeAnnotation": {
"type": "ETSUnionType",
"types": [
{
"type": "ETSTypeReference",
"part": {
"type": "ETSTypeReferencePart",
"name": {
"type": "Identifier",
"name": "Object",
"loc": {
"start": {
"line": 17,
"column": 24,
"program": "generic_function.ets"
},
"end": {
"line": 17,
"column": 30,
"program": "generic_function.ets"
}
}
},
"loc": {
"start": {
"line": 17,
"column": 24,
"program": "generic_function.ets"
},
"end": {
"line": 17,
"column": 30,
"program": "generic_function.ets"
}
}
},
"loc": {
"start": {
"line": 17,
"column": 24,
"program": "generic_function.ets"
},
"end": {
"line": 17,
"column": 30,
"program": "generic_function.ets"
}
}
},
{
"type": "ETSNullType",
"loc": {
"start": {
"line": 17,
"column": 31,
"program": "generic_function.ets"
},
"end": {
"line": 17,
"column": 35,
"program": "generic_function.ets"
}
}
}
],
"loc": {
"start": {
"line": 17,
"column": 24,
"program": "generic_function.ets"
},
"end": {
"line": 17,
"column": 35,
"program": "generic_function.ets"
}
}
},
"loc": {
"start": {
"line": 17,
"column": 17,
"program": "generic_function.ets"
},
"end": {
"line": 17,
"column": 35,
"program": "generic_function.ets"
}
}
},
"loc": {
"start": {
"line": 17,
"column": 17,
"program": "generic_function.ets"
},
"end": {
"line": 17,
"column": 35,
"program": "generic_function.ets"
}
}
}
],
"returnType": {
"type": "ETSPrimitiveType",
"loc": {
"start": {
"line": 17,
"column": 38,
"program": "generic_function.ets"
},
"end": {
"line": 17,
"column": 41,
"program": "generic_function.ets"
}
}
},
"loc": {
"start": {
"line": 17,
"column": 3,
"program": "generic_function.ets"
},
"end": {
"line": 17,
"column": 41,
"program": "generic_function.ets"
}
}
},
"loc": {
"start": {
"line": 17,
"column": 3,
"program": "generic_function.ets"
},
"end": {
"line": 17,
"column": 41,
"program": "generic_function.ets"
}
}
},
"overloads": [],
"loc": {
"start": {
"line": 17,
"column": 3,
"program": "generic_function.ets"
},
"end": {
"line": 17,
"column": 42,
"program": "generic_function.ets"
}
}
}
],
"loc": {
"start": {
"line": 16,
"column": 23,
"program": "generic_function.ets"
},
"end": {
"line": 18,
"column": 2,
"program": "generic_function.ets"
}
}
},
"id": {
"type": "Identifier",
"name": "Comparable2",
"loc": {
"start": {
"line": 16,
"column": 11,
"program": "generic_function.ets"
},
"end": {
"line": 16,
"column": 22,
"program": "generic_function.ets"
}
}
},
"extends": [],
"loc": {
"start": {
"line": 16,
"column": 1,
"program": "generic_function.ets"
},
"end": {
"line": 18,
"column": 2,
"program": "generic_function.ets"
}
}
},
{
"type": "ClassDeclaration",
"definition": {
"id": {
"type": "Identifier",
"name": "ETSGLOBAL",
"loc": {
"start": {
"line": 1,
"column": 1,
"program": "generic_function.ets"
},
"end": {
"line": 1,
"column": 1,
"program": "generic_function.ets"
}
}
},
"superClass": null,
"implements": [],
"body": [
{
"type": "MethodDefinition",
"key": {
"type": "Identifier",
"name": "main",
"loc": {
"start": {
"line": 1,
"column": 1,
"program": null
},
"end": {
"line": 1,
"column": 1,
"program": null
}
}
},
"kind": "method",
"accessibility": "public",
"static": true,
"optional": false,
"computed": false,
"value": {
"type": "FunctionExpression",
"function": {
"type": "ScriptFunction",
"id": {
"type": "Identifier",
"name": "main",
"loc": {
"start": {
"line": 1,
"column": 1,
"program": null
},
"end": {
"line": 1,
"column": 1,
"program": null
}
}
},
"generator": false,
"async": false,
"expression": false,
"params": [],
"body": {
"type": "BlockStatement",
"statements": [],
"loc": {
"start": {
"line": 1,
"column": 1,
"program": "generic_function.ets"
},
"end": {
"line": 1,
"column": 1,
"program": "generic_function.ets"
}
}
},
"loc": {
"start": {
"line": 1,
"column": 1,
"program": "generic_function.ets"
},
"end": {
"line": 1,
"column": 1,
"program": "generic_function.ets"
}
}
},
"loc": {
"start": {
"line": 1,
"column": 1,
"program": "generic_function.ets"
},
"end": {
"line": 1,
"column": 1,
"program": "generic_function.ets"
}
}
},
"overloads": [],
"loc": {
"start": {
"line": 1,
"column": 1,
"program": "generic_function.ets"
},
"end": {
"line": 1,
"column": 1,
"program": "generic_function.ets"
}
}
},
{
"type": "MethodDefinition",
"key": {
"type": "Identifier",
"name": "compare",
"loc": {
"start": {
"line": 20,
"column": 10,
"program": "generic_function.ets"
},
"end": {
"line": 20,
"column": 17,
"program": "generic_function.ets"
}
}
},
"kind": "method",
"accessibility": "public",
"static": true,
"optional": false,
"computed": false,
"value": {
"type": "FunctionExpression",
"function": {
"type": "ScriptFunction",
"id": {
"type": "Identifier",
"name": "compare",
"loc": {
"start": {
"line": 20,
"column": 10,
"program": "generic_function.ets"
},
"end": {
"line": 20,
"column": 17,
"program": "generic_function.ets"
}
}
},
"generator": false,
"async": false,
"expression": false,
"params": [
{
"type": "ETSParameterExpression",
"name": {
"type": "Identifier",
"name": "x",
"typeAnnotation": {
"type": "ETSUnionType",
"types": [
{
"type": "ETSTypeReference",
"part": {
"type": "ETSTypeReferencePart",
"name": {
"type": "Identifier",
"name": "T",
"loc": {
"start": {
"line": 20,
"column": 44,
"program": "generic_function.ets"
},
"end": {
"line": 20,
"column": 45,
"program": "generic_function.ets"
}
}
},
"loc": {
"start": {
"line": 20,
"column": 44,
"program": "generic_function.ets"
},
"end": {
"line": 20,
"column": 45,
"program": "generic_function.ets"
}
}
},
"loc": {
"start": {
"line": 20,
"column": 44,
"program": "generic_function.ets"
},
"end": {
"line": 20,
"column": 45,
"program": "generic_function.ets"
}
}
},
{
"type": "ETSNullType",
"loc": {
"start": {
"line": 20,
"column": 46,
"program": "generic_function.ets"
},
"end": {
"line": 20,
"column": 50,
"program": "generic_function.ets"
}
}
}
],
"loc": {
"start": {
"line": 20,
"column": 44,
"program": "generic_function.ets"
},
"end": {
"line": 20,
"column": 50,
"program": "generic_function.ets"
}
}
},
"loc": {
"start": {
"line": 20,
"column": 41,
"program": "generic_function.ets"
},
"end": {
"line": 20,
"column": 50,
"program": "generic_function.ets"
}
}
},
"loc": {
"start": {
"line": 20,
"column": 41,
"program": "generic_function.ets"
},
"end": {
"line": 20,
"column": 50,
"program": "generic_function.ets"
}
}
},
{
"type": "ETSParameterExpression",
"name": {
"type": "Identifier",
"name": "y",
"typeAnnotation": {
"type": "ETSUnionType",
"types": [
{
"type": "ETSTypeReference",
"part": {
"type": "ETSTypeReferencePart",
"name": {
"type": "Identifier",
"name": "T",
"loc": {
"start": {
"line": 20,
"column": 55,
"program": "generic_function.ets"
},
"end": {
"line": 20,
"column": 56,
"program": "generic_function.ets"
}
}
},
"loc": {
"start": {
"line": 20,
"column": 55,
"program": "generic_function.ets"
},
"end": {
"line": 20,
"column": 56,
"program": "generic_function.ets"
}
}
},
"loc": {
"start": {
"line": 20,
"column": 55,
"program": "generic_function.ets"
},
"end": {
"line": 20,
"column": 56,
"program": "generic_function.ets"
}
}
},
{
"type": "ETSNullType",
"loc": {
"start": {
"line": 20,
"column": 57,
"program": "generic_function.ets"
},
"end": {
"line": 20,
"column": 61,
"program": "generic_function.ets"
}
}
}
],
"loc": {
"start": {
"line": 20,
"column": 55,
"program": "generic_function.ets"
},
"end": {
"line": 20,
"column": 61,
"program": "generic_function.ets"
}
}
},
"loc": {
"start": {
"line": 20,
"column": 52,
"program": "generic_function.ets"
},
"end": {
"line": 20,
"column": 61,
"program": "generic_function.ets"
}
}
},
"loc": {
"start": {
"line": 20,
"column": 52,
"program": "generic_function.ets"
},
"end": {
"line": 20,
"column": 61,
"program": "generic_function.ets"
}
}
}
],
"returnType": {
"type": "ETSPrimitiveType",
"loc": {
"start": {
"line": 20,
"column": 64,
"program": "generic_function.ets"
},
"end": {
"line": 20,
"column": 67,
"program": "generic_function.ets"
}
}
},
"typeParameters": {
"type": "TSTypeParameterDeclaration",
"params": [
{
"type": "TSTypeParameter",
"name": {
"type": "Identifier",
"name": "T",
"loc": {
"start": {
"line": 20,
"column": 18,
"program": "generic_function.ets"
},
"end": {
"line": 20,
"column": 19,
"program": "generic_function.ets"
}
}
},
"constraint": {
"type": "ETSTypeReference",
"part": {
"type": "ETSTypeReferencePart",
"name": {
"type": "Identifier",
"name": "Comparable2",
"loc": {
"start": {
"line": 20,
"column": 28,
"program": "generic_function.ets"
},
"end": {
"line": 20,
"column": 39,
"program": "generic_function.ets"
}
}
},
"loc": {
"start": {
"line": 20,
"column": 28,
"program": "generic_function.ets"
},
"end": {
"line": 20,
"column": 39,
"program": "generic_function.ets"
}
}
},
"loc": {
"start": {
"line": 20,
"column": 28,
"program": "generic_function.ets"
},
"end": {
"line": 20,
"column": 39,
"program": "generic_function.ets"
}
}
},
"loc": {
"start": {
"line": 20,
"column": 18,
"program": "generic_function.ets"
},
"end": {
"line": 20,
"column": 40,
"program": "generic_function.ets"
}
}
}
],
"loc": {
"start": {
"line": 20,
"column": 17,
"program": "generic_function.ets"
},
"end": {
"line": 20,
"column": 40,
"program": "generic_function.ets"
}
}
},
"body": {
"type": "BlockStatement",
"statements": [
{
"type": "IfStatement",
"test": {
"type": "BinaryExpression",
"operator": "==",
"left": {
"type": "Identifier",
"name": "x",
"loc": {
"start": {
"line": 21,
"column": 7,
"program": "generic_function.ets"
},
"end": {
"line": 21,
"column": 8,
"program": "generic_function.ets"
}
}
},
"right": {
"type": "NullLiteral",
"value": null,
"loc": {
"start": {
"line": 21,
"column": 12,
"program": "generic_function.ets"
},
"end": {
"line": 21,
"column": 16,
"program": "generic_function.ets"
}
}
},
"loc": {
"start": {
"line": 21,
"column": 7,
"program": "generic_function.ets"
},
"end": {
"line": 21,
"column": 16,
"program": "generic_function.ets"
}
}
},
"consequent": {
"type": "ReturnStatement",
"argument": {
"type": "ConditionalExpression",
"test": {
"type": "BinaryExpression",
"operator": "==",
"left": {
"type": "Identifier",
"name": "y",
"loc": {
"start": {
"line": 21,
"column": 25,
"program": "generic_function.ets"
},
"end": {
"line": 21,
"column": 26,
"program": "generic_function.ets"
}
}
},
"right": {
"type": "NullLiteral",
"value": null,
"loc": {
"start": {
"line": 21,
"column": 30,
"program": "generic_function.ets"
},
"end": {
"line": 21,
"column": 34,
"program": "generic_function.ets"
}
}
},
"loc": {
"start": {
"line": 21,
"column": 25,
"program": "generic_function.ets"
},
"end": {
"line": 21,
"column": 34,
"program": "generic_function.ets"
}
}
},
"consequent": {
"type": "NumberLiteral",
"value": 0,
"loc": {
"start": {
"line": 21,
"column": 37,
"program": "generic_function.ets"
},
"end": {
"line": 21,
"column": 38,
"program": "generic_function.ets"
}
}
},
"alternate": {
"type": "NumberLiteral",
"value": -1,
"loc": {
"start": {
"line": 21,
"column": 41,
"program": "generic_function.ets"
},
"end": {
"line": 21,
"column": 43,
"program": "generic_function.ets"
}
}
},
"loc": {
"start": {
"line": 21,
"column": 25,
"program": "generic_function.ets"
},
"end": {
"line": 21,
"column": 43,
"program": "generic_function.ets"
}
}
},
"loc": {
"start": {
"line": 21,
"column": 18,
"program": "generic_function.ets"
},
"end": {
"line": 21,
"column": 44,
"program": "generic_function.ets"
}
}
},
"alternate": null,
"loc": {
"start": {
"line": 21,
"column": 3,
"program": "generic_function.ets"
},
"end": {
"line": 21,
"column": 44,
"program": "generic_function.ets"
}
}
},
{
"type": "IfStatement",
"test": {
"type": "BinaryExpression",
"operator": "==",
"left": {
"type": "Identifier",
"name": "y",
"loc": {
"start": {
"line": 22,
"column": 7,
"program": "generic_function.ets"
},
"end": {
"line": 22,
"column": 8,
"program": "generic_function.ets"
}
}
},
"right": {
"type": "NullLiteral",
"value": null,
"loc": {
"start": {
"line": 22,
"column": 12,
"program": "generic_function.ets"
},
"end": {
"line": 22,
"column": 16,
"program": "generic_function.ets"
}
}
},
"loc": {
"start": {
"line": 22,
"column": 7,
"program": "generic_function.ets"
},
"end": {
"line": 22,
"column": 16,
"program": "generic_function.ets"
}
}
},
"consequent": {
"type": "ReturnStatement",
"argument": {
"type": "NumberLiteral",
"value": 1,
"loc": {
"start": {
"line": 22,
"column": 25,
"program": "generic_function.ets"
},
"end": {
"line": 22,
"column": 26,
"program": "generic_function.ets"
}
}
},
"loc": {
"start": {
"line": 22,
"column": 18,
"program": "generic_function.ets"
},
"end": {
"line": 22,
"column": 27,
"program": "generic_function.ets"
}
}
},
"alternate": null,
"loc": {
"start": {
"line": 22,
"column": 3,
"program": "generic_function.ets"
},
"end": {
"line": 22,
"column": 27,
"program": "generic_function.ets"
}
}
},
{
"type": "ReturnStatement",
"argument": {
"type": "CallExpression",
"callee": {
"type": "MemberExpression",
"object": {
"type": "Identifier",
"name": "x",
"loc": {
"start": {
"line": 23,
"column": 10,
"program": "generic_function.ets"
},
"end": {
"line": 23,
"column": 11,
"program": "generic_function.ets"
}
}
},
"property": {
"type": "Identifier",
"name": "localeCompare",
"loc": {
"start": {
"line": 23,
"column": 12,
"program": "generic_function.ets"
},
"end": {
"line": 23,
"column": 25,
"program": "generic_function.ets"
}
}
},
"computed": false,
"optional": false,
"loc": {
"start": {
"line": 23,
"column": 10,
"program": "generic_function.ets"
},
"end": {
"line": 23,
"column": 25,
"program": "generic_function.ets"
}
}
},
"arguments": [
{
"type": "Identifier",
"name": "y",
"loc": {
"start": {
"line": 23,
"column": 26,
"program": "generic_function.ets"
},
"end": {
"line": 23,
"column": 27,
"program": "generic_function.ets"
}
}
}
],
"optional": false,
"loc": {
"start": {
"line": 23,
"column": 10,
"program": "generic_function.ets"
},
"end": {
"line": 23,
"column": 28,
"program": "generic_function.ets"
}
}
},
"loc": {
"start": {
"line": 23,
"column": 3,
"program": "generic_function.ets"
},
"end": {
"line": 23,
"column": 29,
"program": "generic_function.ets"
}
}
}
],
"loc": {
"start": {
"line": 20,
"column": 68,
"program": "generic_function.ets"
},
"end": {
"line": 24,
"column": 2,
"program": "generic_function.ets"
}
}
},
"loc": {
"start": {
"line": 20,
"column": 10,
"program": "generic_function.ets"
},
"end": {
"line": 24,
"column": 2,
"program": "generic_function.ets"
}
}
},
"loc": {
"start": {
"line": 20,
"column": 10,
"program": "generic_function.ets"
},
"end": {
"line": 24,
"column": 2,
"program": "generic_function.ets"
}
}
},
"overloads": [],
"loc": {
"start": {
"line": 20,
"column": 1,
"program": "generic_function.ets"
},
"end": {
"line": 24,
"column": 2,
"program": "generic_function.ets"
}
}
}
],
"loc": {
"start": {
"line": 1,
"column": 1,
"program": "generic_function.ets"
},
"end": {
"line": 1,
"column": 1,
"program": "generic_function.ets"
}
}
},
"loc": {
"start": {
"line": 1,
"column": 1,
"program": "generic_function.ets"
},
"end": {
"line": 1,
"column": 1,
"program": "generic_function.ets"
}
}
}
],
"loc": {
"start": {
"line": 1,
"column": 1,
"program": "generic_function.ets"
},
"end": {
"line": 25,
"column": 1,
"program": "generic_function.ets"
}
}
}