{"action":"created","comment":{"url":"https://api.github.com/repos/NaaS/motto/pulls/comments/68829549","id":68829549,"diff_hunk":"@@ -19,49 +53,38 @@ Stack.push Crisp_syntax.min_indentation scope_stack;;\n let test_indentation indentation follow_on_tokens lexbuf =\n   assert (not (Stack.is_empty scope_stack)); (*There should always be at least\n                                                one element in the stack: 0*)\n-  let next_line () =\n-    (*this function was adapted from\n-      https://realworldocaml.org/v1/en/html/parsing-with-ocamllex-and-menhir.html*)\n-    let pos = lexbuf.lex_curr_p in\n-    lexbuf.lex_curr_p <-\n-      { pos with pos_bol = lexbuf.lex_curr_pos;\n-        pos_lnum = pos.pos_lnum + 1\n-      } in\n   (*Count how many scopes we've moved down (out of).*)\n   let rec undented_scopes (offset : int) =\n     if Stack.top scope_stack = indentation then\n       offset\n     else if Stack.top scope_stack < indentation then\n-      failwith \"Undershot the scope?\"\n+      raise Error\n     else\n       begin\n         ignore(Stack.pop scope_stack);\n         undented_scopes (offset + 1)\n       end in\n   let prev = Stack.top scope_stack in\n-    if indentation > prev then\n-      begin\n-        Stack.push indentation scope_stack;\n-        next_line ();\n-        INDENT\n-      end\n-    else if indentation = prev then\n-      begin\n-        next_line ();\n-        if follow_on_tokens <> [] then\n-          begin\n-            assert (List.length follow_on_tokens = 1);\n-            List.hd follow_on_tokens\n-          end\n-        else NL\n-      end\n-    else\n-      begin\n-        assert (indentation < prev);\n-        next_line ();\n-        UNDENTN (undented_scopes Crisp_syntax.min_indentation,\n-                 follow_on_tokens)\n-      end\n+  if indentation > prev then","path":"syntax/crisp_lexer.mll","position":103,"original_position":89,"commit_id":"10578d6f08320343176b28e57893a9ec851eac9e","original_commit_id":"99ff8ecdfa279777a712d36cedf1a9f1e7cdf375","user":{"login":"TMVector","id":4268638,"avatar_url":"https://avatars.githubusercontent.com/u/4268638?v=3","gravatar_id":"","url":"https://api.github.com/users/TMVector","html_url":"https://github.com/TMVector","followers_url":"https://api.github.com/users/TMVector/followers","following_url":"https://api.github.com/users/TMVector/following{/other_user}","gists_url":"https://api.github.com/users/TMVector/gists{/gist_id}","starred_url":"https://api.github.com/users/TMVector/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TMVector/subscriptions","organizations_url":"https://api.github.com/users/TMVector/orgs","repos_url":"https://api.github.com/users/TMVector/repos","events_url":"https://api.github.com/users/TMVector/events{/privacy}","received_events_url":"https://api.github.com/users/TMVector/received_events","type":"User","site_admin":false},"body":"I'm currently using [VS Code](https://code.visualstudio.com/) with the OCaml plugin, which integrates ocaml-merlin, ocp-indent, and ocamldebug. The only annoyance is it doesn't add the Unix trailing \\n!","created_at":"2016-06-28T19:49:38Z","updated_at":"2016-06-28T19:49:38Z","html_url":"https://github.com/NaaS/motto/pull/4#discussion_r68829549","pull_request_url":"https://api.github.com/repos/NaaS/motto/pulls/4","_links":{"self":{"href":"https://api.github.com/repos/NaaS/motto/pulls/comments/68829549"},"html":{"href":"https://github.com/NaaS/motto/pull/4#discussion_r68829549"},"pull_request":{"href":"https://api.github.com/repos/NaaS/motto/pulls/4"}}},"pull_request":{"url":"https://api.github.com/repos/NaaS/motto/pulls/4","id":73943458,"html_url":"https://github.com/NaaS/motto/pull/4","diff_url":"https://github.com/NaaS/motto/pull/4.diff","patch_url":"https://github.com/NaaS/motto/pull/4.patch","issue_url":"https://api.github.com/repos/NaaS/motto/issues/4","number":4,"state":"open","locked":false,"title":"Fixed line numbers and column positions in syntax error messages","user":{"login":"TMVector","id":4268638,"avatar_url":"https://avatars.githubusercontent.com/u/4268638?v=3","gravatar_id":"","url":"https://api.github.com/users/TMVector","html_url":"https://github.com/TMVector","followers_url":"https://api.github.com/users/TMVector/followers","following_url":"https://api.github.com/users/TMVector/following{/other_user}","gists_url":"https://api.github.com/users/TMVector/gists{/gist_id}","starred_url":"https://api.github.com/users/TMVector/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TMVector/subscriptions","organizations_url":"https://api.github.com/users/TMVector/orgs","repos_url":"https://api.github.com/users/TMVector/repos","events_url":"https://api.github.com/users/TMVector/events{/privacy}","received_events_url":"https://api.github.com/users/TMVector/received_events","type":"User","site_admin":false},"body":"Fixed the positions reported in syntax error messages:\r\n- Correct line number is now reported\r\n- Errors are also now reported at the start of the token; previously they were reported at current lexbuf position\r\n\r\nStill not perfect: a line containing only spaces that is wrongly indented will report the error at `line:0` when it should be `line:1`.","created_at":"2016-06-15T16:30:34Z","updated_at":"2016-06-28T19:49:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4b3f809d881ce7f1e146bba48de04ed525fd1a57","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/NaaS/motto/pulls/4/commits","review_comments_url":"https://api.github.com/repos/NaaS/motto/pulls/4/comments","review_comment_url":"https://api.github.com/repos/NaaS/motto/pulls/comments{/number}","comments_url":"https://api.github.com/repos/NaaS/motto/issues/4/comments","statuses_url":"https://api.github.com/repos/NaaS/motto/statuses/10578d6f08320343176b28e57893a9ec851eac9e","head":{"label":"TMVector:fix-parser","ref":"fix-parser","sha":"10578d6f08320343176b28e57893a9ec851eac9e","user":{"login":"TMVector","id":4268638,"avatar_url":"https://avatars.githubusercontent.com/u/4268638?v=3","gravatar_id":"","url":"https://api.github.com/users/TMVector","html_url":"https://github.com/TMVector","followers_url":"https://api.github.com/users/TMVector/followers","following_url":"https://api.github.com/users/TMVector/following{/other_user}","gists_url":"https://api.github.com/users/TMVector/gists{/gist_id}","starred_url":"https://api.github.com/users/TMVector/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TMVector/subscriptions","organizations_url":"https://api.github.com/users/TMVector/orgs","repos_url":"https://api.github.com/users/TMVector/repos","events_url":"https://api.github.com/users/TMVector/events{/privacy}","received_events_url":"https://api.github.com/users/TMVector/received_events","type":"User","site_admin":false},"repo":{"id":61026701,"name":"motto","full_name":"TMVector/motto","owner":{"login":"TMVector","id":4268638,"avatar_url":"https://avatars.githubusercontent.com/u/4268638?v=3","gravatar_id":"","url":"https://api.github.com/users/TMVector","html_url":"https://github.com/TMVector","followers_url":"https://api.github.com/users/TMVector/followers","following_url":"https://api.github.com/users/TMVector/following{/other_user}","gists_url":"https://api.github.com/users/TMVector/gists{/gist_id}","starred_url":"https://api.github.com/users/TMVector/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TMVector/subscriptions","organizations_url":"https://api.github.com/users/TMVector/orgs","repos_url":"https://api.github.com/users/TMVector/repos","events_url":"https://api.github.com/users/TMVector/events{/privacy}","received_events_url":"https://api.github.com/users/TMVector/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/TMVector/motto","description":"Tool for translating and running Flick programs","fork":true,"url":"https://api.github.com/repos/TMVector/motto","forks_url":"https://api.github.com/repos/TMVector/motto/forks","keys_url":"https://api.github.com/repos/TMVector/motto/keys{/key_id}","collaborators_url":"https://api.github.com/repos/TMVector/motto/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/TMVector/motto/teams","hooks_url":"https://api.github.com/repos/TMVector/motto/hooks","issue_events_url":"https://api.github.com/repos/TMVector/motto/issues/events{/number}","events_url":"https://api.github.com/repos/TMVector/motto/events","assignees_url":"https://api.github.com/repos/TMVector/motto/assignees{/user}","branches_url":"https://api.github.com/repos/TMVector/motto/branches{/branch}","tags_url":"https://api.github.com/repos/TMVector/motto/tags","blobs_url":"https://api.github.com/repos/TMVector/motto/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/TMVector/motto/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/TMVector/motto/git/refs{/sha}","trees_url":"https://api.github.com/repos/TMVector/motto/git/trees{/sha}","statuses_url":"https://api.github.com/repos/TMVector/motto/statuses/{sha}","languages_url":"https://api.github.com/repos/TMVector/motto/languages","stargazers_url":"https://api.github.com/repos/TMVector/motto/stargazers","contributors_url":"https://api.github.com/repos/TMVector/motto/contributors","subscribers_url":"https://api.github.com/repos/TMVector/motto/subscribers","subscription_url":"https://api.github.com/repos/TMVector/motto/subscription","commits_url":"https://api.github.com/repos/TMVector/motto/commits{/sha}","git_commits_url":"https://api.github.com/repos/TMVector/motto/git/commits{/sha}","comments_url":"https://api.github.com/repos/TMVector/motto/comments{/number}","issue_comment_url":"https://api.github.com/repos/TMVector/motto/issues/comments{/number}","contents_url":"https://api.github.com/repos/TMVector/motto/contents/{+path}","compare_url":"https://api.github.com/repos/TMVector/motto/compare/{base}...{head}","merges_url":"https://api.github.com/repos/TMVector/motto/merges","archive_url":"https://api.github.com/repos/TMVector/motto/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/TMVector/motto/downloads","issues_url":"https://api.github.com/repos/TMVector/motto/issues{/number}","pulls_url":"https://api.github.com/repos/TMVector/motto/pulls{/number}","milestones_url":"https://api.github.com/repos/TMVector/motto/milestones{/number}","notifications_url":"https://api.github.com/repos/TMVector/motto/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/TMVector/motto/labels{/name}","releases_url":"https://api.github.com/repos/TMVector/motto/releases{/id}","deployments_url":"https://api.github.com/repos/TMVector/motto/deployments","created_at":"2016-06-13T10:15:04Z","updated_at":"2016-06-13T10:15:04Z","pushed_at":"2016-06-27T17:49:04Z","git_url":"git://github.com/TMVector/motto.git","ssh_url":"git@github.com:TMVector/motto.git","clone_url":"https://github.com/TMVector/motto.git","svn_url":"https://github.com/TMVector/motto","homepage":null,"size":953,"stargazers_count":0,"watchers_count":0,"language":"OCaml","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"NaaS:master","ref":"master","sha":"f0ddaf54cdfeb2938d5fbd01b51269d2275b7ae2","user":{"login":"NaaS","id":5021100,"avatar_url":"https://avatars.githubusercontent.com/u/5021100?v=3","gravatar_id":"","url":"https://api.github.com/users/NaaS","html_url":"https://github.com/NaaS","followers_url":"https://api.github.com/users/NaaS/followers","following_url":"https://api.github.com/users/NaaS/following{/other_user}","gists_url":"https://api.github.com/users/NaaS/gists{/gist_id}","starred_url":"https://api.github.com/users/NaaS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NaaS/subscriptions","organizations_url":"https://api.github.com/users/NaaS/orgs","repos_url":"https://api.github.com/users/NaaS/repos","events_url":"https://api.github.com/users/NaaS/events{/privacy}","received_events_url":"https://api.github.com/users/NaaS/received_events","type":"Organization","site_admin":false},"repo":{"id":39865424,"name":"motto","full_name":"NaaS/motto","owner":{"login":"NaaS","id":5021100,"avatar_url":"https://avatars.githubusercontent.com/u/5021100?v=3","gravatar_id":"","url":"https://api.github.com/users/NaaS","html_url":"https://github.com/NaaS","followers_url":"https://api.github.com/users/NaaS/followers","following_url":"https://api.github.com/users/NaaS/following{/other_user}","gists_url":"https://api.github.com/users/NaaS/gists{/gist_id}","starred_url":"https://api.github.com/users/NaaS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NaaS/subscriptions","organizations_url":"https://api.github.com/users/NaaS/orgs","repos_url":"https://api.github.com/users/NaaS/repos","events_url":"https://api.github.com/users/NaaS/events{/privacy}","received_events_url":"https://api.github.com/users/NaaS/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/NaaS/motto","description":"Tool for translating and running Flick programs","fork":false,"url":"https://api.github.com/repos/NaaS/motto","forks_url":"https://api.github.com/repos/NaaS/motto/forks","keys_url":"https://api.github.com/repos/NaaS/motto/keys{/key_id}","collaborators_url":"https://api.github.com/repos/NaaS/motto/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/NaaS/motto/teams","hooks_url":"https://api.github.com/repos/NaaS/motto/hooks","issue_events_url":"https://api.github.com/repos/NaaS/motto/issues/events{/number}","events_url":"https://api.github.com/repos/NaaS/motto/events","assignees_url":"https://api.github.com/repos/NaaS/motto/assignees{/user}","branches_url":"https://api.github.com/repos/NaaS/motto/branches{/branch}","tags_url":"https://api.github.com/repos/NaaS/motto/tags","blobs_url":"https://api.github.com/repos/NaaS/motto/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/NaaS/motto/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/NaaS/motto/git/refs{/sha}","trees_url":"https://api.github.com/repos/NaaS/motto/git/trees{/sha}","statuses_url":"https://api.github.com/repos/NaaS/motto/statuses/{sha}","languages_url":"https://api.github.com/repos/NaaS/motto/languages","stargazers_url":"https://api.github.com/repos/NaaS/motto/stargazers","contributors_url":"https://api.github.com/repos/NaaS/motto/contributors","subscribers_url":"https://api.github.com/repos/NaaS/motto/subscribers","subscription_url":"https://api.github.com/repos/NaaS/motto/subscription","commits_url":"https://api.github.com/repos/NaaS/motto/commits{/sha}","git_commits_url":"https://api.github.com/repos/NaaS/motto/git/commits{/sha}","comments_url":"https://api.github.com/repos/NaaS/motto/comments{/number}","issue_comment_url":"https://api.github.com/repos/NaaS/motto/issues/comments{/number}","contents_url":"https://api.github.com/repos/NaaS/motto/contents/{+path}","compare_url":"https://api.github.com/repos/NaaS/motto/compare/{base}...{head}","merges_url":"https://api.github.com/repos/NaaS/motto/merges","archive_url":"https://api.github.com/repos/NaaS/motto/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/NaaS/motto/downloads","issues_url":"https://api.github.com/repos/NaaS/motto/issues{/number}","pulls_url":"https://api.github.com/repos/NaaS/motto/pulls{/number}","milestones_url":"https://api.github.com/repos/NaaS/motto/milestones{/number}","notifications_url":"https://api.github.com/repos/NaaS/motto/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/NaaS/motto/labels{/name}","releases_url":"https://api.github.com/repos/NaaS/motto/releases{/id}","deployments_url":"https://api.github.com/repos/NaaS/motto/deployments","created_at":"2015-07-29T01:00:00Z","updated_at":"2016-06-14T23:27:51Z","pushed_at":"2016-06-27T17:49:05Z","git_url":"git://github.com/NaaS/motto.git","ssh_url":"git@github.com:NaaS/motto.git","clone_url":"https://github.com/NaaS/motto.git","svn_url":"https://github.com/NaaS/motto","homepage":null,"size":963,"stargazers_count":5,"watchers_count":5,"language":"OCaml","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":1,"forks":2,"open_issues":1,"watchers":5,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/NaaS/motto/pulls/4"},"html":{"href":"https://github.com/NaaS/motto/pull/4"},"issue":{"href":"https://api.github.com/repos/NaaS/motto/issues/4"},"comments":{"href":"https://api.github.com/repos/NaaS/motto/issues/4/comments"},"review_comments":{"href":"https://api.github.com/repos/NaaS/motto/pulls/4/comments"},"review_comment":{"href":"https://api.github.com/repos/NaaS/motto/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/NaaS/motto/pulls/4/commits"},"statuses":{"href":"https://api.github.com/repos/NaaS/motto/statuses/10578d6f08320343176b28e57893a9ec851eac9e"}}}}
{"actor":{"display_login":"TMVector"}}