Tom Alexander
317293f0f2
Extract the line number from the switches.
2023-10-04 11:31:45 -04:00
Tom Alexander
3d7f411cf9
Compare number lines for example blocks.
2023-10-04 10:31:01 -04:00
Tom Alexander
1d7770e590
Rename data to switches in example and src block.
2023-10-04 09:59:11 -04:00
Tom Alexander
4cdf88a632
Switches are not stored for comment blocks, but they are allowed to appear.
2023-10-04 09:51:28 -04:00
Tom Alexander
68a3f8b87e
Fix table rule row detection.
2023-10-03 00:13:15 -04:00
Tom Alexander
3d1b2713ed
Compare key and value.
2023-10-02 23:45:31 -04:00
Tom Alexander
8169499de3
Compare value.
2023-10-02 23:28:32 -04:00
Tom Alexander
ae66d1bd89
Fix tracing build.
rustfmt Build rustfmt has succeeded
rust-build Build rust-build has succeeded
rust-test Build rust-test has succeeded
rust-foreign-document-test Build rust-foreign-document-test has succeeded
2023-10-02 22:45:25 -04:00
Tom Alexander
0fb80e3fee
Compare name and parameters.
2023-10-02 22:41:56 -04:00
Tom Alexander
2352636672
Split GreaterBlock into CenterBlock, QuoteBlock, and SpecialBlock.
...
Center and quote blocks do not have parameters nor do they store their name so I am separating them out.
2023-10-02 22:33:00 -04:00
Tom Alexander
36217f5704
Do not capture trailing whitespace in parameters.
2023-10-02 21:14:07 -04:00
Tom Alexander
a80d171e4d
Bubble up planning variables to the headline.
2023-10-02 20:37:46 -04:00
Tom Alexander
2e1a946ac9
Compare scheduled, deadline, and closed.
2023-10-02 20:25:08 -04:00
Tom Alexander
94401dcf00
Allow REST despite no TIME.
2023-10-02 19:51:29 -04:00
Tom Alexander
2b5df83956
Format the code.
2023-10-02 19:24:47 -04:00
Tom Alexander
5c929ffc13
Fix repeater type.
...
I had Cumulative and CatchUp backwards.
2023-10-02 19:18:25 -04:00
Tom Alexander
bc3224be7a
Revert the rest_end functions.
2023-10-02 19:09:20 -04:00
Tom Alexander
6a8ae9d838
Compare warning delay and repeater.
2023-10-02 18:58:30 -04:00
Tom Alexander
512432c5f0
Do not allow time range timestamps with REST on the first TIME.
2023-10-02 17:51:33 -04:00
Tom Alexander
890cd3e4fd
Compare start/end time.
2023-10-02 17:17:05 -04:00
Tom Alexander
a8a34e2d9c
Compare date start/end.
2023-10-02 16:16:19 -04:00
Tom Alexander
e7ec23af3d
Move the Date struct into types and implement a get_property_numeric.
2023-10-02 15:49:51 -04:00
Tom Alexander
10ae36a419
Implement date types with basic validation.
2023-10-02 15:10:39 -04:00
Tom Alexander
3ed9b552e2
Compare range type.
2023-10-02 14:35:45 -04:00
Tom Alexander
d04c8c832c
Compare timestamp type.
2023-10-02 13:40:37 -04:00
Tom Alexander
9575ef30ac
Fix compilation.
rustfmt Build rustfmt has succeeded
rust-build Build rust-build has succeeded
rust-test Build rust-test has succeeded
rust-foreign-document-test Build rust-foreign-document-test has succeeded
2023-10-02 13:19:43 -04:00
Tom Alexander
a62c3fc522
Move AstNode into the types crate.
...
Now that it is used for more than just iteration, it makes sense to promote it to the types crate.
2023-10-02 13:10:45 -04:00
Tom Alexander
270ba53150
Set is_footnote_section during parsing.
2023-10-02 11:20:43 -04:00
Tom Alexander
de5788d8f3
Introduce a struct for the partially-parsed headline.
...
We are returning so many fields from that parser that managing a tuple is becoming unreadable. The struct should add some structure 😉 to the code.
2023-10-02 11:16:05 -04:00
Tom Alexander
178894680b
Compare footnote section.
2023-10-02 10:48:34 -04:00
Tom Alexander
599b3b8f0a
Apply category even if there are radio targets.
rustfmt Build rustfmt has failed
rust-build Build rust-build has failed
rust-test Build rust-test has succeeded
rust-foreign-document-test Build rust-foreign-document-test has succeeded
2023-10-02 10:26:57 -04:00
Tom Alexander
186201a4b5
Remove category from global settings.
...
rust-build Build rust-build has succeeded
rust-test Build rust-test has succeeded
rust-foreign-document-test Build rust-foreign-document-test has failed
This setting does not impact parsing so we can iterate over the final document to find the keywords.
2023-09-30 14:35:22 -04:00
Tom Alexander
d38b0a84f6
Fix handling file names with periods before the file extension.
rust-build Build rust-build has succeeded
rust-test Build rust-test has failed
rust-foreign-document-test Build rust-foreign-document-test has failed
2023-09-30 01:26:24 -04:00
Tom Alexander
846a8b3729
Support reading category from in-buffer-settings.
2023-09-30 00:14:26 -04:00
Tom Alexander
fc7d4bd949
Set Document path and category based on file path.
2023-09-29 23:59:32 -04:00
Tom Alexander
3fb2b5d31c
Undo the getters change.
...
The getters were a good idea, but if we are going to support editing later, we will need to expose the fields or write A LOT of boiler-plate. The getters also would prevent people from moving values out of the AST without even more boiler-plate. It is simply not worth it at this stage, so we will need to tolerate frequently changing semver versions as the public interface changes since *every* field in the AST is public.
2023-09-29 21:14:55 -04:00
Tom Alexander
d1dac0b8de
Compare document category.
2023-09-29 20:57:09 -04:00
Tom Alexander
064a4eeee7
Compare plain list item pre blank.
2023-09-29 19:30:02 -04:00
Tom Alexander
7727b5ef47
Compare plain list item counter.
2023-09-29 18:45:38 -04:00
Tom Alexander
967e74c147
Compare plain list item bullets.
2023-09-29 17:28:50 -04:00
Tom Alexander
07e11e359a
Add tests for odd headline levels.
2023-09-29 16:37:22 -04:00
Tom Alexander
f1261ddce8
Remove "org_" prefix from list_allow_alphabetical.
...
These settings are exclusively for parsing org-mode so the prefix is redundant.
2023-09-29 14:33:52 -04:00
Tom Alexander
3a422e6435
Counter set always allows alphabetic values regardless of org-list-allow-alphabetical.
2023-09-29 14:32:41 -04:00
Tom Alexander
f820e27b17
Compare plain list type in diff.rs.
2023-09-29 13:03:25 -04:00
Tom Alexander
a4b1d462c3
Parse out the plain list type.
2023-09-29 12:49:10 -04:00
Tom Alexander
48d550e1fc
Remove old implementation of iteration.
2023-09-27 19:45:40 -04:00
Tom Alexander
9ce042d5b6
Replace old iteration with new iteration.
2023-09-27 19:44:06 -04:00
Tom Alexander
cd781a7dcf
Add simple test to prove the scan for in-buffer settings is still working.
2023-09-24 03:09:51 -04:00
Tom Alexander
8cd0e4ec63
Optimize scanning for in-buffer settings by scanning forward for possible keywords.
...
Previously we stepped through the document character by character which involved a lot of extra processing inside OrgSource. By scanning for possible keywords, we can skip many of the intermediate steps.
2023-09-24 02:58:32 -04:00
Tom Alexander
f9460b88d7
Add a TODO for a performance optimization.
2023-09-24 01:59:26 -04:00
Tom Alexander
0b2a5f4fbf
Change all runtime asserts in private functions to debug_assert.
...
rustfmt Build rustfmt has succeeded
rust-test Build rust-test has succeeded
rust-build Build rust-build has succeeded
rust-foreign-document-test Build rust-foreign-document-test has succeeded
These functions aren't exposed to the public so we can confidently say that if they work in dev then they will work in production. Removing these asserts theoretically should result in a speedup.
2023-09-23 21:17:58 -04:00
Tom Alexander
d5b1014fe4
Unify the standard properties checks in diff.
...
Instead of copy+pasting them into each compare function, we now call a shared function from a handful of places.
2023-09-23 21:05:56 -04:00
Tom Alexander
b4c985071c
Add a GetStandardProperties trait.
2023-09-23 19:13:01 -04:00
Tom Alexander
f7690ff64b
Remove an allocation for lesser block end.
2023-09-22 00:55:10 -04:00
Tom Alexander
bd5e50d558
Remove TODO.
...
rustfmt Build rustfmt has succeeded
rust-test Build rust-test has succeeded
rust-build Build rust-build has succeeded
rust-foreign-document-test Build rust-foreign-document-test has succeeded
I tested and we cannot nest different types of dynamic blocks.
2023-09-21 23:58:41 -04:00
Tom Alexander
31c782499e
Do not match text markup end with empty contents.
2023-09-21 23:20:21 -04:00
Tom Alexander
49e3c90a3a
Add a test showing a text markup condition we are not handling and significantly reduce allocations by using references for the captured marker for text markup.
2023-09-21 22:35:09 -04:00
Tom Alexander
129228c5c5
Require either eof or whitespace to line ending for valueless items.
rust-test Build rust-test has succeeded
rust-build Build rust-build has succeeded
rust-foreign-document-test Build rust-foreign-document-test has failed
2023-09-21 22:06:30 -04:00
Tom Alexander
f0a7493a89
Support blank lines for descriptive list with empty value before final list item.
2023-09-21 22:03:21 -04:00
Tom Alexander
4ff62fbfae
Support backslash as a post character for text markup.
2023-09-21 21:25:33 -04:00
Tom Alexander
c892d406c3
Do not parse the tag for a plain list item if it is an ordered plain list item.
2023-09-21 20:58:03 -04:00
Tom Alexander
1a41cfc6c7
Support detecting line indentation when checking for contentless plain list items.
2023-09-21 20:08:04 -04:00
Tom Alexander
4f34ab9089
Support subscript/superscript wrapped in parenthesis.
2023-09-21 19:21:47 -04:00
Tom Alexander
9b2348c0ef
Allow matched parenthesis inside plain links.
2023-09-21 18:51:11 -04:00
Tom Alexander
5716cbccea
Remove unnecessary peak.
2023-09-21 16:34:24 -04:00
Tom Alexander
61c3e6c10e
Require table formulas have a value.
2023-09-21 14:12:18 -04:00
Tom Alexander
853adadf91
Do not allow unescaped opening bracket in path for link.
2023-09-21 13:41:48 -04:00
Tom Alexander
9bcfb2f1da
Decide headline nesting by star count, not headline level.
...
It is possible to have two headlines that have the same level but different star counts when set to Odd because of rounding. Deciding nesting by star count instead of headline level avoids this issue.
2023-09-20 03:22:25 -04:00
Tom Alexander
4c8d9a3063
Do not require a colon to close dynamic blocks.
2023-09-20 02:37:26 -04:00
Tom Alexander
48cb3c4a02
Move the post-colon check into the item_tag_divider parser.
2023-09-19 23:57:40 -04:00
Tom Alexander
9e60ff6683
Support rematching on italic, underline, and strike-through.
2023-09-19 23:25:49 -04:00
Tom Alexander
c1de001786
Require a space after colon instead of tab for fixed width area.
2023-09-19 20:22:29 -04:00
Tom Alexander
bdd04f4d5c
Do not allow '<' as a pre-character for text-markup but do allow start of file.
2023-09-16 14:06:31 -04:00
Tom Alexander
1a704dd312
Honor the odd startup setting from org-mode files.
rust-test Build rust-test has succeeded
rust-build Build rust-build has succeeded
rust-foreign-document-test Build rust-foreign-document-test has failed
2023-09-15 22:54:49 -04:00
Tom Alexander
a74ea730f4
Read the odd startup option from org-mode files.
2023-09-15 22:31:15 -04:00
Tom Alexander
d443dbd468
Introduce the tab_width setting and give tabs a greater value when counting indentation level.
2023-09-15 21:59:48 -04:00
Tom Alexander
c9ce32c881
Remve redundant org_spaces functions.
...
Turns out the nom space0/space1 parsers accept tab characters already.
2023-09-15 21:28:40 -04:00
Tom Alexander
85454a0a27
Fix footnote reference function label matcher.
...
Previously when a label started with a number but contained other characters, this parser would fail because it would not match the entire label.
2023-09-15 21:14:44 -04:00
Tom Alexander
fdebf6dec5
Delete already solved TODO.
2023-09-15 21:08:52 -04:00
Tom Alexander
444d6758aa
Handle leading blank lines in greater blocks.
rust-test Build rust-test has succeeded
rust-build Build rust-build has succeeded
rust-foreign-document-test Build rust-foreign-document-test has failed
2023-09-15 21:03:35 -04:00
Tom Alexander
bfe67b1f75
Parse plain list item checkboxes.
2023-09-15 16:09:57 -04:00
Tom Alexander
7f751d4f28
Allow no digit in repeater in timestamp.
2023-09-15 13:12:54 -04:00
Tom Alexander
52a4dab67c
Use the timestamp parser in planning.
...
Previously we did not support inactive timestamps in planning. This fixes that.
2023-09-15 12:45:19 -04:00
Tom Alexander
3d86e75059
Always match the entire entity name.
rust-test Build rust-test has succeeded
rust-build Build rust-build has succeeded
rust-foreign-document-test Build rust-foreign-document-test has failed
2023-09-14 04:29:50 -04:00
Tom Alexander
ca6fdf1924
Support different cases in radio links.
2023-09-14 04:04:21 -04:00
Tom Alexander
66d16d89ed
Support interchangeable whitespace in re-matching plain text.
2023-09-14 04:00:34 -04:00
Tom Alexander
22681b6a58
Support trailing whitespace in fixed-width areas.
2023-09-14 03:20:44 -04:00
Tom Alexander
876d33239e
Allow any character to be escaped in the path for links.
2023-09-14 03:05:11 -04:00
Tom Alexander
87941271a4
Handle headlines with trailing spaces without tags.
2023-09-14 02:43:40 -04:00
Tom Alexander
32b19d68d0
Support todo keywords with fast access.
2023-09-14 02:24:06 -04:00
Tom Alexander
44e9f708c9
Handle the possibility of a title-less headline.
2023-09-14 02:01:24 -04:00
Tom Alexander
33372429dd
Add a config option for org-list-allow-alphabetical.
...
This fixes an issue where lines in a paragraph were incorrectly getting identified as lists because I had defaulted to assuming alphabetical bullets were allowed.
2023-09-14 00:27:54 -04:00
Tom Alexander
e4c0e32536
Change public interface to return boxed dynamic error instead of String.
rustfmt Build rustfmt has succeeded
rust-test Build rust-test has succeeded
rust-build Build rust-build has succeeded
rust-foreign-document-test Build rust-foreign-document-test has succeeded
2023-09-12 15:52:01 -04:00
Tom Alexander
a651b79e77
Move sexp into compare.
2023-09-11 15:37:20 -04:00
Tom Alexander
98de5e4ec5
Remove unused sexp parser entry point.
2023-09-11 15:07:52 -04:00
Tom Alexander
cf383fa394
Only include sexp module if compare feature is enabled.
rust-test Build rust-test has succeeded
rust-build Build rust-build has succeeded
rust-foreign-document-test Build rust-foreign-document-test has succeeded
2023-09-11 14:59:24 -04:00
Tom Alexander
84953c1669
Put back in needed pubs.
2023-09-11 14:59:23 -04:00
Tom Alexander
7650a9edff
Remove all pub.
2023-09-11 13:11:08 -04:00
Tom Alexander
f103d168d5
Update diary sexp parser to match org-mode's behavior.
2023-09-11 12:34:57 -04:00
Tom Alexander
f54081437a
Add detect element functions for all elements that can be reasonably detected more efficiently than just parsing normally.
2023-09-11 12:28:15 -04:00
Tom Alexander
1561e1e580
Update plain list item tag parser to allow double colon as long as its not the last one on that line.
2023-09-11 10:29:15 -04:00
Tom Alexander
1f11bfa2ec
Join the plain list item tag end matchers again.
2023-09-11 10:13:22 -04:00
Tom Alexander
b75d9f5c91
Remove an outdated comment.
2023-09-09 00:00:12 -04:00
Tom Alexander
5587e19f16
Cleanup.
2023-09-08 23:19:08 -04:00
Tom Alexander
80f7098f9b
Compare table formulas.
2023-09-08 23:05:04 -04:00
Tom Alexander
84d2babda9
Parse table formulas.
2023-09-08 22:47:07 -04:00
Tom Alexander
0105b49d0d
Handle empty statistics cookies.
2023-09-08 22:21:49 -04:00
Tom Alexander
7545fb7e1a
Support keywords with colons in the key and without a space between the colon and value.
2023-09-08 22:17:10 -04:00
Tom Alexander
21c60d1036
Do not consume trailing whitespace on the footnote definition's final element.
2023-09-08 21:30:03 -04:00
Tom Alexander
6a1bdd5fee
Support blank lines before content in footnote definitions.
2023-09-08 21:11:47 -04:00
Tom Alexander
a8fbf01124
Handle tabs for plain list descriptions.
...
This bug probably exists in hundreds of places across the code base. I am going to have to write a "fuzzer" that replaces random whitespace with tabs to find them all.
2023-09-08 20:02:49 -04:00
Tom Alexander
ceb722e476
Check exit matcher after each space consumed for object trailing whitespace.
...
Since description list tags need to end with a space unconsumed for " ::", we need to check the exit matcher after each space consumed.
2023-09-08 19:38:49 -04:00
Tom Alexander
494fe5cceb
Handle contentless list items mid-document.
2023-09-08 19:01:46 -04:00
Tom Alexander
0d7a15bfeb
Handle spaces after statistics cookies.
2023-09-08 18:35:33 -04:00
Tom Alexander
669da4073e
Accept the end condition as a parameter to the plain text parser so it can adapt to the context.
2023-09-08 17:54:49 -04:00
Tom Alexander
8780976c15
Consume trailing whitespace after planning.
2023-09-08 16:30:40 -04:00
Tom Alexander
c7c0deed74
Parse priority cookie and COMMENT from headlines.
2023-09-08 16:00:16 -04:00
Tom Alexander
2e6e6fdd2b
Move sections to their own source file.
2023-09-08 15:08:16 -04:00
Tom Alexander
3cc2294387
Move headlines into their own file.
2023-09-08 15:05:42 -04:00
Tom Alexander
40f22034da
Make the item tag exit matcher a lower class than all all others.
...
This is to allow for " :: " inside a description list item's tag if it is nested inside another object.
2023-09-08 14:37:30 -04:00
Tom Alexander
c2eb1f51c8
Support blank lines between nested headlines.
2023-09-08 12:41:48 -04:00
Tom Alexander
b0930df788
Support zero skipped text in OrgSource slicing.
2023-09-07 04:16:00 -04:00
Tom Alexander
69512f559a
Fix end conditions for subscript and superscript.
2023-09-07 04:16:00 -04:00
Tom Alexander
76a81b73ac
Add a detect object function similar to the detect element function.
2023-09-07 04:16:00 -04:00
Tom Alexander
ba291c6776
Unify two places checking if text was preceded by whitespace.
2023-09-07 04:16:00 -04:00
Tom Alexander
6b82b46e09
Prevent nesting of text markup of the same type.
...
This greatly reduces the amount of detect element calls that are occurring.
2023-09-07 04:15:59 -04:00
Tom Alexander
6676012eb1
Change footnote reference class to Gamma.
2023-09-07 04:15:59 -04:00
Tom Alexander
facbe716e9
Cleanup
2023-09-07 01:23:26 -04:00
Tom Alexander
f8b99ed235
Support counter set in plain list items.
2023-09-06 19:09:20 -04:00
Tom Alexander
6fc607cfe0
Compare node properties.
2023-09-06 18:54:47 -04:00
Tom Alexander
49afcf0db6
Support property nodes with colons in their key.
2023-09-06 18:54:01 -04:00
Tom Alexander
c4d7e646fc
Support spaces after the end of a lesser block.
2023-09-06 18:54:01 -04:00
Tom Alexander
3fc3a5d1ef
Add support for empty lesser blocks.
2023-09-06 18:11:57 -04:00
Tom Alexander
6e2fc362ea
Add support for babel-call keywords.
2023-09-06 18:04:53 -04:00
Tom Alexander
90fa48661c
Prefer the longer version of affiliated keywords.
2023-09-06 17:41:00 -04:00
Tom Alexander
28b2d27054
Consume trailing whitespace after a plain link.
rustfmt Build rustfmt has succeeded
rust-test Build rust-test has succeeded
rust-build Build rust-build has succeeded
2023-09-06 14:39:31 -04:00
Tom Alexander
84edd10864
Change lesser block exit class to Alpha.
...
rust-test Build rust-test has succeeded
rust-build Build rust-build has succeeded
rustfmt Build rustfmt has succeeded
When an example block is nested inside a list, this change allows for the contents of the example block to be on lines less indented than before.
2023-09-06 14:14:02 -04:00
Tom Alexander
728a79f9a4
Handle zero-width space in text markup.
rust-test Build rust-test has succeeded
rust-build Build rust-build has succeeded
rustfmt Build rustfmt has succeeded
2023-09-06 13:56:27 -04:00
Tom Alexander
12cbb89861
Compare todo-type on headlines.
rust-test Build rust-test has succeeded
rust-build Build rust-build has succeeded
2023-09-06 12:39:03 -04:00
Tom Alexander
400f53e440
Cleanup.
2023-09-06 11:53:21 -04:00
Tom Alexander
028aeb70aa
Use the global settings todo keywords when parsing headlines.
2023-09-06 11:45:35 -04:00
Tom Alexander
70fafd801e
Apply the TODO keyword settings.
2023-09-06 11:07:57 -04:00
Tom Alexander
bdba495f69
Add a parser for the todo keyword's value.
rust-test Build rust-test has succeeded
rust-build Build rust-build has succeeded
2023-09-06 09:24:59 -04:00
Tom Alexander
b0392ad6fb
Trim the trailing space off keywords with values.
rust-test Build rust-test has succeeded
rust-build Build rust-build has succeeded
2023-09-04 22:35:46 -04:00
Tom Alexander
1c142b68c6
Make the parse entry point call the parse_with_settings entry point.
2023-09-04 22:11:56 -04:00
Tom Alexander
9060f9b26d
Only do a single pre-pass on the full document pulling out both setupfile and all other in-buffer settings.
...
rust-test Build rust-test has failed
rust-build Build rust-build has failed
Previously we made a separate pass just to find setupfile and then we pulled the in-buffer settings from everything.
2023-09-04 22:05:59 -04:00
Tom Alexander
d3c733c5ad
Take into account the source directory when parsing org-mode in Organic.
...
Previously only the emacs code was doing this.
2023-09-04 21:46:40 -04:00
Tom Alexander
275b4b53d1
Use a single function for finding all keywords.
2023-09-04 19:19:23 -04:00
Tom Alexander
d38e198258
Add a parse_with_settings function.
2023-09-04 17:44:27 -04:00
Tom Alexander
c7d5c89a60
Passing the setupfile contents to the document parser.
2023-09-04 17:16:08 -04:00