{"action":"created","issue":{"url":"https://api.github.com/repos/postcss/postcss/issues/939","repository_url":"https://api.github.com/repos/postcss/postcss","labels_url":"https://api.github.com/repos/postcss/postcss/issues/939/labels{/name}","comments_url":"https://api.github.com/repos/postcss/postcss/issues/939/comments","events_url":"https://api.github.com/repos/postcss/postcss/issues/939/events","html_url":"https://github.com/postcss/postcss/issues/939","id":197991536,"number":939,"title":"Parser structure","user":{"login":"hzlmn","id":8246283,"avatar_url":"https://avatars.githubusercontent.com/u/8246283?v=3","gravatar_id":"","url":"https://api.github.com/users/hzlmn","html_url":"https://github.com/hzlmn","followers_url":"https://api.github.com/users/hzlmn/followers","following_url":"https://api.github.com/users/hzlmn/following{/other_user}","gists_url":"https://api.github.com/users/hzlmn/gists{/gist_id}","starred_url":"https://api.github.com/users/hzlmn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hzlmn/subscriptions","organizations_url":"https://api.github.com/users/hzlmn/orgs","repos_url":"https://api.github.com/users/hzlmn/repos","events_url":"https://api.github.com/users/hzlmn/events{/privacy}","received_events_url":"https://api.github.com/users/hzlmn/received_events","type":"User","site_admin":false},"labels":[{"id":57904552,"url":"https://api.github.com/repos/postcss/postcss/labels/enhancement","name":"enhancement","color":"84b6eb","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-12-29T11:14:15Z","updated_at":"2016-12-29T16:22:24Z","closed_at":null,"body":"While was reading throught `postcss` sources, found a moment that current parsing architecture looks                          \r\n```\r\n ___________                        __________\r\n|           |                      |          |\r\n| Tokenizer | -> List of Tokens -> |  Parser  | -> Parser eats them and produces AST\r\n|___________|                      |__________|\r\n\r\n```\r\n\r\nWhile it works fine, I am really wondering if there are any reasons for not using `tokens streaming` like `babylon` do for example, where you plug tokenizer in parser, or expose something like `readNextToken`?\r\n\r\nIn this manner you only scan source once, instead of scanning source and then iterating over tokens, that could provide significant performance boost."},"comment":{"url":"https://api.github.com/repos/postcss/postcss/issues/comments/269654038","html_url":"https://github.com/postcss/postcss/issues/939#issuecomment-269654038","issue_url":"https://api.github.com/repos/postcss/postcss/issues/939","id":269654038,"user":{"login":"ai","id":19343,"avatar_url":"https://avatars.githubusercontent.com/u/19343?v=3","gravatar_id":"","url":"https://api.github.com/users/ai","html_url":"https://github.com/ai","followers_url":"https://api.github.com/users/ai/followers","following_url":"https://api.github.com/users/ai/following{/other_user}","gists_url":"https://api.github.com/users/ai/gists{/gist_id}","starred_url":"https://api.github.com/users/ai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ai/subscriptions","organizations_url":"https://api.github.com/users/ai/orgs","repos_url":"https://api.github.com/users/ai/repos","events_url":"https://api.github.com/users/ai/events{/privacy}","received_events_url":"https://api.github.com/users/ai/received_events","type":"User","site_admin":false},"created_at":"2016-12-29T16:22:24Z","updated_at":"2016-12-29T16:22:24Z","body":"@hzlmn I think you could start from backporting `csstree` tokenizer. If it possible, it will give a tokens streaming in the fastest way. If it is not possible we could try to add this feature to current tokenizer.\r\n\r\n@lahmatiy do you think it is possible to backport `csstree` tokenizer to PostCSS?"}}
{"actor":{"display_login":"ai"}}