<commit_before>package ca.concordia.cssanalyser.migration.topreprocessors.mixin;

import ca.concordia.cssanalyser.cssmodel.declaration.PropertyAndLayer;


public class MixinParameter implements MixinValue {
	
	private String parameterName;
	
	public MixinParameter(String parameterName, MixinDeclaration forDeclaration, PropertyAndLayer assignedTo) {
		this.parameterName = parameterName;
	}
	
	public String getName() {
		return parameterName;
	}
	
	public void setName(String name) {
		this.parameterName = name;
	}
	
	// FIXME: Less syntax
	@Override
	public String toString() {
		return String.format("@%s", parameterName);
	}<commit_msg>Add check for parameter name to be valid<commit_after>package ca.concordia.cssanalyser.migration.topreprocessors.mixin;

import ca.concordia.cssanalyser.cssmodel.declaration.PropertyAndLayer;


public class MixinParameter implements MixinValue {
	
	private String parameterName;
	
	public MixinParameter(String parameterName, MixinDeclaration forDeclaration, PropertyAndLayer assignedTo) {
		this.parameterName = parameterName;
	}
	
	public String getName() {
		return parameterName;
	}
	
	public void setName(String name) {
		String mixinNamePattern = "[a-zA-Z_][a-zA-Z0-9_]*";
		if (!name.matches(mixinNamePattern)) {
			throw new IllegalArgumentException("Parameter name is invalid");
		}
		this.parameterName = name;
	}
	
	// FIXME: Less syntax
	@Override
	public String toString() {
		return String.format("@%s", parameterName);
	}
{'fraction_non_alphanumeric': 0.09269282814614344, 'fraction_numerical': 0.0013531799729364006, 'mean_word_length': 5.2405063291139244, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4234927', 'n_tokens_mistral': 469, 'n_tokens_neox': 438, 'n_words': 102}