Commit Graph

897 Commits

Author SHA1 Message Date
Tom Alexander
d126488891
Handle orgifying text in regular link path and raw-link. 2023-10-06 18:30:08 -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
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
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
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
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
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
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
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.
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
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.
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
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.
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
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