flor 0.9.5 → 0.10.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (91) hide show
  1. data/CHANGELOG.md +10 -0
  2. data/Makefile +13 -5
  3. data/README.md +0 -35
  4. data/flor.gemspec +1 -0
  5. data/lib/flor.rb +6 -24
  6. data/lib/flor/changes.rb +26 -0
  7. data/lib/flor/colours.rb +65 -31
  8. data/lib/flor/conf.rb +84 -54
  9. data/lib/flor/core.rb +0 -23
  10. data/lib/flor/core/executor.rb +12 -42
  11. data/lib/flor/core/node.rb +19 -24
  12. data/lib/flor/core/procedure.rb +13 -24
  13. data/lib/flor/core/texecutor.rb +10 -28
  14. data/lib/flor/deep.rb +152 -0
  15. data/lib/flor/djan.rb +200 -0
  16. data/lib/flor/dollar.rb +0 -24
  17. data/lib/flor/errors.rb +0 -24
  18. data/lib/flor/flor.rb +43 -296
  19. data/lib/flor/id.rb +90 -0
  20. data/lib/flor/log.rb +12 -35
  21. data/lib/flor/migrations/0002_cunit_and_munit.rb +86 -0
  22. data/lib/flor/parser.rb +40 -46
  23. data/lib/flor/pcore/_arr.rb +0 -24
  24. data/lib/flor/pcore/_atom.rb +0 -24
  25. data/lib/flor/pcore/_att.rb +3 -25
  26. data/lib/flor/pcore/_dump.rb +0 -24
  27. data/lib/flor/pcore/_err.rb +0 -24
  28. data/lib/flor/pcore/_happly.rb +0 -24
  29. data/lib/flor/pcore/_obj.rb +0 -24
  30. data/lib/flor/pcore/_skip.rb +0 -24
  31. data/lib/flor/pcore/arith.rb +0 -24
  32. data/lib/flor/pcore/break.rb +0 -24
  33. data/lib/flor/pcore/case.rb +127 -0
  34. data/lib/flor/pcore/cmp.rb +0 -24
  35. data/lib/flor/pcore/cond.rb +24 -24
  36. data/lib/flor/pcore/cursor.rb +0 -24
  37. data/lib/flor/pcore/define.rb +0 -24
  38. data/lib/flor/pcore/fail.rb +0 -24
  39. data/lib/flor/pcore/if.rb +39 -0
  40. data/lib/flor/pcore/loop.rb +0 -24
  41. data/lib/flor/pcore/map.rb +0 -24
  42. data/lib/flor/pcore/match.rb +0 -24
  43. data/lib/flor/pcore/move.rb +0 -24
  44. data/lib/flor/pcore/noeval.rb +0 -24
  45. data/lib/flor/pcore/noret.rb +0 -24
  46. data/lib/flor/pcore/push.rb +1 -25
  47. data/lib/flor/pcore/rand.rb +59 -0
  48. data/lib/flor/pcore/sequence.rb +0 -24
  49. data/lib/flor/pcore/set.rb +0 -24
  50. data/lib/flor/pcore/stall.rb +0 -24
  51. data/lib/flor/pcore/until.rb +0 -24
  52. data/lib/flor/pcore/val.rb +0 -24
  53. data/lib/flor/punit/cancel.rb +0 -24
  54. data/lib/flor/punit/cmap.rb +0 -24
  55. data/lib/flor/punit/concurrence.rb +54 -24
  56. data/lib/flor/punit/every.rb +0 -24
  57. data/lib/flor/punit/graft.rb +41 -0
  58. data/lib/flor/punit/on.rb +0 -24
  59. data/lib/flor/punit/schedule.rb +0 -24
  60. data/lib/flor/punit/signal.rb +0 -24
  61. data/lib/flor/punit/sleep.rb +0 -24
  62. data/lib/flor/punit/task.rb +0 -26
  63. data/lib/flor/punit/trace.rb +0 -24
  64. data/lib/flor/punit/trap.rb +0 -24
  65. data/lib/flor/to_string.rb +4 -25
  66. data/lib/flor/tools/env.rb +0 -23
  67. data/lib/flor/tools/shell.rb +810 -0
  68. data/lib/flor/unit.rb +0 -23
  69. data/lib/flor/unit/executor.rb +35 -31
  70. data/lib/flor/unit/ganger.rb +9 -34
  71. data/lib/flor/unit/hooker.rb +5 -25
  72. data/lib/flor/unit/journal.rb +0 -23
  73. data/lib/flor/unit/loader.rb +63 -94
  74. data/lib/flor/unit/logger.rb +8 -27
  75. data/lib/flor/unit/models.rb +0 -24
  76. data/lib/flor/unit/models/execution.rb +13 -24
  77. data/lib/flor/unit/models/pointer.rb +0 -24
  78. data/lib/flor/unit/models/timer.rb +0 -24
  79. data/lib/flor/unit/models/trace.rb +0 -24
  80. data/lib/flor/unit/models/trap.rb +0 -24
  81. data/lib/flor/unit/scheduler.rb +157 -128
  82. data/lib/flor/unit/storage.rb +224 -167
  83. data/lib/flor/unit/taskers.rb +38 -25
  84. data/lib/flor/unit/waiter.rb +7 -26
  85. data/lib/flor/unit/wlist.rb +8 -24
  86. metadata +28 -7
  87. data/fail.txt +0 -16
  88. data/intercepted.txt +0 -123
  89. data/lib/flor/pcore/ife.rb +0 -56
  90. data/lib/flor/tools/repl.rb +0 -231
  91. data/out.txt +0 -206
@@ -1,32 +1,10 @@
1
- #--
2
- # Copyright (c) 2015-2017, John Mettraux, jmettraux+flor@gmail.com
3
- #
4
- # Permission is hereby granted, free of charge, to any person obtaining a copy
5
- # of this software and associated documentation files (the "Software"), to deal
6
- # in the Software without restriction, including without limitation the rights
7
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
- # copies of the Software, and to permit persons to whom the Software is
9
- # furnished to do so, subject to the following conditions:
10
- #
11
- # The above copyright notice and this permission notice shall be included in
12
- # all copies or substantial portions of the Software.
13
- #
14
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20
- # THE SOFTWARE.
21
- #
22
- # Made in Japan.
23
- #++
24
-
25
1
 
26
2
  module Flor
27
3
 
28
4
  def self.log_message(executor, m, opts={})
29
5
 
6
+ return if m['point'] == 'end'
7
+
30
8
  _c = colours(opts)
31
9
 
32
10
  nid = m['nid']
@@ -47,7 +25,7 @@ module Flor
47
25
  a << _c.dg
48
26
 
49
27
  if ex = (m['exid'] || '').split('.').last
50
- a << ex[-2..-1]
28
+ a << ex[-4..-1]
51
29
  a << ' '
52
30
  end
53
31
 
@@ -78,9 +56,9 @@ module Flor
78
56
  t || Node.new(executor, nd, m).lookup_tree(nid)
79
57
  t0 =
80
58
  if t
81
- " [#{rw}#{_c.yl}#{Flor.s_to_d(t[0], compact: true)}#{_c.dg} L#{t[2]}]"
59
+ " [#{rw}#{_c.yl}#{Flor.to_d(t[0], compact: true)}#{_c.dg} L#{t[2]}]"
82
60
  elsif nt
83
- " [#{_c.dg}#{Flor.s_to_d(nt[0], compact: true)}#{_c.dg} L#{nt[2]}]"
61
+ " [#{_c.dg}#{Flor.to_d(nt[0], compact: true)}#{_c.dg} L#{nt[2]}]"
84
62
  else
85
63
  ''
86
64
  end
@@ -98,7 +76,7 @@ module Flor
98
76
  a << tri
99
77
 
100
78
  cn = t ? " #{_c.dg}#{Flor.to_d(t[1], compact: true, inner: true)}" : ''
101
- cn = cn.length > 49 ? "#{cn[0, 49]}..." : cn
79
+ cn = Flor.truncate_string(cn, 49, "#{_c.dg}...#{_c.rs}")
102
80
  a << cn
103
81
 
104
82
  hp = nd && nd['heap']
@@ -112,7 +90,7 @@ module Flor
112
90
  fr = m['from'] ? " from #{m['from']}" : ''
113
91
  a << fr
114
92
 
115
- rt = ret_to_s(executor, m)
93
+ rt = ret_to_s(executor, m, _c)
116
94
  rt = rt.length > 0 ? " #{_c.lg}f.ret #{rt}" : ''
117
95
  a << rt
118
96
 
@@ -172,7 +150,7 @@ module Flor
172
150
  headers = opts[:headers]; headers = true if headers.nil?
173
151
  headers = true if opts[:title]
174
152
 
175
- h = "#{_c.yl}#{Flor.s_to_d(tree[0], compact: true)}"
153
+ h = "#{_c.yl}#{Flor.to_d(tree[0], compact: true)}"
176
154
  c = tree[1].is_a?(Array) ? '' : " #{_c.yl}#{tree[1]}"
177
155
  l = " #{_c.dg}L#{tree[2]}"
178
156
 
@@ -222,7 +200,7 @@ module Flor
222
200
  end
223
201
 
224
202
  s << ind << _c.dg << '| ' << nid << ' '
225
- s << _c.yl << Flor.s_to_d(tree[0], compact: true) << _c.dg << ' L' << tree[2]
203
+ s << _c.yl << Flor.to_d(tree[0], compact: true) << _c.dg << ' L' << tree[2]
226
204
 
227
205
  atts.each_with_index do |ct, i|
228
206
  print_flat_tree(ct, "_#{i}", opts)
@@ -241,12 +219,11 @@ module Flor
241
219
  opts[:out].puts(s.string) if is_root
242
220
  end
243
221
 
244
- def self.ret_to_s(executor, m)
222
+ def self.ret_to_s(executor, m, c)
245
223
 
246
224
  ret = (m['payload'] || {})['ret']
247
225
  s = Flor.to_d(ret, compact: true)
248
- l = s.length
249
- l < 35 ? s : "#{s[0, 35]}(...L#{l})"
226
+ Flor.truncate_string(s, 35, Proc.new { |x| "#{c.dg}... (L#{x})#{c.rs}" })
250
227
  end
251
228
 
252
229
  def self.nod_to_s(executor, n, opts, here=false)
@@ -255,7 +232,7 @@ module Flor
255
232
 
256
233
  t = n['tree'] || Node.new(executor, n, nil).lookup_tree(n['nid'])
257
234
  t = Flor.to_d(t, compact: true) if t
258
- t = t[0, 35] + '...' if t && t.length > 35
235
+ t = Flor.truncate_string(t, 42);
259
236
 
260
237
  h = {}
261
238
  %w[ parent cnid noreply dbg removed ].each do |k|
