Skip to content

Commit

Permalink
Ignore comments in command count analysis
Browse files Browse the repository at this point in the history
  • Loading branch information
Zomis committed May 14, 2017
1 parent 21aaff2 commit ab8c36c
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import net.zomis.brainf.analyze.MemoryCell
import net.zomis.brainf.model.BrainfuckRunner
import net.zomis.brainf.model.ast.tree.ChangePointerSyntax
import net.zomis.brainf.model.ast.tree.ChangeValueSyntax
import net.zomis.brainf.model.ast.tree.CommentSyntax
import net.zomis.brainf.model.ast.tree.GroovySyntax
import net.zomis.brainf.model.ast.tree.PrintSyntax
import net.zomis.brainf.model.ast.tree.ReadSyntax
Expand Down Expand Up @@ -103,7 +104,7 @@ class CommandCountAnalysis implements BrainfuckAnalyzer {
} else if (syntax instanceof ChangeValueSyntax) {
String key = value < 0 ? BrainFCommand.SUBTRACT.name() : BrainFCommand.ADD.name();
codeCommands.merge(key, times, MERGE_FUNCTION)
} else {
} else if (!(syntax instanceof CommentSyntax)) {
codeCommands.merge(syntax.toString(), times, MERGE_FUNCTION)
}
}
Expand Down

0 comments on commit ab8c36c

Please sign in to comment.