@naanlang/naan 1.5.0 → 1.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/LICENSE.md +2 -2
  2. package/README.md +2 -2
  3. package/bin/index.js +7 -3
  4. package/dist/env_web.js +162 -48
  5. package/dist/naan.min.js +11 -11
  6. package/frameworks/browser/https_request.nlg +2 -2
  7. package/frameworks/browser/sworker.js +28 -26
  8. package/frameworks/browser/terminals.nlg +295 -737
  9. package/frameworks/browser/worker.nlg +295 -0
  10. package/frameworks/browser/workers.nlg +6 -6
  11. package/frameworks/browser/ws_client.nlg +15 -10
  12. package/frameworks/client/apiclient.nlg +211 -9
  13. package/frameworks/client/psm_client.nlg +10 -14
  14. package/frameworks/client/relaycon.nlg +87 -161
  15. package/frameworks/common/common.nlg +2 -0
  16. package/frameworks/common/events.nlg +101 -0
  17. package/frameworks/common/repltools.nlg +80 -1
  18. package/frameworks/node/apiserver.nlg +38 -246
  19. package/frameworks/node/filesystem.nlg +31 -6
  20. package/frameworks/node/http_request.nlg +34 -13
  21. package/frameworks/node/https_request.nlg +8 -3
  22. package/frameworks/node/node.nlg +3 -0
  23. package/frameworks/node/pty.nlg +346 -0
  24. package/frameworks/node/shell.nlg +26 -3
  25. package/frameworks/node/worker.nlg +504 -560
  26. package/frameworks/node/ws_client.nlg +2 -2
  27. package/frameworks/project/build.nlg +56 -14
  28. package/frameworks/project/projects.nlg +1 -1
  29. package/frameworks/running/debugcom.nlg +20 -3
  30. package/frameworks/running/debugnub.nlg +33 -11
  31. package/frameworks/running/executors.nlg +40 -285
  32. package/frameworks/running/instances.nlg +394 -0
  33. package/frameworks/running/remote_req.nlg +139 -0
  34. package/frameworks/running/remote_res.nlg +89 -0
  35. package/frameworks/running/sourcecode.nlg +3 -2
  36. package/frameworks/running/taskexec.nlg +16 -59
  37. package/frameworks/service/imp.nlg +751 -0
  38. package/frameworks/service/model.nlg +71 -0
  39. package/frameworks/service/nubnode.nlg +136 -0
  40. package/frameworks/service/nubweb.nlg +124 -0
  41. package/frameworks/service/service.nlg +28 -0
  42. package/frameworks/storage/file_manager.nlg +3 -2
  43. package/lib/browser/env_web.js +169 -55
  44. package/lib/browser/env_webworker.js +89 -31
  45. package/lib/core/naanlib.js +11 -11
  46. package/lib/env_node.js +186 -27
  47. package/lib/env_nodeworker.js +82 -44
  48. package/lib/node_server_init.nlg +149 -0
  49. package/lib/node_worker.js +36 -0
  50. package/lib/node_worker_init.nlg +43 -0
  51. package/package.json +1 -1
  52. package/plugins/openSearch/openSearch.nlg +3 -2
  53. package/plugins/openSearch/os_dynamo.nlg +3 -2
  54. package/plugins/serviceAws/aws_cloudwatchlogs.nlg +44 -2
  55. package/plugins/serviceAws/aws_dynamo.nlg +144 -63
  56. package/plugins/serviceAws/aws_utils.nlg +6 -11
  57. package/plugins/serviceAws/serviceAws.nlg +3 -2
  58. package/plugins/serviceNexara/speechrec.nlg +10 -6
  59. package/test/test_01_core.nlg +2 -2
  60. package/test/test_02_context.nlg +32 -9
  61. package/test/test_03_jsinterop.nlg +3 -3
  62. package/test/test_07_lingo.nlg +1 -1
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * column positioning: // // !
8
8
  *
9
- * Copyright (c) 2017-2024 by Richard C. Zulch
9
+ * Copyright (c) 2017-2026 by Richard C. Zulch
10
10
  *
11
11
  */
12
12
 