@@ -0,0 +1,86 @@
1
+
2
+ Sequel.migration do
3
+
4
+ up do
5
+
6
+ alter_table :flor_messages do
7
+
8
+ add_column :cunit, String
9
+ add_column :munit, String
10
+ end
11
+
12
+ alter_table :flor_executions do
13
+
14
+ add_column :cunit, String
15
+ add_column :munit, String
16
+ end
17
+
18
+ alter_table :flor_timers do
19
+
20
+ add_column :cunit, String
21
+ add_column :munit, String
22
+ end
23
+
24
+ alter_table :flor_traps do
25
+
26
+ add_column :cunit, String
27
+ add_column :munit, String
28
+ end
29
+
30
+ alter_table :flor_pointers do
31
+
32
+ add_column :cunit, String
33
+
34
+ add_column :mtime, String
35
+ add_column :munit, String
36
+ #
37
+ # those 2 could prove useful later on
38
+ end
39
+
40
+ alter_table :flor_traces do
41
+
42
+ add_column :cunit, String
43
+ end
44
+ end
45
+
46
+ down do
47
+
48
+ alter_table :flor_messages do
49
+
50
+ drop_column :cunit
51
+ drop_column :munit
52
+ end
53
+
54
+ alter_table :flor_executions do
55
+
56
+ drop_column :cunit
57
+ drop_column :munit
58
+ end
59
+
60
+ alter_table :flor_timers do
61
+
62
+ drop_column :cunit
63
+ drop_column :munit
64
+ end
65
+
66
+ alter_table :flor_traps do
67
+
68
+ drop_column :cunit
69
+ drop_column :munit
70
+ end
71
+
72
+ alter_table :flor_pointers do
73
+
74
+ drop_column :cunit
75
+
76
+ drop_column :mtime
77
+ drop_column :munit
78
+ end
79
+
80
+ alter_table :flor_traces do
81
+
82
+ drop_column :cunit
83
+ end
84
+ end
85
+ end
86
+
@@ -1,27 +1,3 @@
1
- #--
2
- # Copyright (c) 2015-2017, John Mettraux, jmettraux+flor@gmail.com
3
- #
4
- # Permission is hereby granted, free of charge, to any person obtaining a copy
5
- # of this software and associated documentation files (the "Software"), to deal
6
- # in the Software without restriction, including without limitation the rights
7
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
- # copies of the Software, and to permit persons to whom the Software is
9
- # furnished to do so, subject to the following conditions:
10
- #
11
- # The above copyright notice and this permission notice shall be included in
12
- # all copies or substantial portions of the Software.
13
- #
14
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20
- # THE SOFTWARE.
21
- #
22
- # Made in Japan.
23
- #++
24
-
25
1
 
26
2
  module Flor
27
3
 
@@ -29,6 +5,20 @@ module Flor
29
5
 
30
6
  # parsing
31
7
 
8
+ def ws_star(i); rex(nil, i, /[ \t]*/); end
9
+ def retnew(i); rex(nil, i, /[\r\n]*/); end
10
+ def dot(i); str(nil, i, '.'); end
11
+ def colon(i); str(nil, i, ':'); end
12
+ def comma(i); str(nil, i, ','); end
13
+ def bslash(i); str(nil, i, '\\'); end
14
+
15
+ def pstart(i); str(nil, i, '('); end
16
+ def pend(i); str(nil, i, ')'); end
17
+ def sbstart(i); str(nil, i, '['); end
18
+ def sbend(i); str(nil, i, ']'); end
19
+ def pbstart(i); str(nil, i, '{'); end
20
+ def pbend(i); str(nil, i, '}'); end
21
+
32
22
  def null(i); str(:null, i, 'null'); end
33
23
  def number(i); rex(:number, i, /-?[0-9]+(\.[0-9]+)?([eE][+-]?[0-9]+)?/); end
34
24
 
@@ -36,11 +26,18 @@ module Flor
36
26
  def fls(i); str(nil, i, 'false'); end
37
27
  def boolean(i); alt(:boolean, i, :tru, :fls); end
38
28
 
