#include <eepp/ui/doc/languages/swift.hpp>
#include <eepp/ui/doc/syntaxdefinitionmanager.hpp>

namespace EE { namespace UI { namespace Doc { namespace Language {

SyntaxDefinition& addSwift() {

	auto& sd = SyntaxDefinitionManager::instance()->add(

		{ "Swift",
		  { "%.swift$" },
		  {
			  { { "//.-\n" }, "comment" },
			  { { "/%*", "%*/" }, "comment" },
			  { { "\"\"\"", "\"\"\"" }, "string" },
			  { { "\"", "\"", "\\" }, "string" },
			  { { "-?0x%x+" }, "number" },
			  { { "-?%d+[%d%.eE]*f?" }, "number" },
			  { { "-?%.?%d+f?" }, "number" },
			  { { "[%+%-=/%*%^%%<>!~|&]" }, "operator" },
			  { { "[%a_][%w_]*%f[(]" }, "function" },
			  { { "[%a_][%w_]*[?!]?" }, "symbol" },

		  },
		  {
			  { "encodeBitsAsWords", "type" },
			  { "postfix", "keyword" },
			  { "open", "keyword" },
			  { "debugPrintln", "type" },
			  { "debugPrint", "type" },
			  { "convenience", "keyword" },
			  { "count", "type" },
			  { "contains", "type" },
			  { "#imageLiteral", "keyword" },
			  { "enumerate", "type" },
			  { "c", "type" },
			  { "bridgeToObjectiveCUnconditional", "type" },
			  { "try?", "keyword" },
			  { "assertionFailure", "type" },
			  { "withUnsafePointers", "type" },
			  { "Void", "type" },
			  { "assert", "type" },
			  { "in", "keyword" },
			  { "anyGenerator", "type" },
			  { "fatalError", "type" },
			  { "alignofValue", "type" },
			  { "bridgeToObjectiveC", "type" },
			  { "alignof", "type" },
			  { "willSet", "keyword" },
			  { "where", "keyword" },
			  { "weak", "keyword" },
			  { "typealias", "keyword" },
			  { "isBridgedToObjectiveC", "type" },
			  { "isUniquelyReferenced", "type" },
			  { "underestimateCount", "type" },
			  { "try!", "keyword" },
			  { "as!", "keyword" },
			  { "none", "keyword" },
			  { "maxElement", "type" },
			  { "throws", "keyword" },
			  { "associatedtype", "keyword" },
			  { "throw", "keyword" },
			  { "lazy", "keyword" },
			  { "switch", "keyword" },
			  { "super", "keyword" },
			  { "struct", "keyword" },
			  { "static", "keyword" },
			  { "unsafeReflect", "type" },
			  { "dropLast", "type" },
			  { "Self", "keyword" },
			  { "fallthrough", "keyword" },
			  { "unowned", "keyword" },
			  { "__FILE__", "keyword" },
			  { "right", "keyword" },
			  { "required", "keyword" },
			  { "nonmutating", "keyword" },
			  { "try", "keyword" },
			  { "withExtendedLifetime", "type" },
			  { "public", "keyword" },
			  { "final", "keyword" },
			  { "Protocol", "keyword" },
			  { "guard", "keyword" },
			  { "operator", "keyword" },
			  { "let", "keyword" },
			  { "extension", "keyword" },
			  { "posix", "type" },
			  { "precedence", "keyword" },
			  { "case", "keyword" },
			  { "left", "keyword" },
			  { "filter", "type" },
			  { "min", "type" },
			  { "countElements", "type" },
			  { "unsafeBitCast", "type" },
			  { "do", "keyword" },
			  { "max", "type" },
			  { "dynamicType", "keyword" },
			  { "reverse", "type" },
			  { "while", "keyword" },
			  { "init", "keyword" },
			  { "func", "keyword" },
			  { "abs", "type" },
			  { "sizeof", "type" },
			  { "true", "keyword" },
			  { "default", "keyword" },
			  { "dynamic", "keyword" },
			  { "var", "keyword" },
			  { "#sourceLocation", "keyword" },
			  { "indices", "type" },
			  { "isUniquelyReferencedNonObjC", "type" },
			  { "getBridgedObjectiveCType", "type" },
			  { "precondition", "type" },
			  { "getVaList", "type" },
			  { "get", "keyword" },
			  { "Double", "type" },
			  { "join", "type" },
			  { "startsWith", "type" },
			  { "Bool", "type" },
			  { "associativity", "keyword" },
			  { "self", "keyword" },
			  { "prefix", "keyword" },
			  { "sort", "type" },
			  { "lexicographicalCompare", "type" },
			  { "insertionSort", "type" },
			  { "__LINE__", "keyword" },
			  { "Array", "type" },
			  { "stride", "type" },
			  { "unsafeDowncast", "type" },
			  { "strideof", "type" },
			  { "continue", "keyword" },
			  { "sizeofValue", "type" },
			  { "swap", "type" },
			  { "withUnsafeMutablePointer", "type" },
			  { "Type", "keyword" },
			  { "find", "type" },
			  { "zip", "type" },
			  { "preconditionFailure", "type" },
			  { "enum", "keyword" },
			  { "withObjectAtPlusZero", "type" },
			  { "strideofValue", "type" },
			  { "transcode", "type" },
			  { "withUnsafePointerToObject", "type" },
			  { "overlaps", "type" },
			  { "split", "type" },
			  { "withUnsafePointer", "type" },
			  { "internal", "keyword" },
			  { "reinterpretCast", "type" },
			  { "reduce", "type" },
			  { "toString", "type" },
			  { "readLine", "type" },
			  { "as", "keyword" },
			  { "deinit", "keyword" },
			  { "break", "keyword" },
			  { "optional", "keyword" },
			  { "withVaList", "type" },
			  { "quickSort", "type" },
			  { "unsafeAddressOf", "type" },
			  { "fileprivate", "keyword" },
			  { "bridgeFromObjectiveCUnconditional", "type" },
			  { "if", "keyword" },
			  { "isBridgedVerbatimToObjectiveC", "type" },
			  { "String", "type" },
			  { "print", "type" },
			  { "roundUpToAlignment", "type" },
			  { "catch", "keyword" },
			  { "equal", "type" },
			  { "Optional", "type" },
			  { "map", "type" },
			  { "println", "type" },
			  { "as?", "keyword" },
			  { "didSet", "keyword" },
			  { "defer", "keyword" },
			  { "inout", "keyword" },
			  { "is", "keyword" },
			  { "Int", "type" },
			  { "minElement", "type" },
			  { "private", "keyword" },
			  { "countLeadingZeros", "type" },
			  { "bridgeFromObjectiveC", "type" },
			  { "nil", "keyword" },
			  { "rethrows", "keyword" },
			  { "withUnsafeMutablePointers", "type" },
			  { "compactMap", "type" },
			  { "unsafeUnwrap", "type" },
			  { "#if", "keyword" },
			  { "#column", "keyword" },
			  { "protocol", "keyword" },
			  { "#file", "keyword" },
			  { "indirect", "keyword" },
			  { "numericCast", "type" },
			  { "#elseif", "keyword" },
			  { "infix", "keyword" },
			  { "override", "keyword" },
			  { "#else", "keyword" },
			  { "dropFirst", "type" },
			  { "subscript", "keyword" },
			  { "#line", "keyword" },
			  { "for", "keyword" },
			  { "import", "keyword" },
			  { "false", "keyword" },
			  { "#fileLiteral", "keyword" },
			  { "advance", "type" },
			  { "partition", "type" },
			  { "__FUNCTION__", "keyword" },
			  { "#endif", "keyword" },
			  { "repeat", "keyword" },
			  { "#selector", "keyword" },
			  { "#available", "keyword" },
			  { "mutating", "keyword" },
			  { "#colorLiteral", "keyword" },
			  { "class", "keyword" },
			  { "dump", "type" },
			  { "#function", "keyword" },
			  { "__COLUMN__", "keyword" },
			  { "set", "keyword" },
			  { "Any", "keyword" },
			  { "return", "keyword" },
			  { "distance", "type" },
			  { "reflect", "type" },
			  { "else", "keyword" },
			  { "Float", "type" },
			  { "_", "keyword" },

		  },
		  "//",
		  {}

		} );

	sd.setFoldRangeType( FoldRangeType::Braces ).setFoldBraces( { { '{', '}' } } );
	sd.setBlockComment( { "/*", "*/" } );
	return sd;
}

}}}} // namespace EE::UI::Doc::Language
