From 8d2a0eda5a76a341ae6b597f58e874d9e3bd571c Mon Sep 17 00:00:00 2001 From: Jay Berkenbilt Date: Sun, 1 May 2022 14:06:31 -0400 Subject: Add reactors to the JSON parser --- libtests/qtest/json_parse/good-01-react.out | 21 +++++++++++++ libtests/qtest/json_parse/good-02-react.out | 3 ++ libtests/qtest/json_parse/good-03-react.out | 3 ++ libtests/qtest/json_parse/good-04-react.out | 18 +++++++++++ libtests/qtest/json_parse/good-05-react.out | 2 ++ libtests/qtest/json_parse/good-06-react.out | 2 ++ libtests/qtest/json_parse/good-07-react.out | 2 ++ libtests/qtest/json_parse/good-08-react.out | 11 +++++++ libtests/qtest/json_parse/good-09-react.out | 8 +++++ libtests/qtest/json_parse/good-10-react.out | 47 +++++++++++++++++++++++++++++ libtests/qtest/json_parse/good-10.json | 4 +++ libtests/qtest/json_parse/save-10.json | 27 +++++++++++++++++ 12 files changed, 148 insertions(+) create mode 100644 libtests/qtest/json_parse/good-01-react.out create mode 100644 libtests/qtest/json_parse/good-02-react.out create mode 100644 libtests/qtest/json_parse/good-03-react.out create mode 100644 libtests/qtest/json_parse/good-04-react.out create mode 100644 libtests/qtest/json_parse/good-05-react.out create mode 100644 libtests/qtest/json_parse/good-06-react.out create mode 100644 libtests/qtest/json_parse/good-07-react.out create mode 100644 libtests/qtest/json_parse/good-08-react.out create mode 100644 libtests/qtest/json_parse/good-09-react.out create mode 100644 libtests/qtest/json_parse/good-10-react.out create mode 100644 libtests/qtest/json_parse/good-10.json create mode 100644 libtests/qtest/json_parse/save-10.json (limited to 'libtests/qtest/json_parse') diff --git a/libtests/qtest/json_parse/good-01-react.out b/libtests/qtest/json_parse/good-01-react.out new file mode 100644 index 00000000..d6167a6b --- /dev/null +++ b/libtests/qtest/json_parse/good-01-react.out @@ -0,0 +1,21 @@ +dictionary start +dictionary item: a -> [6, 11): "bcd" +array start +dictionary item: e -> [18, 0): [] +array item: [19, 20): 1 +array item: [41, 42): 2 +array item: [44, 45): 3 +array item: [46, 47): 4 +array item: [48, 54): "five" +dictionary start +array item: [56, 0): {} +dictionary item: six -> [64, 65): 7 +dictionary item: 8 -> [72, 73): 9 +container end: [56, 74): {} +array item: [76, 80): null +array item: [82, 86): true +array item: [107, 112): false +array item: [114, 134): "a\b\f\n\r\t\\\"/z" +container end: [18, 135): [] +container end: [0, 136): {} +{} diff --git a/libtests/qtest/json_parse/good-02-react.out b/libtests/qtest/json_parse/good-02-react.out new file mode 100644 index 00000000..12d1931a --- /dev/null +++ b/libtests/qtest/json_parse/good-02-react.out @@ -0,0 +1,3 @@ +dictionary start +container end: [0, 2): {} +{} diff --git a/libtests/qtest/json_parse/good-03-react.out b/libtests/qtest/json_parse/good-03-react.out new file mode 100644 index 00000000..02e632b7 --- /dev/null +++ b/libtests/qtest/json_parse/good-03-react.out @@ -0,0 +1,3 @@ +array start +container end: [0, 2): [] +[] diff --git a/libtests/qtest/json_parse/good-04-react.out b/libtests/qtest/json_parse/good-04-react.out new file mode 100644 index 00000000..bd18ccfc --- /dev/null +++ b/libtests/qtest/json_parse/good-04-react.out @@ -0,0 +1,18 @@ +array start +array start +array item: [1, 0): [] +array start +array item: [2, 0): [] +dictionary start +array item: [3, 0): {} +container end: [3, 5): {} +container end: [2, 6): [] +dictionary start +array item: [8, 0): {} +dictionary start +dictionary item: -> [13, 0): {} +container end: [13, 15): {} +container end: [8, 16): {} +container end: [1, 17): [] +container end: [0, 18): [] +[] diff --git a/libtests/qtest/json_parse/good-05-react.out b/libtests/qtest/json_parse/good-05-react.out new file mode 100644 index 00000000..daa37173 --- /dev/null +++ b/libtests/qtest/json_parse/good-05-react.out @@ -0,0 +1,2 @@ +top-level scalar +"x" diff --git a/libtests/qtest/json_parse/good-06-react.out b/libtests/qtest/json_parse/good-06-react.out new file mode 100644 index 00000000..adec78ee --- /dev/null +++ b/libtests/qtest/json_parse/good-06-react.out @@ -0,0 +1,2 @@ +top-level scalar +123 diff --git a/libtests/qtest/json_parse/good-07-react.out b/libtests/qtest/json_parse/good-07-react.out new file mode 100644 index 00000000..e08bca41 --- /dev/null +++ b/libtests/qtest/json_parse/good-07-react.out @@ -0,0 +1,2 @@ +top-level scalar +-123 diff --git a/libtests/qtest/json_parse/good-08-react.out b/libtests/qtest/json_parse/good-08-react.out new file mode 100644 index 00000000..c773d585 --- /dev/null +++ b/libtests/qtest/json_parse/good-08-react.out @@ -0,0 +1,11 @@ +array start +array item: [1, 2): 1 +array item: [4, 6): -2 +array item: [8, 11): 3.4 +array item: [13, 17): -5.6 +array item: [19, 23): -9e1 +array item: [25, 29): 10e2 +array item: [31, 37): 12.3e5 +array item: [39, 46): 12.6e-7 +container end: [0, 47): [] +[] diff --git a/libtests/qtest/json_parse/good-09-react.out b/libtests/qtest/json_parse/good-09-react.out new file mode 100644 index 00000000..edbf869b --- /dev/null +++ b/libtests/qtest/json_parse/good-09-react.out @@ -0,0 +1,8 @@ +array start +array item: [1, 7): "aπb" +array item: [9, 23): "a\b\f\n\r\tc" +array item: [25, 42): "aπbπc" +array item: [44, 52): "π" +array item: [54, 71): "a\u0018bʬc" +container end: [0, 72): [] +[] diff --git a/libtests/qtest/json_parse/good-10-react.out b/libtests/qtest/json_parse/good-10-react.out new file mode 100644 index 00000000..142d95d0 --- /dev/null +++ b/libtests/qtest/json_parse/good-10-react.out @@ -0,0 +1,47 @@ +dictionary start +array start +dictionary item: a -> [9, 0): [] +array item: [10, 11): 1 +array item: [13, 14): 2 +dictionary start +array item: [16, 0): {} +dictionary item: x -> [22, 25): "y" +container end: [16, 26): {} +array item: [28, 29): 3 +dictionary start +array item: [31, 0): {} +dictionary item: keep -> [40, 61): "not in final output" +container end: [31, 62): { + "keep": "not in final output" +} +container end: [9, 63): [] +array start +dictionary item: keep -> [75, 0): [] +array item: [76, 77): 1 +array item: [79, 83): null +array item: [85, 86): 2 +array item: [88, 93): false +array item: [95, 101): "keep" +array item: [103, 104): 3 +array start +array item: [106, 0): [] +array item: [107, 113): "this" +array item: [115, 121): "keep" +array item: [123, 128): "not" +array item: [130, 137): "final" +container end: [106, 138): [ + "keep" +] +container end: [75, 139): [ + "keep" +] +container end: [0, 141): { + "keep": [ + "keep" + ] +} +{ + "keep": [ + "keep" + ] +} diff --git a/libtests/qtest/json_parse/good-10.json b/libtests/qtest/json_parse/good-10.json new file mode 100644 index 00000000..8f2d46b3 --- /dev/null +++ b/libtests/qtest/json_parse/good-10.json @@ -0,0 +1,4 @@ +{ + "a": [1, 2, {"x": "y"}, 3, {"keep": "not in final output"}], + "keep": [1, null, 2, false, "keep", 3, ["this", "keep", "not", "final"]] +} diff --git a/libtests/qtest/json_parse/save-10.json b/libtests/qtest/json_parse/save-10.json new file mode 100644 index 00000000..1b111dbd --- /dev/null +++ b/libtests/qtest/json_parse/save-10.json @@ -0,0 +1,27 @@ +{ + "a": [ + 1, + 2, + { + "x": "y" + }, + 3, + { + "keep": "not in final output" + } + ], + "keep": [ + 1, + null, + 2, + false, + "keep", + 3, + [ + "this", + "keep", + "not", + "final" + ] + ] +} -- cgit v1.2.3-54-g00ecf