├── Preferences └── Comments.tmPreferences ├── README.md └── Syntaxes └── Swift.tmLanguage /Preferences/Comments.tmPreferences: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | name 6 | Comments 7 | scope 8 | source.swift 9 | settings 10 | 11 | shellVariables 12 | 13 | 14 | name 15 | TM_COMMENT_START 16 | value 17 | // 18 | 19 | 20 | name 21 | TM_COMMENT_START_2 22 | value 23 | /* 24 | 25 | 26 | name 27 | TM_COMMENT_END_2 28 | value 29 | */ 30 | 31 | 32 | 33 | uuid 34 | 67FF7F40-F84B-11E3-A3AC-0800200C9A66 35 | 36 | 37 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | # Syntax Highlighting for Swift 3 | 4 | ![](http://i.imgur.com/cvYfBU0.png) 5 | [Source code: https://github.com/fullstackio/FlappySwift](https://github.com/fullstackio/FlappySwift) 6 | 7 | ## Install 8 | 9 | Clone this repo to your package folder, then set syntax to `Swift`. 10 | 11 | ## License 12 | 13 | Syntax Highlighting for Swift is released under the MIT License. http://www.opensource.org/licenses/mit-license -------------------------------------------------------------------------------- /Syntaxes/Swift.tmLanguage: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | fileTypes 6 | 7 | swift 8 | 9 | name 10 | Swift 11 | patterns 12 | 13 | 14 | begin 15 | /\* 16 | end 17 | \*/ 18 | name 19 | comment.block.swift 20 | 21 | 22 | begin 23 | // 24 | end 25 | $\n? 26 | name 27 | comment.line.swift 28 | 29 | 30 | begin 31 | " 32 | end 33 | " 34 | name 35 | string.quoted.double.swift 36 | patterns 37 | 38 | 39 | begin 40 | \\\( 41 | end 42 | \) 43 | name 44 | string-interpolation 45 | captures 46 | 47 | 0 48 | 49 | name 50 | keyword.operator.swift 51 | 52 | 53 | patterns 54 | 55 | 56 | match 57 | \+ 58 | name 59 | keyword.operator.swift 60 | 61 | 62 | 63 | 64 | 65 | 66 | match 67 | , 68 | name 69 | comment.punctuation.comma.swift 70 | 71 | 72 | match 73 | \b(class|deinit|enum|extension|func|import|init|let|protocol|static|struct|subscript|typealias|var|break|case|continue|default|do|else|fallthrough|if|in|for|return|switch|where|while|as|dynamicType|is|new|super|self|Self|Type|__COLUMN__|__FILE__|__FUNCTION__|__LINE__|associativity|didSet|get|infix|inout|left|mutating|none|nonmutating|operator|override|postfix|precedence|prefix|right|set|unowned|weak|willSet)\b 74 | name 75 | keyword.reserved.swift 76 | 77 | 78 | match 79 | \b(true|false)\b 80 | name 81 | string.boolean.swift 82 | 83 | 84 | match 85 | (-|\.)?\b[0-9]+(\.[0-9]+)?\b 86 | name 87 | constant.numeric.swift 88 | 89 | 90 | match 91 | \+|-|\*|/|%|=|!|\^|~|\||\?|<|>|& 92 | name 93 | keyword.operator.swift 94 | 95 | 96 | match 97 | \w+(?=\s*:) 98 | name 99 | meta.tag.swift 100 | 101 | 102 | match 103 | (?<=\.)\w+(?=\.|\s|,|;|\)|\?|\+|\-|=) 104 | name 105 | support.constant.swift 106 | 107 | 108 | match 109 | \w+(?=\s*\() 110 | name 111 | support.function.swift 112 | 113 | 114 | scopeName 115 | source.swift 116 | uuid 117 | 6A273AF0-EB4A-11E3-AC10-0800200C9A66 118 | 119 | --------------------------------------------------------------------------------