Commit Graph

1312 Commits

Author SHA1 Message Date
Tom Alexander
c150aa4dea
Add support for an org-entities global setting. 2023-10-08 18:01:42 -04:00
Tom Alexander
1df6777b0b
Starting to compare entity properties. 2023-10-08 17:24:03 -04:00
Tom Alexander
f07d041eb9
Fix handling capitalization in macro names.
All checks were successful
rust-build Build rust-build has succeeded
rust-foreign-document-test Build rust-foreign-document-test has succeeded
rust-test Build rust-test has succeeded
2023-10-08 16:51:44 -04:00
Tom Alexander
9bdec391f1
Do not capture trailing whitespace on the final macro arg.
Some checks failed
rust-build Build rust-build has succeeded
rust-foreign-document-test Build rust-foreign-document-test has failed
rust-test Build rust-test has succeeded
2023-10-08 16:39:22 -04:00
Tom Alexander
dd009498dd
Switch to using coalesce_whitespace_escaped for macro args.
Some checks failed
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
2023-10-08 16:19:25 -04:00
Tom Alexander
17c745ee71
Improve coalesce_whitespace_escaped to borrow when single spaces are used. 2023-10-08 16:15:49 -04:00
Tom Alexander
41aa0349a0
Add tests for coalesce_whitespace_escaped. 2023-10-08 16:06:52 -04:00
Tom Alexander
a6adeee40b
Handle escaping the characters in org macro arguments. 2023-10-08 15:54:56 -04:00
Tom Alexander
a32cea8139
Coalesce whitespace in macro args. 2023-10-08 15:08:21 -04:00
Tom Alexander
37bc5ef712
Do not include whitespace at the end of value. 2023-10-08 14:48:29 -04:00
Tom Alexander
1a2f0856da
Compare macro properties. 2023-10-08 14:40:01 -04:00
Tom Alexander
e9276e35ca
Add comments. 2023-10-08 14:18:17 -04:00
Tom Alexander
3041a575f9
Fix lifetimes. 2023-10-08 14:13:02 -04:00
Tom Alexander
42dbda494a
Switch to using a similar optimized Cow function for regular link. 2023-10-08 14:11:46 -04:00
Tom Alexander
0e791e67ab
Move the angle link string processing functions to a util file.
Since I bothered to do the right thing and implement these as returning Cow so I can avoid unnecessary allocations, I figure I should move them to a util file so they can be re-used.
2023-10-08 13:36:57 -04:00
Tom Alexander
ba55e0df4f
Remove all whitespace from search option if it contains any line breaks and handle triple+ slashes for file links. 2023-10-08 13:23:12 -04:00
Tom Alexander
d987b9b75b
Remove line breaks from path and do not allow search option for protocol links. 2023-10-08 13:02:09 -04:00
Tom Alexander
aa253c38dd
Parse out the angle link properties. 2023-10-08 12:46:18 -04:00
Tom Alexander
ceb5376b21
Fix handling of search option for plain links when parenthesis are involved. 2023-10-08 10:57:05 -04:00
Tom Alexander
b64c1c944b
Allow :: to end links regardless of parenthesis. 2023-10-08 10:57:05 -04:00
Tom Alexander
120a06055f
Handle 3 or more slashes in the path for regular links. 2023-10-08 09:54:10 -04:00
Tom Alexander
bbcafef8bf
Handle 3 or more slashes in the path for plain links. 2023-10-08 09:51:12 -04:00
Tom Alexander
038535174b
Do not allow empty path in plain links and do not remove "//" in regular links. 2023-10-08 09:34:47 -04:00
Tom Alexander
1bbe8fc688
Do not strip "//" from plain link path. 2023-10-08 09:28:09 -04:00
Tom Alexander
ba8115c648
Remove "//" from file paths. 2023-10-08 09:16:48 -04:00
Tom Alexander
0030ef4459
Parse application and handle parenthesis in regular links. 2023-10-08 09:10:47 -04:00
Tom Alexander
20a8683894
Handle puncuation-only search options.
Some checks failed
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-10-07 03:25:37 -04:00
Tom Alexander
7196e10b69
Set up regular links for adding application. 2023-10-07 03:14:16 -04:00
Tom Alexander
ddb09a1805
Add support for application in plain links. 2023-10-07 03:00:40 -04:00
Tom Alexander
c58b850570
Add support for search options. 2023-10-07 02:42:07 -04:00
Tom Alexander
a55694176c
Compare the properties of plain links. 2023-10-07 02:22:36 -04:00
Tom Alexander
6973d5a2c0
Since value and path are always the same for radio links, I removed the extra value. 2023-10-07 01:48:16 -04:00
Tom Alexander
36327e92d7
Radio link did not need Cow.
All checks were successful
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
I was only using Cow because regular links can use templates which would require owned data. Radio links do not share this feature.
2023-10-07 01:26:52 -04:00
Tom Alexander
c70eb69ed6
Compare radio target properties. 2023-10-07 01:24:32 -04:00
Tom Alexander
029791e0b2
Fix tests. 2023-10-07 01:01:04 -04:00
Tom Alexander
8d621b32dc
Compare radio link properties.
Some checks failed
rust-test Build rust-test has failed
rust-build Build rust-build has succeeded
rust-foreign-document-test Build rust-foreign-document-test has succeeded
2023-10-07 00:57:55 -04:00
Tom Alexander
56348a6d54
Actually absolute paths are files too.
All checks were successful
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-07 00:15:37 -04:00
Tom Alexander
65e142a215
Link templates support single-colons and inject the value at the end if no %s is found. 2023-10-06 23:55:21 -04:00
Tom Alexander
aa0a0b890e
Relative paths are file links, absolute paths are fuzzy. 2023-10-06 23:48:55 -04:00
Tom Alexander
4c8828b91b
Apply the link templates. 2023-10-06 23:33:09 -04:00
Tom Alexander
2ba5156ee1
Add a global setting for link templates. 2023-10-06 20:34:13 -04:00
Tom Alexander
4716e1ce5b
Switch to using AsRef<str> to make compare_property_quoted_string generic. 2023-10-06 20:23:19 -04:00
Tom Alexander
89fcf6cb54
Restrict protocol links to org-link-parameters. 2023-10-06 19:18:58 -04:00
Tom Alexander
f220fd63e5
Add org-link-parameters to the GlobalSettings. 2023-10-06 19:14:11 -04:00
Tom Alexander
7cf1f7b7bb
Only orgify the link text if there are line breaks present. 2023-10-06 19:05:56 -04:00
Tom Alexander
135ca133ea
Add tests for search option. 2023-10-06 18:56:11 -04:00
Tom Alexander
d126488891
Handle orgifying text in regular link path and raw-link. 2023-10-06 18:30:08 -04:00
Tom Alexander
51748afd41
Compare pathreg. 2023-10-06 17:28:26 -04:00
Tom Alexander
e84135985e
Parse out the pathreg on regular links. 2023-10-06 17:21:43 -04:00
Tom Alexander
448902bb05
Add regular link tests for all the types. 2023-10-06 16:52:45 -04:00
Tom Alexander
65df18171a
Add field list for regular link. 2023-10-06 16:42:31 -04:00
Tom Alexander
fbe3c76ab7
Cleanup. 2023-10-06 16:32:49 -04:00
Tom Alexander
368c6a457e
Wrap the parameter sets in parenthesis. 2023-10-06 16:19:43 -04:00
Tom Alexander
c7dbe596b3
Switch to more generic implementation. 2023-10-06 16:03:41 -04:00
Tom Alexander
3da52a0826
Make a more generic version of compare_property_quoted_string.
This allows for the rust value to be determined by a function rather than hard-coded.
2023-10-06 14:07:25 -04:00
Tom Alexander
ae11e390d1
Add a default case for tokens which do not have any expected properties except for :standard-properties. 2023-10-06 13:45:19 -04:00
Tom Alexander
45dd38ac2d
Assume :standard-properties is an expected field. 2023-10-06 13:40:11 -04:00
Tom Alexander
7af18e2312
Move the EmacsField enum since it has nothing to do with ElispFact. 2023-10-06 13:32:39 -04:00
Tom Alexander
1b603f3a05
Implement the comparison. 2023-10-06 13:29:46 -04:00
Tom Alexander
d06e4de7b0
Starting a new macro for comparing fields.
This will help us assert that all fields are tested and that only expected fields are present.
2023-10-06 13:08:15 -04:00
Tom Alexander
672848d06a
Compare the properties of text markup. 2023-10-06 12:12:24 -04:00
Tom Alexander
758e224e6d
Move consuming trailing element whitespace inside the parsers.
This ensures the parsers can take into account the affiliated keywords when setting their source without needing the SetSource trait.
2023-10-06 12:02:14 -04:00
Tom Alexander
f79606047e
Compare value.
Some checks failed
rust-test Build rust-test has failed
rust-foreign-document-test Build rust-foreign-document-test has succeeded
rust-build Build rust-build has succeeded
2023-10-05 20:13:10 -04:00
Tom Alexander
823426a4f1
Cleanup. 2023-10-05 20:04:52 -04:00
Tom Alexander
fa97124186
Handle nesting of brackets.
All checks were successful
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-05 19:51:13 -04:00
Tom Alexander
885fefd060
Implement generic function for balanced brackets text. 2023-10-05 19:51:13 -04:00
Tom Alexander
68e392811e
Parse the babel call. 2023-10-05 18:44:56 -04:00
Tom Alexander
343af41f78
Separate babel call out to its own parser. 2023-10-05 16:27:36 -04:00
Tom Alexander
6bd8d9efd7
Cleanup. 2023-10-05 04:04:18 -04:00
Tom Alexander
18ad80e018
Compare value. 2023-10-05 03:58:42 -04:00
Tom Alexander
4ba9d7439a
Compare value. 2023-10-05 03:46:14 -04:00
Tom Alexander
b478b6f5d7
Compare value, duration, and status. 2023-10-05 03:40:29 -04:00
Tom Alexander
e21701b97c
Cleanup. 2023-10-05 02:26:11 -04:00
Tom Alexander
ef8a6884fe
Remove outdated TODO. 2023-10-05 02:20:25 -04:00
Tom Alexander
ac7125d9b6
Only allow a single export type for export blocks. 2023-10-05 02:17:53 -04:00
Tom Alexander
58ca9569a6
Compare export type. 2023-10-05 02:15:32 -04:00
Tom Alexander
1da521b08a
Compare value for export block. 2023-10-05 02:06:26 -04:00
Tom Alexander
386ad5091d
End switches at the first unrecognized word in src blocks. 2023-10-05 01:55:33 -04:00
Tom Alexander
d8ea450a46
Add TODOs for comparing caption to elems that can have affiliated keywords. 2023-10-05 01:06:30 -04:00
Tom Alexander
3742f4fa08
Remove double option. 2023-10-05 00:53:11 -04:00
Tom Alexander
11a7234900
Handle empty parameters with whitespace preceding. 2023-10-05 00:49:15 -04:00
Tom Alexander
50a3631b79
Handle whitespace after parameters in src blocks. 2023-10-05 00:43:03 -04:00
Tom Alexander
da2d7535e8
Add synonyms for name. 2023-10-05 00:30:33 -04:00
Tom Alexander
1351577c5a
Fix handling affiliated keywords before invalid paragraphs. 2023-10-04 23:40:38 -04:00
Tom Alexander
65eda08843
Re-work the element parser to handle affiliated keywords before elements that cannot have affiliated keywords. 2023-10-04 22:47:13 -04:00
Tom Alexander
b82d4c0eca
Fix finding name keyword in affiliated keywords list. 2023-10-04 21:32:10 -04:00
Tom Alexander
93fe46e4e7
Populate the name field on elements. 2023-10-04 21:27:55 -04:00
Tom Alexander
5b308ea76f
Implement a function to read the name from the affiliated keywords. 2023-10-04 21:12:06 -04:00
Tom Alexander
ab4a0c1224
Clean up. 2023-10-04 21:05:20 -04:00
Tom Alexander
786521ad4a
Add affiliated keyword matching to the detect_* functions. 2023-10-04 21:03:32 -04:00
Tom Alexander
d8102b7bc2
Move the affiliated keywords parser inside the specific element parsers.
We need access to the affiliated keywords to do things like set the name of the element, and only half the element parsers are allowed to have affiliated keywords, so it makes sense to move it inside the specific parsers.
2023-10-04 20:55:48 -04:00
Tom Alexander
a26640355c
Add check for name on paragraph. 2023-10-04 19:58:09 -04:00
Tom Alexander
057c8a1387
Compare name. 2023-10-04 19:43:34 -04:00
Tom Alexander
4fc81e983a
Add tests for names for lesser blocks. 2023-10-04 19:39:50 -04:00
Tom Alexander
258e9485de
Add tests for names and references in src and example blocks. 2023-10-04 19:34:10 -04:00
Tom Alexander
87ac18e6b2
Add real handling for preserve indent.
Now that I know which flag changes this setting, we can handle it properly.
2023-10-04 19:23:47 -04:00
Tom Alexander
c877116540
Fix handling of spaces between language, switches, and parameters. 2023-10-04 18:57:51 -04:00
Tom Alexander
8e70773b15
Fix handling cases where only language is specified before parameters. 2023-10-04 18:11:38 -04:00
Tom Alexander
f046b16c11
Compare src block parameters. 2023-10-04 18:02:50 -04:00
Tom Alexander
1ab7d2f2d7
Add a test showing we are not handling exports flags properly. 2023-10-04 17:32:51 -04:00
Tom Alexander
a548c7e170
Exclude language from the switches property. 2023-10-04 17:11:13 -04:00
Tom Alexander
b556f4617f
Add src block properties.
These are largely the same as example blocks but with a :language property.
2023-10-04 16:58:45 -04:00
Tom Alexander
13163f2468
Retain labels stays a boolean without -r. 2023-10-04 16:37:15 -04:00
Tom Alexander
da5dcd4c1b
Support multiple commas when escaping lines. 2023-10-04 16:03:45 -04:00
Tom Alexander
d059afef07
Add a setting for coderef_label_format. 2023-10-04 15:48:57 -04:00
Tom Alexander
bcade66e68
Retain labels is actually either a boolean or a number. 2023-10-04 15:43:09 -04:00
Tom Alexander
301a6db83e
Fix retain labels.
This is a numeric value based on the character offset of -k from the beginning of the switches.
2023-10-04 15:21:27 -04:00
Tom Alexander
32da06776c
Handle matching no switches. 2023-10-04 15:21:27 -04:00
Tom Alexander
169bf69f5e
Preserve the leading whitespace before an escape. 2023-10-04 15:21:27 -04:00
Tom Alexander
7ee48ff65c
Switch to handling the unescaping during the initial parsing.
This preserves the line ending characters unlike the rust .lines() iterator.
2023-10-04 15:21:27 -04:00
Tom Alexander
afb43ff34f
Switch to getting the contents with a function to handle the escaped lines. 2023-10-04 15:21:27 -04:00
Tom Alexander
b56d847cfa
Compare label format, retain labels, and use labels. 2023-10-04 15:21:27 -04:00
Tom Alexander
1503054994
Make an argument for the line number switch optional. 2023-10-04 11:46:02 -04:00
Tom Alexander
03028889bd
Fix capturing trailing whitespace for switches. 2023-10-04 11:34:01 -04:00
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
650cbc17db
Compare switches for example block. 2023-10-04 10:04:11 -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
e6c809ab03
Compare value for comment block. 2023-10-04 09:35:19 -04:00
Tom Alexander
68a3f8b87e
Fix table rule row detection. 2023-10-03 00:13:15 -04:00
Tom Alexander
b1244de1dc
Compare row type. 2023-10-03 00:03:58 -04:00
Tom Alexander
e5a402ee1b
Compare type and value.
All checks were successful
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
Since we only support org-mode tables, type is always org. Value seems to always be nil, not sure why.
2023-10-02 23:57:17 -04:00
Tom Alexander
3d1b2713ed
Compare key and value. 2023-10-02 23:45:31 -04:00
Tom Alexander
d992947ff1
Compare name. 2023-10-02 23:34:06 -04:00
Tom Alexander
b56318fbe4
Add TODO comment. 2023-10-02 23:29:58 -04:00
Tom Alexander
8169499de3
Compare value. 2023-10-02 23:28:32 -04:00
Tom Alexander
4d356b855e
Compare label. 2023-10-02 22:48:54 -04:00
Tom Alexander
ae66d1bd89
Fix tracing build.
All checks were successful
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
4a72747dc9
Compare name and parameters. 2023-10-02 22:33:00 -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
d53b9e1e1f
Fix get_property.
This was returning the error when a token was not an atom whereas we only wanted to check to see if it was the atom nil.
2023-10-02 19:22:35 -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
54c66fb4d6
Change get_property to allow absent values.
We're returning an Option<> anyway so might as well handle absent values.
2023-10-02 19:07:12 -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
9846cde2f0
Trim whitespace from raw value. 2023-10-02 16:32:33 -04:00
Tom Alexander
dec3242e72
Implement the Time struct. 2023-10-02 16:24:51 -04:00
Tom Alexander
a8a34e2d9c
Compare date start/end. 2023-10-02 16:16:19 -04:00
Tom Alexander
c55fae86f8
Improve lifetimes for get_property_numeric. 2023-10-02 15:51:29 -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
ecdfd7087f
Compare raw-value. 2023-10-02 14:45:20 -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
06ecf41663
Add notes about the fields for timestamps. 2023-10-02 13:19:43 -04:00
Tom Alexander
9575ef30ac
Fix compilation.
All checks were successful
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
25f664e69e
Fix warnings. 2023-10-02 13:05:51 -04:00
Tom Alexander
52e0d305aa
Remove compare_element and compare_object. 2023-10-02 13:05:29 -04:00
Tom Alexander
418c5c1ce8
Implement the traits for all ast node types. 2023-10-02 12:53:23 -04:00
Tom Alexander
ecd523fa8f
Fix lifetimes in the compare functions. 2023-10-02 12:36:09 -04:00
Tom Alexander
c0555dec0b
Fix lifetimes for DiffEntry/DiffResult. 2023-10-02 12:28:48 -04:00
Tom Alexander
1b788f3f21
Fix lifetimes on StandardProperties. 2023-10-02 12:11:05 -04:00
Tom Alexander
b3382c66cd
Fix lifetimes on ElispFact.
This was listed as a yellow flag on https://quinedot.github.io/rust-learning/pf-shared-nested.html.
2023-10-02 12:11:05 -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
d78ce10a0b
Compare raw-value. 2023-10-02 10:26:57 -04:00
Tom Alexander
599b3b8f0a
Apply category even if there are radio targets.
Some checks failed
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.
Some checks failed
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.
Some checks failed
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
6ed35f4674
Minor cleanup. 2023-09-30 00:16:19 -04:00
Tom Alexander
846a8b3729
Support reading category from in-buffer-settings. 2023-09-30 00:14:26 -04:00
Tom Alexander
896250836b
Add support for parsing quoted strings containing escaped octals. 2023-09-29 23:59:33 -04:00
Tom Alexander
6c77586960
Improve error message. 2023-09-29 23:59:32 -04:00
Tom Alexander
fc7d4bd949
Set Document path and category based on file path. 2023-09-29 23:59:32 -04:00
Tom Alexander
f1e35e317b
Compare document path. 2023-09-29 21:20:23 -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
93f1bcd744
Add getters for Document. 2023-09-29 20:57:09 -04:00
Tom Alexander
5d1582be4d
Remove multi_field_getter_iter.
This was written because I originally intended to make the fields of the ast node types entirely private, but that made constructing them tedious so they are pub(crate) which coincidentally also allows them to be used by the iterator.
2023-09-29 20:40:31 -04:00
Tom Alexander
dae10c2eef
Initial work for exposing getters and hiding the fields of the ast nodes.
Ultimately this is about semver and exposing a stable interface while allowing the internal representation to change. The fields are still pub(crate) to make constructing the types easier inside this crate, which should be fine because we can refactor the code inside this crate whenever the internal structure changes.
2023-09-29 20:40:31 -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
0c363c8dd6
Add tests for tab width. 2023-09-29 16:03:55 -04:00
Tom Alexander
9a479b33e0
Make the same changes we did for stdin compare to comparing files. 2023-09-29 15:42:07 -04:00
Tom Alexander
7a854838ef
Clean up code duplication. 2023-09-29 15:35:57 -04:00
Tom Alexander
2012e5a6d5
Test org_mode_samples both with and without alphabetical lists enabled. 2023-09-29 15:30:38 -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
1b7326eafe
Use static strings for CustomError.
All checks were successful
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
This resulted in a 20% speedup.
2023-09-29 12:02:26 -04:00
Tom Alexander
90433aa55f
Update callgrind script to build with optimizations. 2023-09-29 12:02:25 -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
8784da5179
Implement all ast node iteration. 2023-09-27 19:30:21 -04:00
Tom Alexander
875a50ae46
Finish implementing AstNodeIter for all types. 2023-09-27 19:02:33 -04:00
Tom Alexander
c4ea3fbf88
Implement the rest of the elements. 2023-09-27 18:55:50 -04:00
Tom Alexander
95fa834420
Switch to using the multi field macro for document and heading. 2023-09-27 18:38:51 -04:00
Tom Alexander
32a7ce3f36
Implement a macro for iterators with multiple fields. 2023-09-27 18:36:29 -04:00
Tom Alexander
d8c52568db
Add PlainListItem to ast nodes. 2023-09-27 18:21:42 -04:00
Tom Alexander
c5be75ee8d
Implement DocumentIter and SectionIter. 2023-09-27 18:05:53 -04:00
Tom Alexander
282417ee94
Implementing HeadingIter but I do not think it can be generic enough for a macro.
Hopefully most types won't need so much care.
2023-09-27 18:00:30 -04:00
Tom Alexander
ab46a9e5c6
Ran into issue with heading, naming this type is going to be a nightmare. 2023-09-27 15:56:45 -04:00
Tom Alexander
4359fc9266
Introduce a macro for empty iterators. 2023-09-27 15:47:01 -04:00
Tom Alexander
7419b75d76
Implement empty iterator for types with no ast node children. 2023-09-27 15:38:33 -04:00
Tom Alexander
e4cfc296e5
Introduce macro to simplify this. 2023-09-27 15:28:43 -04:00
Tom Alexander
9a1d91ae45
Manual implementation of BoldIter. 2023-09-27 15:17:56 -04:00
Tom Alexander
df5d699a39
Implement Into for AstNode. 2023-09-27 15:07:26 -04:00
Tom Alexander
9111408d83
Introduce AstNode and AstNodeIter enums. 2023-09-27 14:24:08 -04:00
Tom Alexander
35f058a354
Starting a new iteration implementation.
This implementation will reduce the use of heap by elimininating Box<> from the individual iterators but it will still need heap for maintaining a vector of iterators from nodes.
2023-09-27 13:48:17 -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.
All checks were successful
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
dd8a8207ce
Move assert bounds for elements and objects (except PlainText) to the compare element/object functions. 2023-09-23 19:35:12 -04:00
Tom Alexander
b4c985071c
Add a GetStandardProperties trait. 2023-09-23 19:13:01 -04:00
Tom Alexander
d4f27ef297
Remove only use of Source trait. 2023-09-23 17:59:13 -04:00
Tom Alexander
f25246556c
Rename the existing StandardProperties struct to EmacsStandardProperties. 2023-09-23 17:44:54 -04:00
Tom Alexander
3fe56e9aa3
Implement StandardProperties for all the AST nodes and restrict the Source trait to this crate.
Currently this is a copy of the Source trait but it will grow to more functions. The Source trait is restricted to this crate in anticipation of its removal in favor of StandardProperties.
2023-09-23 17:42:27 -04:00
Tom Alexander
f180412ff3
Introduce a StandardProperties trait. 2023-09-23 17:33:46 -04:00
Tom Alexander
1f64e289a2
Add TODOs for all of the properties that need to be compared.
Some checks failed
rust-foreign-document-test Build rust-foreign-document-test has started
rustfmt Build rustfmt has failed
rust-build Build rust-build has failed
rust-test Build rust-test has failed
2023-09-23 14:46:36 -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.
All checks were successful
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.
Some checks failed
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
ba15999534
Add a test showing we are not handling parenthesis in links properly.
Some checks failed
rust-test Build rust-test has failed
rust-build Build rust-build has succeeded
rust-foreign-document-test Build rust-foreign-document-test has failed
2023-09-21 14:31:13 -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.
Some checks failed
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.
Some checks failed
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
fd41ad9c29
Pretend dos line endings do not exist. 2023-09-15 14:13:17 -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.
Some checks failed
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
b8a4876779
Disable auto-aligning tables when Emacs loads Org-mode.
Emacs will auto-align tables when org-mode is loaded if the document contains "#+STARTUP: align". Since Organic is just a parser, it has no business editing the input it receives so we are disabling this auto-align in Emacs to make the tests work properly.
2023-09-13 21:02:38 -04:00
Tom Alexander
e4c0e32536
Change public interface to return boxed dynamic error instead of String.
All checks were successful
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
37e85158ea
Reduce the exposed functions when compare feature is enabled. 2023-09-12 15:48:37 -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.
All checks were successful
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
a74319d381
Add TODO. 2023-09-11 13:09:46 -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
de7ad182b3
Make parse and compare their own binaries.
All checks were successful
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
This ensures that both code paths are capable of being parsed by rust-analyzer simultaneously and I think it will be less confusing to newcomers.
2023-09-09 04:21:34 -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
cc56b79683
Add a test showing we're not handling table formulas. 2023-09-08 22:42:24 -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
93d3d9471f
Compare priority, archived, and commented in headlines. 2023-09-08 16:00:16 -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