Skip to content

Instantly share code, notes, and snippets.

@robknight
Created January 15, 2014 18:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save robknight/8441515 to your computer and use it in GitHub Desktop.
Save robknight/8441515 to your computer and use it in GitHub Desktop.
Calling test-parser results in out of memory error. Reducing the number of elements in the string does get it to work.
(ns parser.testing
(:require [instaparse.core :as insta]))
(def textparse
(insta/parser
"S = (Content)*
Content = (ContentLine)*
ContentLine = (Word | Whitespace)+ LineEnd?
<Word> = #'\\S+'
<Whitespace> = #'\\s*'
LineEnd = '\\n'"
))
(defn test-parser []
(textparse "1 2 3 4 5 6 7 8 9 0"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment