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

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

SyntaxDefinition& addFlow9() {

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

		{ "Flow9",
		  { "%.flow$" },
		  {
			  { { "//.-\n" }, "comment" },
			  { { "/%*", "%*/" }, "comment" },
			  { { "\"", "[\"\n]", "\\" }, "string" },
			  { { "'", "'", "\\" }, "string" },
			  { { "(import)%s+(%a+[%w/_]+)" }, { "normal", "keyword", "literal" } },
			  { { "common_number_parser" }, "number", "", SyntaxPatternMatchType::Parser },
			  { { "[%+%-=/%*%^%%<>!~|&\\]" }, "operator" },
			  { { "[%a_][%w_]*%f[(]" }, "function" },
			  { { "[%a_][%w_]*" }, "symbol" },

		  },
		  {
			  { "int", "type" },		{ "false", "literal" },	 { "native", "keyword" },
			  { "default", "keyword" }, { "true", "literal" },	 { "else", "keyword" },
			  { "switch", "keyword" },	{ "UInt64", "type" },	 { "forbid", "keyword" },
			  { "flow", "type" },		{ "double", "type" },	 { "bool", "type" },
			  { "import", "keyword" },	{ "void", "type" },		 { "string", "type" },
			  { "if", "keyword" },		{ "export", "keyword" }, { "unittest", "keyword" },
			  { "io", "type" },			{ "ref", "type" },

		  },
		  "//",
		  {}

		} );

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

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