Skip to content

Instantly share code, notes, and snippets.

@atamis
Created November 8, 2018 23:25
Show Gist options
  • Save atamis/6e8fa93d69a07a6bce8035cf6d9b0a21 to your computer and use it in GitHub Desktop.
Save atamis/6e8fa93d69a07a6bce8035cf6d9b0a21 to your computer and use it in GitHub Desktop.
Minor usability issue in nimble-parsec
defmodule NimbleParsecTest.MixProject do
use Mix.Project
def project do
[
app: :nimble_parsec_test,
version: "0.1.0",
elixir: "~> 1.7",
start_permanent: Mix.env() == :prod,
deps: deps()
]
end
# Run "mix help compile.app" to learn about applications.
def application do
[
mod: {NimbleParsecTest, []},
extra_applications: [:logger]
]
end
# Run "mix help deps" to learn about dependencies.
defp deps do
[
{:nimble_parsec, "~> 0.2"}
# {:dep_from_hexpm, "~> 0.3.0"},
# {:dep_from_git, git: "https://github.com/elixir-lang/my_dep.git", tag: "0.1.0"},
]
end
end
defmodule NimbleParsecTest do
use Application
import NimbleParsec
test = repeat(optional(utf8_char([?a])))
defparsec :test, test
def start(_type, _args) do
IO.puts("Parsing...")
IO.inspect(test("aaaaaa"))
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment