Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
shellyln committed Nov 11, 2018
0 parents commit 65b1767
Show file tree
Hide file tree
Showing 17 changed files with 749 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"extends": ["eslint:recommended"],
"plugins": [],
"parserOptions": {
"ecmaVersion": 8,
"sourceType": "module"
},
"env": {
"node": true,
"es6": true
},
"globals": {
"SharedArrayBuffer": true,
"Atomics": true
},
"rules": {
"no-console": 0
}
}
60 changes: 60 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Logs
logs
*.log
npm-debug.log*

# Runtime data
pids
*.pid
*.seed

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# node-waf configuration
.lock-wscript

# Optional npm cache directory
.npm

# Optional REPL history
.node_repl_history

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release


# Visual Studio files
/.vs/

# VS Code cache files
/.vscode/.browse.VC*

# Dependency directory
# https://docs.npmjs.com/misc/faq#should-i-check-my-node-modules-folder-into-git
/node_modules/

# Bin directory
/bin/
/bin.test/

# ES2015 modules (for webpack)
/modules/

# Declarations directory
/declarations/

# Dist directory
/dist/

# Debug output directory
/debug/

# NPM files
.npmrc
27 changes: 27 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
image: node:11

before_script:
- npm install -g eslint
- npm ci

#cache:
# paths:
# - node_modules/

test:lint:
script:
- npm run lint

test:node:11:
script:
- npm run clean
- npm run build
- npm test

# LTS
test:node:10:
image: node:10
script:
- npm run clean
- npm run build
- npm test
78 changes: 78 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# Logs
logs
*.log
npm-debug.log*

# Runtime data
pids
*.pid
*.seed

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# node-waf configuration
.lock-wscript

# Optional npm cache directory
.npm

# Optional REPL history
.node_repl_history

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release


# Visual Studio files
/.vs/

# VS Code cache files
/.vscode/.browse.VC*

# Dependency directory
# https://docs.npmjs.com/misc/faq#should-i-check-my-node-modules-folder-into-git
/node_modules/

# Bin directory
# /bin/
/bin.test/

# ES2015 modules (for webpack)
# /modules/

# Declarations directory
# /declarations/

# Dist directory
/dist/

# Debug output directory
/debug/

# NPM files
.npmrc



###################
#### npmignore ####

/.vscode/
/spec/
.babelrc
.travis.yml
.gitlab-ci.yml
tsconfig.json
tsconfig.spec.json
tslint.json
webpack.config.js

/src.dist/
webpack.dist.config.js
17 changes: 17 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
language: node_js
node_js:
- "10"
- "11"

#branches:
# only:
# - master

sudo: false

before_script:
- npm install -g eslint
- npm run clean
- npm run lint
- npm run build
- npm test
16 changes: 16 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Launch Program",
"program": "${workspaceFolder}\\index.js",
"args": [
]
}
]
}
13 changes: 13 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# ISC License (ISC)

### Copyright (c) 2018, Shellyl_N and Authors
#### https://github.com/shellyln

Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby
granted, provided that the above copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL,
DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE
OR PERFORMANCE OF THIS SOFTWARE.
46 changes: 46 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Liyad CLI
### CLI and REPL for [Liyad](https://github.com/shellyln/liyad) (Lisp yet another DSL interpreter).


----

## Requirements

* Node >= 10

## Install

```bash
$ npm install -g liyad-cli
$ liyad
```

## CLI Usage

```
Usage: liyad [options] [ -- ] [ -e script | script.lisp | - ] [ -- ] [arguments]
liyad [options]
Options:
- script read from stdin (default; interactive mode if a tty)
-- indicate the end of CLI options / script files
-e, --eval=... evaluate script
-i, --interactive always enter the REPL even if stdin does not appear to be a terminal
-h, --help print command line options
-v, --version print version informations
```

## Packaging to the single executable file.
Use [pkg](https://www.npmjs.com/package/pkg).

```bash
$ npm install -g pkg
$ pkg . --output liyad
$ ./liyad
```

----

## License
[ISC](https://github.com/shellyln/liyad-cli/blob/master/LICENSE.md)
Copyright (c) 2018, Shellyl_N and Authors.
15 changes: 15 additions & 0 deletions examples/example.lisp
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
($local ()
($let fac-sub (-> (n a)
;; ($pause)
($if (< n 2)
($cond (=== n 1) a
(=== n 0) 1
true 0)
($self (- n 1) (* n a)) )
))
($capture (fac-sub)
($defun fac (n) (fac-sub n 1)) ))

($concat "Hello, " (fac 5) "!")
($concat "Hello, " (fac 5) "!")
($concat "Hello, " (fac 5) "!")
12 changes: 12 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env node

// Copyright (c) 2018, Shellyl_N and Authors
// license: ISC
// https://github.com/shellyln


const cli = require('./lib/cli').cli;



cli();
Loading

0 comments on commit 65b1767

Please sign in to comment.