class PluginParser extends Parser<T> {

    @Override
    protected void parse(T type) {
        var plugin = environment.resolver.any(type, Plugin.class);
        
        environment.mappings.put("main", stringify(type));
        
        var name = plugin.name().isEmpty() ? environment.project.name : plugin.name();
        if (!matcher.reset(name).matches()) {
            environment.error(type, format(name, "is not a valid plugin name", "should contain only alphanumeric characters and \"_\""));
        }
        
        environment.mappings.put("name", name);
        
        var version = plugin.version().isEmpty() ? environment.project.version : plugin.version();
        if (!VERSIONING.matcher(version).matches()) {
            environment.warn(type, format(version, "may be malformed", "version should follow SemVer, https://semver.org/"));
        }
        
        environment.mappings.put("version", version);
    }

    public  PluginParser(Environment<T> environment);

}