@@ -38,7 +38,7 @@ RegisterTestCategory("context", [
38
38
  [ "function setNS(ns) { ns=reverse(ns),sudo(nsactive(reverse(ns, defNS))) };", "setNS" ],
39
39
  [ "x;", "x" ],
40
40
  [ "y;", "y" ],
41
- [ "length(symlist(nsactive(true).0));", "173"],
41
+ [ "length(symlist(nsactive(true).0));", "175"],
42
42
  [ "testvar;", "testvar" ],
43
43
  [ "function setTestvar(v) { testvar=v };", "setTestvar" ],
44
44
  [ "naanvar;", "naanvar" ],
@@ -200,20 +200,20 @@ RegisterTestCategory("context", [
200
200
  [ "test2(4);", "10001|10001" ],
201
201
 
202
202
  [ "function test1(x) { if x > 10000 printline(x) else test2(x+1), undefined() };", "==> redefined: test1|test1" ],
203
- [ "test2(5);", { errors: "exception: recursed 101" } ],
203
+ [ "test2(5);", { errors: "exception: recursed 99" } ],
204
204
 
205
205
  [ "function test1(x) { if x > 10000 printline(x) else loop test2(x+1) };", "==> redefined: test1|test1" ],
206
- [ "test2(6);", { errors: "exception: recursed 102" } ],
206
+ [ "test2(6);", { errors: "exception: recursed 100" } ],
207
207
 
208
208
  [ "function test1(x) { if x > 10000 printline(x) else 0+test2(x+1) };", "==> redefined: test1|test1" ],
209
- [ "test2(7);", { errors: "exception: recursed 149" } ],
209
+ [ "test2(7);", { errors: "exception: recursed 147" } ],
210
210
 
211
211
  [ "function test2(x) { testRecurCheck(x), if true test1(x+1) else print(x) };", "==> redefined: test2|test2" ],
212
- [ "test2(8);", { errors: "exception: recursed 150" } ],
212
+ [ "test2(8);", { errors: "exception: recursed 148" } ],
213
213
 
214
214
  [ "function test1(x) { if x > 10000 printline(x) else loop test2(x+1, 4, 5) };", "==> redefined: test1|test1" ],
215
215
  [ "function test2(x,y,z) { testRecurCheck(x), loop if true { test1(x+1),break } else print(x) };", "==> redefined: test2|test2" ],
216
- [ "test2(9);", { errors: "exception: recursed 51" } ],
216
+ [ "test2(9);", { errors: "exception: recursed 49" } ],
217
217
 
218
218
  [ "function test1 xt { if car(xt) > 10000 printline(xt) else test2(car(xt)+1) };", "==> redefined: test1|test1" ],
219
219
  [ "function test2 xt { testRecurCheck(car(xt)), test1(car(xt)+1) };", "==> redefined: test2|test2" ],
@@ -222,7 +222,7 @@ RegisterTestCategory("context", [
222
222
  [ "oo=new(object);", "Object{0}"],
223
223
  [ "oo.test1 = function test1(x) { if x > 10000 printline(x) else test2(x+1) };", "==> redefined: test1|test1"],
224
224
  [ "oo.test2 = function test2 xt { testRecurCheck(car(xt)), oo.test1(car(xt)+1) };", "==> redefined: test2|test2"],
225
- [ "oo.test1(11);", { errors: "exception: recursed 154" } ],
225
+ [ "oo.test1(11);", { errors: "exception: recursed 152" } ],
226
226
 
227
227
  [ "function test1 xt { testRecurCheck(car(xt)), if car(xt) > 10000 printline(xt) else test1(car(xt)+1) };",
228
228
  "==> redefined: test1|test1" ],
@@ -265,5 +265,28 @@ RegisterTestCategory("context", [
265
265
  [ "closure Xx(y, local xx) { xx = new(object, this) };", "Xx" ],
266
266
  [ "x = Xx(33);", "{object Xx}" ],
267
267
  [ "car(x@\\.closure.proc.2.0)", "33" ],
268
- [ "new(object, 3)@*", "false" ]
268
+ [ "new(object, 3)@*", "false" ],
269
+
270
+ //
271
+ // undefined objects
272
+ //
273
+
274
+ [ "closure undef(local o) {\n"
275
+ " o = new(object, undef)\n"
276
+ " put(o,'.undefined', function udef args {\n"
277
+ " print('udef:', args)\n"
278
+ " })\n"
279
+ " o\n"
280
+ "};", "undef" ],
281
+ [ "oo = undef();", "{object undef}"],
282
+ [ "closure(c) {\n"
283
+ "xset(c, joe2, macro mjoe args {\n"
284
+ " printline(args)\n"
285
+ " deref(c, joe, args)\n"
286
+ "})\n"
287
+ "}(oo);>", "(macro mjoe args (printline args) (deref c joe args))"],
288
+ [ "oo.joe(8,2+5);", "udef:(joe 8 7)|(joe, 8, 7)" ],
289
+ [ "oo.joe2(5,9+3);", "(5 (+ 9 3))|udef:(joe 5 (+ 9 3))|(joe, 5, 9+3)" ],
290
+ [ "dargs = list(3,quote(2+4));", "(3, 2+4)"],
291
+ [ "deref(oo, joe, dargs);", "udef:(joe 3 (+ 2 4))|(joe, 3, 2+4)"]
269
292
  ]);
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * column positioning: // // !
8
8
  *
9
- * Copyright (c) 2020-2025 by Richard C. Zulch
9
+ * Copyright (c) 2020-2026 by Richard C. Zulch
10
10
  *
11
11
  */
12
12
 
@@ -35,11 +35,11 @@ RegisterTestCategory("JSinterop", [
35
35
 
36
36
  [ "o(3);", {
37
37
  "dev": { errors: "xcall \"[object Object]\": TypeError: object.apply is not a function" }
38
- "prod": { errors: "xcall \"[object Object]\": TypeError: e[3].apply is not a function" }
38
+ "prod": { errors: "xcall \"[object Object]\": TypeError: r[3].apply is not a function" }
39
39
  }[ "prod"]],
40
40
  [ "o(Number);", {
41
41
  "dev": { errors: "xcall \"[object Object]\": TypeError: object.apply is not a function" }
42
- "prod": { errors: "xcall \"[object Object]\": TypeError: e[3].apply is not a function" }
42
+ "prod": { errors: "xcall \"[object Object]\": TypeError: r[3].apply is not a function" }
43
43
  }[ "prod"]],
44
44
  [ "Number(3);", "[Number 3]" ],
45
45
  [ "Number(3).toString();", "\"3\"" ],
@@ -474,7 +474,7 @@ RegisterTestCategory("Lingo", [
474
474
  { errors: "invalid iteration variable at (1, 5) found 3" } ],
475
475
  [ "for x in xnew() print(x);>", "Dictionary{6}"],
476
476
  [ "for x in Array(e, f, g) print(x);>", "efg|Dictionary{7}"],
477
- [ "for x in false print(x);>", "Dictionary{5}"],
477
+ [ "for x in false print(x);>", "Dictionary{6}"],
478
478
  [ "for x in { } print(x);>", "Dictionary{7}"],
479
479
 
480
480
  //