Skip to content

Instantly share code, notes, and snippets.

@slifin
Created May 1, 2020 09:02
Show Gist options
  • Save slifin/342436d837b96b37888f841d2eac864d to your computer and use it in GitHub Desktop.
Save slifin/342436d837b96b37888f841d2eac864d to your computer and use it in GitHub Desktop.
activity_log = opening_line (qualifierFromTo|qualifierTo|qualifierRemoved)?+
opening_line = entity identifiers (for <space> name)? <space> was <space> verb (<space> location)? <space> on datetime source period newline?
source = (by <space> name) | 'via Birdie' | 'by the automatic confirmation process'
qualifierFromTo = attribute <space> modificationFrom from to_string to period newline?
qualifierTo = attribute <space> modificationTo to period newline?
qualifierRemoved = attribute <space> 'was removed' period newline?
attribute = (#'\S+' | <space>)+
modificationFrom = 'was changed from' | 'were changed from'
modificationTo = 'was set to' | 'were set to'
from = (#'\w+' | time | <space>)+
to = (#'\w+' | time | <space>)+
entity =
'Appointment'
| 'Appointment instance'
| 'Client'
| 'Invoice group'
identifiers = (<space> | #'\w+' | time)+
for = 'for'
verb = 'edited' | 'created' | 'confirmed'
location = 'using the save and update button'
name = forename <space> surname
forename = #'\w+'
surname = #'\w+'
to_string = 'to'
on = 'on'
period = '.'
by = 'by'
space = ' '
was = 'was'
newline = '\n'
(* date time stuff *)
time = minutes_hours | minutes_hours_seconds
minutes_hours = #'\d\d:\d\d'
minutes_hours_seconds = #'\d\d:\d\d:\d\d'
datetime = (#'\w+' | <space> | minutes_hours_seconds)+
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment