1.0.3 • Published 6 years ago

bason-funky v1.0.3

Weekly downloads
3
License
MIT
Repository
github
Last release
6 years ago

bason-funky

funky is a parser that makes writing programs in BASON more friendly by adopting a familiar javascript-like function syntax

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))
}

Installation

npm install bason-funky --save

Usage

Import the package, define your program, and run it with BASON.RUN()

let BASON = require('bason')
let funky = require('bason-funky')

BASON.RUN(funky.parse(`
  FUNCTION('TEST', 'name') {
    PRINT(ADD('Hello ', name))
  }
  TEST('World!')
`));
1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago