Skip to content

Instantly share code, notes, and snippets.

View lkarthee's full-sized avatar

Kartheek L lkarthee

  • 13:52 (UTC +05:30)
View GitHub Profile
defmodule Kinda.ParserHelper do
@moduledoc false
@doc """
define a parser combinator and variable with same name
"""
defmacro defcv(name, expr) do
quote do
defcombinatorp(unquote(name), unquote(expr))
Kernel.var!(unquote({name, [], nil})) = parsec(unquote(name))
_ = Kernel.var!(unquote({name, [], nil}))