From 4dd18006a57314672109feb456cfcbf700e7911b Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Mon, 17 Apr 2023 20:13:07 -0400 Subject: [PATCH 1/3] Add some tests for paragraphs. --- .../element_container_priority/README.org | 19 +++++++++++-------- .../paragraph_drawer.org | 5 +++++ .../paragraph_greater_block.org | 5 +++++ toy_language.txt | 13 +++---------- 4 files changed, 24 insertions(+), 18 deletions(-) create mode 100644 org_mode_samples/element_container_priority/paragraph_drawer.org create mode 100644 org_mode_samples/element_container_priority/paragraph_greater_block.org diff --git a/org_mode_samples/element_container_priority/README.org b/org_mode_samples/element_container_priority/README.org index ee016aa..af43ab0 100644 --- a/org_mode_samples/element_container_priority/README.org +++ b/org_mode_samples/element_container_priority/README.org @@ -55,14 +55,15 @@ Sections are divided by headlines. This test interleaves the opening and closing of each element container to see which element becomes parsed vs gets broken up. The row determines the first opening element and the column determines the second opening element. # Section first and section second tests are identical so I only included section first in the repo. # Footnote definition and plain list have the same end condition of two blank lines so they are untestable. -| | Section | Greater Block | Drawer | Dynamic Block | Footnote Definition | Plain List | -|---------------------+---------+---------------+---------+---------------+---------------------+------------| -| Section | - | Section | Section | Section | Section | Section | -| Greater Block | Section | First | First | First | First | First | -| Drawer | Section | First | First | First | First | First | -| Dynamic Block | Section | First | First | First | First | First | -| Footnote Definition | Section | First | First | First | - | - | -| Plain List | Section | Second | Second | Second | - | First | +| | Section | Greater Block | Drawer | Dynamic Block | Footnote Definition | Plain List | Paragraph | +|---------------------+---------+---------------+---------+---------------+---------------------+------------+-----------| +| Section | - | Section | Section | Section | Section | Section | | +| Greater Block | Section | First | First | First | First | First | | +| Drawer | Section | First | First | First | First | First | | +| Dynamic Block | Section | First | First | First | First | First | | +| Footnote Definition | Section | First | First | First | - | - | | +| Plain List | Section | Second | Second | Second | - | First | | +| Paragraph | Section | Second | Second | | | | | * Possible solutions ** Greater blocks, drawers, and dynamic blocks disable plain list exit matcher *** Test Case 1 @@ -77,3 +78,5 @@ This test interleaves the opening and closing of each element container to see w #+end_src ** Parse out headlines first Then go through elements parsing them in-order +** Should paragraph exit matcher apply to the element matcher in the exit matcher +No. But paragraph exit matcher needs to apply to the object matcher. diff --git a/org_mode_samples/element_container_priority/paragraph_drawer.org b/org_mode_samples/element_container_priority/paragraph_drawer.org new file mode 100644 index 0000000..574a2f2 --- /dev/null +++ b/org_mode_samples/element_container_priority/paragraph_drawer.org @@ -0,0 +1,5 @@ +foo +:drawername: + + +:end: diff --git a/org_mode_samples/element_container_priority/paragraph_greater_block.org b/org_mode_samples/element_container_priority/paragraph_greater_block.org new file mode 100644 index 0000000..24d76ec --- /dev/null +++ b/org_mode_samples/element_container_priority/paragraph_greater_block.org @@ -0,0 +1,5 @@ +foo +#+begin_center + + +#+end_center diff --git a/toy_language.txt b/toy_language.txt index 6497a29..24d76ec 100644 --- a/toy_language.txt +++ b/toy_language.txt @@ -1,12 +1,5 @@ -1. foo - - bar - - 1. baz - - lorem - - ipsum +foo +#+begin_center -dolar +#+end_center From 867a55fbf75e7aabd8e65cf26cc7d2acd5eb9720 Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Mon, 17 Apr 2023 20:33:51 -0400 Subject: [PATCH 2/3] More paragraph tests. --- org_mode_samples/element_container_priority/README.org | 6 +++--- .../element_container_priority/paragraph_dynamic_block.org | 5 +++++ 2 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 org_mode_samples/element_container_priority/paragraph_dynamic_block.org diff --git a/org_mode_samples/element_container_priority/README.org b/org_mode_samples/element_container_priority/README.org index af43ab0..309e71d 100644 --- a/org_mode_samples/element_container_priority/README.org +++ b/org_mode_samples/element_container_priority/README.org @@ -57,13 +57,13 @@ This test interleaves the opening and closing of each element container to see w # Footnote definition and plain list have the same end condition of two blank lines so they are untestable. | | Section | Greater Block | Drawer | Dynamic Block | Footnote Definition | Plain List | Paragraph | |---------------------+---------+---------------+---------+---------------+---------------------+------------+-----------| -| Section | - | Section | Section | Section | Section | Section | | +| Section | - | Section | Section | Section | Section | Section | Section | | Greater Block | Section | First | First | First | First | First | | | Drawer | Section | First | First | First | First | First | | | Dynamic Block | Section | First | First | First | First | First | | | Footnote Definition | Section | First | First | First | - | - | | -| Plain List | Section | Second | Second | Second | - | First | | -| Paragraph | Section | Second | Second | | | | | +| Plain List | Section | Second | Second | Second | - | - | | +| Paragraph | Section | Second | Second | Second | - | - | - | * Possible solutions ** Greater blocks, drawers, and dynamic blocks disable plain list exit matcher *** Test Case 1 diff --git a/org_mode_samples/element_container_priority/paragraph_dynamic_block.org b/org_mode_samples/element_container_priority/paragraph_dynamic_block.org new file mode 100644 index 0000000..c6f9904 --- /dev/null +++ b/org_mode_samples/element_container_priority/paragraph_dynamic_block.org @@ -0,0 +1,5 @@ +foo +#+BEGIN: foo :hlines 1 :id global + + +#+END: From dc5fc863f573cf6d9f0be2e8ad58f6b8e8b40fed Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Mon, 17 Apr 2023 20:40:23 -0400 Subject: [PATCH 3/3] Add more paragraph tests. --- org_mode_samples/element_container_priority/README.org | 10 +++++----- .../element_container_priority/drawer_paragraph.org | 4 ++++ .../dynamic_block_paragraph.org | 4 ++++ .../greater_block_paragraph.org | 4 ++++ 4 files changed, 17 insertions(+), 5 deletions(-) create mode 100644 org_mode_samples/element_container_priority/drawer_paragraph.org create mode 100644 org_mode_samples/element_container_priority/dynamic_block_paragraph.org create mode 100644 org_mode_samples/element_container_priority/greater_block_paragraph.org diff --git a/org_mode_samples/element_container_priority/README.org b/org_mode_samples/element_container_priority/README.org index 309e71d..86c9d90 100644 --- a/org_mode_samples/element_container_priority/README.org +++ b/org_mode_samples/element_container_priority/README.org @@ -58,11 +58,11 @@ This test interleaves the opening and closing of each element container to see w | | Section | Greater Block | Drawer | Dynamic Block | Footnote Definition | Plain List | Paragraph | |---------------------+---------+---------------+---------+---------------+---------------------+------------+-----------| | Section | - | Section | Section | Section | Section | Section | Section | -| Greater Block | Section | First | First | First | First | First | | -| Drawer | Section | First | First | First | First | First | | -| Dynamic Block | Section | First | First | First | First | First | | -| Footnote Definition | Section | First | First | First | - | - | | -| Plain List | Section | Second | Second | Second | - | - | | +| Greater Block | Section | First | First | First | First | First | First | +| Drawer | Section | First | First | First | First | First | First | +| Dynamic Block | Section | First | First | First | First | First | First | +| Footnote Definition | Section | First | First | First | - | - | - | +| Plain List | Section | Second | Second | Second | - | - | - | | Paragraph | Section | Second | Second | Second | - | - | - | * Possible solutions ** Greater blocks, drawers, and dynamic blocks disable plain list exit matcher diff --git a/org_mode_samples/element_container_priority/drawer_paragraph.org b/org_mode_samples/element_container_priority/drawer_paragraph.org new file mode 100644 index 0000000..1a3a97f --- /dev/null +++ b/org_mode_samples/element_container_priority/drawer_paragraph.org @@ -0,0 +1,4 @@ +:drawername: +foo +:end: +Is this still in the paragraph? diff --git a/org_mode_samples/element_container_priority/dynamic_block_paragraph.org b/org_mode_samples/element_container_priority/dynamic_block_paragraph.org new file mode 100644 index 0000000..15cca1a --- /dev/null +++ b/org_mode_samples/element_container_priority/dynamic_block_paragraph.org @@ -0,0 +1,4 @@ +#+BEGIN: foo :hlines 1 :id global +foo +#+END: +Is this still in the paragraph? diff --git a/org_mode_samples/element_container_priority/greater_block_paragraph.org b/org_mode_samples/element_container_priority/greater_block_paragraph.org new file mode 100644 index 0000000..36188e9 --- /dev/null +++ b/org_mode_samples/element_container_priority/greater_block_paragraph.org @@ -0,0 +1,4 @@ +#+begin_center +foo +#+end_center +Is this still in the paragraph?