Skip to content

Instantly share code, notes, and snippets.

@markelog
Created November 4, 2015 19:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save markelog/c7674a737b2c7e993215 to your computer and use it in GitHub Desktop.
Save markelog/c7674a737b2c7e993215 to your computer and use it in GitHub Desktop.
babel ast
[
{
"type": "FunctionDeclaration",
"start": 0,
"end": 34,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 3,
"column": 1
}
},
"id": {
"type": "Identifier",
"start": 9,
"end": 12,
"loc": {
"start": {
"line": 1,
"column": 9
},
"end": {
"line": 1,
"column": 12
}
},
"name": "foo",
"range": [
9,
12
],
"_babelType": "Identifier",
"parentNode": "[Circular ~.0]",
"parentCollection": [
"[Circular ~.0.id]"
]
},
"generator": false,
"expression": false,
"async": false,
"params": [],
"body": {
"type": "BlockStatement",
"start": 15,
"end": 34,
"loc": {
"start": {
"line": 1,
"column": 15
},
"end": "[Circular ~.0.loc.end]"
},
"body": [
{
"type": "ExpressionStatement",
"start": 21,
"end": 32,
"loc": {
"start": {
"line": 2,
"column": 4
},
"end": {
"line": 2,
"column": 15
}
},
"expression": {
"type": "JSXElement",
"start": 21,
"end": 32,
"loc": {
"start": "[Circular ~.0.body.body.0.loc.start]",
"end": "[Circular ~.0.body.body.0.loc.end]"
},
"openingElement": {
"type": "JSXOpeningElement",
"start": 21,
"end": 26,
"loc": {
"start": "[Circular ~.0.body.body.0.loc.start]",
"end": {
"line": 2,
"column": 9
}
},
"attributes": [],
"name": {
"type": "JSXIdentifier",
"start": 22,
"end": 25,
"loc": {
"start": {
"line": 2,
"column": 5
},
"end": {
"line": 2,
"column": 8
}
},
"name": "div",
"range": [
22,
25
],
"_babelType": "JSXIdentifier",
"parentNode": "[Circular ~.0.body.body.0.expression.openingElement]",
"parentCollection": [
"[Circular ~.0.body.body.0.expression.openingElement.name]"
]
},
"selfClosing": false,
"range": [
21,
26
],
"_babelType": "JSXOpeningElement",
"_paths": [
{
"contexts": [],
"parent": "[Circular ~.0.body.body.0.expression.openingElement]",
"data": {},
"shouldSkip": false,
"shouldStop": false,
"removed": false,
"opts": {
"noScope": true,
"enter": [
null
],
"exit": [
null
],
"_exploded": true,
"_verified": true
},
"skipKeys": {},
"parentPath": {
"contexts": [],
"parent": "[Circular ~.0.body.body.0.expression]",
"data": {},
"shouldSkip": false,
"shouldStop": false,
"removed": false,
"opts": "[Circular ~.0.body.body.0.expression.openingElement._paths.0.opts]",
"skipKeys": {},
"parentPath": {
"contexts": [],
"parent": "[Circular ~.0.body.body.0]",
"data": {},
"shouldSkip": false,
"shouldStop": false,
"removed": false,
"opts": "[Circular ~.0.body.body.0.expression.openingElement._paths.0.opts]",
"skipKeys": {},
"parentPath": {
"contexts": [],
"parent": "[Circular ~.0.body]",
"data": {},
"shouldSkip": false,
"shouldStop": false,
"removed": false,
"opts": "[Circular ~.0.body.body.0.expression.openingElement._paths.0.opts]",
"skipKeys": {},
"parentPath": {
"contexts": [],
"parent": "[Circular ~.0]",
"data": {},
"shouldSkip": false,
"shouldStop": false,
"removed": false,
"opts": "[Circular ~.0.body.body.0.expression.openingElement._paths.0.opts]",
"skipKeys": {},
"parentPath": {
"contexts": [],
"parent": {
"type": "Program",
"start": 0,
"end": 35,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 4,
"column": 0
}
},
"sourceType": "module",
"body": "[Circular ~]",
"tokens": [
{
"type": "Keyword",
"value": "function",
"start": 0,
"end": 8,
"loc": {
"start": "[Circular ~.0.loc.start]",
"end": {
"line": 1,
"column": 8
}
},
"range": [
0,
8
],
"_tokenIndex": 0
},
{
"type": "Identifier",
"value": "foo",
"start": 9,
"end": 12,
"loc": {
"start": "[Circular ~.0.id.loc.start]",
"end": "[Circular ~.0.id.loc.end]"
},
"range": [
9,
12
],
"_tokenIndex": 2
},
{
"type": "Punctuator",
"value": "(",
"start": 12,
"end": 13,
"loc": {
"start": {
"line": 1,
"column": 12
},
"end": {
"line": 1,
"column": 13
}
},
"range": [
12,
13
],
"_tokenIndex": 3
},
{
"type": "Punctuator",
"value": ")",
"start": 13,
"end": 14,
"loc": {
"start": {
"line": 1,
"column": 13
},
"end": {
"line": 1,
"column": 14
}
},
"range": [
13,
14
],
"_tokenIndex": 4
},
{
"type": "Punctuator",
"value": "{",
"start": 15,
"end": 16,
"loc": {
"start": "[Circular ~.0.body.loc.start]",
"end": {
"line": 1,
"column": 16
}
},
"range": [
15,
16
],
"_tokenIndex": 6
},
{
"type": "Punctuator",
"value": "<",
"start": 21,
"end": 22,
"loc": {
"start": "[Circular ~.0.body.body.0.loc.start]",
"end": {
"line": 2,
"column": 5
}
},
"range": [
21,
22
],
"_tokenIndex": 8
},
{
"type": "JSXIdentifier",
"value": "div",
"start": 22,
"end": 25,
"loc": {
"start": "[Circular ~.0.body.body.0.expression.openingElement.name.loc.start]",
"end": "[Circular ~.0.body.body.0.expression.openingElement.name.loc.end]"
},
"range": [
22,
25
],
"_tokenIndex": 9
},
{
"type": "Punctuator",
"value": ">",
"start": 25,
"end": 26,
"loc": {
"start": {
"line": 2,
"column": 8
},
"end": "[Circular ~.0.body.body.0.expression.openingElement.loc.end]"
},
"range": [
25,
26
],
"_tokenIndex": 10
},
{
"type": "Punctuator",
"value": "<",
"start": 26,
"end": 27,
"loc": {
"start": {
"line": 2,
"column": 9
},
"end": {
"line": 2,
"column": 10
}
},
"range": [
26,
27
],
"_tokenIndex": 11
},
{
"type": "Punctuator",
"value": "/",
"start": 27,
"end": 28,
"loc": {
"start": {
"line": 2,
"column": 10
},
"end": {
"line": 2,
"column": 11
}
},
"range": [
27,
28
],
"_tokenIndex": 12
},
{
"type": "JSXIdentifier",
"value": "div",
"start": 28,
"end": 31,
"loc": {
"start": {
"line": 2,
"column": 11
},
"end": {
"line": 2,
"column": 14
}
},
"range": [
28,
31
],
"_tokenIndex": 13
},
{
"type": "Punctuator",
"value": ">",
"start": 31,
"end": 32,
"loc": {
"start": {
"line": 2,
"column": 14
},
"end": "[Circular ~.0.body.body.0.loc.end]"
},
"range": [
31,
32
],
"_tokenIndex": 14
},
{
"type": "Punctuator",
"value": "}",
"start": 33,
"end": 34,
"loc": {
"start": {
"line": 3,
"column": 0
},
"end": "[Circular ~.0.loc.end]"
},
"range": [
33,
34
],
"_tokenIndex": 16
}
],
"comments": [],
"range": [
0,
35
],
"_paths": [
"[Circular ~.0.body.body.0.expression.openingElement._paths.0.parentPath.parentPath.parentPath.parentPath.parentPath]"
],
"parentNode": null,
"parentCollection": []
},
"data": {},
"shouldSkip": false,
"shouldStop": false,
"removed": false,
"opts": "[Circular ~.0.body.body.0.expression.openingElement._paths.0.opts]",
"skipKeys": {},
"parentPath": null,
"context": {
"queue": null,
"opts": "[Circular ~.0.body.body.0.expression.openingElement._paths.0.opts]"
},
"container": "[Circular ~]",
"listKey": "body",
"inList": true,
"parentKey": "body",
"key": 0,
"node": "[Circular ~.0]",
"scope": null,
"type": "FunctionDeclaration",
"typeAnnotation": null
},
"context": {
"queue": null,
"parentPath": "[Circular ~.0.body.body.0.expression.openingElement._paths.0.parentPath.parentPath.parentPath.parentPath.parentPath]",
"scope": null,
"opts": "[Circular ~.0.body.body.0.expression.openingElement._paths.0.opts]"
},
"container": "[Circular ~.0]",
"inList": false,
"parentKey": "body",
"key": "body",
"node": "[Circular ~.0.body]",
"scope": null,
"type": "BlockStatement",
"typeAnnotation": null
},
"context": {
"queue": null,
"parentPath": "[Circular ~.0.body.body.0.expression.openingElement._paths.0.parentPath.parentPath.parentPath.parentPath]",
"scope": null,
"opts": "[Circular ~.0.body.body.0.expression.openingElement._paths.0.opts]"
},
"container": "[Circular ~.0.body.body]",
"listKey": "body",
"inList": true,
"parentKey": "body",
"key": 0,
"node": "[Circular ~.0.body.body.0]",
"scope": null,
"type": "ExpressionStatement",
"typeAnnotation": null
},
"context": {
"queue": null,
"parentPath": "[Circular ~.0.body.body.0.expression.openingElement._paths.0.parentPath.parentPath.parentPath]",
"scope": null,
"opts": "[Circular ~.0.body.body.0.expression.openingElement._paths.0.opts]"
},
"container": "[Circular ~.0.body.body.0]",
"inList": false,
"parentKey": "expression",
"key": "expression",
"node": "[Circular ~.0.body.body.0.expression]",
"scope": null,
"type": "JSXElement",
"typeAnnotation": null
},
"context": {
"queue": null,
"parentPath": "[Circular ~.0.body.body.0.expression.openingElement._paths.0.parentPath.parentPath]",
"scope": null,
"opts": "[Circular ~.0.body.body.0.expression.openingElement._paths.0.opts]"
},
"container": "[Circular ~.0.body.body.0.expression]",
"inList": false,
"parentKey": "openingElement",
"key": "openingElement",
"node": "[Circular ~.0.body.body.0.expression.openingElement]",
"scope": null,
"type": "JSXOpeningElement",
"typeAnnotation": null
},
"context": {
"queue": null,
"parentPath": "[Circular ~.0.body.body.0.expression.openingElement._paths.0.parentPath]",
"scope": null,
"opts": "[Circular ~.0.body.body.0.expression.openingElement._paths.0.opts]"
},
"container": "[Circular ~.0.body.body.0.expression.openingElement]",
"inList": false,
"parentKey": "name",
"key": "name",
"node": "[Circular ~.0.body.body.0.expression.openingElement.name]",
"scope": null,
"type": "JSXIdentifier",
"typeAnnotation": null
}
],
"parentNode": "[Circular ~.0.body.body.0.expression]",
"parentCollection": [
"[Circular ~.0.body.body.0.expression.openingElement]"
]
},
"closingElement": {
"type": "JSXClosingElement",
"start": 26,
"end": 32,
"loc": {
"start": "[Circular ~.0.body.body.0.expression.openingElement._paths.0.parentPath.parentPath.parentPath.parentPath.parentPath.parent.tokens.8.loc.start]",
"end": "[Circular ~.0.body.body.0.loc.end]"
},
"name": {
"type": "JSXIdentifier",
"start": 28,
"end": 31,
"loc": {
"start": "[Circular ~.0.body.body.0.expression.openingElement._paths.0.parentPath.parentPath.parentPath.parentPath.parentPath.parent.tokens.10.loc.start]",
"end": "[Circular ~.0.body.body.0.expression.openingElement._paths.0.parentPath.parentPath.parentPath.parentPath.parentPath.parent.tokens.10.loc.end]"
},
"name": "div",
"range": [
28,
31
],
"_babelType": "JSXIdentifier",
"parentNode": "[Circular ~.0.body.body.0.expression.closingElement]",
"parentCollection": [
"[Circular ~.0.body.body.0.expression.closingElement.name]"
]
},
"range": [
26,
32
],
"_babelType": "JSXClosingElement",
"_paths": [
{
"contexts": [],
"parent": "[Circular ~.0.body.body.0.expression.closingElement]",
"data": {},
"shouldSkip": false,
"shouldStop": false,
"removed": false,
"opts": "[Circular ~.0.body.body.0.expression.openingElement._paths.0.opts]",
"skipKeys": {},
"parentPath": {
"contexts": [],
"parent": "[Circular ~.0.body.body.0.expression]",
"data": {},
"shouldSkip": false,
"shouldStop": false,
"removed": false,
"opts": "[Circular ~.0.body.body.0.expression.openingElement._paths.0.opts]",
"skipKeys": {},
"parentPath": "[Circular ~.0.body.body.0.expression.openingElement._paths.0.parentPath.parentPath]",
"context": "[Circular ~.0.body.body.0.expression.openingElement._paths.0.parentPath.context]",
"container": "[Circular ~.0.body.body.0.expression]",
"inList": false,
"parentKey": "closingElement",
"key": "closingElement",
"node": "[Circular ~.0.body.body.0.expression.closingElement]",
"scope": null,
"type": "JSXClosingElement",
"typeAnnotation": null
},
"context": {
"queue": null,
"parentPath": "[Circular ~.0.body.body.0.expression.closingElement._paths.0.parentPath]",
"scope": null,
"opts": "[Circular ~.0.body.body.0.expression.openingElement._paths.0.opts]"
},
"container": "[Circular ~.0.body.body.0.expression.closingElement]",
"inList": false,
"parentKey": "name",
"key": "name",
"node": "[Circular ~.0.body.body.0.expression.closingElement.name]",
"scope": null,
"type": "JSXIdentifier",
"typeAnnotation": null
}
],
"parentNode": "[Circular ~.0.body.body.0.expression]",
"parentCollection": [
"[Circular ~.0.body.body.0.expression.closingElement]"
]
},
"children": [],
"range": [
21,
32
],
"_babelType": "JSXElement",
"_paths": [
"[Circular ~.0.body.body.0.expression.openingElement._paths.0.parentPath]",
"[Circular ~.0.body.body.0.expression.closingElement._paths.0.parentPath]"
],
"parentNode": "[Circular ~.0.body.body.0]",
"parentCollection": [
"[Circular ~.0.body.body.0.expression]"
]
},
"range": [
21,
32
],
"_babelType": "ExpressionStatement",
"_paths": [
"[Circular ~.0.body.body.0.expression.openingElement._paths.0.parentPath.parentPath]"
],
"parentNode": "[Circular ~.0.body]",
"parentCollection": "[Circular ~.0.body.body]"
}
],
"range": [
15,
34
],
"_babelType": "BlockStatement",
"_paths": [
"[Circular ~.0.body.body.0.expression.openingElement._paths.0.parentPath.parentPath.parentPath]"
],
"parentNode": "[Circular ~.0]",
"parentCollection": [
"[Circular ~.0.body]"
]
},
"range": [
0,
34
],
"_babelType": "FunctionDeclaration",
"_paths": [
{
"contexts": [],
"parent": "[Circular ~.0]",
"data": {},
"shouldSkip": false,
"shouldStop": false,
"removed": false,
"opts": "[Circular ~.0.body.body.0.expression.openingElement._paths.0.opts]",
"skipKeys": {},
"parentPath": "[Circular ~.0.body.body.0.expression.openingElement._paths.0.parentPath.parentPath.parentPath.parentPath.parentPath]",
"context": "[Circular ~.0.body.body.0.expression.openingElement._paths.0.parentPath.parentPath.parentPath.parentPath.context]",
"container": "[Circular ~.0]",
"inList": false,
"parentKey": "id",
"key": "id",
"node": "[Circular ~.0.id]",
"scope": null,
"type": "Identifier",
"typeAnnotation": null
},
"[Circular ~.0.body.body.0.expression.openingElement._paths.0.parentPath.parentPath.parentPath.parentPath]"
],
"defaults": [],
"parentNode": "[Circular ~.0.body.body.0.expression.openingElement._paths.0.parentPath.parentPath.parentPath.parentPath.parentPath.parent]",
"parentCollection": "[Circular ~]"
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment