shen-ruby 0.7.0 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- data/HISTORY.md +7 -0
- data/README.md +7 -7
- data/lib/shen_ruby/version.rb +1 -1
- data/shen-ruby.gemspec +1 -1
- data/shen/README.txt +1 -1
- data/shen/release/k_lambda/declarations.kl +5 -3
- data/shen/release/k_lambda/load.kl +1 -1
- data/shen/release/k_lambda/macros.kl +23 -21
- data/shen/release/k_lambda/prolog.kl +97 -97
- data/shen/release/k_lambda/reader.kl +79 -79
- data/shen/release/k_lambda/sequent.kl +53 -53
- data/shen/release/k_lambda/sys.kl +112 -98
- data/shen/release/k_lambda/t-star.kl +50 -48
- data/shen/release/k_lambda/toplevel.kl +21 -25
- data/shen/release/k_lambda/track.kl +25 -25
- data/shen/release/k_lambda/types.kl +21 -9
- data/shen/release/k_lambda/writer.kl +25 -25
- data/shen/release/k_lambda/yacc.kl +26 -32
- data/shen/release/test_programs/strings.shen +1 -2
- metadata +12 -8
- checksums.yaml +0 -7
@@ -47,65 +47,59 @@
|
|
47
47
|
* explains this license in full. *
|
48
48
|
* *
|
49
49
|
*****************************************************************************************
|
50
|
-
"(defun shen.yacc (
|
50
|
+
"(defun shen.yacc (V2133) (cond ((and (cons? V2133) (and (= defcc (hd V2133)) (cons? (tl V2133)))) (shen.yacc->shen (hd (tl V2133)) (tl (tl V2133)))) (true (shen.sys-error shen.yacc))))
|
51
51
|
|
52
|
-
(defun shen.yacc->shen (
|
52
|
+
(defun shen.yacc->shen (V2134 V2135) (let CCRules (shen.split_cc_rules V2135 ()) (let CCBody (map shen.cc_body CCRules) (let YaccCases (shen.yacc_cases CCBody) (cons define (cons V2134 (cons Stream (cons -> (cons YaccCases ())))))))))
|
53
53
|
|
54
|
-
(defun shen.split_cc_rules (
|
54
|
+
(defun shen.split_cc_rules (V2136 V2137) (cond ((and (= () V2136) (= () V2137)) ()) ((= () V2136) (cons (shen.split_cc_rule (reverse V2137) ()) ())) ((and (cons? V2136) (= ; (hd V2136))) (cons (shen.split_cc_rule (reverse V2137) ()) (shen.split_cc_rules (tl V2136) ()))) ((cons? V2136) (shen.split_cc_rules (tl V2136) (cons (hd V2136) V2137))) (true (shen.sys-error shen.split_cc_rules))))
|
55
55
|
|
56
|
-
(defun shen.split_cc_rule (
|
57
|
-
" (stoutput)) (shen.split_cc_rule (cons := (cons (shen.default_semantics (reverse
|
56
|
+
(defun shen.split_cc_rule (V2138 V2139) (cond ((and (cons? V2138) (and (= := (hd V2138)) (and (cons? (tl V2138)) (= () (tl (tl V2138)))))) (cons (reverse V2139) (tl V2138))) ((and (cons? V2138) (and (= := (hd V2138)) (and (cons? (tl V2138)) (and (cons? (tl (tl V2138))) (and (= where (hd (tl (tl V2138)))) (and (cons? (tl (tl (tl V2138)))) (= () (tl (tl (tl (tl V2138))))))))))) (cons (reverse V2139) (cons (cons where (cons (hd (tl (tl (tl V2138)))) (cons (hd (tl V2138)) ()))) ()))) ((= () V2138) (do (shen.prhush "warning: " (stoutput)) (do (map (lambda X (shen.prhush (shen.app X " " shen.a) (stoutput))) (reverse V2139)) (do (shen.prhush "has no semantics.
|
57
|
+
" (stoutput)) (shen.split_cc_rule (cons := (cons (shen.default_semantics (reverse V2139)) ())) V2139))))) ((cons? V2138) (shen.split_cc_rule (tl V2138) (cons (hd V2138) V2139))) (true (shen.sys-error shen.split_cc_rule))))
|
58
58
|
|
59
|
-
(defun shen.default_semantics (
|
59
|
+
(defun shen.default_semantics (V2140) (cond ((= () V2140) ()) ((and (cons? V2140) (and (= () (tl V2140)) (shen.grammar_symbol? (hd V2140)))) (hd V2140)) ((and (cons? V2140) (shen.grammar_symbol? (hd V2140))) (cons append (cons (hd V2140) (cons (shen.default_semantics (tl V2140)) ())))) ((cons? V2140) (cons cons (cons (hd V2140) (cons (shen.default_semantics (tl V2140)) ())))) (true (shen.sys-error shen.default_semantics))))
|
60
60
|
|
61
|
-
(defun shen.grammar_symbol? (
|
61
|
+
(defun shen.grammar_symbol? (V2141) (and (symbol? V2141) (let Cs (shen.strip-pathname (explode V2141)) (and (= (hd Cs) "<") (= (hd (reverse Cs)) ">")))))
|
62
62
|
|
63
|
-
(defun shen.yacc_cases (
|
63
|
+
(defun shen.yacc_cases (V2142) (cond ((and (cons? V2142) (= () (tl V2142))) (hd V2142)) ((cons? V2142) (let P YaccParse (cons let (cons P (cons (hd V2142) (cons (cons if (cons (cons = (cons P (cons (cons fail ()) ()))) (cons (shen.yacc_cases (tl V2142)) (cons P ())))) ())))))) (true (shen.sys-error shen.yacc_cases))))
|
64
64
|
|
65
|
-
(defun shen.cc_body (
|
65
|
+
(defun shen.cc_body (V2143) (cond ((and (cons? V2143) (and (cons? (tl V2143)) (= () (tl (tl V2143))))) (shen.syntax (hd V2143) Stream (hd (tl V2143)))) (true (shen.sys-error shen.cc_body))))
|
66
66
|
|
67
|
-
(defun shen.syntax (
|
67
|
+
(defun shen.syntax (V2144 V2145 V2146) (cond ((and (= () V2144) (and (cons? V2146) (and (= where (hd V2146)) (and (cons? (tl V2146)) (and (cons? (tl (tl V2146))) (= () (tl (tl (tl V2146))))))))) (cons if (cons (shen.semantics (hd (tl V2146))) (cons (cons shen.pair (cons (cons hd (cons V2145 ())) (cons (shen.semantics (hd (tl (tl V2146)))) ()))) (cons (cons fail ()) ()))))) ((= () V2144) (cons shen.pair (cons (cons hd (cons V2145 ())) (cons (shen.semantics V2146) ())))) ((cons? V2144) (if (shen.grammar_symbol? (hd V2144)) (shen.recursive_descent V2144 V2145 V2146) (if (variable? (hd V2144)) (shen.variable-match V2144 V2145 V2146) (if (shen.jump_stream? (hd V2144)) (shen.jump_stream V2144 V2145 V2146) (if (shen.terminal? (hd V2144)) (shen.check_stream V2144 V2145 V2146) (if (cons? (hd V2144)) (shen.list-stream (shen.decons (hd V2144)) (tl V2144) V2145 V2146) (simple-error (shen.app (hd V2144) " is not legal syntax
|
68
68
|
" shen.a)))))))) (true (shen.sys-error shen.syntax))))
|
69
69
|
|
70
|
-
(defun shen.
|
70
|
+
(defun shen.list-stream (V2147 V2148 V2149 V2150) (let Test (cons and (cons (cons cons? (cons (cons hd (cons V2149 ())) ())) (cons (cons cons? (cons (cons hd (cons (cons hd (cons V2149 ())) ())) ())) ()))) (let Placeholder (gensym shen.place) (let RunOn (shen.syntax V2148 (cons shen.pair (cons (cons tl (cons (cons hd (cons V2149 ())) ())) (cons (cons hd (cons (cons tl (cons V2149 ())) ())) ()))) V2150) (let Action (shen.insert-runon RunOn Placeholder (shen.syntax V2147 (cons shen.pair (cons (cons hd (cons (cons hd (cons V2149 ())) ())) (cons (cons hd (cons (cons tl (cons V2149 ())) ())) ()))) Placeholder)) (cons if (cons Test (cons Action (cons (cons fail ()) ())))))))))
|
71
71
|
|
72
|
-
(defun shen.decons (
|
72
|
+
(defun shen.decons (V2151) (cond ((and (cons? V2151) (and (= cons (hd V2151)) (and (cons? (tl V2151)) (and (cons? (tl (tl V2151))) (and (= () (hd (tl (tl V2151)))) (= () (tl (tl (tl V2151))))))))) (cons (hd (tl V2151)) ())) ((and (cons? V2151) (and (= cons (hd V2151)) (and (cons? (tl V2151)) (and (cons? (tl (tl V2151))) (= () (tl (tl (tl V2151)))))))) (cons (hd (tl V2151)) (shen.decons (hd (tl (tl V2151)))))) (true V2151)))
|
73
73
|
|
74
|
-
(defun shen.
|
74
|
+
(defun shen.insert-runon (V2162 V2163 V2164) (cond ((and (cons? V2164) (and (= shen.pair (hd V2164)) (and (cons? (tl V2164)) (and (cons? (tl (tl V2164))) (and (= () (tl (tl (tl V2164)))) (= (hd (tl (tl V2164))) V2163)))))) V2162) ((cons? V2164) (map (lambda Z (shen.insert-runon V2162 V2163 Z)) V2164)) (true V2164)))
|
75
75
|
|
76
|
-
(defun shen.
|
76
|
+
(defun shen.strip-pathname (V2170) (cond ((not (element? "." V2170)) V2170) ((cons? V2170) (shen.strip-pathname (tl V2170))) (true (shen.sys-error shen.strip-pathname))))
|
77
77
|
|
78
|
-
(defun shen.
|
78
|
+
(defun shen.recursive_descent (V2171 V2172 V2173) (cond ((cons? V2171) (let Test (cons (hd V2171) (cons V2172 ())) (let Action (shen.syntax (tl V2171) (concat Parse_ (hd V2171)) V2173) (let Else (cons fail ()) (cons let (cons (concat Parse_ (hd V2171)) (cons Test (cons (cons if (cons (cons not (cons (cons = (cons (cons fail ()) (cons (concat Parse_ (hd V2171)) ()))) ())) (cons Action (cons Else ())))) ())))))))) (true (shen.sys-error shen.recursive_descent))))
|
79
79
|
|
80
|
-
(defun shen.
|
80
|
+
(defun shen.variable-match (V2174 V2175 V2176) (cond ((cons? V2174) (let Test (cons cons? (cons (cons hd (cons V2175 ())) ())) (let Action (cons let (cons (concat Parse_ (hd V2174)) (cons (cons hd (cons (cons hd (cons V2175 ())) ())) (cons (shen.syntax (tl V2174) (cons shen.pair (cons (cons tl (cons (cons hd (cons V2175 ())) ())) (cons (cons shen.hdtl (cons V2175 ())) ()))) V2176) ())))) (let Else (cons fail ()) (cons if (cons Test (cons Action (cons Else ())))))))) (true (shen.sys-error shen.variable-match))))
|
81
81
|
|
82
|
-
(defun shen.
|
82
|
+
(defun shen.terminal? (V2185) (cond ((cons? V2185) false) ((variable? V2185) false) (true true)))
|
83
83
|
|
84
|
-
(defun shen.
|
84
|
+
(defun shen.jump_stream? (V2190) (cond ((= V2190 _) true) (true false)))
|
85
85
|
|
86
|
-
(defun shen.
|
86
|
+
(defun shen.check_stream (V2191 V2192 V2193) (cond ((cons? V2191) (let Test (cons and (cons (cons cons? (cons (cons hd (cons V2192 ())) ())) (cons (cons = (cons (hd V2191) (cons (cons hd (cons (cons hd (cons V2192 ())) ())) ()))) ()))) (let Action (shen.syntax (tl V2191) (cons shen.pair (cons (cons tl (cons (cons hd (cons V2192 ())) ())) (cons (cons shen.hdtl (cons V2192 ())) ()))) V2193) (let Else (cons fail ()) (cons if (cons Test (cons Action (cons Else ())))))))) (true (shen.sys-error shen.check_stream))))
|
87
87
|
|
88
|
-
(defun shen.
|
88
|
+
(defun shen.jump_stream (V2194 V2195 V2196) (cond ((cons? V2194) (let Test (cons cons? (cons (cons hd (cons V2195 ())) ())) (let Action (shen.syntax (tl V2194) (cons shen.pair (cons (cons tl (cons (cons hd (cons V2195 ())) ())) (cons (cons shen.hdtl (cons V2195 ())) ()))) V2196) (let Else (cons fail ()) (cons if (cons Test (cons Action (cons Else ())))))))) (true (shen.sys-error shen.jump_stream))))
|
89
89
|
|
90
|
-
(defun shen.
|
90
|
+
(defun shen.semantics (V2197) (cond ((= () V2197) ()) ((shen.grammar_symbol? V2197) (cons shen.hdtl (cons (concat Parse_ V2197) ()))) ((variable? V2197) (concat Parse_ V2197)) ((and (cons? V2197) (and (= function (hd V2197)) (and (cons? (tl V2197)) (= () (tl (tl V2197)))))) V2197) ((cons? V2197) (map shen.semantics V2197)) (true V2197)))
|
91
91
|
|
92
|
-
(defun shen.
|
92
|
+
(defun shen.snd-or-fail (V2204) (cond ((and (cons? V2204) (and (cons? (tl V2204)) (= () (tl (tl V2204))))) (hd (tl V2204))) (true (fail))))
|
93
93
|
|
94
94
|
(defun fail () shen.fail!)
|
95
95
|
|
96
|
-
(defun shen.pair (
|
96
|
+
(defun shen.pair (V2205 V2206) (cons V2205 (cons V2206 ())))
|
97
97
|
|
98
|
-
(defun shen.hdtl (
|
98
|
+
(defun shen.hdtl (V2207) (hd (tl V2207)))
|
99
99
|
|
100
|
-
(defun <!> (
|
100
|
+
(defun <!> (V2214) (cond ((and (cons? V2214) (and (cons? (tl V2214)) (= () (tl (tl V2214))))) (cons () (cons (hd V2214) ()))) (true (fail))))
|
101
101
|
|
102
|
-
(defun <e> (
|
103
|
-
|
104
|
-
(defun shen.catchkill (V2208) (cons trap-error (cons V2208 (cons (cons lambda (cons E (cons (cons shen.analyse-kill (cons E ())) ()))) ()))))
|
105
|
-
|
106
|
-
(defun shen.analyse-kill (V2209) (let String (error-to-string V2209) (if (= String "Shen YACC kill") (fail) (simple-error String))))
|
107
|
-
|
108
|
-
(defun kill () (simple-error "Shen YACC kill"))
|
102
|
+
(defun <e> (V2219) (cond ((and (cons? V2219) (and (cons? (tl V2219)) (= () (tl (tl V2219))))) (cons (hd V2219) (cons () ()))) (true (shen.sys-error <e>))))
|
109
103
|
|
110
104
|
|
111
105
|
|
metadata
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shen-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.8.0
|
5
|
+
prerelease:
|
5
6
|
platform: ruby
|
6
7
|
authors:
|
7
8
|
- Greg Spurrier
|
@@ -9,11 +10,12 @@ authors:
|
|
9
10
|
autorequire:
|
10
11
|
bindir: bin
|
11
12
|
cert_chain: []
|
12
|
-
date: 2013-
|
13
|
+
date: 2013-11-29 00:00:00.000000000 Z
|
13
14
|
dependencies:
|
14
15
|
- !ruby/object:Gem::Dependency
|
15
16
|
name: rspec
|
16
17
|
requirement: !ruby/object:Gem::Requirement
|
18
|
+
none: false
|
17
19
|
requirements:
|
18
20
|
- - ~>
|
19
21
|
- !ruby/object:Gem::Version
|
@@ -21,12 +23,13 @@ dependencies:
|
|
21
23
|
type: :development
|
22
24
|
prerelease: false
|
23
25
|
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
none: false
|
24
27
|
requirements:
|
25
28
|
- - ~>
|
26
29
|
- !ruby/object:Gem::Version
|
27
30
|
version: '2.12'
|
28
31
|
description: ShenRuby is a port of the Shen programming language to Ruby. It currently
|
29
|
-
supports Shen version
|
32
|
+
supports Shen version 14.
|
30
33
|
email:
|
31
34
|
- greg@sourcematters.org
|
32
35
|
executables:
|
@@ -168,27 +171,28 @@ files:
|
|
168
171
|
homepage: https://github.com/gregspurrier/shen-ruby
|
169
172
|
licenses:
|
170
173
|
- Shen License
|
171
|
-
metadata: {}
|
172
174
|
post_install_message:
|
173
175
|
rdoc_options: []
|
174
176
|
require_paths:
|
175
177
|
- lib
|
176
178
|
- shen/lib
|
177
179
|
required_ruby_version: !ruby/object:Gem::Requirement
|
180
|
+
none: false
|
178
181
|
requirements:
|
179
|
-
- - '>='
|
182
|
+
- - ! '>='
|
180
183
|
- !ruby/object:Gem::Version
|
181
184
|
version: 1.9.3
|
182
185
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
186
|
+
none: false
|
183
187
|
requirements:
|
184
|
-
- - '>='
|
188
|
+
- - ! '>='
|
185
189
|
- !ruby/object:Gem::Version
|
186
190
|
version: '0'
|
187
191
|
requirements: []
|
188
192
|
rubyforge_project:
|
189
|
-
rubygems_version:
|
193
|
+
rubygems_version: 1.8.23
|
190
194
|
signing_key:
|
191
|
-
specification_version:
|
195
|
+
specification_version: 3
|
192
196
|
summary: ShenRuby is a Ruby port of the Shen programming language
|
193
197
|
test_files:
|
194
198
|
- spec/kl/cons_spec.rb
|
checksums.yaml
DELETED
@@ -1,7 +0,0 @@
|
|
1
|
-
---
|
2
|
-
SHA1:
|
3
|
-
metadata.gz: 6b5c1f5512d88233c44e5b0c849748d47127d291
|
4
|
-
data.tar.gz: 84655e2af667611b2bd7a54a1893b798d055ae94
|
5
|
-
SHA512:
|
6
|
-
metadata.gz: 1c7ec95bdf8959aca387542066d81a60c880d0a12829824c5f5881dcd2d414e2858b593e4577956a297d2c20e75ab969a1197115ea0d358c0f1e210567106614
|
7
|
-
data.tar.gz: 3d05dff268f7a351e95acb22c4a0e0dec82d766b9eabd1b54d63162fd9be0d392d540a1ef74ce9920a0fd3f45e3b8671da357fb15378f6662fc81ee45f80accb
|