diff options
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/language_buzz.lua | 76 | ||||
-rw-r--r-- | plugins/language_carbon.lua | 83 | ||||
-rw-r--r-- | plugins/language_fortran.lua | 85 | ||||
-rw-r--r-- | plugins/language_swift.lua | 149 |
4 files changed, 393 insertions, 0 deletions
diff --git a/plugins/language_buzz.lua b/plugins/language_buzz.lua new file mode 100644 index 0000000..c00bf1a --- /dev/null +++ b/plugins/language_buzz.lua @@ -0,0 +1,76 @@ +-- Author: Rohan Vashisht: https://github.com/rohanvashisht1234/ + + +-- mod-version:3 +local syntax = require "core.syntax" + +syntax.add { + name = "Buzz", -- tested ok + files = { "%.buzz$" }, -- tested ok + comment = "|", -- tested ok + patterns = { + { pattern = { '"', '"', '\\' }, type = "string" }, -- tested ok + { pattern = "|.*", type = "comment" }, -- tested ok + { pattern = "[!%-/*?:=><]", type = "operator" }, -- tested ok + { pattern = "[%a_][%w_]*%f[(]", type = "function" }, -- tested ok + { pattern = "const()%s+()[%a_][%w_]*", type = { "keyword", "normal", "literal" } }, -- tested ok + { pattern = "object()%s+()[%a_][%w_]*", type = { "keyword", "normal", "literal" } }, -- tested ok + { pattern = "var()%s+()[%a_][%w_]*", type = { "keyword", "normal", "literal" } }, -- tested ok + { pattern = "-?%d+[%d%.eE_]*", type = "number" }, -- tested ok + { pattern = "-?%.?%d+", type = "number" }, -- tested ok + { pattern = "[%a_][%w_]*", type = "normal" }, -- tested ok + }, + symbols = { + ["bool"] = "keyword", -- tested ok + ["ud"] = "keyword", -- tested ok + ["float"] = "keyword", -- tested ok + ["zdef"] = "keyword", -- tested ok + ["resolve"] = "keyword", -- tested ok + ["yield"] = "keyword", -- tested ok + ["resume"] = "keyword", -- tested ok + ["export"] = "keyword", -- tested ok + ["void"] = "keyword", -- tested ok + ["protocol"] = "keyword", -- tested ok + ["do"] = "keyword", -- tested ok + ["enum"] = "keyword", -- tested ok + ["test"] = "keyword", -- tested ok + ["extern"] = "keyword", -- tested ok + ["object"] = "keyword", -- tested ok + ["foreach"] = "keyword", -- tested ok + ["is"] = "keyword", -- tested ok + ["return"] = "keyword", -- tested ok + ["continue"] = "keyword", -- tested ok + ["for"] = "keyword", -- tested ok + ["lambda"] = "keyword", -- tested ok + ["try"] = "keyword", -- tested ok + ["fun"] = "keyword", -- tested ok + ["type"] = "keyword", -- tested ok + ["while"] = "keyword", -- tested ok + ["and"] = "keyword", -- tested ok + ["global"] = "keyword", -- tested ok + ["not"] = "keyword2", -- tested ok + ["any"] = "keyword", -- tested ok + ["as"] = "keyword", -- tested ok + ["if"] = "keyword", -- tested ok + ["or"] = "keyword", -- tested ok + ["else"] = "keyword", -- tested ok + ["match"] = "keyword", -- tested ok + ["pat"] = "keyword", -- tested ok + ["import"] = "keyword", -- tested ok + ["str"] = "keyword", -- tested ok + ["var"] = "keyword", -- tested ok + ["catch"] = "keyword", -- tested ok + ["typeof"] = "keyword", -- tested ok + ["int"] = "keyword", -- tested ok + ["const"] = "keyword", -- tested ok + ["namespace"] = "keyword", -- tested ok + ["this"] = "keyword2", -- tested ok + ["null"] = "literal", -- tested ok + ["true"] = "literal", -- tested ok + ["false"] = "literal", -- tested ok + ["in"] = "literal", -- tested ok + ["static"] = "keyword2", -- tested ok + ["std"] = "keyword2", -- tested ok + ["io"] = "keyword2", -- tested ok + } +} diff --git a/plugins/language_carbon.lua b/plugins/language_carbon.lua new file mode 100644 index 0000000..ea8c621 --- /dev/null +++ b/plugins/language_carbon.lua @@ -0,0 +1,83 @@ +-- Author: Rohan Vashisht: https://github.com/rohanvashisht1234/ + +-- mod-version:3 +local syntax = require "core.syntax" + +syntax.add { + name = "Carbon", -- tested ok + files = { + "%.carbon$" -- tested ok + }, + comment = "//", -- tested ok + patterns = { + { pattern = { '"', '"', '\\' }, type = "string" }, -- tested ok + { pattern = { '"""', '"""', '\\' }, type = "string" }, -- tested ok + { pattern = { "'''", "'''", '\\' }, type = "string" }, -- tested ok + { pattern = "//.*", type = "comment" }, -- tested ok + { pattern = "[!%-/*?:=><+]", type = "operator" }, -- tested ok + { pattern = "[%a_][%w_]*%f[(]", type = "function" }, -- tested ok + { pattern = "packages()%s+()[%a_][%w_]*", type = { "keyword", "normal", "literal" } }, -- tested ok + { pattern = "let()%s+()[%a_][%w_]*", type = { "keyword", "normal", "literal" } }, -- tested ok + { pattern = "import()%s+()[%a_][%w_]*", type = { "keyword", "normal", "literal" } }, -- tested ok + { pattern = "impl()%s+()[%a_][%w_]*", type = { "keyword", "normal", "literal" } }, -- tested ok + { pattern = "class()%s+()[%a_][%w_]*", type = { "keyword", "normal", "literal" } }, -- tested ok + { pattern = "var()%s+()[%a_][%w_]*", type = { "keyword", "normal", "literal" } }, -- tested ok + { pattern = "package()%s+()[%a_][%w_]*", type = { "keyword", "normal", "literal" } }, -- tested ok + { pattern = "-?%d+[%d%.eE_]*", type = "number" }, -- tested ok + { pattern = "-?%.?%d+", type = "number" }, -- tested ok + { pattern = "[%a_][%w_]*", type = "normal" }, -- tested ok + }, + symbols = { + ["package"] = "keyword", -- tested ok + ["import"] = "keyword", -- tested ok + ["fn"] = "keyword", -- tested ok + ["var"] = "keyword", -- tested ok + ["for"] = "keyword", -- tested ok + ["return"] = "keyword", -- tested ok + ["class"] = "keyword", -- tested ok + ["api"] = "keyword", -- tested ok + ["i8"] = "keyword", -- tested ok + ["i16"] = "keyword", -- tested ok + ["i32"] = "keyword", -- tested ok + ["i64"] = "keyword", -- tested ok + ["i128"] = "keyword", -- tested ok + ["i256"] = "keyword", -- tested ok + ["u8"] = "keyword", -- tested ok + ["u16"] = "keyword", -- tested ok + ["u32"] = "keyword", -- tested ok + ["u64"] = "keyword", -- tested ok + ["u128"] = "keyword", -- tested ok + ["u256"] = "keyword", -- tested ok + ["f8"] = "keyword", -- tested ok + ["f16"] = "keyword", -- tested ok + ["f32"] = "keyword", -- tested ok + ["f64"] = "keyword", -- tested ok + ["f128"] = "keyword", -- tested ok + ["if"] = "keyword", -- tested ok + ["else"] = "keyword", -- tested ok + ["auto"] = "keyword", -- tested ok + ["let"] = "keyword", -- tested ok + ["File"] = "keyword", -- tested ok + ["while"] = "keyword", -- tested ok + ["match"] = "keyword", -- tested ok + ["case"] = "keyword", -- tested ok + ["default"] = "keyword", -- tested ok + ["returned"] = "keyword", -- tested ok + ["base"] = "keyword", -- tested ok + ["bool"] = "keyword", -- tested ok + ["virtual"] = "keyword", -- tested ok + ["abstract"] = "keyword", -- tested ok + ["String"] = "keyword", -- tested ok + + ["impl"] = "keyword2", -- tested ok + ["extend"] = "keyword", -- tested ok + ["partial"] = "keyword2", -- tested ok + ["Self"] = "keyword", -- tested ok + ["Int"] = "keyword", -- tested ok + ["UInt"] = "keyword", -- tested ok + ["Base"] = "keyword", -- tested ok + ["template"] = "keyword2", -- tested ok + ["true"] = "keyword2", -- tested ok + ["false"] = "keyword2", -- tested ok + } +} diff --git a/plugins/language_fortran.lua b/plugins/language_fortran.lua new file mode 100644 index 0000000..da97a4c --- /dev/null +++ b/plugins/language_fortran.lua @@ -0,0 +1,85 @@ +-- Author: Rohan Vashisht: https://github.com/rohanvashisht1234/ + + +-- mod-version:3 +local syntax = require "core.syntax" + +syntax.add { + name = "Fortran", -- tested ok + files = { + "%.f$", -- tested ok + "%.f90$", -- tested ok + "%.f95$" -- tested ok + }, + comment = "!", -- tested ok + patterns = { + { pattern = { "'", "'", '\\' }, type = "string" }, -- tested ok + { pattern = { '"', '"', '\\' }, type = "string" }, -- tested ok + { pattern = "!.*", type = "comment" }, -- tested ok + { pattern = "%.[%a_][%w_]+%.", type = "normal" }, -- tested ok + { pattern = "[!%-/*?:=><+]", type = "operator" }, -- tested ok + { pattern = "[%a_][%w_]*%f[(]", type = "function" }, -- tested ok + { pattern = "program()%s+()[%a_][%w_]*", type = { "keyword", "normal", "literal" } }, -- tested ok + { pattern = "module()%s+()[%a_][%w_]*", type = { "keyword", "normal", "literal" } }, -- tested ok + { pattern = "use()%s+()[%a_][%w_]*", type = { "keyword", "normal", "literal" } }, -- tested ok + { pattern = "struct()%s+()[%a_][%w_]*", type = { "keyword", "normal", "literal" } }, -- tested ok + + { pattern = "-?%d+[%d%.eE_]*", type = "number" }, -- tested ok + { pattern = "-?%.?%d+", type = "number" }, -- tested ok + { pattern = "[%a_][%w_]*", type = "normal" }, -- tested ok + }, + symbols = { + ["end"] = "keyword", -- tested ok + ["program"] = "keyword", -- tested ok + ["write"] = "keyword", -- tested ok + ["print"] = "keyword", -- tested ok + ["implicit"] = "keyword", -- tested ok + ["integer"] = "keyword", -- tested ok + ["real"] = "keyword", -- tested ok + ["complex"] = "keyword", -- tested ok + ["character"] = "keyword", -- tested ok + ["logical"] = "keyword", -- tested ok + ["allocatable"] = "keyword", -- tested ok + ["subroutine"] = "keyword", -- tested ok + ["do"] = "keyword", -- tested ok + ["call"] = "keyword", -- tested ok + ["extends"] = "keyword", -- tested ok + ["protected"] = "keyword", -- tested ok + ["contains"] = "keyword", -- tested ok + ["else"] = "keyword", -- tested ok + ["then"] = "keyword", -- tested ok + ["if"] = "keyword", -- tested ok + ["cycle"] = "keyword", -- tested ok + ["parameter"] = "keyword", -- tested ok + ["concurrent"] = "keyword", -- tested ok + ["function"] = "keyword", -- tested ok + ["private"] = "keyword", -- tested ok + ["public"] = "keyword", -- tested ok + ["module"] = "keyword", -- tested ok + ["use"] = "keyword", -- tested ok + ["type"] = "keyword", -- tested ok + ["sequence"] = "keyword", -- tested ok + ["struct"] = "keyword", -- tested ok + ["result"] = "keyword", -- tested ok + ["stop"] = "keyword", -- tested ok + ["only"] = "keyword", -- tested ok + + + ["none"] = "keyword2", -- tested ok + ["len"] = "keyword2", -- tested ok + + [".false."] = "keyword2", -- tested ok + [".true."] = "keyword2", -- tested ok + [".eq."] = "keyword2", -- tested ok + [".ne."] = "keyword2", -- tested ok + [".gt."] = "keyword2", -- tested ok + [".lt."] = "keyword2", -- tested ok + [".ge"] = "keyword2", -- tested ok + [".not."] = "keyword2", -- tested ok + [".le."] = "keyword2", -- tested ok + [".or."] = "keyword2", -- tested ok + [".and."] = "keyword2", -- tested ok + [".eqv."] = "keyword2", -- tested ok + [".neqv."] = "keyword2", -- tested ok + } +} diff --git a/plugins/language_swift.lua b/plugins/language_swift.lua new file mode 100644 index 0000000..b428899 --- /dev/null +++ b/plugins/language_swift.lua @@ -0,0 +1,149 @@ +-- Author: Rohan Vashisht: https://github.com/rohanvashisht1234/ + + +-- mod-version:3 +local syntax = require "core.syntax" + +syntax.add { + name = "Swift", + files = { "%.swift$" }, + comment = "//", + patterns = { + { pattern = { '"', '"', '\\' }, type = "string" }, -- tested ok + { pattern = { '"""', '"""', '\\' }, type = "string" }, -- tested ok + { pattern = { '#"', '"#', '\\' }, type = "string" }, -- tested ok + { pattern = { '#"""', '"""#', '\\' }, type = "string" }, -- tested ok + { pattern = "//.*", type = "comment" }, -- tested ok + { pattern = { "/%*", "%*/" }, type = "comment" }, -- tested ok + { pattern = "[!%-/*?:=><+]", type = "operator" }, -- tested ok + { pattern = "[%a_][%w_]*%f[(]", type = "function" }, -- tested ok + { pattern = "let()%s+()[%a_][%w_]*", type = { "keyword", "normal", "literal" } }, -- tested ok + { pattern = "var()%s+()[%a_][%w_]*", type = { "keyword", "normal", "literal" } }, -- tested ok + { pattern = "import()%s+()[%a_][%w_]*", type = { "keyword", "normal", "literal" } }, -- tested ok + { pattern = "struct()%s+()[%a_][%w_]*", type = { "keyword", "normal", "literal" } }, -- tested ok + { pattern = "class()%s+()[%a_][%w_]*", type = { "keyword", "normal", "literal" } }, -- tested ok + { pattern = "enum()%s+()[%a_][%w_]*", type = { "keyword", "normal", "literal" } }, -- tested ok + + { pattern = "-?%d+[%d%.eE_]*", type = "number" }, -- tested ok + { pattern = "-?%.?%d+", type = "number" }, -- tested ok + { pattern = "[%a_][%w_]*", type = "normal" }, -- tested ok + }, + symbols = { + ["import"] = "keyword", -- tested ok + ["inout"] = "keyword", -- tested ok + ["internal"] = "keyword", -- tested ok + ["let"] = "keyword", -- tested ok + ["Let"] = "keyword", -- tested ok + ["open"] = "keyword", -- tested ok + ["operator"] = "keyword", -- tested ok + ["private"] = "keyword", -- tested ok + ["precedencegroup"] = "keyword", -- tested ok + ["protocol"] = "keyword", -- tested ok + ["public"] = "keyword", -- tested ok + ["rethrows"] = "keyword", -- tested ok + ["static"] = "keyword", -- tested ok + ["struct"] = "keyword", -- tested ok + ["subscript"] = "keyword", -- tested ok + ["typealias"] = "keyword", -- tested ok + ["var"] = "keyword", -- tested ok + ["break"] = "keyword", -- tested ok + ["while"] = "keyword", -- tested ok + ["nil"] = "keyword", -- tested ok + ["associativity"] = "keyword", -- tested ok + ["convenience"] = "keyword", -- tested ok + ["didSet"] = "keyword", -- tested ok + ["dynamic"] = "keyword", -- tested ok + ["final"] = "keyword", -- tested ok + ["get"] = "keyword", -- tested ok + ["indirect"] = "keyword", -- tested ok + ["infix"] = "keyword", -- tested ok + ["left"] = "keyword", -- tested ok + ["mutating"] = "keyword", -- tested ok + ["none"] = "keyword", -- tested ok + ["nonmutating"] = "keyword", -- tested ok + ["optional"] = "keyword", -- tested ok + ["override"] = "keyword", -- tested ok + ["postfix"] = "keyword", -- tested ok + ["Protocol"] = "keyword", -- tested ok + ["required"] = "keyword", -- tested ok + ["right"] = "keyword", -- tested ok + ["set"] = "keyword", -- tested ok + ["some"] = "keyword", -- tested ok + ["Type"] = "keyword", -- tested ok + ["unowned"] = "keyword", -- tested ok + ["weak"] = "keyword", -- tested ok + ["lazy"] = "keyword", -- tested ok + ["prefix"] = "keyword", -- tested ok + ["willSet"] = "keyword", -- tested ok + ["try"] = "keyword", -- tested ok + ["true"] = "keyword", -- tested ok + ["throws"] = "keyword", -- tested ok + ["super"] = "keyword", -- tested ok + ["Self"] = "keyword", -- tested ok + ["self"] = "keyword", -- tested ok + ["is"] = "keyword", -- tested ok + ["false"] = "keyword", -- tested ok + ["as"] = "keyword", -- tested ok + ["Any"] = "keyword", -- tested ok + ["where"] = "keyword", -- tested ok + ["switch"] = "keyword", -- tested ok + ["throw"] = "keyword", -- tested ok + ["catch"] = "keyword", -- tested ok + ["return"] = "keyword", -- tested ok + ["repeat"] = "keyword", -- tested ok + ["in"] = "keyword", -- tested ok + ["if"] = "keyword", -- tested ok + ["gaurd"] = "keyword", -- tested ok + ["for"] = "keyword", -- tested ok + ["fallthrough"] = "keyword", -- tested ok + ["else"] = "keyword", -- tested ok + ["do"] = "keyword", -- tested ok + ["defer"] = "keyword", -- tested ok + ["default"] = "keyword", -- tested ok + ["continue"] = "keyword", -- tested ok + ["case"] = "keyword", -- tested ok + ["init"] = "keyword", -- tested ok + ["func"] = "keyword", -- tested ok + ["fileprivate"] = "keyword", -- tested ok + ["extension"] = "keyword", -- tested ok + ["associatedtype"] = "keyword", -- tested ok + ["enum"] = "keyword", -- tested ok + ["Init"] = "keyword", -- tested ok + ["Enum"] = "keyword", -- tested ok + ["deinit"] = "keyword", -- tested ok + ["class"] = "keyword", -- tested ok + ["Class"] = "keyword", -- tested ok + ["precedence"] = "keyword", -- tested ok + + ["#available"] = "keyword2", -- tested ok + ["#colorLiteral"] = "keyword2", -- tested ok + ["#column"] = "keyword2", -- tested ok + ["#dsohandle"] = "keyword2", -- tested ok + ["#elseif"] = "keyword2", -- tested ok + ["#else"] = "keyword2", -- tested ok + ["#endif"] = "keyword2", -- tested ok + ["#error"] = "keyword2", -- tested ok + ["#keyPath"] = "keyword2", -- tested ok + ["#line"] = "keyword2", -- tested ok + ["#selector"] = "keyword2", -- tested ok + ["#sourceLocation"] = "keyword2", -- tested ok + ["#warning"] = "keyword2", -- tested ok + ["_COLUMN_"] = "keyword2", -- tested ok + ["_FILE_"] = "keyword2", -- tested ok + ["_FUNCTION_"] = "keyword2", -- tested ok + ["_LINE_"] = "keyword2", -- tested ok + ["String"] = "keyword2", -- tested ok + ["Int"] = "keyword2", -- tested ok + ["Int8"] = "keyword2", -- tested ok + ["Int16"] = "keyword2", -- tested ok + ["Int32"] = "keyword2", -- tested ok + ["Int64"] = "keyword2", -- tested ok + ["UInt8"] = "keyword2", -- tested ok + ["UInt16"] = "keyword2", -- tested ok + ["UInt32"] = "keyword2", -- tested ok + ["UInt64"] = "keyword2", -- tested ok + ["Float"] = "keyword2", -- tested ok + ["Bool"] = "keyword2", -- tested ok + ["at"] = "keyword2", -- tested ok + } +} |