Skip to content

Instantly share code, notes, and snippets.

@takeoutweight
Forked from roman/gist:2338955
Created April 8, 2012 18:44
Show Gist options
  • Save takeoutweight/2339102 to your computer and use it in GitHub Desktop.
Save takeoutweight/2339102 to your computer and use it in GitHub Desktop.
(ns blah
(:use [zetta.parser.seq :only (whitespace number char)]
[zetta.combinators :only (choice around)]
[zetta.core :only (*>, <*)])
(:require [zetta.core :as z]))
(def whitespaces (many whitespace))
(def id4
(around
whitespaces
(*> (char \#)
(<$> (fn [n c] (case c
\= [:def n]
\# [:ref n])) number (choice [(char \=)
(char \#)])))))
; Nice! We can distinguish the choice.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment