Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CxxPreprocessor: fix handling of SquidAstVisitorContext #1645

Merged
merged 2 commits into from
Dec 31, 2018

Conversation

ivangalkin
Copy link
Contributor

@ivangalkin ivangalkin commented Dec 27, 2018

  • SquidAstVisitorContext::getFile() never returns null during productive execution

  • the only exception is preprocessing inside of preprocessor's constructor
    (error-prone design in my humble opinion)

  • Fixes:

    • wrong assumptions in CxxPreprocessor were fixed
    • documentation was added
    • poorly parametrized mocks were fixed in the unit tests
    • minor refactoring

This change is Reviewable

* `SquidAstVisitorContext::getFile()` never returns `null` during productive execution
* the only exception is preprocessing inside of preprocessor's constructor
  (error-prone design in my humble opinion)

* Fixes:
   * wrong assumptions in `CxxPreprocessor` were fixed
   * documentation was added
   * poorly parametrized mocks were fixed in the unit tests
   * minor refactoring
@ivangalkin ivangalkin added this to the 1.2.2 milestone Dec 27, 2018
@ivangalkin ivangalkin self-assigned this Dec 27, 2018
* remove wrong is-null checks (although I hope, that SonarOpenCommunity#1638 will
  be merged and we could remove the code completely)
@guwirth
Copy link
Collaborator

guwirth commented Dec 29, 2018

@ivangalkin looks good. And yes, maybe there is a better solution how to add default macros and config settings to preprocessor.

@guwirth guwirth merged commit 4fe19d2 into SonarOpenCommunity:master Dec 31, 2018
ivangalkin added a commit to ivangalkin/sonar-cxx that referenced this pull request Jan 10, 2019
* org.sonar.sslr.toolkit.ConfigurationModel doesn't receive
  the file path of the processed file
* file path plays important role for the preprocessor
* pass a dummy path

fixes SonarOpenCommunity#1662
ivangalkin added a commit to ivangalkin/sonar-cxx that referenced this pull request Jan 10, 2019
* org.sonar.sslr.toolkit.ConfigurationModel doesn't receive
  the file path of the processed file
* file path plays important role for the preprocessor
* pass a dummy path

fixes SonarOpenCommunity#1662
guwirth added a commit that referenced this pull request Jan 11, 2019
fix: sslr-cxx-toolkit fails after #1645
@guwirth guwirth mentioned this pull request Feb 8, 2019
Bertk pushed a commit to Bertk/sonar-cxx that referenced this pull request Jun 22, 2019
* org.sonar.sslr.toolkit.ConfigurationModel doesn't receive
  the file path of the processed file
* file path plays important role for the preprocessor
* pass a dummy path

fixes SonarOpenCommunity#1662
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

2 participants