{"action":"created","comment":{"url":"https://api.github.com/repos/helloeave/worksheets/pulls/comments/169491222","pull_request_review_id":98025967,"id":169491222,"diff_hunk":"@@ -253,6 +253,20 @@ func (s *Zuite) TestParser_parseExpressionErrors() {\n \t}\n }\n \n+func (s *Zuite) TestParser_parseNumberLiteralWithPercentAndSpace() {","path":"parser_test.go","position":17,"original_position":4,"commit_id":"ce5158b8573b9c13a76cd085a9cf8a369f693222","original_commit_id":"ce5158b8573b9c13a76cd085a9cf8a369f693222","user":{"login":"pascallouisperez","id":141069,"avatar_url":"https://avatars3.githubusercontent.com/u/141069?v=4","gravatar_id":"","url":"https://api.github.com/users/pascallouisperez","html_url":"https://github.com/pascallouisperez","followers_url":"https://api.github.com/users/pascallouisperez/followers","following_url":"https://api.github.com/users/pascallouisperez/following{/other_user}","gists_url":"https://api.github.com/users/pascallouisperez/gists{/gist_id}","starred_url":"https://api.github.com/users/pascallouisperez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pascallouisperez/subscriptions","organizations_url":"https://api.github.com/users/pascallouisperez/orgs","repos_url":"https://api.github.com/users/pascallouisperez/repos","events_url":"https://api.github.com/users/pascallouisperez/events{/privacy}","received_events_url":"https://api.github.com/users/pascallouisperez/received_events","type":"User","site_admin":false},"body":"Why not add to `TestParser_parseExpressionErrors`?","created_at":"2018-02-20T23:13:05Z","updated_at":"2018-02-20T23:13:05Z","html_url":"https://github.com/helloeave/worksheets/pull/75#discussion_r169491222","pull_request_url":"https://api.github.com/repos/helloeave/worksheets/pulls/75","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/helloeave/worksheets/pulls/comments/169491222"},"html":{"href":"https://github.com/helloeave/worksheets/pull/75#discussion_r169491222"},"pull_request":{"href":"https://api.github.com/repos/helloeave/worksheets/pulls/75"}}},"pull_request":{"url":"https://api.github.com/repos/helloeave/worksheets/pulls/75","id":170326285,"html_url":"https://github.com/helloeave/worksheets/pull/75","diff_url":"https://github.com/helloeave/worksheets/pull/75.diff","patch_url":"https://github.com/helloeave/worksheets/pull/75.patch","issue_url":"https://api.github.com/repos/helloeave/worksheets/issues/75","number":75,"state":"open","locked":false,"title":"Support percentages on number literals","user":{"login":"workmajj","id":324870,"avatar_url":"https://avatars3.githubusercontent.com/u/324870?v=4","gravatar_id":"","url":"https://api.github.com/users/workmajj","html_url":"https://github.com/workmajj","followers_url":"https://api.github.com/users/workmajj/followers","following_url":"https://api.github.com/users/workmajj/following{/other_user}","gists_url":"https://api.github.com/users/workmajj/gists{/gist_id}","starred_url":"https://api.github.com/users/workmajj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/workmajj/subscriptions","organizations_url":"https://api.github.com/users/workmajj/orgs","repos_url":"https://api.github.com/users/workmajj/repos","events_url":"https://api.github.com/users/workmajj/events{/privacy}","received_events_url":"https://api.github.com/users/workmajj/received_events","type":"User","site_admin":false},"body":"This diff adds support for writing number literals as percentages, where appending a `%` sign to any number literal increases its scale by `2`. So, for example, `3.625%` is the same as writing `0.03625`.\r\n\r\nThe implementation here is kept simple because we don't yet have a mod operator. If we do implement a mod operator as `%`, we'll need to do future work to disambiguate between percentage literals and mod binops (which we can do by looking at tokens beyond the `%`).\r\n\r\nFor now, however, everything still works as expected, without mod:\r\n\r\n* `5.75%` is the same as `0.0575`\r\n* `1.2% * 100_000` and `1.2%*100_000` (no spaces) both work as expected\r\n* `10 % 2` and `10%2` (no spaces) both fail as expected, since we have no `%` operator\r\n\r\nN.B. In working on this change, I found a bug (?) where we allow spaces in number literals because of how the scanner ignores whitespace and then we [greedily concatenate number tokens](https://github.com/helloeave/worksheets/blob/5b3558e60f1220067610126fbf4bbd01d1b9bc62/parser.go#L607). I'll make a separate issue to note this if needed. As an example, `123 456 789` (accidentally) parses to `&Number{123456789, &NumberType{0}}`, just like `123_456_789` does (as designed).","created_at":"2018-02-20T22:25:23Z","updated_at":"2018-02-20T23:13:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f62b2551feb8b8c612be3bb40c435a74e4f650a2","assignee":null,"assignees":[],"requested_reviewers":[{"login":"alexandrinaw","id":4393302,"avatar_url":"https://avatars3.githubusercontent.com/u/4393302?v=4","gravatar_id":"","url":"https://api.github.com/users/alexandrinaw","html_url":"https://github.com/alexandrinaw","followers_url":"https://api.github.com/users/alexandrinaw/followers","following_url":"https://api.github.com/users/alexandrinaw/following{/other_user}","gists_url":"https://api.github.com/users/alexandrinaw/gists{/gist_id}","starred_url":"https://api.github.com/users/alexandrinaw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexandrinaw/subscriptions","organizations_url":"https://api.github.com/users/alexandrinaw/orgs","repos_url":"https://api.github.com/users/alexandrinaw/repos","events_url":"https://api.github.com/users/alexandrinaw/events{/privacy}","received_events_url":"https://api.github.com/users/alexandrinaw/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/helloeave/worksheets/pulls/75/commits","review_comments_url":"https://api.github.com/repos/helloeave/worksheets/pulls/75/comments","review_comment_url":"https://api.github.com/repos/helloeave/worksheets/pulls/comments{/number}","comments_url":"https://api.github.com/repos/helloeave/worksheets/issues/75/comments","statuses_url":"https://api.github.com/repos/helloeave/worksheets/statuses/ce5158b8573b9c13a76cd085a9cf8a369f693222","head":{"label":"helloeave:jjw/support-percentages-as-syntactic-sugar","ref":"jjw/support-percentages-as-syntactic-sugar","sha":"ce5158b8573b9c13a76cd085a9cf8a369f693222","user":{"login":"helloeave","id":19152041,"avatar_url":"https://avatars0.githubusercontent.com/u/19152041?v=4","gravatar_id":"","url":"https://api.github.com/users/helloeave","html_url":"https://github.com/helloeave","followers_url":"https://api.github.com/users/helloeave/followers","following_url":"https://api.github.com/users/helloeave/following{/other_user}","gists_url":"https://api.github.com/users/helloeave/gists{/gist_id}","starred_url":"https://api.github.com/users/helloeave/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/helloeave/subscriptions","organizations_url":"https://api.github.com/users/helloeave/orgs","repos_url":"https://api.github.com/users/helloeave/repos","events_url":"https://api.github.com/users/helloeave/events{/privacy}","received_events_url":"https://api.github.com/users/helloeave/received_events","type":"Organization","site_admin":false},"repo":{"id":101068137,"name":"worksheets","full_name":"helloeave/worksheets","owner":{"login":"helloeave","id":19152041,"avatar_url":"https://avatars0.githubusercontent.com/u/19152041?v=4","gravatar_id":"","url":"https://api.github.com/users/helloeave","html_url":"https://github.com/helloeave","followers_url":"https://api.github.com/users/helloeave/followers","following_url":"https://api.github.com/users/helloeave/following{/other_user}","gists_url":"https://api.github.com/users/helloeave/gists{/gist_id}","starred_url":"https://api.github.com/users/helloeave/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/helloeave/subscriptions","organizations_url":"https://api.github.com/users/helloeave/orgs","repos_url":"https://api.github.com/users/helloeave/repos","events_url":"https://api.github.com/users/helloeave/events{/privacy}","received_events_url":"https://api.github.com/users/helloeave/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/helloeave/worksheets","description":"The Worksheets Framework — Making Excel Cool Again","fork":false,"url":"https://api.github.com/repos/helloeave/worksheets","forks_url":"https://api.github.com/repos/helloeave/worksheets/forks","keys_url":"https://api.github.com/repos/helloeave/worksheets/keys{/key_id}","collaborators_url":"https://api.github.com/repos/helloeave/worksheets/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/helloeave/worksheets/teams","hooks_url":"https://api.github.com/repos/helloeave/worksheets/hooks","issue_events_url":"https://api.github.com/repos/helloeave/worksheets/issues/events{/number}","events_url":"https://api.github.com/repos/helloeave/worksheets/events","assignees_url":"https://api.github.com/repos/helloeave/worksheets/assignees{/user}","branches_url":"https://api.github.com/repos/helloeave/worksheets/branches{/branch}","tags_url":"https://api.github.com/repos/helloeave/worksheets/tags","blobs_url":"https://api.github.com/repos/helloeave/worksheets/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/helloeave/worksheets/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/helloeave/worksheets/git/refs{/sha}","trees_url":"https://api.github.com/repos/helloeave/worksheets/git/trees{/sha}","statuses_url":"https://api.github.com/repos/helloeave/worksheets/statuses/{sha}","languages_url":"https://api.github.com/repos/helloeave/worksheets/languages","stargazers_url":"https://api.github.com/repos/helloeave/worksheets/stargazers","contributors_url":"https://api.github.com/repos/helloeave/worksheets/contributors","subscribers_url":"https://api.github.com/repos/helloeave/worksheets/subscribers","subscription_url":"https://api.github.com/repos/helloeave/worksheets/subscription","commits_url":"https://api.github.com/repos/helloeave/worksheets/commits{/sha}","git_commits_url":"https://api.github.com/repos/helloeave/worksheets/git/commits{/sha}","comments_url":"https://api.github.com/repos/helloeave/worksheets/comments{/number}","issue_comment_url":"https://api.github.com/repos/helloeave/worksheets/issues/comments{/number}","contents_url":"https://api.github.com/repos/helloeave/worksheets/contents/{+path}","compare_url":"https://api.github.com/repos/helloeave/worksheets/compare/{base}...{head}","merges_url":"https://api.github.com/repos/helloeave/worksheets/merges","archive_url":"https://api.github.com/repos/helloeave/worksheets/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/helloeave/worksheets/downloads","issues_url":"https://api.github.com/repos/helloeave/worksheets/issues{/number}","pulls_url":"https://api.github.com/repos/helloeave/worksheets/pulls{/number}","milestones_url":"https://api.github.com/repos/helloeave/worksheets/milestones{/number}","notifications_url":"https://api.github.com/repos/helloeave/worksheets/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/helloeave/worksheets/labels{/name}","releases_url":"https://api.github.com/repos/helloeave/worksheets/releases{/id}","deployments_url":"https://api.github.com/repos/helloeave/worksheets/deployments","created_at":"2017-08-22T13:50:54Z","updated_at":"2018-02-15T18:46:17Z","pushed_at":"2018-02-20T23:05:52Z","git_url":"git://github.com/helloeave/worksheets.git","ssh_url":"git@github.com:helloeave/worksheets.git","clone_url":"https://github.com/helloeave/worksheets.git","svn_url":"https://github.com/helloeave/worksheets","homepage":null,"size":280,"stargazers_count":8,"watchers_count":8,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":29,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":1,"open_issues":29,"watchers":8,"default_branch":"master"}},"base":{"label":"helloeave:master","ref":"master","sha":"6c0fe95db15bd89663da050509d7a6bb15723120","user":{"login":"helloeave","id":19152041,"avatar_url":"https://avatars0.githubusercontent.com/u/19152041?v=4","gravatar_id":"","url":"https://api.github.com/users/helloeave","html_url":"https://github.com/helloeave","followers_url":"https://api.github.com/users/helloeave/followers","following_url":"https://api.github.com/users/helloeave/following{/other_user}","gists_url":"https://api.github.com/users/helloeave/gists{/gist_id}","starred_url":"https://api.github.com/users/helloeave/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/helloeave/subscriptions","organizations_url":"https://api.github.com/users/helloeave/orgs","repos_url":"https://api.github.com/users/helloeave/repos","events_url":"https://api.github.com/users/helloeave/events{/privacy}","received_events_url":"https://api.github.com/users/helloeave/received_events","type":"Organization","site_admin":false},"repo":{"id":101068137,"name":"worksheets","full_name":"helloeave/worksheets","owner":{"login":"helloeave","id":19152041,"avatar_url":"https://avatars0.githubusercontent.com/u/19152041?v=4","gravatar_id":"","url":"https://api.github.com/users/helloeave","html_url":"https://github.com/helloeave","followers_url":"https://api.github.com/users/helloeave/followers","following_url":"https://api.github.com/users/helloeave/following{/other_user}","gists_url":"https://api.github.com/users/helloeave/gists{/gist_id}","starred_url":"https://api.github.com/users/helloeave/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/helloeave/subscriptions","organizations_url":"https://api.github.com/users/helloeave/orgs","repos_url":"https://api.github.com/users/helloeave/repos","events_url":"https://api.github.com/users/helloeave/events{/privacy}","received_events_url":"https://api.github.com/users/helloeave/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/helloeave/worksheets","description":"The Worksheets Framework — Making Excel Cool Again","fork":false,"url":"https://api.github.com/repos/helloeave/worksheets","forks_url":"https://api.github.com/repos/helloeave/worksheets/forks","keys_url":"https://api.github.com/repos/helloeave/worksheets/keys{/key_id}","collaborators_url":"https://api.github.com/repos/helloeave/worksheets/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/helloeave/worksheets/teams","hooks_url":"https://api.github.com/repos/helloeave/worksheets/hooks","issue_events_url":"https://api.github.com/repos/helloeave/worksheets/issues/events{/number}","events_url":"https://api.github.com/repos/helloeave/worksheets/events","assignees_url":"https://api.github.com/repos/helloeave/worksheets/assignees{/user}","branches_url":"https://api.github.com/repos/helloeave/worksheets/branches{/branch}","tags_url":"https://api.github.com/repos/helloeave/worksheets/tags","blobs_url":"https://api.github.com/repos/helloeave/worksheets/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/helloeave/worksheets/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/helloeave/worksheets/git/refs{/sha}","trees_url":"https://api.github.com/repos/helloeave/worksheets/git/trees{/sha}","statuses_url":"https://api.github.com/repos/helloeave/worksheets/statuses/{sha}","languages_url":"https://api.github.com/repos/helloeave/worksheets/languages","stargazers_url":"https://api.github.com/repos/helloeave/worksheets/stargazers","contributors_url":"https://api.github.com/repos/helloeave/worksheets/contributors","subscribers_url":"https://api.github.com/repos/helloeave/worksheets/subscribers","subscription_url":"https://api.github.com/repos/helloeave/worksheets/subscription","commits_url":"https://api.github.com/repos/helloeave/worksheets/commits{/sha}","git_commits_url":"https://api.github.com/repos/helloeave/worksheets/git/commits{/sha}","comments_url":"https://api.github.com/repos/helloeave/worksheets/comments{/number}","issue_comment_url":"https://api.github.com/repos/helloeave/worksheets/issues/comments{/number}","contents_url":"https://api.github.com/repos/helloeave/worksheets/contents/{+path}","compare_url":"https://api.github.com/repos/helloeave/worksheets/compare/{base}...{head}","merges_url":"https://api.github.com/repos/helloeave/worksheets/merges","archive_url":"https://api.github.com/repos/helloeave/worksheets/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/helloeave/worksheets/downloads","issues_url":"https://api.github.com/repos/helloeave/worksheets/issues{/number}","pulls_url":"https://api.github.com/repos/helloeave/worksheets/pulls{/number}","milestones_url":"https://api.github.com/repos/helloeave/worksheets/milestones{/number}","notifications_url":"https://api.github.com/repos/helloeave/worksheets/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/helloeave/worksheets/labels{/name}","releases_url":"https://api.github.com/repos/helloeave/worksheets/releases{/id}","deployments_url":"https://api.github.com/repos/helloeave/worksheets/deployments","created_at":"2017-08-22T13:50:54Z","updated_at":"2018-02-15T18:46:17Z","pushed_at":"2018-02-20T23:05:52Z","git_url":"git://github.com/helloeave/worksheets.git","ssh_url":"git@github.com:helloeave/worksheets.git","clone_url":"https://github.com/helloeave/worksheets.git","svn_url":"https://github.com/helloeave/worksheets","homepage":null,"size":280,"stargazers_count":8,"watchers_count":8,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":29,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":1,"open_issues":29,"watchers":8,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/helloeave/worksheets/pulls/75"},"html":{"href":"https://github.com/helloeave/worksheets/pull/75"},"issue":{"href":"https://api.github.com/repos/helloeave/worksheets/issues/75"},"comments":{"href":"https://api.github.com/repos/helloeave/worksheets/issues/75/comments"},"review_comments":{"href":"https://api.github.com/repos/helloeave/worksheets/pulls/75/comments"},"review_comment":{"href":"https://api.github.com/repos/helloeave/worksheets/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/helloeave/worksheets/pulls/75/commits"},"statuses":{"href":"https://api.github.com/repos/helloeave/worksheets/statuses/ce5158b8573b9c13a76cd085a9cf8a369f693222"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"pascallouisperez"}}