nendo 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/nendo +33 -2
- data/example/cgi/dekamoji.cgi +78 -43
- data/lib/debug/syslog.nnd +42 -0
- data/lib/debug/syslog.nndc +53 -0
- data/lib/init.nnd +61 -9
- data/lib/init.nndc +9674 -9037
- data/lib/nendo.rb +99 -10
- data/lib/text/html-lite.nnd +3 -2
- data/lib/text/html-lite.nndc +2864 -2357
- data/lib/text/tree.nnd +4 -2
- data/lib/text/tree.nndc +183 -177
- metadata +17 -6
data/lib/text/tree.nnd
CHANGED
@@ -1,9 +1,11 @@
|
|
1
|
+
;;-*- mode: nendo; syntax: scheme -*-;;
|
1
2
|
;;;
|
2
|
-
;;;
|
3
|
+
;;; text/tree.scm - lightweight text generation
|
3
4
|
;;;
|
4
5
|
;;; Public Domain.
|
5
|
-
;;; $Id:
|
6
|
+
;;; $Id:
|
6
7
|
;;;
|
8
|
+
;;; ported for Nendo language by Kiyoka Nishiyama.
|
7
9
|
|
8
10
|
(require "stringio")
|
9
11
|
|
data/lib/text/tree.nndc
CHANGED
@@ -1,215 +1,221 @@
|
|
1
1
|
|
2
2
|
callProcedure( 'require',
|
3
3
|
begin
|
4
|
-
if
|
4
|
+
if @global_lisp_binding.has_key?('_require') then
|
5
5
|
@_require
|
6
6
|
else raise NameError.new( "Error: undefined variable _require", "_require" ) end
|
7
|
-
rescue => __e ; __e.set_backtrace( ["./lib/text/tree.nnd:
|
7
|
+
rescue => __e ; __e.set_backtrace( ["./lib/text/tree.nnd:10"] + __e.backtrace ) ; raise __e
|
8
8
|
end ,
|
9
9
|
Cell.new(
|
10
10
|
"stringio"
|
11
11
|
))
|
12
12
|
#--------------------
|
13
13
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
@_null_QUMARK
|
27
|
-
else raise NameError.new( "Error: undefined variable _null_QUMARK", "_null_QUMARK" ) end
|
28
|
-
rescue => __e ; __e.set_backtrace( ["./lib/text/tree.nnd:15"] + __e.backtrace ) ; raise __e
|
29
|
-
end ,
|
30
|
-
Cell.new(
|
14
|
+
begin
|
15
|
+
@global_lisp_binding['_write_MIMARKtree'] = true
|
16
|
+
@_write_MIMARKtree =
|
17
|
+
Proc.new { |_tree,*__rest__| _out = __rest__[0] ;
|
18
|
+
begin
|
19
|
+
___lambda = lambda { |_out|
|
20
|
+
begin
|
21
|
+
___lambda = lambda { |_loop|
|
22
|
+
_loop =
|
23
|
+
Proc.new { |_tree|
|
24
|
+
if (
|
25
|
+
callProcedure( 'null?',
|
31
26
|
begin
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
true
|
39
|
-
end
|
40
|
-
else
|
41
|
-
if (
|
42
|
-
callProcedure( 'pair?',
|
27
|
+
if @global_lisp_binding.has_key?('_null_QUMARK') then
|
28
|
+
@_null_QUMARK
|
29
|
+
else raise NameError.new( "Error: undefined variable _null_QUMARK", "_null_QUMARK" ) end
|
30
|
+
rescue => __e ; __e.set_backtrace( ["./lib/text/tree.nnd:17"] + __e.backtrace ) ; raise __e
|
31
|
+
end ,
|
32
|
+
Cell.new(
|
43
33
|
begin
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
34
|
+
_tree
|
35
|
+
rescue => __e ; __e.set_backtrace( ["./lib/text/tree.nnd:20"] + __e.backtrace ) ; raise __e
|
36
|
+
end
|
37
|
+
))
|
38
|
+
) then
|
39
|
+
begin
|
40
|
+
true
|
41
|
+
end
|
42
|
+
else
|
43
|
+
if (
|
44
|
+
callProcedure( 'pair?',
|
50
45
|
begin
|
51
|
-
|
46
|
+
if @global_lisp_binding.has_key?('_pair_QUMARK') then
|
47
|
+
@_pair_QUMARK
|
48
|
+
else raise NameError.new( "Error: undefined variable _pair_QUMARK", "_pair_QUMARK" ) end
|
52
49
|
rescue => __e ; __e.set_backtrace( ["./lib/text/tree.nnd:18"] + __e.backtrace ) ; raise __e
|
53
|
-
end
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
end ,
|
72
|
-
Cell.new(
|
50
|
+
end ,
|
51
|
+
Cell.new(
|
52
|
+
begin
|
53
|
+
_tree
|
54
|
+
rescue => __e ; __e.set_backtrace( ["./lib/text/tree.nnd:20"] + __e.backtrace ) ; raise __e
|
55
|
+
end
|
56
|
+
))
|
57
|
+
) then
|
58
|
+
begin
|
59
|
+
callProcedure( 'write-tree',
|
60
|
+
begin
|
61
|
+
if @global_lisp_binding.has_key?('_write_MIMARKtree') then
|
62
|
+
@_write_MIMARKtree
|
63
|
+
else raise NameError.new( "Error: undefined variable _write_MIMARKtree", "_write_MIMARKtree" ) end
|
64
|
+
rescue => __e ; __e.set_backtrace( ["./lib/text/tree.nnd:18"] + __e.backtrace ) ; raise __e
|
65
|
+
end ,
|
66
|
+
Cell.new(
|
67
|
+
callProcedure( 'car',
|
73
68
|
begin
|
74
|
-
|
69
|
+
if @global_lisp_binding.has_key?('_car') then
|
70
|
+
@_car
|
71
|
+
else raise NameError.new( "Error: undefined variable _car", "_car" ) end
|
75
72
|
rescue => __e ; __e.set_backtrace( ["./lib/text/tree.nnd:18"] + __e.backtrace ) ; raise __e
|
76
|
-
end
|
77
|
-
|
73
|
+
end ,
|
74
|
+
Cell.new(
|
75
|
+
begin
|
76
|
+
_tree
|
77
|
+
rescue => __e ; __e.set_backtrace( ["./lib/text/tree.nnd:20"] + __e.backtrace ) ; raise __e
|
78
|
+
end
|
79
|
+
)) ,Cell.new(
|
80
|
+
begin
|
81
|
+
_out
|
82
|
+
rescue => __e ; __e.set_backtrace( ["./lib/text/tree.nnd:18"] + __e.backtrace ) ; raise __e
|
83
|
+
end
|
84
|
+
)))
|
85
|
+
callProcedure( 'loop',
|
78
86
|
begin
|
79
|
-
|
80
|
-
rescue => __e ; __e.set_backtrace( ["./lib/text/tree.nnd:
|
81
|
-
end
|
82
|
-
|
83
|
-
|
84
|
-
begin
|
85
|
-
_loop
|
86
|
-
rescue => __e ; __e.set_backtrace( ["./lib/text/tree.nnd:16"] + __e.backtrace ) ; raise __e
|
87
|
-
end ,
|
88
|
-
Cell.new(
|
89
|
-
callProcedure( 'cdr',
|
90
|
-
begin
|
91
|
-
if (self.instance_variables.include?(:@_cdr)) then
|
92
|
-
@_cdr
|
93
|
-
else raise NameError.new( "Error: undefined variable _cdr", "_cdr" ) end
|
94
|
-
rescue => __e ; __e.set_backtrace( ["./lib/text/tree.nnd:16"] + __e.backtrace ) ; raise __e
|
95
|
-
end ,
|
96
|
-
Cell.new(
|
87
|
+
_loop
|
88
|
+
rescue => __e ; __e.set_backtrace( ["./lib/text/tree.nnd:18"] + __e.backtrace ) ; raise __e
|
89
|
+
end ,
|
90
|
+
Cell.new(
|
91
|
+
callProcedure( 'cdr',
|
97
92
|
begin
|
98
|
-
|
93
|
+
if @global_lisp_binding.has_key?('_cdr') then
|
94
|
+
@_cdr
|
95
|
+
else raise NameError.new( "Error: undefined variable _cdr", "_cdr" ) end
|
99
96
|
rescue => __e ; __e.set_backtrace( ["./lib/text/tree.nnd:18"] + __e.backtrace ) ; raise __e
|
100
|
-
end
|
101
|
-
|
102
|
-
))
|
103
|
-
end
|
104
|
-
else
|
105
|
-
if (
|
106
|
-
true
|
107
|
-
) then
|
108
|
-
begin
|
109
|
-
begin
|
110
|
-
_out.print(
|
97
|
+
end ,
|
98
|
+
Cell.new(
|
111
99
|
begin
|
112
100
|
_tree
|
113
|
-
rescue => __e ; __e.set_backtrace( ["./lib/text/tree.nnd:
|
101
|
+
rescue => __e ; __e.set_backtrace( ["./lib/text/tree.nnd:20"] + __e.backtrace ) ; raise __e
|
114
102
|
end
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
103
|
+
))
|
104
|
+
))
|
105
|
+
end
|
106
|
+
else
|
107
|
+
if (
|
108
|
+
true
|
109
|
+
) then
|
110
|
+
begin
|
111
|
+
begin
|
112
|
+
_out.print(
|
113
|
+
begin
|
114
|
+
_tree
|
115
|
+
rescue => __e ; __e.set_backtrace( ["./lib/text/tree.nnd:20"] + __e.backtrace ) ; raise __e
|
116
|
+
end
|
117
|
+
)
|
118
|
+
rescue => __e ; __e.set_backtrace( ["./lib/text/tree.nnd:20"] + __e.backtrace ) ; raise __e
|
119
|
+
end
|
120
|
+
end
|
121
|
+
else
|
122
|
+
Nil.new
|
123
|
+
end
|
124
|
+
end
|
125
|
+
end
|
126
|
+
}
|
127
|
+
callProcedure( 'loop',
|
131
128
|
begin
|
132
|
-
|
129
|
+
_loop
|
133
130
|
rescue => __e ; __e.set_backtrace( ["./lib/text/tree.nnd:18"] + __e.backtrace ) ; raise __e
|
134
|
-
end
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
end ,
|
149
|
-
Cell.new(
|
150
|
-
begin
|
151
|
-
_out
|
152
|
-
rescue => __e ; __e.set_backtrace( ["./lib/text/tree.nnd:16"] + __e.backtrace ) ; raise __e
|
153
|
-
end
|
154
|
-
))
|
155
|
-
) then
|
156
|
-
begin
|
157
|
-
STDOUT
|
158
|
-
rescue => __e ; __e.set_backtrace( ["./lib/text/tree.nnd:12"] + __e.backtrace ) ; raise __e
|
159
|
-
end
|
160
|
-
else
|
161
|
-
callProcedure( 'car',
|
131
|
+
end ,
|
132
|
+
Cell.new(
|
133
|
+
begin
|
134
|
+
_tree
|
135
|
+
rescue => __e ; __e.set_backtrace( ["./lib/text/tree.nnd:20"] + __e.backtrace ) ; raise __e
|
136
|
+
end
|
137
|
+
))
|
138
|
+
} ; ___lambda.call(
|
139
|
+
nil
|
140
|
+
)
|
141
|
+
end
|
142
|
+
} ; ___lambda.call(
|
143
|
+
if (
|
144
|
+
callProcedure( 'null?',
|
162
145
|
begin
|
163
|
-
if
|
164
|
-
@
|
165
|
-
else raise NameError.new( "Error: undefined variable
|
166
|
-
rescue => __e ; __e.set_backtrace( ["./lib/text/tree.nnd:
|
146
|
+
if @global_lisp_binding.has_key?('_null_QUMARK') then
|
147
|
+
@_null_QUMARK
|
148
|
+
else raise NameError.new( "Error: undefined variable _null_QUMARK", "_null_QUMARK" ) end
|
149
|
+
rescue => __e ; __e.set_backtrace( ["./lib/text/tree.nnd:17"] + __e.backtrace ) ; raise __e
|
167
150
|
end ,
|
168
151
|
Cell.new(
|
169
152
|
begin
|
170
153
|
_out
|
171
|
-
rescue => __e ; __e.set_backtrace( ["./lib/text/tree.nnd:
|
154
|
+
rescue => __e ; __e.set_backtrace( ["./lib/text/tree.nnd:18"] + __e.backtrace ) ; raise __e
|
172
155
|
end
|
173
156
|
))
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
157
|
+
) then
|
158
|
+
begin
|
159
|
+
STDOUT
|
160
|
+
rescue => __e ; __e.set_backtrace( ["./lib/text/tree.nnd:14"] + __e.backtrace ) ; raise __e
|
161
|
+
end
|
162
|
+
else
|
163
|
+
callProcedure( 'car',
|
164
|
+
begin
|
165
|
+
if @global_lisp_binding.has_key?('_car') then
|
166
|
+
@_car
|
167
|
+
else raise NameError.new( "Error: undefined variable _car", "_car" ) end
|
168
|
+
rescue => __e ; __e.set_backtrace( ["./lib/text/tree.nnd:18"] + __e.backtrace ) ; raise __e
|
169
|
+
end ,
|
170
|
+
Cell.new(
|
171
|
+
begin
|
172
|
+
_out
|
173
|
+
rescue => __e ; __e.set_backtrace( ["./lib/text/tree.nnd:18"] + __e.backtrace ) ; raise __e
|
174
|
+
end
|
175
|
+
))
|
176
|
+
end
|
177
|
+
)
|
178
|
+
end
|
179
|
+
}
|
180
|
+
end
|
178
181
|
#--------------------
|
179
182
|
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
@_write_MIMARKtree
|
188
|
-
else raise NameError.new( "Error: undefined variable _write_MIMARKtree", "_write_MIMARKtree" ) end
|
189
|
-
rescue => __e ; __e.set_backtrace( ["./lib/text/tree.nnd:22"] + __e.backtrace ) ; raise __e
|
190
|
-
end ,
|
191
|
-
Cell.new(
|
183
|
+
begin
|
184
|
+
@global_lisp_binding['_tree_MIMARK_GTMARKstring'] = true
|
185
|
+
@_tree_MIMARK_GTMARKstring =
|
186
|
+
Proc.new { |_tree|
|
187
|
+
begin
|
188
|
+
___lambda = lambda { |_sio|
|
189
|
+
callProcedure( 'write-tree',
|
192
190
|
begin
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
191
|
+
if @global_lisp_binding.has_key?('_write_MIMARKtree') then
|
192
|
+
@_write_MIMARKtree
|
193
|
+
else raise NameError.new( "Error: undefined variable _write_MIMARKtree", "_write_MIMARKtree" ) end
|
194
|
+
rescue => __e ; __e.set_backtrace( ["./lib/text/tree.nnd:24"] + __e.backtrace ) ; raise __e
|
195
|
+
end ,
|
196
|
+
Cell.new(
|
197
|
+
begin
|
198
|
+
_tree
|
199
|
+
rescue => __e ; __e.set_backtrace( ["./lib/text/tree.nnd:24"] + __e.backtrace ) ; raise __e
|
200
|
+
end ,Cell.new(
|
201
|
+
begin
|
202
|
+
_sio
|
203
|
+
rescue => __e ; __e.set_backtrace( ["./lib/text/tree.nnd:24"] + __e.backtrace ) ; raise __e
|
204
|
+
end
|
205
|
+
)))
|
207
206
|
begin
|
208
|
-
|
209
|
-
""
|
207
|
+
_sio.string(
|
210
208
|
)
|
211
|
-
rescue => __e ; __e.set_backtrace( ["./lib/text/tree.nnd:
|
209
|
+
rescue => __e ; __e.set_backtrace( ["./lib/text/tree.nnd:25"] + __e.backtrace ) ; raise __e
|
212
210
|
end
|
213
|
-
|
214
|
-
|
215
|
-
|
211
|
+
} ; ___lambda.call(
|
212
|
+
begin
|
213
|
+
StringIO.new(
|
214
|
+
""
|
215
|
+
)
|
216
|
+
rescue => __e ; __e.set_backtrace( ["./lib/text/tree.nnd:23"] + __e.backtrace ) ; raise __e
|
217
|
+
end
|
218
|
+
)
|
219
|
+
end
|
220
|
+
}
|
221
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nendo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 0
|
7
|
+
- 3
|
8
|
+
- 1
|
9
|
+
version: 0.3.1
|
5
10
|
platform: ruby
|
6
11
|
authors:
|
7
12
|
- Kiyoka Nishiyama
|
@@ -9,7 +14,7 @@ autorequire:
|
|
9
14
|
bindir: bin
|
10
15
|
cert_chain: []
|
11
16
|
|
12
|
-
date: 2010-04-
|
17
|
+
date: 2010-04-30 00:00:00 +09:00
|
13
18
|
default_executable: nendo
|
14
19
|
dependencies: []
|
15
20
|
|
@@ -32,6 +37,8 @@ files:
|
|
32
37
|
- example/html-lite-sample.nnd
|
33
38
|
- example/scratch.nnd
|
34
39
|
- example/tak.nnd
|
40
|
+
- lib/debug/syslog.nnd
|
41
|
+
- lib/debug/syslog.nndc
|
35
42
|
- lib/init.nnd
|
36
43
|
- lib/init.nndc
|
37
44
|
- lib/nendo.rb
|
@@ -42,6 +49,8 @@ files:
|
|
42
49
|
- README
|
43
50
|
has_rdoc: true
|
44
51
|
homepage: http://github.com/kiyoka/nendo
|
52
|
+
licenses: []
|
53
|
+
|
45
54
|
post_install_message:
|
46
55
|
rdoc_options:
|
47
56
|
- --charset=UTF-8
|
@@ -51,20 +60,22 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
51
60
|
requirements:
|
52
61
|
- - ">="
|
53
62
|
- !ruby/object:Gem::Version
|
63
|
+
segments:
|
64
|
+
- 0
|
54
65
|
version: "0"
|
55
|
-
version:
|
56
66
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
57
67
|
requirements:
|
58
68
|
- - ">="
|
59
69
|
- !ruby/object:Gem::Version
|
70
|
+
segments:
|
71
|
+
- 0
|
60
72
|
version: "0"
|
61
|
-
version:
|
62
73
|
requirements: []
|
63
74
|
|
64
75
|
rubyforge_project:
|
65
|
-
rubygems_version: 1.3.
|
76
|
+
rubygems_version: 1.3.6
|
66
77
|
signing_key:
|
67
|
-
specification_version:
|
78
|
+
specification_version: 3
|
68
79
|
summary: Nendo is a dialect of Lisp.
|
69
80
|
test_files: []
|
70
81
|
|