new datetime parser #13
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
navicore/nvim-reminders!13
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "new-datetime-parser"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
I've implemented the token-based natural language datetime parser as specified:
Files Modified
- Removed all 5 parse_* functions with ~50 regex patterns
- Added TokenType definitions (16 token types)
- Added M.tokenize(expression) - tokenizes input left-to-right
- Added M.assemble(tokens, opts) - assembles datetime from tokens
- Updated M.parse(expression, opts) - backward compatible API with new opts parameter
- Kept M.time_until(datetime) unchanged
- Added date validation (rejects Feb 31, Apr 31, handles leap years)
- Replaced hardcoded if/elseif chain with single call to time_parser.parse()
- Added word-order flexibility tests
- Added default_hour option tests
- Added error case tests
- Added tokenize function tests
- Added snooze choices validation test
- Removed tests for deleted internal functions
Key Features