Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incomplete date range causes Error #39

Closed
Maltimore opened this issue Jan 26, 2023 · 3 comments
Closed

Incomplete date range causes Error #39

Maltimore opened this issue Jan 26, 2023 · 3 comments

Comments

@Maltimore
Copy link

A date range would be something like <2023-01-26 Thu>--<2023-01-27 Fri>. Having an incomplete date range like <2023-01-26 Thu>-- in some parts of the document leads to a parsing error, but not in others:

* headline
  <2023-01-26 Thu>--

leads to

subsection: (section) [1:1-3:0]
 headline: (headline) [1:1-2:0]
  stars: (stars) [1:1-1]
  item: (item) [1:3-10]
   (expr) [1:3-10]
 plan: (plan) [2:3-3:0]
  (entry) [2:3-18]
   timestamp: (timestamp) [2:3-18]
    date: (date) [2:4-13]
    day: (day) [2:15-17]
  (ERROR) [2:19-20]

but

* headline

  <2023-01-26 Thu>--

leads to

subsection: (section) [1:1-4:0]
 headline: (headline) [1:1-2:0]
  stars: (stars) [1:1-1]
  item: (item) [1:3-10]
   (expr) [1:3-10]
 body: (body) [2:1-4:0]
  (paragraph) [3:3-4:0]
   (expr) [3:3-13]
   (expr) [3:15-20]
@milisims
Copy link
Owner

This is expected and intended behavior. Only the line after the headline is parsed as a planning line, and it's an error if the date is incomplete. After the empty space, dates are just text.

@Maltimore
Copy link
Author

Oh, in that case sorry for the noise! Thanks for explaining.

@tonico
Copy link

tonico commented Nov 21, 2023

I ran into a similar issue.

* Some event
  <2023-11-17 Fr> will be fun!

The text above produces a parse tree that contains an error (similar as in the comment above). But according to https://orgmode.org/worg/org-syntax.html#Planning the line after the heading is not a planning line because either DEADLINE, SCHEDULED, or CLOSED is required at the start of a planning line.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants