From 12ca574125659a107f3aa00e9fd7bf468599ef6f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 16 Dec 2025 10:06:55 +0000 Subject: [PATCH 1/2] Initial plan From 0e8d66711f2a3f1620c9f82041abbe700f3e3b23 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 16 Dec 2025 10:10:46 +0000 Subject: [PATCH 2/2] Update BNF documentation to reflect trailing newline in DS format Co-authored-by: hzhangxyz <11623447+hzhangxyz@users.noreply.github.com> --- bnf/README.md | 18 +++++++++--------- docs/support-packages/bnf.md | 16 ++++++++-------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/bnf/README.md b/bnf/README.md index ce4af3c9..1bb8c235 100644 --- a/bnf/README.md +++ b/bnf/README.md @@ -50,7 +50,7 @@ print(ds_output) # c # Unparse: Convert from DS format to readable Dsp -ds_input = "a\nb\n----\nc" +ds_input = "a\nb\n----\nc\n" dsp_output = unparse(ds_input) print(dsp_output) # Output: a, b -> c @@ -72,7 +72,7 @@ console.log(ds_output); // c // Unparse: Convert from DS format to readable Dsp -const ds_input = "a\nb\n----\nc"; +const ds_input = "a\nb\n----\nc\n"; const dsp_output = unparse(ds_input); console.log(dsp_output); // Output: a, b -> c @@ -115,13 +115,13 @@ For structured terms: | Description | Dsp Format (parse input / unparse output) | Ds Format | |-------------|-------------------|-------------------| -| Simple rule | `a, b -> c` | `a\nb\n----\nc` | -| Axiom | `a` | `----\na` | -| Function call | `f(a, b) -> c` | `(function f a b)\n----------------\nc` | -| Subscript | `a[i, j] -> b` | `(subscript a i j)\n-----------------\nb` | -| Binary operator | `(a + b) -> c` | `(binary + a b)\n--------------\nc` | -| Unary operator | `~ a -> b` | `(unary ~ a)\n-----------\nb` | -| Complex expression | `((a + b) * c), d[i] -> f(g, h)` | `(binary * (binary + a b) c)\n(subscript d i)\n---------------------------\n(function f g h)` | +| Simple rule | `a, b -> c` | `a\nb\n----\nc\n` | +| Axiom | `a` | `----\na\n` | +| Function call | `f(a, b) -> c` | `(function f a b)\n----------------\nc\n` | +| Subscript | `a[i, j] -> b` | `(subscript a i j)\n-----------------\nb\n` | +| Binary operator | `(a + b) -> c` | `(binary + a b)\n--------------\nc\n` | +| Unary operator | `~ a -> b` | `(unary ~ a)\n-----------\nb\n` | +| Complex expression | `((a + b) * c), d[i] -> f(g, h)` | `(binary * (binary + a b) c)\n(subscript d i)\n---------------------------\n(function f g h)\n` | ## Building from Source diff --git a/docs/support-packages/bnf.md b/docs/support-packages/bnf.md index e1bb072e..140b7dd2 100644 --- a/docs/support-packages/bnf.md +++ b/docs/support-packages/bnf.md @@ -41,7 +41,7 @@ print(ds_output) # c # Unparse: Convert from DS format to readable Dsp -ds_input = "a\nb\n----\nc" +ds_input = "a\nb\n----\nc\n" dsp_output = unparse(ds_input) print(dsp_output) # Output: a, b -> c @@ -63,7 +63,7 @@ console.log(ds_output); // c // Unparse: Convert from DS format to readable Dsp -const ds_input = "a\nb\n----\nc"; +const ds_input = "a\nb\n----\nc\n"; const dsp_output = unparse(ds_input); console.log(dsp_output); // Output: a, b -> c @@ -108,13 +108,13 @@ For structured terms: | Description | Dsp Format | Ds Format | |-------------|------------|-----------| -| Simple rule | `a, b -> c` | `a\nb\n----\nc` | +| Simple rule | `a, b -> c` | `a\nb\n----\nc\n` | | Axiom | `a` | `----\na\n` | -| Function call | `f(a, b) -> c` | `(function f a b)\n----------------\nc` | -| Subscript | `a[i, j] -> b` | `(subscript a i j)\n-----------------\nb` | -| Binary operator | `(a + b) -> c` | `(binary + a b)\n--------------\nc` | -| Unary operator | `~ a -> b` | `(unary ~ a)\n-----------\nb` | -| Complex expression | `((a + b) * c), d[i] -> f(g, h)` | `(binary * (binary + a b) c)\n(subscript d i)\n---------------------------\n(function f g h)` | +| Function call | `f(a, b) -> c` | `(function f a b)\n----------------\nc\n` | +| Subscript | `a[i, j] -> b` | `(subscript a i j)\n-----------------\nb\n` | +| Binary operator | `(a + b) -> c` | `(binary + a b)\n--------------\nc\n` | +| Unary operator | `~ a -> b` | `(unary ~ a)\n-----------\nb\n` | +| Complex expression | `((a + b) * c), d[i] -> f(g, h)` | `(binary * (binary + a b) c)\n(subscript d i)\n---------------------------\n(function f g h)\n` | ## Package Information