Skip to content

A BASON Parser with javascript function-like syntax

License

Notifications You must be signed in to change notification settings

DanFessler/bason-funky

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 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!')
`));

About

A BASON Parser with javascript function-like syntax

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published