package seedu.tasklist.logic.parser;

import static seedu.tasklist.commons.core.Messages.MESSAGE_INVALID_COMMAND_FORMAT;
import static seedu.tasklist.logic.parser.CliSyntax.PREFIX_COMMENT;
import static seedu.tasklist.logic.parser.CliSyntax.PREFIX_TAG;

import java.util.NoSuchElementException;

import seedu.tasklist.commons.exceptions.IllegalValueException;
import seedu.tasklist.logic.commands.AddCommand;
import seedu.tasklist.logic.commands.Command;
import seedu.tasklist.logic.commands.IncorrectCommand;

/**
 * Parses input arguments and creates a new AddCommand object
 */
public class AddCommandParser {

    /**
     * Parses the given {@code String} of arguments in the context of the AddCommand
     * and returns an AddCommand object for execution.
     */
    public Command parse(String args) {
        ArgumentTokenizer argsTokenizer =
                new ArgumentTokenizer(PREFIX_COMMENT, PREFIX_TAG);
        argsTokenizer.tokenize(args);
        try {
            return new AddCommand(
                    argsTokenizer.getPreamble().get(),
                    argsTokenizer.getValue(PREFIX_COMMENT).get(),
                    ParserUtil.toSet(argsTokenizer.getAllValues(PREFIX_TAG))
            );
        } catch (NoSuchElementException nsee) {
            return new IncorrectCommand(String.format(MESSAGE_INVALID_COMMAND_FORMAT, AddCommand.MESSAGE_USAGE));
        } catch (IllegalValueException ive) {
            return new IncorrectCommand(ive.getMessage());
        }
    }

}

@@ -182,16 +182,150 @@
 OMMENT;%0A
+import static seedu.tasklist.logic.parser.CliSyntax.PREFIX_DATE;%0Aimport static seedu.tasklist.logic.parser.CliSyntax.PREFIX_PRIORITY;%0A
 import s
@@ -1024,23 +1024,53 @@
 (PREFIX_
-COMMENT
+DATE, PREFIX_COMMENT, PREFIX_PRIORITY
 , PREFIX
@@ -1272,21 +1272,139 @@
 FIX_
-COMMENT).get(
+DATE),%0A                    argsTokenizer.getValue(PREFIX_COMMENT).get(),%0A                    argsTokenizer.getValue(PREFIX_PRIORITY
 ),%0A 

update parse in AddCommandParser to accept date and priority