Home
Scripts
Create
Home
Source
Demo Script
Kudos: 2
Runtime:
2.22ms
Result:
0
StdOut:
Hello World!
Script:
function greet(name) print("Hello ", name, "!") end greet("World")
Lexer Output
KEYWORD, function IDENT, greet PAREN, ( IDENT, name PAREN, ) IDENT, print PAREN, ( STRING, "Hello " COMMA, , IDENT, name COMMA, , STRING, "!" PAREN, ) KEYWORD, end IDENT, greet PAREN, ( STRING, "World" PAREN, )
AST Output
[ { "type": "FunctionExpression", "token_count": 14, "name": "greet", "args": [ "name" ], "body": [ { "type": "ApplicationExpression", "token_count": 8, "method": { "type": "VariableExpression", "token_count": 1, "token": "print" }, "args": [ { "type": "LiteralExpression", "token_count": 1, "token": "\"Hello \"" }, { "type": "VariableExpression", "token_count": 1, "token": "name" }, { "type": "LiteralExpression", "token_count": 1, "token": "\"!\"" } ] } ] }, { "type": "ApplicationExpression", "token_count": 4, "method": { "type": "VariableExpression", "token_count": 1, "token": "greet" }, "args": [ { "type": "LiteralExpression", "token_count": 1, "token": "\"World\"" } ] } ]