{"action":"created","issue":{"url":"https://api.github.com/repos/shapesecurity/shift-java/issues/101","repository_url":"https://api.github.com/repos/shapesecurity/shift-java","labels_url":"https://api.github.com/repos/shapesecurity/shift-java/issues/101/labels{/name}","comments_url":"https://api.github.com/repos/shapesecurity/shift-java/issues/101/comments","events_url":"https://api.github.com/repos/shapesecurity/shift-java/issues/101/events","html_url":"https://github.com/shapesecurity/shift-java/pull/101","id":139392850,"number":101,"title":"SourceLocation bugfix and temporary solution to store","user":{"login":"steindani","id":1426659,"avatar_url":"https://avatars.githubusercontent.com/u/1426659?v=3","gravatar_id":"","url":"https://api.github.com/users/steindani","html_url":"https://github.com/steindani","followers_url":"https://api.github.com/users/steindani/followers","following_url":"https://api.github.com/users/steindani/following{/other_user}","gists_url":"https://api.github.com/users/steindani/gists{/gist_id}","starred_url":"https://api.github.com/users/steindani/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/steindani/subscriptions","organizations_url":"https://api.github.com/users/steindani/orgs","repos_url":"https://api.github.com/users/steindani/repos","events_url":"https://api.github.com/users/steindani/events{/privacy}","received_events_url":"https://api.github.com/users/steindani/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-03-08T21:04:39Z","updated_at":"2016-03-08T22:47:03Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/shapesecurity/shift-java/pulls/101","html_url":"https://github.com/shapesecurity/shift-java/pull/101","diff_url":"https://github.com/shapesecurity/shift-java/pull/101.diff","patch_url":"https://github.com/shapesecurity/shift-java/pull/101.patch"},"body":"`TokenizerState` did not save the `lastLine` and `lastLineStart` values, thus they could not be restored. Also the `Tokenizer` did not update the previously mentioned variables while collecting tokens.\r\n\r\nI've fixed these issues and used them to calculate and store the start and end source locations of the AST nodes. While the `Node` interface can not be easily transformed into an abstract class containing a reference to its `SourceSpan` (see #92), the `Parser` could temporarily keep a map of these, so users may access them. \r\n\r\nUntil a greater refactoring, this solution may be used, and later the introduced `Parser.getLocation(Node)` may just redirect to `Node.getLocation()`."},"comment":{"url":"https://api.github.com/repos/shapesecurity/shift-java/issues/comments/194003552","html_url":"https://github.com/shapesecurity/shift-java/pull/101#issuecomment-194003552","issue_url":"https://api.github.com/repos/shapesecurity/shift-java/issues/101","id":194003552,"user":{"login":"michaelficarra","id":218840,"avatar_url":"https://avatars.githubusercontent.com/u/218840?v=3","gravatar_id":"","url":"https://api.github.com/users/michaelficarra","html_url":"https://github.com/michaelficarra","followers_url":"https://api.github.com/users/michaelficarra/followers","following_url":"https://api.github.com/users/michaelficarra/following{/other_user}","gists_url":"https://api.github.com/users/michaelficarra/gists{/gist_id}","starred_url":"https://api.github.com/users/michaelficarra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michaelficarra/subscriptions","organizations_url":"https://api.github.com/users/michaelficarra/orgs","repos_url":"https://api.github.com/users/michaelficarra/repos","events_url":"https://api.github.com/users/michaelficarra/events{/privacy}","received_events_url":"https://api.github.com/users/michaelficarra/received_events","type":"User","site_admin":false},"created_at":"2016-03-08T22:47:03Z","updated_at":"2016-03-08T22:47:03Z","body":"Thanks so much, @steindani! This is a very creative solution, and I think it will work well for us."}}