Title: Refactoring: separate the cppcheck-specific &= handling from TokenList::combineOperators() · Issue #737 · cppcheck-opensource/simplecpp · GitHub
Open Graph Title: Refactoring: separate the cppcheck-specific &= handling from TokenList::combineOperators() · Issue #737 · cppcheck-opensource/simplecpp
X Title: Refactoring: separate the cppcheck-specific &= handling from TokenList::combineOperators() · Issue #737 · cppcheck-opensource/simplecpp
Description: TokenList::combineOperators() joins single-character tokens into operators (& = → &=). It also contains a heuristic for cppcheck: in a function declaration with an unnamed reference parameter that has a default value, &= is not joined. v...
Open Graph Description: TokenList::combineOperators() joins single-character tokens into operators (& = → &=). It also contains a heuristic for cppcheck: in a function declaration with an unnamed reference parameter that ...
X Description: TokenList::combineOperators() joins single-character tokens into operators (& = → &=). It also contains a heuristic for cppcheck: in a function declaration with an unnamed reference paramet...
Opengraph URL: https://github.com/cppcheck-opensource/simplecpp/issues/737
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Refactoring: separate the cppcheck-specific &= handling from TokenList::combineOperators()","articleBody":" `TokenList::combineOperators()` joins single-character tokens into operators (`&` `=` → `&=`). It also contains a heuristic for\n cppcheck: in a function declaration with an unnamed reference parameter that has a default value, `&=` is not joined.\n\n```cpp\nvoid f(x&=2); // simplecpp: void f ( x & = 2 ) ;\nf(x&=2); // simplecpp: f ( x &= 2 ) ;\n```\n\n This is not part of preprocessing. Compilers tokenize `&=` as one operator here (g++: `expected ',' or '...' before '&=' token`). To\n decide, the heuristic tracks whether the code is inside a function body (`executableScope`) and looks back for a function\n declaration. That is C++ parsing.\n\n Before `combineOperators()` is replaced by a longest-match tokenizer (step 2 of #708), move this code into separate functions with\n clear names, so that it can be kept as its own step:\n\n - tracking of `{` / `}` to know if the current code is in a function body\n - detection of \"`&=` in the parameter list of a function declaration\"\n\n This is a pure refactoring, so behaviour does not change. The existing tests in `combineOperators_andequal` keep passing unchanged.\n","author":{"url":"https://github.com/danmar","@type":"Person","name":"danmar"},"datePublished":"2026-11-07T17:38:20Z","url":"https://github.com/cppcheck-opensource/simplecpp/issues/737"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| 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:4f69069f-5684-e59f-9d7e-0b45f3bd58d6 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9FFA:2A4A01:3D0712:54FA6D:6AFC51F8 |
| html-safe-nonce | 41bd730e0aae14776e975d8c57571953abb2eda0e3a96d00ac246a4707d514ba |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5RkZBOjJBNEEwMTozRDA3MTI6NTRGQTZEOjZBRkM1MUY4IiwidmlzaXRvcl9pZCI6IjI3Njg2NzA1MDM1OTY3NDExMTIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 214c82dd7d7e22ff883b9eef75227735127bdb5a0a37a15d1a9d2b829bb7b75a |
| hovercard-subject-tag | issue:6262230327 |
| 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/cppcheck-opensource/simplecpp/737/issue_layout |
| twitter:image | https://opengraph.githubassets.com/58ccf3c69f41139d9cb066bda5fed8e3d92a57122c662b7a927df3ff3f04da4f/cppcheck-opensource/simplecpp/issues/737 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/58ccf3c69f41139d9cb066bda5fed8e3d92a57122c662b7a927df3ff3f04da4f/cppcheck-opensource/simplecpp/issues/737 |
| og:image:alt | TokenList::combineOperators() joins single-character tokens into operators (& = → &=). It also contains a heuristic for cppcheck: in a function declaration with an unnamed reference parameter that ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | danmar |
| hostname | github.com |
| expected-hostname | github.com |
| None | b63557e0027d8014589e873df28328da74a4356701bb1a9eab49dbf012ba8fa6 |
| turbo-cache-control | no-preview |
| go-import | github.com/cppcheck-opensource/simplecpp git https://github.com/cppcheck-opensource/simplecpp.git |
| octolytics-dimension-user_id | 278097703 |
| octolytics-dimension-user_login | cppcheck-opensource |
| octolytics-dimension-repository_id | 33434464 |
| octolytics-dimension-repository_nwo | cppcheck-opensource/simplecpp |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 33434464 |
| octolytics-dimension-repository_network_root_nwo | cppcheck-opensource/simplecpp |
| 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 | 0243355b0352c83733a042e0dfb3d75149b51261 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width