-
Notifications
You must be signed in to change notification settings - Fork 332
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
Feature/normalization option #1479
Merged
Merged
Changes from 13 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
11e24c5
Added option for normalization.
TwoOfTwelve cbce48e
Enabled normalization for java and cpp2
TwoOfTwelve e6c550c
Enabled normalization for java and cpp2
TwoOfTwelve 32920f1
Merge remote-tracking branch 'origin/feature/normalizationOption' int…
TwoOfTwelve a2408dc
Merge branch 'develop' into feature/normalizationOption
TwoOfTwelve 6b9e97c
spotless
TwoOfTwelve 6d84632
Updated help text in documentation.
TwoOfTwelve 15cc503
Implemented suggestions from github.
TwoOfTwelve af71103
Merge branch 'develop' into feature/normalizationOption
TwoOfTwelve 8aad785
Rough implementation of language specific normalization option.
TwoOfTwelve 7613a5b
Revert "Rough implementation of language specific normalization option."
TwoOfTwelve 490a62f
The normalization flag is now passed to the language modules.
TwoOfTwelve 5f3f077
Implemented simple test for the Language interface
TwoOfTwelve 12c3b0c
Changed the Language interface to force all Language to implement the…
TwoOfTwelve e3a1552
Merge branch 'develop' into feature/normalizationOption
TwoOfTwelve 6d19f3e
Fixed error in ScalaLanguage due to Language interface change.
TwoOfTwelve c5fea4e
Fixed error in ScalaLanguageTest due to Language interface change.
TwoOfTwelve 4169a8d
spotless
TwoOfTwelve File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
core/src/main/java/de/jplag/exceptions/ConfigurationException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package de.jplag.exceptions; | ||
|
||
/** | ||
* Exceptions used if configuration is wrong. | ||
*/ | ||
public class ConfigurationException extends ExitException { | ||
public ConfigurationException(String message) { | ||
super(message); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
package de.jplag; | ||
|
||
import java.io.File; | ||
import java.util.Collections; | ||
import java.util.List; | ||
import java.util.Set; | ||
|
||
import org.junit.jupiter.api.Assertions; | ||
import org.junit.jupiter.api.Test; | ||
|
||
class LanguageTest { | ||
@Test | ||
public void testInvalidLanguageDoesNotWork() { | ||
Assertions.assertThrows(UnsupportedOperationException.class, () -> { | ||
InvalidLanguage invalidLanguage = new InvalidLanguage(); | ||
invalidLanguage.parse(Collections.emptySet(), false); | ||
}); | ||
} | ||
|
||
@Test | ||
public void testValidLanguageWithNormalization() throws ParsingException { | ||
Language language = new LanguageWithNormalization(); | ||
language.parse(Collections.emptySet(), false); | ||
} | ||
|
||
@Test | ||
public void testValidLanguageWithoutNormalization() throws ParsingException { | ||
Language language = new LanguageWithoutNormalization(); | ||
language.parse(Collections.emptySet(), false); | ||
} | ||
|
||
private static abstract class LanguageBase implements Language { | ||
@Override | ||
public String[] suffixes() { | ||
return new String[0]; | ||
} | ||
|
||
@Override | ||
public String getName() { | ||
return null; | ||
} | ||
|
||
@Override | ||
public String getIdentifier() { | ||
return null; | ||
} | ||
|
||
@Override | ||
public int minimumTokenMatch() { | ||
return 0; | ||
} | ||
} | ||
|
||
private static class InvalidLanguage extends LanguageBase { | ||
} | ||
|
||
private static class LanguageWithNormalization extends LanguageBase { | ||
@Override | ||
public List<Token> parse(Set<File> files, boolean normalize) { | ||
return Collections.emptyList(); | ||
} | ||
} | ||
|
||
private static class LanguageWithoutNormalization extends LanguageBase { | ||
@Override | ||
public List<Token> parse(Set<File> files) { | ||
return Collections.emptyList(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Good for now, when we enable it for EMF, we need a language method that can be called for the normalization.