funky is a parser that makes writing programs in BASON more friendly by adopting a familiar javascript-like function syntax
The syntax is universal and simple. Keyword (command, function, or variable) followed by its parameters in parenthesis, followed by its code block in curly brackets (if applicable):
// comment
keyword (parameters, ...) {
script...
}
defining functions in funky is also similar to javascript:
FUNCTION GREET('name') {
PRINT(ADD('Hello ', name))
}
GREET('World!')
Funky hoists functions for you so you can declare them anywhere in your file
// still works!
GREET('World!')
FUNCTION GREET('name') {
PRINT(ADD('Hello ', name))
}
npm install bason-funky --save
Import the package, define your program, and parse it with .parse()
let BASON = require('bason')
let funky = require('bason-funky')
BASON.RUN(funky.parse(`
FUNCTION GREET('name') {
PRINT(ADD('Hello ', name))
}
GREET('World!')
`));