package token;

import java.util.function.Supplier;

import file.FilePosition;
import sexpression.CommaExpression;
import sexpression.SExpression;

public class Comma extends Token {

    public Comma(String text, FilePosition position) {
        super(text, position);
    }

    @Override
    public SExpression parseSExpression(Supplier<Token> getNextToken) {
        Token nextToken = getNextToken.get();
        SExpression argument = nextToken.parseSExpression(getNextToken);

        return new CommaExpression(argument);
    }

}
