0.1.0-dev • Published 7 years ago
hogget v0.1.0-dev
Hogget compiler
Installation
Requires Node.js v10 or higher. This package has no dependencies.
npm install hogget --globalCompiling
The Hogget compiler needs an input and output to run. To run from the terminal:
hogget --input program.hgg --output program.hgg.jsor, more concisely:
hogget -i program.hgg -o program.hgg.jsTo run programatically from Node.js:
import hogget from 'hogget'
const hoggetString = 'log("the answer is" add(12 30))'
console.log(hogget(hoggetString))The hogget package also exports a parse method.
Linting
To run from the terminal, either the --lint or -l option must be used:
hogget --lint --input program.hggTo run programatically from Node.js:
import { lint } from 'hogget'
const hoggetString =
'let myAdd = (a, b) => { let result = add(a, b); result; };'
console.log(lint(hoggetString))Formatting
To run from the terminal, either the --format or -f option must be used:
hogget --format --input program.hgg0.1.0-dev
7 years ago