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 @@ + +