From 5bee3c8c8f48465798cf2432124b060f13a69074 Mon Sep 17 00:00:00 2001 From: Evgenii Neumerzhitckii Date: Sun, 27 Jul 2014 13:24:45 +1000 Subject: [PATCH] Add basic support for swift language (function definition) --- js/language/swift.js | 15 +++++++++++++++ tests/language/test.swift.js | 16 ++++++++++++++++ tests/rainbow.html | 2 ++ 3 files changed, 33 insertions(+) create mode 100644 js/language/swift.js create mode 100644 tests/language/test.swift.js diff --git a/js/language/swift.js b/js/language/swift.js new file mode 100644 index 00000000..c07ab85b --- /dev/null +++ b/js/language/swift.js @@ -0,0 +1,15 @@ +/** + * Swift patterns + * + * @author Evgenii Neumerzhitckii + * @version 1.0.0 + */ +Rainbow.extend('swift', [ + { + 'matches': { + 1: 'storage.function', + 2: 'entity.name.function' + }, + 'pattern': /(func)\s(.*?)(?=\()/g + } +]); \ No newline at end of file diff --git a/tests/language/test.swift.js b/tests/language/test.swift.js new file mode 100644 index 00000000..6733b14a --- /dev/null +++ b/tests/language/test.swift.js @@ -0,0 +1,16 @@ +/* global describe, run */ +var language = 'swift'; + +describe(language, function() { + + run( + language, + + 'function definition', + + 'func functionName(){}', + + 'func ' + + 'functionName(){}' + ); +}); diff --git a/tests/rainbow.html b/tests/rainbow.html index 2ac44d7d..b1260b94 100644 --- a/tests/rainbow.html +++ b/tests/rainbow.html @@ -28,6 +28,7 @@ + +