<commit_before>/* run.vala
 *
 * Copyright (C) 2008-2009 <NAME>
 * Copyright (C) 2008-2012 <NAME>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
 *
 * Author:
 * 	Didier '<NAME> <<EMAIL>>
 */

using Gee;


public class Valadoc.Content.Run : InlineContent, Inline {
	public enum Style {
		NONE,
		BOLD,
		ITALIC,
		UNDERLINED,
		MONOSPACED,
		STROKE,
		LANG_KEYWORD,
		LANG_LITERAL,
		LANG_BASIC_TYPE,
		LANG_TYPE,
		LANG_PREPROCESSOR,
		LANG_COMMENT,
		LANG_ESCAPE,
		
		XML_ESCAPE,
		XML_ELEMENT,
		XML_ATTRIBUTE,
		XML_ATTRIBUTE_VALUE,
		XML_COMMENT,
		XML_CDATA;

		public static Style? from_string (string str) {
			switch (str) {
			case "none":
				return Style.NONE;

			case "bold":
				return Style.BOLD;

			case "italic":
				return Style.ITALIC;

			case "underlined":
				return Style.UNDERLINED;

			case "monospaced":
				return Style.MONOSPACED;	

			case "stroke":
				return Style.STROKE;

			case "lang-escape":
				return Style.LANG_ESCAPE;

			case "lang-keyword":
				return Style.LANG_KEYWORD;

			case "lang-literal":
				return Style.LANG_LITERAL;

			case "lang-basic-type":
				return Style.LANG_BASIC_TYPE;

			case "lang-type":
				return Style.LANG_TYPE;

			case "lang-preprocessor":
				return Style.LANG_PREPROCESSOR;

			case "lang-comment":
				return Style.LANG_COMMENT;

			case "xml-escape":
				return Style.XML_ESCAPE;

			case "xml-element":
				return Style.XML_ELEMENT;

			case "xml-attribute":
				return Style.XML_ATTRIBUTE;

			case "xml-attribute-value":
				return Style.XML_ATTRIBUTE_VALUE;

			case "xml-comment":
				return Style.XML_COMMENT;

			case "xml-cdata":
				return Style.XML_CDATA;
			}

			return null;
		}

		public unowned string to_string () {
			switch (this) {
			case Style.NONE:
				return "none";

			case Style.BOLD:
				return "bold";

			case Style.ITALIC:
				return "italic";

			case Style.UNDERLINED:
				return "underlined";

			case Style.MONOSPACED:
				return "monopace";

			case Style.STROKE:
				return "stroke";

			case Style.LANG_ESCAPE:
				return "lang-escape";

			case Style.LANG_KEYWORD:
				return "lang-keyword";

			case Style.LANG_LITERAL:
				return "lang-literal";

			case Style.LANG_BASIC_TYPE:
				return "lang-basic-type";

			case Style.LANG_TYPE:
				return "lang-type";

			case Style.LANG_PREPROCESSOR:
				return "lang-preprocessor";

			case Style.LANG_COMMENT:
				return "lang-comment";

			case Style.XML_ESCAPE:
				return "xml-escape";

			case Style.XML_ELEMENT:
				return "xml-element";

			case Style.XML_ATTRIBUTE:
				return "xml-attribute";

			case Style.XML_ATTRIBUTE_VALUE:
				return "xml-attribute-value";

			case Style.XML_COMMENT:
				return "xml-comment";

			case Style.XML_CDATA:
				return "xml-cdata";
			}

			assert (true);
			return "";
		}
	}

	public Style style { get; set; }

	internal Run (Style style) {
		base ();
		_style = style;
	}

	public override void check (Api.Tree api_root, Api.Node container, string file_path,
								ErrorReporter reporter, Settings settings)
	{
		// Check inline content
		base.check (api_root, container, file_path, reporter, settings);
	}

	public override void accept (ContentVisitor visitor) {
		visitor.visit_run (this);
	}

	public override ContentElement copy (ContentElement? new_parent = null) {
		Run run = new Run (style);
		run.parent = new_parent;

		foreach (Inline element in content) {
			Inline copy = element.copy (run) as Inline;
			run.content.add (copy);
		}

		return run;
	}
}

<commit_msg>Fix typo in Run.Style enum<commit_after>/* run.vala
 *
 * Copyright (C) 2008-2009 <NAME>
 * Copyright (C) 2008-2012 <NAME>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
 *
 * Author:
 * 	<NAME> <<EMAIL>>
 */

