Title: Tokenizer returnings pointers make calculation of position info more complicated · Issue #97973 · python/cpython · GitHub
Open Graph Title: Tokenizer returnings pointers make calculation of position info more complicated · Issue #97973 · python/cpython
X Title: Tokenizer returnings pointers make calculation of position info more complicated · Issue #97973 · python/cpython
Description: Bacause the tokenizer only returns pointers to the beginning and the end of the token, calculating line numbers/column offsets is more complicated than needed. Feature or enhancement Instead of the tokenizer returning a token type and se...
Open Graph Description: Bacause the tokenizer only returns pointers to the beginning and the end of the token, calculating line numbers/column offsets is more complicated than needed. Feature or enhancement Instead of the...
X Description: Bacause the tokenizer only returns pointers to the beginning and the end of the token, calculating line numbers/column offsets is more complicated than needed. Feature or enhancement Instead of the...
Opengraph URL: https://github.com/python/cpython/issues/97973
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Tokenizer returnings pointers make calculation of position info more complicated","articleBody":"Bacause the tokenizer only returns pointers to the beginning and the end of the token, calculating line numbers/column offsets is more complicated than needed. \r\n\r\n### Feature or enhancement\r\n\r\nInstead of the tokenizer returning a token type and settings pointers, we wanna return the token type (remains as is) and then set a `struct token` that has the following information:\r\n1. Pointers to beginning and end\r\n2. Location information (`lineno`, `col_offset`, etc.)\r\n3. Level (the level in the `parenstack`)\r\n\r\nThis way the parser will have a much easier job of setting line numbers \u0026 column offsets in the generated AST numbers and will make some of our work on the f-strings parsing easier. \r\n","author":{"url":"https://github.com/lysnikolaou","@type":"Person","name":"lysnikolaou"},"datePublished":"2022-10-06T17:05:32.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/97973/cpython/issues/97973"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:4b2bded7-97e1-1f90-d2b2-f15eb46ab430 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 80D2:22A978:3CD74E:5601C8:696A0A63 |
| html-safe-nonce | a06d702539791802e0518fd5d9f19be7bc8af915d549939134f31a92d24704a6 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MEQyOjIyQTk3ODozQ0Q3NEU6NTYwMUM4OjY5NkEwQTYzIiwidmlzaXRvcl9pZCI6IjYwMTE2MjIyMzM4NzgwNjMwNyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 4b95bc700beb7f4afd10ba9223f2a9916bda02d347e9c9987fe036e7ab38debb |
| hovercard-subject-tag | issue:1400029780 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/97973/issue_layout |
| twitter:image | https://opengraph.githubassets.com/edd812c77e7711f9dd91657116961513e58263ae9d63defb9fc47e0aa47369fc/python/cpython/issues/97973 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/edd812c77e7711f9dd91657116961513e58263ae9d63defb9fc47e0aa47369fc/python/cpython/issues/97973 |
| og:image:alt | Bacause the tokenizer only returns pointers to the beginning and the end of the token, calculating line numbers/column offsets is more complicated than needed. Feature or enhancement Instead of the... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | lysnikolaou |
| hostname | github.com |
| expected-hostname | github.com |
| None | 699227a00bbb7fe1eec276d2ae1c3a93068bc5ba483bd9dc4b2a27a8f4f2f595 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 7266b2d935baa1c6474b16dd9feaa5ca30607261 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width