https://github.com/sibelius/slack-reminder-grammar
Simplify Slack /reminder command grammar
https://github.com/sibelius/slack-reminder-grammar
Last synced: about 1 year ago
JSON representation
Simplify Slack /reminder command grammar
- Host: GitHub
- URL: https://github.com/sibelius/slack-reminder-grammar
- Owner: sibelius
- Created: 2020-07-22T10:17:16.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-06T12:12:35.000Z (over 3 years ago)
- Last Synced: 2025-05-04T13:12:18.563Z (about 1 year ago)
- Language: JavaScript
- Size: 932 KB
- Stars: 9
- Watchers: 4
- Forks: 2
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-list - slack-reminder-grammar
README
# Slack Reminder Grammar
Simplified Slack Reminder Grammer to parse /remind commands like
## Blog Post
[Parsing Slack /remind Command](https://medium.com/@sibelius/parsing-slack-remind-command-fc3f5e4026e)
## Examples
```jsx
npx slack-reminder-grammar "/remind @sibelius work tomorrow"
[
{
someoneChannel: { type: 'someone', value: 'sibelius' },
what: 'work',
when: 'tomorrow',
}
]
```
```jsx
npx slack-reminder-grammar "/remind #general party next week"
[
{
someoneChannel: { type: 'channel', value: 'general' },
what: 'party',
when: 'next week',
}
]
```
## How it works?
We use [Nearley](https://github.com/kach/nearley) to compile our grammar written in Nearley syntax (close to EBNF)
The grammar is described at [GrammarReminderSlack](./src/GrammarReminderSlack.ne)
We compile the grammar using `nearleyc`
## Other resources to learn about parsers and Nearley
[Parsing Absolutely Anything in Javascript using Earley Algorithm](https://medium.com/@gajus/parsing-absolutely-anything-in-javascript-using-earley-algorithm-886edcc31e5e) by @gajus is a great start
## Is this Turing complete?
No, and Turing completeness are not useful in all domain languages.