Skip to content

Commit

Permalink
Fix checkstyle errors (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
Remy9926 authored Nov 3, 2023
1 parent 74fa347 commit b0df278
Showing 1 changed file with 49 additions and 53 deletions.
102 changes: 49 additions & 53 deletions src/main/java/seedu/duke/parser/Parser.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,10 @@
import seedu.duke.commands.logcommands.DeleteLogCommand;
import seedu.duke.commands.logcommands.ViewLogCommand;
import seedu.duke.commands.logcommands.UpdateLogCommand;
import seedu.duke.commands.meal.MealCommand;
import seedu.duke.data.exception.IllegalValueException;
import seedu.duke.commands.meal.*;
import seedu.duke.commands.meal.AddCommand;


/**
* Parses user input.
*/
public class Parser {

public static final Pattern PERSON_INDEX_ARGS_FORMAT = Pattern.compile("(?<targetIndex>.+)");
Expand Down Expand Up @@ -56,56 +53,55 @@ public Command parseCommand(String userInput) throws Exception {

switch (commandWord) {

// case AddCommand.COMMAND_WORD:
// return prepareAdd(arguments);
//
// case DeleteCommand.COMMAND_WORD:
// return prepareDelete(arguments);
//
// case ClearCommand.COMMAND_WORD:
// return new ClearCommand();
//
// case FindCommand.COMMAND_WORD:
// return prepareFind(arguments);
//
// case ListCommand.COMMAND_WORD:
// return new ListCommand();
//
// case ViewCommand.COMMAND_WORD:
// return prepareView(arguments);
//
// case ViewAllCommand.COMMAND_WORD:
// return prepareViewAll(arguments);
//

case LogCommand.COMMAND_WORD:
return new LogCommand(Arrays.asList(arguments.trim().split(" ")));

case DeleteLogCommand.COMMAND_WORD:
return new DeleteLogCommand(Arrays.asList(arguments.trim().split(" ")));

case ViewLogCommand.COMMAND_WORD:
return new ViewLogCommand(Arrays.asList(arguments.trim().split(" ")));

case UpdateLogCommand.COMMAND_WORD:
return new UpdateLogCommand(Arrays.asList(arguments.trim().split(" ")));

case seedu.duke.commands.meal.AddCommand.COMMAND_WORD:
return new AddCommand(Arrays.asList(arguments.trim().split(" ")));

case GoalCommand.COMMAND_WORD:
return new GoalCommand(userInput);

case ExitCommand.COMMAND_WORD:
return new ExitCommand();

case HelpCommand.COMMAND_WORD: // Fallthrough

default:
return new HelpCommand();
// case AddCommand.COMMAND_WORD:
// return prepareAdd(arguments);
//
// case DeleteCommand.COMMAND_WORD:
// return prepareDelete(arguments);
//
// case ClearCommand.COMMAND_WORD:
// return new ClearCommand();
//
// case FindCommand.COMMAND_WORD:
// return prepareFind(arguments);
//
// case ListCommand.COMMAND_WORD:
// return new ListCommand();
//
// case ViewCommand.COMMAND_WORD:
// return prepareView(arguments);
//
// case ViewAllCommand.COMMAND_WORD:
// return prepareViewAll(arguments);
//

case LogCommand.COMMAND_WORD:
return new LogCommand(Arrays.asList(arguments.trim().split(" ")));

case DeleteLogCommand.COMMAND_WORD:
return new DeleteLogCommand(Arrays.asList(arguments.trim().split(" ")));

case ViewLogCommand.COMMAND_WORD:
return new ViewLogCommand(Arrays.asList(arguments.trim().split(" ")));

case UpdateLogCommand.COMMAND_WORD:
return new UpdateLogCommand(Arrays.asList(arguments.trim().split(" ")));

case seedu.duke.commands.meal.AddCommand.COMMAND_WORD:
return new AddCommand(Arrays.asList(arguments.trim().split(" ")));

case GoalCommand.COMMAND_WORD:
return new GoalCommand(userInput);

case ExitCommand.COMMAND_WORD:
return new ExitCommand();

case HelpCommand.COMMAND_WORD: // Fallthrough

default:
return new HelpCommand();
}
}

// /**
// * Parses arguments in the context of the add person command.
// *
Expand Down

0 comments on commit b0df278

Please sign in to comment.