Add support for an InterpreterDirective AST node.

This commit is contained in:
Logan Smyth
2018-05-12 10:50:33 -07:00
parent c0013264b7
commit 2058e0686e
2113 changed files with 2281 additions and 162 deletions

View File

@@ -27,6 +27,7 @@
}
},
"sourceType": "script",
"interpreter": null,
"body": [
{
"type": "BlockStatement",

View File

@@ -27,6 +27,7 @@
}
},
"sourceType": "script",
"interpreter": null,
"body": [
{
"type": "IfStatement",

View File

@@ -27,6 +27,7 @@
}
},
"sourceType": "module",
"interpreter": null,
"body": [
{
"type": "ExportDefaultDeclaration",

View File

@@ -27,6 +27,7 @@
}
},
"sourceType": "script",
"interpreter": null,
"body": [
{
"type": "ExpressionStatement",

View File

@@ -27,6 +27,7 @@
}
},
"sourceType": "script",
"interpreter": null,
"body": [
{
"type": "ExpressionStatement",

View File

@@ -27,6 +27,7 @@
}
},
"sourceType": "script",
"interpreter": null,
"body": [
{
"type": "VariableDeclaration",

View File

@@ -27,6 +27,22 @@
}
},
"sourceType": "module",
"interpreter": {
"type": "InterpreterDirective",
"start": 0,
"end": 25,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 25
}
},
"value": "/usr/bin/env babel-node"
},
"body": [
{
"type": "ImportDeclaration",
@@ -112,45 +128,9 @@
"raw": "'foobar'"
},
"value": "foobar"
},
"leadingComments": [
{
"type": "CommentLine",
"value": "/usr/bin/env babel-node",
"start": 0,
"end": 25,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 25
}
}
}
]
}
}
],
"directives": []
},
"comments": [
{
"type": "CommentLine",
"value": "/usr/bin/env babel-node",
"start": 0,
"end": 25,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 25
}
}
}
]
}
}

View File

@@ -27,6 +27,22 @@
}
},
"sourceType": "script",
"interpreter": {
"type": "InterpreterDirective",
"start": 0,
"end": 25,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 25
}
},
"value": "/usr/bin/env babel-node"
},
"body": [
{
"type": "VariableDeclaration",
@@ -148,45 +164,9 @@
}
}
],
"kind": "var",
"leadingComments": [
{
"type": "CommentLine",
"value": "/usr/bin/env babel-node",
"start": 0,
"end": 25,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 25
}
}
}
]
"kind": "var"
}
],
"directives": []
},
"comments": [
{
"type": "CommentLine",
"value": "/usr/bin/env babel-node",
"start": 0,
"end": 25,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 25
}
}
}
]
}
}

View File

@@ -27,6 +27,7 @@
}
},
"sourceType": "script",
"interpreter": null,
"body": [
{
"type": "FunctionDeclaration",

View File

@@ -27,6 +27,7 @@
}
},
"sourceType": "script",
"interpreter": null,
"body": [
{
"type": "FunctionDeclaration",

View File

@@ -27,6 +27,7 @@
}
},
"sourceType": "script",
"interpreter": null,
"body": [
{
"type": "FunctionDeclaration",

View File

@@ -27,6 +27,7 @@
}
},
"sourceType": "script",
"interpreter": null,
"body": [
{
"type": "FunctionDeclaration",

View File

@@ -27,6 +27,7 @@
}
},
"sourceType": "script",
"interpreter": null,
"body": [
{
"type": "FunctionDeclaration",

View File

@@ -27,6 +27,7 @@
}
},
"sourceType": "script",
"interpreter": null,
"body": [
{
"type": "FunctionDeclaration",

View File

@@ -27,6 +27,7 @@
}
},
"sourceType": "script",
"interpreter": null,
"body": [
{
"type": "SwitchStatement",

View File

@@ -27,6 +27,7 @@
}
},
"sourceType": "script",
"interpreter": null,
"body": [
{
"type": "SwitchStatement",

View File

@@ -27,6 +27,7 @@
}
},
"sourceType": "script",
"interpreter": null,
"body": [
{
"type": "SwitchStatement",

View File

@@ -27,6 +27,7 @@
}
},
"sourceType": "script",
"interpreter": null,
"body": [
{
"type": "FunctionDeclaration",

View File

@@ -27,6 +27,7 @@
}
},
"sourceType": "script",
"interpreter": null,
"body": [
{
"type": "ExpressionStatement",

View File

@@ -27,6 +27,7 @@
}
},
"sourceType": "script",
"interpreter": null,
"body": [
{
"type": "SwitchStatement",