A Telegram bot which converts JavaScript into an Abstract Syntax Tree using Babel.
To use the bot, just send JavaScript source code directly to it or use one of the below commands.
/parse <code>- Parses source code into aProgramAST node. Sending source code/single <code>- Parses a single atom of source code. (One expression, statement, etc...)/help- Shows a list of commands.
One of these messages is sent to the bot:
console.log("Hello World!");(or)
/parse console.log("Hello World!");
This message is recieved from the bot:
{
"type": "Program",
"sourceType": "module",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "CallExpression",
"callee": {
"type": "MemberExpression",
"object": {
"type": "Identifier",
"name": "console"
},
"property": {
"type": "Identifier",
"name": "log"
},
"computed": false
},
"arguments": [
{
"type": "StringLiteral",
"extra": {
"rawValue": "Hello World!",
"raw": "\"Hello World!\""
},
"value": "Hello World!"
}
]
}
}
],
"directives": []
}This message is sent directly to the bot:
/single hello
This message is recieved from bot:
{
"type": "ExpressionStatement",
"expression": {
"type": "Identifier",
"name": "hello"
}
}