Commit Graph

998 Commits

Author SHA1 Message Date
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
rust-test Build rust-test has succeeded
rust-foreign-document-test Build rust-foreign-document-test has succeeded
rustfmt Build rustfmt has succeeded
rust-build Build rust-build 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-foreign-document-test Build rust-foreign-document-test has succeeded
rust-test Build rust-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