Created
October 19, 2014 14:16
-
-
Save ndrew/1fb8f1d452b991dba9c9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns testo.repl | |
(:use [clojure.pprint]) | |
(:require [instaparse.core :as insta])) | |
(def grammar "PHPDOC = '/**' {S|tag} '*/' | |
S = <'*'> #'.+' | |
tag = <{'*'} '@'> #'\\w*' params | |
params = #'.*'") | |
(def test-phpdoc "/** | |
* Lorem ipsum dolor sit amet, eu iisque disputando qui, ex ponderum invidunt prodesset cum. | |
* Tests: | |
* - Appetere invidunt sapientem ea eos, has ea dicta aeterno | |
* - ex his atqui saperet repudiandae | |
* - Et pri velit labore fastidii, est in quas albucius | |
* - Eruditi antiopam no usu, iuvaret fuisset has et. Rebum possit detracto sit cu | |
* | |
* | |
* @dataProvider tesopesto | |
* @group usa | |
* | |
* @author Some Guy <[email protected]> | |
* @reviewer Other Guy <[email protected]> | |
* | |
* @access public | |
* | |
* @param array $super_data - super data array | |
* @param Foo_Baria_Model_Buzz $buzz | |
* @param string $jfid - id of the jf | |
* @param array $conf - configuration array ('minf' => , 'minh' => ) | |
* @param string $rfid - rfid of the customer | |
* @param array $ra_conf - configuration of RA to test | |
* | |
* @return void | |
*/") | |
(let [whitespace (insta/parser "whitespace = #'[ \t\f\r\n]+'") | |
parser (insta/parser grammar | |
:auto-whitespace whitespace | |
:output-format :hiccup)] | |
(time | |
(pprint (insta/parse parser test-phpdoc :optimize :memory)) | |
) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment