Tode

→ examples

Hello World


Tode

Language => Hello world!


Output

Hello world!


Greeter


Tode

Language :: GreetFunction

GreetFunction
:: "greet" _ [Text]
=> Hello {3}!

TextLiteral [Text]
:: "'" AnyCharacter* "'"
=> {2}

WhiteSpace _ :: /[ |	]*/
AnyCharacter :: /./


Input

greet 'Luke'


Output

Hello Luke!


Asker


Tode

Language :: Header Line*

Header => let name = ""\n
Line :: Expression "\n"? => {1}\n

Expression
:: AskForNameFunction
:: GreetFunction

AskForNameFunction
:: "askForName"
=> name = prompt("What is your name?")

GreetFunction
:: "greet"
=> alert(`Hello ${name}!`)


Input

askForName
greet


Output

let name = ""
name = prompt("What is your name?")
alert(`Hello ${name}!`)


Fibonacci


Tode

Language :: [Number]
WhiteSpace _ :: /[ |	]*/

NumberLiteral [Number]
:: /[0-9]+/

AddOperator [Number]
:: [Number] _ "+" _ [Number]
-> {1} + {5}

SubtractOperator [Number]
:: [Number] _ "-" _ [Number]
-> {1} - {5}

FibonacciFunction [Number]
:: "fibonacci(" {0} ")"      >> 0
:: "fibonacci(" {1} ")"      >> 1
:: "fibonacci(" [Number] ")" >> fibonacci({3} - 1) + fibonacci({3} - 2)


Input

fibonacci(4)


Output

3