-
Notifications
You must be signed in to change notification settings - Fork 5
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
feat: generic parsing interface and parsing of JavaPP annotations #134
Conversation
…on in preparation for JPP parsing
@pmbittner, for some reason, GitHub is not able to determine that some files have simply been renamed or moved and instead shows them as fully deleted and re-added. This might be a bit confusing. |
Have to fix Javadocs |
It seems that the nix build breaks because I incremented DiffDetective's version number. How can I update the build files accordingly? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these changes look great. Thank you! 😃 The documentation is awesome, too.
I have one major comment: Should we really include the heavy reformatting changes? The reformatting of JavaDoc (e.g., to a certain line width limit) look good to me but many files also have their indentation changed extensively. Next time, I perform some changes in IntelliJ, all the formatting will be reverted, yielding large commits again.
Is this some setting in NeoVim? It might be very hard to change the indentation retroactively, so I can live with the changes. Maybe we should add a style configuration (.editorconfig) to DiffDetective or so.
src/main/java/org/variantsync/diffdetective/feature/AnnotationParser.java
Show resolved
Hide resolved
src/main/java/org/variantsync/diffdetective/feature/DiffLineFormulaExtractor.java
Outdated
Show resolved
Hide resolved
src/main/java/org/variantsync/diffdetective/datasets/predefined/Marlin.java
Show resolved
Hide resolved
src/main/java/org/variantsync/diffdetective/feature/PropositionalFormulaParser.java
Show resolved
Hide resolved
src/main/java/org/variantsync/diffdetective/feature/cpp/CPPDiffLineFormulaExtractor.java
Show resolved
Hide resolved
src/main/java/org/variantsync/diffdetective/feature/jpp/JPPDiffLineFormulaExtractor.java
Outdated
Show resolved
Hide resolved
src/main/java/org/variantsync/diffdetective/variation/NodeType.java
Outdated
Show resolved
Hide resolved
src/main/java/org/variantsync/diffdetective/variation/NodeType.java
Outdated
Show resolved
Hide resolved
new TestCase("#ifdef \\U0001000", "__B_SLASH__U0001000"), | ||
new TestCase("#if (defined(NAME) && (NAME >= 199905) && (NAME < 1991011)) || (NAME >= 300000) || defined(NAME)", "(DEFINED___LB__NAME__RB__&&(NAME__GEQ__199905)&&(NAME__LT__1991011))||(NAME__GEQ__300000)||DEFINED___LB__NAME__RB__"), | ||
new TestCase("#if __has_warning(\"-Wa-warning\"_foo)", | ||
"__HAS_WARNING___LB____QUOTE____SUB__Wa__SUB__warning__QUOTE_____foo__RB__") | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this reindentation necessary? Why should we use 8 spaces instead of 4 spaces now? (Next time I change something in IntelliJ, this styling will be reset and we have huge patches again. 😵 )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have not used nvim because I was worried about my style being applied to reformat the entire codebase 🙈 . I only used IntelliJ which did this autoformatting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh I see. Seems we have different settings then. I guess its time for a common .editorconfig then. I will open an issue soon then. You dont have to revert the indentation stuff. That is too cumbersome I guess.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you tried formatting he file with your Intellij? I am using the default settings, because I only just installed it on my new Laptop. Perhaps something else in the implementation had changed since the last time it was formatted?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just formatted this block of TestCases in IntelliJ and the same formatting as you have was applied. Interesting...
sorry, hit the wrong button and closed by accident 😓 |
These were missed in 569f663.
You missed the version bump in seven other files. Please use something like @pmbittner Should I create an issue for making these files independent of the version number such that we have one canonical place for changing the version number (e.g., |
I am also a NeoVim user. In case you have problems with your setup I might be able to help you. |
Having to do this is not ideal. I searched for the version numbers, but I was unsure which ones I can change safely, because I am not familiar with nix and was not sure whether I would break stuff. I think that having only one place where the version number is specified would be great. |
I have not configured jdtls to use Intellij's style for auto-formatting. How have you integrated Intellij's style in your configuration? |
…ssorAnnotationParser
That is a good idea, given that also I missed this in my review (even though I incremented the version number correctly just two weeks ago). |
…s upon implementation changes
Sorry for the late answer, I totally forgot this.
No actually not. I will open an issue for creating an editor config or, if possible, start agreeing on a single formatter. I also use jdtl, however I only format lines that I actually changed: The |
Hi all, thanks for opening an issue @ibbem . We can proceed to merge this PR for now and deal with indentation and formatting later. Thanks @AlexanderSchultheiss for all the improvements. :) |
new TestCase("#ifdef \\U0001000", "__B_SLASH__U0001000"), | ||
new TestCase("#if (defined(NAME) && (NAME >= 199905) && (NAME < 1991011)) || (NAME >= 300000) || defined(NAME)", "(DEFINED___LB__NAME__RB__&&(NAME__GEQ__199905)&&(NAME__LT__1991011))||(NAME__GEQ__300000)||DEFINED___LB__NAME__RB__"), | ||
new TestCase("#if __has_warning(\"-Wa-warning\"_foo)", | ||
"__HAS_WARNING___LB____QUOTE____SUB__Wa__SUB__warning__QUOTE_____foo__RB__") | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just formatted this block of TestCases in IntelliJ and the same formatting as you have was applied. Interesting...
Description
The ArgoUML-SPL has been build using the Java Preprocessor library which mimics the conditional compilation of the C preprocessor. Due to JavaPP using a slightly different Syntax and being hidden behind line comments, we cannot simply apply our current parsing pipeline to ArgoUML.
This pull request pull up the necessary interfaced of our existing parsing pipeline to allow for different parser implementations. Additionally, it includes a parser for JavaPP.
Notes
I have integrated this version of DiffDetective in VEVOS and I was able to extract a ground truth for ArgoUML. However, ArgoUML only has one commit in which the variability is edited and this commit appears to contain files with missing 'endif' statements, which causes errors to be reported.