-
Notifications
You must be signed in to change notification settings - Fork 250
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
Parser updates #482
Parser updates #482
Conversation
With a double comma before tags, hashes can be anywhere in the activity, category or description
93bed5f
to
823bf27
Compare
I played with this a little and it seems okay to me. |
This is breaking: starting a description with a single comma does not work any longer. A double coma is required instead.
9cce2d7 allowed both a single and a double comma to start a description. Restricting the description barrier to be a double comma Since the next version is a major revision anyway, this might be acceptable. Kind word of warning: known issue (loosely related): in the gui cmdline, do not try to add a comma in a tag; |
I've played with this a bit and it seems to work "as advertised". A hiccup I've noticed: when entering the old style |
2f1b309
to
50ab84d
Compare
Good catch, thanks ! 50ab84d makes the error slightly more obvious since |
Do not silently swallow commas in category.
Get datetimes directly, using regular expressions, following parse_datetime_range in hamster-cli. The parser is both simplified further and enhanced. Civil dates can now be given explicitly, as on the command line.
This is still experimental, Line 203 in 9e86b70
gives an idea of the possibilities. Next step: polish, and use the same parser for command line (slightly modified to look for the datetimes at the "tail" instead of "head"). |
Necessary for past days in gui, while keeping relative times reference to be now.
Done: the cli now uses the main parser |
Done in d8c6425. |
a07fe75
to
b890717
Compare
Breaking: - removed prepend_date argument, - renamed serialized_time to serialized_range.
b890717
to
88db677
Compare
Users should use parse_time.
Users should use parse_datetime.
The first commit is #476.
The next two were from #475 (that will be closed).
Breaking change:
double comma
,,
is now always required to start a description.Single comma does not work any longer for this purpose.
If a single comma happens to be used by mistake,
the comma and the following text would end in the category.
So comma will be forbidden in the category,
to raise an error instead of merging a wrong fact in the database.
That will be the purpose of a forthcoming PR.
This allows to enter a comma in the activity (fixes #280),
while even clarifying the parser.
Then with a double comma barrier
,,
before tags,hashes can be anywhere in the activity, category or description.
(fixes #423)
The same parser is used in gui (cmdline) and terminal (command line).
(Fixes #438)
The only difference is the location of start-end: head or tail, respectively (no change).
New: dates can be entered on the gui cmdline.
Otherwise facts overlapping day-start would be impossible to enter due to #476.
For standard facts that fit in a single hamster day, times are enough (no change).
Almost finished, just need
(meanwhile, a good way to investigate: enter in the separate fields and look at the cmdline)