-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.sh
More file actions
59 lines (47 loc) · 749 Bytes
/
script.sh
File metadata and controls
59 lines (47 loc) · 749 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/bin/bash
function src {
echo "_ = require('lodash')
promise = require('../promise')
evaluator = () ->
module.exports = (rules, strm) ->
do (rules, strm) ->
p = promise(['atom', 'error', 'end'])
strm.onError((error) -> p.error(error))
strm.onEnd(() -> p.end())
state = null
strm.onAtom((atom) ->
if atom.t == 'sy' and atom.ch == '$1'
atom.eval = evaluator
console.log atom
p.atom(atom)
)
p" > ./lib/primitives/$1.coffee
}
src def
src int
src str
src char
src date
src num
src bool
src list
src array
src object
src tuple
src quote
src fun
src mac
src either
src and
src or
src not
src xor
src rec
src use
src add
src sub
src div
src mul
src stdout
src errout
src stdin