From e7397f818d60caeb70d8836689d012ae60e4cabb Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Mon, 27 Mar 2023 12:33:58 -0400 Subject: [PATCH] Adding some notes on the exit matcher loop issue. --- notes/exit_matcher_loop_notes.txt | 35 +++++++++++++++++++ .../paragraph_with_immediate_list.org | 2 ++ 2 files changed, 37 insertions(+) create mode 100644 notes/exit_matcher_loop_notes.txt create mode 100644 org_mode_samples/paragraphs/paragraph_with_immediate_list.org diff --git a/notes/exit_matcher_loop_notes.txt b/notes/exit_matcher_loop_notes.txt new file mode 100644 index 0000000..5e357ae --- /dev/null +++ b/notes/exit_matcher_loop_notes.txt @@ -0,0 +1,35 @@ +Headings add exit matcher for heading + +Paragraphs add exit matcher for elements (but it should be sans paragraph) + + + + +* foo +* bar +* baz + +context tree -> () + +match * foo + +context tree -> exit(heading matcher) + +check exit +invoke heading matcher +check exit +invoke heading matcher +check exit +invoke heading matcher +adds second heading matcher exit + + +Ways around this: +- Always parse SOMETHING before checking for exit + - Doesn't always seem possible +- Disable exit matchers during exit check + - Seems like it would break syntax +- Have separate parsers for the beginning of the exit condition (for example, checking for just the headline instead of the full heading parser) + - Won't be possible with paragraphs ending at any other element +- Check exit matchers in parent parser + - Will this work? seems like it would just create larger loops diff --git a/org_mode_samples/paragraphs/paragraph_with_immediate_list.org b/org_mode_samples/paragraphs/paragraph_with_immediate_list.org new file mode 100644 index 0000000..2271d13 --- /dev/null +++ b/org_mode_samples/paragraphs/paragraph_with_immediate_list.org @@ -0,0 +1,2 @@ +foo bar baz +1. lorem