Skip to content

Commit

Permalink
Removed unused code
Browse files Browse the repository at this point in the history
Signed-off-by: Ben Sherman <[email protected]>
  • Loading branch information
bentsherman committed Dec 8, 2024
1 parent 08c2c6f commit 18b5c58
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 32 deletions.
1 change: 0 additions & 1 deletion modules/compiler/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ plugins {

dependencies {
antlr 'org.antlr:antlr4:4.9.2'
implementation 'com.google.guava:guava:33.3.1-jre'
implementation 'org.apache.groovy:groovy:4.0.24'

testImplementation ('net.bytebuddy:byte-buddy:1.14.17')
Expand Down
16 changes: 0 additions & 16 deletions modules/compiler/src/main/java/config/parser/ConfigAstBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors;

import com.google.common.hash.Hashing;
import groovy.lang.Tuple2;
import nextflow.config.ast.ConfigAppendNode;
import nextflow.config.ast.ConfigAssignNode;
Expand Down Expand Up @@ -87,7 +86,6 @@
import org.codehaus.groovy.control.CompilePhase;
import org.codehaus.groovy.control.SourceUnit;
import org.codehaus.groovy.control.messages.SyntaxErrorMessage;
import org.codehaus.groovy.runtime.IOGroovyMethods;
import org.codehaus.groovy.syntax.Numbers;
import org.codehaus.groovy.syntax.SyntaxException;
import org.codehaus.groovy.syntax.Types;
Expand Down Expand Up @@ -188,8 +186,6 @@ private ModuleNode compilationUnit(CompilationUnitContext ctx) {
moduleNode.addConfigStatement(configStatement(stmt));

var scriptClassNode = moduleNode.getScriptClassDummy();
scriptClassNode.setName(getMainClassName());

var statements = moduleNode.getConfigStatements();
if( scriptClassNode != null && !statements.isEmpty() ) {
var first = statements.get(0);
Expand All @@ -205,18 +201,6 @@ private ModuleNode compilationUnit(CompilationUnitContext ctx) {
return moduleNode;
}

private String getMainClassName() {
try {
var reader = sourceUnit.getSource().getReader();
var text = IOGroovyMethods.getText(reader);
var hash = Hashing.sipHash24().newHasher().putUnencodedChars(text).hash();
return "_nf_config_" + hash.toString();
}
catch( IOException e ) {
throw new GroovyBugError("Failed to create main class name", e);
}
}

private ConfigStatement configStatement(ConfigStatementContext ctx) {
ConfigStatement result;

Expand Down
15 changes: 0 additions & 15 deletions modules/compiler/src/main/java/script/parser/ScriptAstBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors;

import com.google.common.hash.Hashing;
import groovy.lang.Tuple2;
import nextflow.script.ast.AssignmentExpression;
import nextflow.script.ast.FeatureFlagNode;
Expand Down Expand Up @@ -95,7 +94,6 @@
import org.codehaus.groovy.control.CompilePhase;
import org.codehaus.groovy.control.SourceUnit;
import org.codehaus.groovy.control.messages.SyntaxErrorMessage;
import org.codehaus.groovy.runtime.IOGroovyMethods;
import org.codehaus.groovy.syntax.Numbers;
import org.codehaus.groovy.syntax.SyntaxException;
import org.codehaus.groovy.syntax.Types;
Expand Down Expand Up @@ -236,26 +234,13 @@ private ModuleNode compilationUnit(CompilationUnitContext ctx) {
}

var scriptClassNode = moduleNode.getScriptClassDummy();
scriptClassNode.setName(getMainClassName());

if( numberFormatError != null )
throw createParsingFailedException(numberFormatError.getV2().getMessage(), numberFormatError.getV1());

return moduleNode;
}

private String getMainClassName() {
try {
var reader = sourceUnit.getSource().getReader();
var text = IOGroovyMethods.getText(reader);
var hash = Hashing.sipHash24().newHasher().putUnencodedChars(text).hash();
return "_nf_script_" + hash.toString();
}
catch( IOException e ) {
throw new GroovyBugError("Failed to create main class name", e);
}
}

private boolean scriptDeclaration(ScriptDeclarationContext ctx) {
if( ctx instanceof FeatureFlagDeclAltContext ffac ) {
var node = featureFlagDeclaration(ffac.featureFlagDeclaration());
Expand Down

0 comments on commit 18b5c58

Please sign in to comment.