29
+ def rf_symbol(i); rex(nil, i, /[^.:;| \b\f\n\r\t"',()\[\]{}#\\]+/); end
30
+ def rf_square_index(i); alt(nil, i, :rf_symbol, :dqstring, :sqstring); end
31
+ def rf_square(i); seq(nil, i, :sbstart, :rf_square_index, :sbend); end
32
+ def rf_dot(i); seq(nil, i, :dot, :rf_symbol); end
33
+ def rf_index(i); alt(nil, i, :rf_dot, :rf_square); end
34
+ def reference(i); seq(:ref, i, :rf_symbol, :rf_index, '*'); end
35
+
39
36
  def dqstring(i)
40
37
 
41
38
  rex(:dqstring, i, %r{
42
39
  "(
43
- \\["bfnrt] |
40
+ \\["\\\/bfnrt] |
44
41
  \\u[0-9a-fA-F]{4} |
45
42
  [^"\\\b\f\n\r\t]
46
43
  )*"
@@ -51,7 +48,7 @@ module Flor
51
48
 
52
49
  rex(:sqstring, i, %r{
53
50
  '(
54
- \\['bfnrt] |
51
+ \\['\\\/bfnrt] |
55
52
  \\u[0-9a-fA-F]{4} |
56
53
  [^'\\\b\f\n\r\t]
57
54
  )*'
@@ -69,23 +66,8 @@ module Flor
69
66
  }x)
70
67
  end
71
68
 
72
- def symbol(i); rex(:symbol, i, /[^:;| \b\f\n\r\t"',()\[\]{}#\\]+/); end
73
-
74
69
  def comment(i); rex(nil, i, /#[^\r\n]*/); end
75
70
 
76
- def ws_star(i); rex(nil, i, /[ \t]*/); end
77
- def retnew(i); rex(nil, i, /[\r\n]*/); end
78
- def colon(i); str(nil, i, ':'); end
79
- def comma(i); str(nil, i, ','); end
80
- def bslash(i); str(nil, i, '\\'); end
81
-
82
- def pstart(i); str(nil, i, '('); end
83
- def pend(i); str(nil, i, ')'); end
84
- def sbstart(i); str(nil, i, '['); end
85
- def sbend(i); str(nil, i, ']'); end
86
- def pbstart(i); str(nil, i, '{'); end
87
- def pbend(i); str(nil, i, '}'); end
88
-
89
71
  def eol(i); seq(nil, i, :ws_star, :comment, '?', :retnew); end
90
72
  def postval(i); rep(nil, i, :eol, 0); end
91
73
 
@@ -109,7 +91,7 @@ module Flor
109
91
  def val(i)
110
92
  altg(:val, i,
111
93
  :panode, :par,
112
- :symbol, :sqstring, :dqstring, :rxstring,
94
+ :reference, :sqstring, :dqstring, :rxstring,
113
95
  :arr, :obj,
114
96
  :number, :boolean, :null)
115
97
  end
@@ -172,10 +154,22 @@ module Flor
172
154
  Nod.new(t.lookup(:node)).to_a
173
155
  end
174
156
 
175
- def rewrite_symbol(t); [ t.string, [], ln(t) ]; end
157
+ def rewrite_ref(t); [ t.string, [], ln(t) ]; end
158
+
159
+ UNESCAPE = {
160
+ "'" => "'", '"' => '"', '\\' => '\\', '/' => '/',
161
+ 'b' => "\b", 'f' => "\f", 'n' => "\n", 'r' => "\r", 't' => "\t"
162
+ }
163
+ def restring(s)
164
+ s.gsub(
165
+ /\\(?:(['"\\\/bfnrt])|u([\da-fA-F]{4}))/
166
+ ) {
167
+ $1 ? UNESCAPE[$1] : [ "#$2".hex ].pack('U*')
168
+ }
169
+ end
176
170
 
177
- def rewrite_sqstring(t); [ '_sqs', t.string[1..-2], ln(t) ]; end
178
- def rewrite_dqstring(t); [ '_dqs', t.string[1..-2], ln(t) ]; end
171
+ def rewrite_dqstring(t); [ '_dqs', restring(t.string[1..-2]), ln(t) ]; end
172
+ def rewrite_sqstring(t); [ '_sqs', restring(t.string[1..-2]), ln(t) ]; end
179
173
  def rewrite_rxstring(t); [ '_rxs', t.string, ln(t) ]; end
180
174
 
181
175
  def rewrite_boolean(t); [ '_boo', t.string == 'true', line_number(t) ]; end
@@ -290,7 +284,7 @@ module Flor
290
284
 
291
285
  # rewrite if/unless suffix
292
286
 
293
- t = [ atts[i][0][0] == 'if' ? 'ife' : 'unlesse', [], @line ]
287
+ t = [ atts[i][0][0] == 'if' ? 'if' : 'unless', [], @line ]
294
288
  t[1].concat(atts[i + 1..-1].collect(&:first))
295
289
  t[1].push([ @head, cn[0, i], @line ])
296
290
 
@@ -1,27 +1,3 @@
1
- #--
2
- # Copyright (c) 2015-2017, John Mettraux, jmettraux+flor@gmail.com
3
- #
4
- # Permission is hereby granted, free of charge, to any person obtaining a copy
5
- # of this software and associated documentation files (the "Software"), to deal
6
- # in the Software without restriction, including without limitation the rights
7
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
- # copies of the Software, and to permit persons to whom the Software is
9
- # furnished to do so, subject to the following conditions:
10
- #
11
- # The above copyright notice and this permission notice shall be included in
12
- # all copies or substantial portions of the Software.
13
- #
14
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20
- # THE SOFTWARE.
21
- #
22
- # Made in Japan.
23
- #++
24
-
25
1
 
26
2
  class Flor::Pro::Arr < Flor::Procedure
27
3
 
@@ -1,27 +1,3 @@
1
- #--
2
- # Copyright (c) 2015-2017, John Mettraux, jmettraux+flor@gmail.com
3
- #
4
- # Permission is hereby granted, free of charge, to any person obtaining a copy
5
- # of this software and associated documentation files (the "Software"), to deal
6
- # in the Software without restriction, including without limitation the rights
7
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
- # copies of the Software, and to permit persons to whom the Software is
9
- # furnished to do so, subject to the following conditions:
10
- #
11
- # The above copyright notice and this permission notice shall be included in
12
- # all copies or substantial portions of the Software.
13
- #
14
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20
- # THE SOFTWARE.
21
- #
22
- # Made in Japan.
23
- #++
24
-
25
1
 
26
2
  class Flor::Pro::Atom < Flor::Procedure
27
3
 
@@ -1,27 +1,3 @@
1
- #--
2
- # Copyright (c) 2015-2017, John Mettraux, jmettraux+flor@gmail.com
3
- #
4
- # Permission is hereby granted, free of charge, to any person obtaining a copy
5
- # of this software and associated documentation files (the "Software"), to deal
6
- # in the Software without restriction, including without limitation the rights
7
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
- # copies of the Software, and to permit persons to whom the Software is
9
- # furnished to do so, subject to the following conditions:
10
- #
11
- # The above copyright notice and this permission notice shall be included in
12
- # all copies or substantial portions of the Software.
13
- #
14
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20
- # THE SOFTWARE.
21
- #
22
- # Made in Japan.
23
- #++
24
-
25
1
 
26
2
  class Flor::Pro::Att < Flor::Procedure
27
3
 
@@ -57,7 +33,9 @@ class Flor::Pro::Att < Flor::Procedure
57
33
  def receive_keyed
58
34
 
59
35
  if Flor.child_id(@message['from']) == 0
60
- @node['key'] = k = payload['ret']
36
+ ret = payload['ret']
37
+ ret = ret[1]['task'] if Flor.is_task_tree?(ret)
38
+ @node['key'] = k = ret
61
39
  as = (parent_node || {})['atts_accepting_symbols'] || []
62
40
  execute_child(1, nil, 'accept_symbol' => as.include?(k))
63
41
  else
@@ -1,27 +1,3 @@
1
- #--
2
- # Copyright (c) 2015-2017, John Mettraux, jmettraux+flor@gmail.com
3
- #
4
- # Permission is hereby granted, free of charge, to any person obtaining a copy
5
- # of this software and associated documentation files (the "Software"), to deal
6
- # in the Software without restriction, including without limitation the rights
7
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
- # copies of the Software, and to permit persons to whom the Software is
9
- # furnished to do so, subject to the following conditions:
10
- #
11
- # The above copyright notice and this permission notice shall be included in
12
- # all copies or substantial portions of the Software.
13
- #
14
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20
- # THE SOFTWARE.
21
- #
22
- # Made in Japan.
23
- #++
24
-
25
1
 
26
2
  class Flor::Pro::Dump < Flor::Procedure
27
3