Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/phadej/typify-parser
Type signature parser for typify
https://github.com/phadej/typify-parser
Last synced: 10 days ago
JSON representation
Type signature parser for typify
- Host: GitHub
- URL: https://github.com/phadej/typify-parser
- Owner: phadej
- License: mit
- Created: 2014-07-23T04:39:09.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2019-11-07T17:27:20.000Z (almost 5 years ago)
- Last Synced: 2024-10-11T23:53:19.931Z (26 days ago)
- Language: JavaScript
- Size: 5.84 MB
- Stars: 9
- Watchers: 3
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# typify type parser
> Type signature parser for typify
[![Build Status](https://secure.travis-ci.org/phadej/typify-parser.svg?branch=master)](http://travis-ci.org/phadej/typify-parser)
[![NPM version](https://badge.fury.io/js/typify-parser.svg)](http://badge.fury.io/js/typify-parser)
[![Dependency Status](https://david-dm.org/phadej/typify-parser.svg)](https://david-dm.org/phadej/typify-parser)
[![devDependency Status](https://david-dm.org/phadej/typify-parser/dev-status.svg)](https://david-dm.org/phadej/typify-parser#info=devDependencies)
[![Code Climate](https://img.shields.io/codeclimate/github/phadej/typify-parser.svg)](https://codeclimate.com/github/phadej/typify-parser)Turns `(foo, bar 42) -> quux` into
```js
{
"type": "function",
"arg": {
"type": "product",
"args": [
{
"type": "ident",
"value": "foo"
},
{
"type": "application",
"callee": {
"type": "ident",
"value": "bar"
},
"args": [
{
"type": "number",
"value": 42
}
]
}
]
},
"result": {
"type": "ident",
"value": "quux"
}
}
```## Synopsis
```js
var parser = require("typify-parser");// Example from above
var t = parser("(foo, bar 42) -> quux");// Free vars
p.freeVars(t); // ['bar', 'foo', 'quux']
p.freeVars(p("rec list -> () | a & list")) // ['a']
```