using Gee;


public class Valadoc.Content.Run : InlineContent, Inline {
	public enum Style {
		NONE,
		BOLD,
		ITALIC,
		UNDERLINED,
		MONOSPACED,
		STROKE,
		LANG_KEYWORD,
		LANG_LITERAL,
		LANG_BASIC_TYPE,
		LANG_TYPE,
		LANG_PREPROCESSOR,
		LANG_COMMENT,
		LANG_ESCAPE,
		
		XML_ESCAPE,
		XML_ELEMENT,
		XML_ATTRIBUTE,
		XML_ATTRIBUTE_VALUE,
		XML_COMMENT,
		XML_CDATA;

		public static Style? from_string (string str) {
			switch (str) {
			case "none":
				return Style.NONE;

			case "bold":
				return Style.BOLD;

			case "italic":
				return Style.ITALIC;

			case "underlined":
				return Style.UNDERLINED;

			case "monospaced":
				return Style.MONOSPACED;	

			case "stroke":
				return Style.STROKE;

			case "lang-escape":
				return Style.LANG_ESCAPE;

			case "lang-keyword":
				return Style.LANG_KEYWORD;

			case "lang-literal":
				return Style.LANG_LITERAL;

			case "lang-basic-type":
				return Style.LANG_BASIC_TYPE;

			case "lang-type":
				return Style.LANG_TYPE;

			case "lang-preprocessor":
				return Style.LANG_PREPROCESSOR;

			case "lang-comment":
				return Style.LANG_COMMENT;

			case "xml-escape":
				return Style.XML_ESCAPE;

			case "xml-element":
				return Style.XML_ELEMENT;

			case "xml-attribute":
				return Style.XML_ATTRIBUTE;

			case "xml-attribute-value":
				return Style.XML_ATTRIBUTE_VALUE;

			case "xml-comment":
				return Style.XML_COMMENT;

			case "xml-cdata":
				return Style.XML_CDATA;
			}

			return null;
		}

		public unowned string to_string () {
			switch (this) {
			case Style.NONE:
				return "none";

			case Style.BOLD:
				return "bold";

			case Style.ITALIC:
				return "italic";

			case Style.UNDERLINED:
				return "underlined";

			case Style.MONOSPACED:
				return "monospaced";

			case Style.STROKE:
				return "stroke";

			case Style.LANG_ESCAPE:
				return "lang-escape";

			case Style.LANG_KEYWORD:
				return "lang-keyword";

			case Style.LANG_LITERAL:
				return "lang-literal";

			case Style.LANG_BASIC_TYPE:
				return "lang-basic-type";

			case Style.LANG_TYPE:
				return "lang-type";

			case Style.LANG_PREPROCESSOR:
				return "lang-preprocessor";

			case Style.LANG_COMMENT:
				return "lang-comment";

			case Style.XML_ESCAPE:
				return "xml-escape";

			case Style.XML_ELEMENT:
				return "xml-element";

			case Style.XML_ATTRIBUTE:
				return "xml-attribute";

			case Style.XML_ATTRIBUTE_VALUE:
				return "xml-attribute-value";

			case Style.XML_COMMENT:
				return "xml-comment";

			case Style.XML_CDATA:
				return "xml-cdata";
			}

			assert (true);
			return "";
		}
	}

	public Style style { get; set; }

	internal Run (Style style) {
		base ();
		_style = style;
	}

	public override void check (Api.Tree api_root, Api.Node container, string file_path,
								ErrorReporter reporter, Settings settings)
	{
		// Check inline content
		base.check (api_root, container, file_path, reporter, settings);
	}

	public override void accept (ContentVisitor visitor) {
		visitor.visit_run (this);
	}

	public override ContentElement copy (ContentElement? new_parent = null) {
		Run run = new Run (style);
		run.parent = new_parent;

		foreach (Inline element in content) {
			Inline copy = element.copy (run) as Inline;
			run.content.add (copy);
		}

		return run;
	}
}


{'fraction_non_alphanumeric': 0.09740957383311448, 'fraction_numerical': 0.006923719708726274, 'mean_word_length': 3.149578999504705, 'pattern_counts': {'":': 38, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 24}, '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': '948847', 'n_tokens_mistral': 3386, 'n_tokens_neox': 2736, 'n_words': 807}