Skip to content

Instantly share code, notes, and snippets.

@deobald
Created December 2, 2022 02:11
Show Gist options
  • Save deobald/d29b59e29a419b8c085c2003d3c533cf to your computer and use it in GitHub Desktop.
Save deobald/d29b59e29a419b8c085c2003d3c533cf to your computer and use it in GitHub Desktop.
;; i want this:
[:time_value
{:tag :cat,
:parsers
'({:tag :nt, :keyword :hours_value}
{:tag :nt, :keyword :colon, :hide true}
{:tag :nt, :keyword :minutes_value}
{:tag :nt, :keyword :colon, :hide true}
{:tag :nt, :keyword :seconds_value})}]
;; turned into this:
Diagram(Sequence(NonTerminal(':hours_value'),NonTerminal(':colon'),NonTerminal(':minutes_value'),NonTerminal(':colon'),NonTerminal(':seconds_value')))
;; (where "cat" == "Sequence" and "nt" == "NonTerminal")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment