{"action":"created","comment":{"url":"https://api.github.com/repos/stoeffel/elm-doc-test/pulls/comments/89690533","pull_request_review_id":10231073,"id":89690533,"diff_hunk":"@@ -1,144 +1,143 @@\n-module DocTest.Parser\n-    exposing\n-        ( parse\n-        , parseImports\n-        , parseComments\n-        )\n+module DocTest.Parser exposing (parse)\n \n-import String\n-import Regex exposing (..)\n-import List.Extra\n import DocTest.Types exposing (..)\n+import List.Extra\n+import Regex exposing (Regex, HowMany(..))\n+import String\n \n \n parse : String -> TestSuite\n parse str =\n     { imports = parseImports str\n     , tests =\n-        str\n-            |> parseComments\n-            |> List.Extra.groupWhile (\\x y -> not <| assertionPrefix y)\n-            |> List.map (toTest ( [], [] ) \"\")\n+        parseComments str\n+            |> List.concatMap (filterNotDocTest << List.filterMap parseDocTest << String.lines)\n+            |> List.Extra.groupWhile (\\x y -> not <| isAssertion y)\n+            |> List.filterMap toTest\n     }\n \n \n-toTest : ( List String, List String ) -> String -> List String -> Test\n-toTest ( assertion, expectation ) last str =\n-    case str of\n-        h :: rest ->\n-            if assertionPrefix h then\n-                toTest ( h :: assertion, expectation ) h rest\n-            else if continuationPrefix h then\n-                toTest ( h :: assertion, expectation ) last rest\n-            else if assertionPrefix last then\n-                toTest ( assertion, h :: expectation ) last rest\n-            else\n-                toTest ( assertion, expectation ) \"\" rest\n+parseImports : String -> List String\n+parseImports str =\n+    Regex.find All importRegex str\n+        |> List.map .match\n \n-        _ ->\n-            let\n-                clean x =\n-                    List.map replacePrefix x\n-                        |> List.reverse\n-                        |> String.join \" \"\n-            in\n-                Test (clean assertion) (clean expectation)\n \n+parseComments : String -> List String\n+parseComments str =\n+    Regex.find All commentRegex str\n+        |> List.map .match\n \n-parseImports : String -> List String\n-parseImports str =\n-    str\n-        |> String.lines\n-        |> List.foldl parseImport []\n-        |> List.reverse\n \n+parseDocTest : String -> Maybe Syntax\n+parseDocTest =\n+    oneOf\n+        [ choice assertionRegex Assertion\n+        , choice continuationRegex Continuation\n+        , choice expectationRegex Expectation\n+        ]\n \n-parseImport : String -> List String -> List String\n-parseImport str acc =\n-    if contains (regex \"^import\\\\s.*\") str then\n-        str :: acc\n-    else\n-        acc\n \n+importRegex : Regex\n+importRegex =\n+    Regex.regex \"import\\\\s.*\"","path":"src/DocTest/Parser.elm","position":null,"original_position":88,"commit_id":"e44c4ae2680e097108bab1a89a2710f819a92501","original_commit_id":"d5ae9eccb2b226826e043cc5837fad7ebcc1f26b","user":{"login":"stoeffel","id":1217681,"avatar_url":"https://avatars.githubusercontent.com/u/1217681?v=3","gravatar_id":"","url":"https://api.github.com/users/stoeffel","html_url":"https://github.com/stoeffel","followers_url":"https://api.github.com/users/stoeffel/followers","following_url":"https://api.github.com/users/stoeffel/following{/other_user}","gists_url":"https://api.github.com/users/stoeffel/gists{/gist_id}","starred_url":"https://api.github.com/users/stoeffel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stoeffel/subscriptions","organizations_url":"https://api.github.com/users/stoeffel/orgs","repos_url":"https://api.github.com/users/stoeffel/repos","events_url":"https://api.github.com/users/stoeffel/events{/privacy}","received_events_url":"https://api.github.com/users/stoeffel/received_events","type":"User","site_admin":false},"body":"I added a stopgap solution for imports. I think we should explicitly import modules (syntax or config json).","created_at":"2016-11-27T13:48:43Z","updated_at":"2016-11-27T13:48:43Z","html_url":"https://github.com/stoeffel/elm-doc-test/pull/9#discussion_r89690533","pull_request_url":"https://api.github.com/repos/stoeffel/elm-doc-test/pulls/9","_links":{"self":{"href":"https://api.github.com/repos/stoeffel/elm-doc-test/pulls/comments/89690533"},"html":{"href":"https://github.com/stoeffel/elm-doc-test/pull/9#discussion_r89690533"},"pull_request":{"href":"https://api.github.com/repos/stoeffel/elm-doc-test/pulls/9"}}},"pull_request":{"url":"https://api.github.com/repos/stoeffel/elm-doc-test/pulls/9","id":95302847,"html_url":"https://github.com/stoeffel/elm-doc-test/pull/9","diff_url":"https://github.com/stoeffel/elm-doc-test/pull/9.diff","patch_url":"https://github.com/stoeffel/elm-doc-test/pull/9.patch","issue_url":"https://api.github.com/repos/stoeffel/elm-doc-test/issues/9","number":9,"state":"open","locked":false,"title":"better Parser","user":{"login":"stoeffel","id":1217681,"avatar_url":"https://avatars.githubusercontent.com/u/1217681?v=3","gravatar_id":"","url":"https://api.github.com/users/stoeffel","html_url":"https://github.com/stoeffel","followers_url":"https://api.github.com/users/stoeffel/followers","following_url":"https://api.github.com/users/stoeffel/following{/other_user}","gists_url":"https://api.github.com/users/stoeffel/gists{/gist_id}","starred_url":"https://api.github.com/users/stoeffel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stoeffel/subscriptions","organizations_url":"https://api.github.com/users/stoeffel/orgs","repos_url":"https://api.github.com/users/stoeffel/repos","events_url":"https://api.github.com/users/stoeffel/events{/privacy}","received_events_url":"https://api.github.com/users/stoeffel/received_events","type":"User","site_admin":false},"body":"^^","created_at":"2016-11-25T13:15:27Z","updated_at":"2016-11-27T13:48:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0838bdffe90ea7ffe601ff0810050acc6ba02106","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/stoeffel/elm-doc-test/pulls/9/commits","review_comments_url":"https://api.github.com/repos/stoeffel/elm-doc-test/pulls/9/comments","review_comment_url":"https://api.github.com/repos/stoeffel/elm-doc-test/pulls/comments{/number}","comments_url":"https://api.github.com/repos/stoeffel/elm-doc-test/issues/9/comments","statuses_url":"https://api.github.com/repos/stoeffel/elm-doc-test/statuses/e44c4ae2680e097108bab1a89a2710f819a92501","head":{"label":"stoeffel:parser","ref":"parser","sha":"e44c4ae2680e097108bab1a89a2710f819a92501","user":{"login":"stoeffel","id":1217681,"avatar_url":"https://avatars.githubusercontent.com/u/1217681?v=3","gravatar_id":"","url":"https://api.github.com/users/stoeffel","html_url":"https://github.com/stoeffel","followers_url":"https://api.github.com/users/stoeffel/followers","following_url":"https://api.github.com/users/stoeffel/following{/other_user}","gists_url":"https://api.github.com/users/stoeffel/gists{/gist_id}","starred_url":"https://api.github.com/users/stoeffel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stoeffel/subscriptions","organizations_url":"https://api.github.com/users/stoeffel/orgs","repos_url":"https://api.github.com/users/stoeffel/repos","events_url":"https://api.github.com/users/stoeffel/events{/privacy}","received_events_url":"https://api.github.com/users/stoeffel/received_events","type":"User","site_admin":false},"repo":{"id":74123320,"name":"elm-doc-test","full_name":"stoeffel/elm-doc-test","owner":{"login":"stoeffel","id":1217681,"avatar_url":"https://avatars.githubusercontent.com/u/1217681?v=3","gravatar_id":"","url":"https://api.github.com/users/stoeffel","html_url":"https://github.com/stoeffel","followers_url":"https://api.github.com/users/stoeffel/followers","following_url":"https://api.github.com/users/stoeffel/following{/other_user}","gists_url":"https://api.github.com/users/stoeffel/gists{/gist_id}","starred_url":"https://api.github.com/users/stoeffel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stoeffel/subscriptions","organizations_url":"https://api.github.com/users/stoeffel/orgs","repos_url":"https://api.github.com/users/stoeffel/repos","events_url":"https://api.github.com/users/stoeffel/events{/privacy}","received_events_url":"https://api.github.com/users/stoeffel/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/stoeffel/elm-doc-test","description":null,"fork":false,"url":"https://api.github.com/repos/stoeffel/elm-doc-test","forks_url":"https://api.github.com/repos/stoeffel/elm-doc-test/forks","keys_url":"https://api.github.com/repos/stoeffel/elm-doc-test/keys{/key_id}","collaborators_url":"https://api.github.com/repos/stoeffel/elm-doc-test/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/stoeffel/elm-doc-test/teams","hooks_url":"https://api.github.com/repos/stoeffel/elm-doc-test/hooks","issue_events_url":"https://api.github.com/repos/stoeffel/elm-doc-test/issues/events{/number}","events_url":"https://api.github.com/repos/stoeffel/elm-doc-test/events","assignees_url":"https://api.github.com/repos/stoeffel/elm-doc-test/assignees{/user}","branches_url":"https://api.github.com/repos/stoeffel/elm-doc-test/branches{/branch}","tags_url":"https://api.github.com/repos/stoeffel/elm-doc-test/tags","blobs_url":"https://api.github.com/repos/stoeffel/elm-doc-test/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/stoeffel/elm-doc-test/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/stoeffel/elm-doc-test/git/refs{/sha}","trees_url":"https://api.github.com/repos/stoeffel/elm-doc-test/git/trees{/sha}","statuses_url":"https://api.github.com/repos/stoeffel/elm-doc-test/statuses/{sha}","languages_url":"https://api.github.com/repos/stoeffel/elm-doc-test/languages","stargazers_url":"https://api.github.com/repos/stoeffel/elm-doc-test/stargazers","contributors_url":"https://api.github.com/repos/stoeffel/elm-doc-test/contributors","subscribers_url":"https://api.github.com/repos/stoeffel/elm-doc-test/subscribers","subscription_url":"https://api.github.com/repos/stoeffel/elm-doc-test/subscription","commits_url":"https://api.github.com/repos/stoeffel/elm-doc-test/commits{/sha}","git_commits_url":"https://api.github.com/repos/stoeffel/elm-doc-test/git/commits{/sha}","comments_url":"https://api.github.com/repos/stoeffel/elm-doc-test/comments{/number}","issue_comment_url":"https://api.github.com/repos/stoeffel/elm-doc-test/issues/comments{/number}","contents_url":"https://api.github.com/repos/stoeffel/elm-doc-test/contents/{+path}","compare_url":"https://api.github.com/repos/stoeffel/elm-doc-test/compare/{base}...{head}","merges_url":"https://api.github.com/repos/stoeffel/elm-doc-test/merges","archive_url":"https://api.github.com/repos/stoeffel/elm-doc-test/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/stoeffel/elm-doc-test/downloads","issues_url":"https://api.github.com/repos/stoeffel/elm-doc-test/issues{/number}","pulls_url":"https://api.github.com/repos/stoeffel/elm-doc-test/pulls{/number}","milestones_url":"https://api.github.com/repos/stoeffel/elm-doc-test/milestones{/number}","notifications_url":"https://api.github.com/repos/stoeffel/elm-doc-test/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/stoeffel/elm-doc-test/labels{/name}","releases_url":"https://api.github.com/repos/stoeffel/elm-doc-test/releases{/id}","deployments_url":"https://api.github.com/repos/stoeffel/elm-doc-test/deployments","created_at":"2016-11-18T11:17:58Z","updated_at":"2016-11-23T21:13:33Z","pushed_at":"2016-11-27T13:47:13Z","git_url":"git://github.com/stoeffel/elm-doc-test.git","ssh_url":"git@github.com:stoeffel/elm-doc-test.git","clone_url":"https://github.com/stoeffel/elm-doc-test.git","svn_url":"https://github.com/stoeffel/elm-doc-test","homepage":null,"size":18793,"stargazers_count":9,"watchers_count":9,"language":"Elm","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":7,"forks":1,"open_issues":7,"watchers":9,"default_branch":"master"}},"base":{"label":"stoeffel:master","ref":"master","sha":"d0c9ea485334b988689dc679bb69e67c4cf69c06","user":{"login":"stoeffel","id":1217681,"avatar_url":"https://avatars.githubusercontent.com/u/1217681?v=3","gravatar_id":"","url":"https://api.github.com/users/stoeffel","html_url":"https://github.com/stoeffel","followers_url":"https://api.github.com/users/stoeffel/followers","following_url":"https://api.github.com/users/stoeffel/following{/other_user}","gists_url":"https://api.github.com/users/stoeffel/gists{/gist_id}","starred_url":"https://api.github.com/users/stoeffel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stoeffel/subscriptions","organizations_url":"https://api.github.com/users/stoeffel/orgs","repos_url":"https://api.github.com/users/stoeffel/repos","events_url":"https://api.github.com/users/stoeffel/events{/privacy}","received_events_url":"https://api.github.com/users/stoeffel/received_events","type":"User","site_admin":false},"repo":{"id":74123320,"name":"elm-doc-test","full_name":"stoeffel/elm-doc-test","owner":{"login":"stoeffel","id":1217681,"avatar_url":"https://avatars.githubusercontent.com/u/1217681?v=3","gravatar_id":"","url":"https://api.github.com/users/stoeffel","html_url":"https://github.com/stoeffel","followers_url":"https://api.github.com/users/stoeffel/followers","following_url":"https://api.github.com/users/stoeffel/following{/other_user}","gists_url":"https://api.github.com/users/stoeffel/gists{/gist_id}","starred_url":"https://api.github.com/users/stoeffel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stoeffel/subscriptions","organizations_url":"https://api.github.com/users/stoeffel/orgs","repos_url":"https://api.github.com/users/stoeffel/repos","events_url":"https://api.github.com/users/stoeffel/events{/privacy}","received_events_url":"https://api.github.com/users/stoeffel/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/stoeffel/elm-doc-test","description":null,"fork":false,"url":"https://api.github.com/repos/stoeffel/elm-doc-test","forks_url":"https://api.github.com/repos/stoeffel/elm-doc-test/forks","keys_url":"https://api.github.com/repos/stoeffel/elm-doc-test/keys{/key_id}","collaborators_url":"https://api.github.com/repos/stoeffel/elm-doc-test/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/stoeffel/elm-doc-test/teams","hooks_url":"https://api.github.com/repos/stoeffel/elm-doc-test/hooks","issue_events_url":"https://api.github.com/repos/stoeffel/elm-doc-test/issues/events{/number}","events_url":"https://api.github.com/repos/stoeffel/elm-doc-test/events","assignees_url":"https://api.github.com/repos/stoeffel/elm-doc-test/assignees{/user}","branches_url":"https://api.github.com/repos/stoeffel/elm-doc-test/branches{/branch}","tags_url":"https://api.github.com/repos/stoeffel/elm-doc-test/tags","blobs_url":"https://api.github.com/repos/stoeffel/elm-doc-test/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/stoeffel/elm-doc-test/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/stoeffel/elm-doc-test/git/refs{/sha}","trees_url":"https://api.github.com/repos/stoeffel/elm-doc-test/git/trees{/sha}","statuses_url":"https://api.github.com/repos/stoeffel/elm-doc-test/statuses/{sha}","languages_url":"https://api.github.com/repos/stoeffel/elm-doc-test/languages","stargazers_url":"https://api.github.com/repos/stoeffel/elm-doc-test/stargazers","contributors_url":"https://api.github.com/repos/stoeffel/elm-doc-test/contributors","subscribers_url":"https://api.github.com/repos/stoeffel/elm-doc-test/subscribers","subscription_url":"https://api.github.com/repos/stoeffel/elm-doc-test/subscription","commits_url":"https://api.github.com/repos/stoeffel/elm-doc-test/commits{/sha}","git_commits_url":"https://api.github.com/repos/stoeffel/elm-doc-test/git/commits{/sha}","comments_url":"https://api.github.com/repos/stoeffel/elm-doc-test/comments{/number}","issue_comment_url":"https://api.github.com/repos/stoeffel/elm-doc-test/issues/comments{/number}","contents_url":"https://api.github.com/repos/stoeffel/elm-doc-test/contents/{+path}","compare_url":"https://api.github.com/repos/stoeffel/elm-doc-test/compare/{base}...{head}","merges_url":"https://api.github.com/repos/stoeffel/elm-doc-test/merges","archive_url":"https://api.github.com/repos/stoeffel/elm-doc-test/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/stoeffel/elm-doc-test/downloads","issues_url":"https://api.github.com/repos/stoeffel/elm-doc-test/issues{/number}","pulls_url":"https://api.github.com/repos/stoeffel/elm-doc-test/pulls{/number}","milestones_url":"https://api.github.com/repos/stoeffel/elm-doc-test/milestones{/number}","notifications_url":"https://api.github.com/repos/stoeffel/elm-doc-test/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/stoeffel/elm-doc-test/labels{/name}","releases_url":"https://api.github.com/repos/stoeffel/elm-doc-test/releases{/id}","deployments_url":"https://api.github.com/repos/stoeffel/elm-doc-test/deployments","created_at":"2016-11-18T11:17:58Z","updated_at":"2016-11-23T21:13:33Z","pushed_at":"2016-11-27T13:47:13Z","git_url":"git://github.com/stoeffel/elm-doc-test.git","ssh_url":"git@github.com:stoeffel/elm-doc-test.git","clone_url":"https://github.com/stoeffel/elm-doc-test.git","svn_url":"https://github.com/stoeffel/elm-doc-test","homepage":null,"size":18793,"stargazers_count":9,"watchers_count":9,"language":"Elm","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":7,"forks":1,"open_issues":7,"watchers":9,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/stoeffel/elm-doc-test/pulls/9"},"html":{"href":"https://github.com/stoeffel/elm-doc-test/pull/9"},"issue":{"href":"https://api.github.com/repos/stoeffel/elm-doc-test/issues/9"},"comments":{"href":"https://api.github.com/repos/stoeffel/elm-doc-test/issues/9/comments"},"review_comments":{"href":"https://api.github.com/repos/stoeffel/elm-doc-test/pulls/9/comments"},"review_comment":{"href":"https://api.github.com/repos/stoeffel/elm-doc-test/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/stoeffel/elm-doc-test/pulls/9/commits"},"statuses":{"href":"https://api.github.com/repos/stoeffel/elm-doc-test/statuses/e44c4ae2680e097108bab1a89a2710f819a92501"}}}}
{"actor":{"display_login":"stoeffel"}}