| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 7185bae commit 51690ca
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -60,60 +60,88 @@ | |||
| 60 | 60 | ''' | |
| 61 | 61 | 'patterns': [ | |
| 62 | 62 | { | |
| 63 | + 'begin': '\\bclass\\b' | ||
| 63 | 64 | 'captures': | |
| 64 | - '1': | ||
| 65 | + '0': | ||
| 65 | 66 | 'name': 'keyword.control.class.ruby' | |
| 66 | - '2': | ||
| 67 | - 'name': 'entity.name.type.class.ruby' | ||
| 68 | - '4': | ||
| 69 | - 'name': 'entity.other.inherited-class.ruby' | ||
| 70 | - '5': | ||
| 71 | - 'name': 'punctuation.separator.inheritance.ruby' | ||
| 72 | - '6': | ||
| 73 | - 'name': 'variable.other.object.ruby' | ||
| 74 | - '7': | ||
| 75 | - 'name': 'punctuation.definition.variable.ruby' | ||
| 76 | - 'match': '''(?x) | ||
| 77 | - ^\\s*(class)\\s+ | ||
| 78 | - ( | ||
| 79 | - ( | ||
| 80 | - [.a-zA-Z0-9_:]+ | ||
| 81 | - (\\s*(<)\\s*[.a-zA-Z0-9_:]+)? # class A < B | ||
| 82 | - ) | ||
| 83 | - | | ||
| 84 | - ((<<)\\s*[.a-zA-Z0-9_:]+) # class << C | ||
| 85 | - ) | ||
| 86 | - ''' | ||
| 67 | + 'end': '\\s*$|(?![\\s\\w.:<])' | ||
| 87 | 68 | 'name': 'meta.class.ruby' | |
| 69 | + 'patterns': [ | ||
| 70 | + { | ||
| 71 | + 'match': '[A-Z]\\w*' | ||
| 72 | + 'name': 'entity.name.type.class.ruby' | ||
| 73 | + } | ||
| 74 | + { | ||
| 75 | + 'include': '#separators' | ||
| 76 | + } | ||
| 77 | + { | ||
| 78 | + 'begin': '<<' | ||
| 79 | + 'captures': | ||
| 80 | + '0': | ||
| 81 | + 'name': 'punctuation.definition.variable.ruby' | ||
| 82 | + 'end': '(?=$)|(?![\\s\\w.:])' | ||
| 83 | + 'patterns': [ | ||
| 84 | + { | ||
| 85 | + 'begin': '\\s*' | ||
| 86 | + 'end': '(?=$)|(?![\\s\\w.:])' | ||
| 87 | + 'contentName': 'variable.other.object.ruby' | ||
| 88 | + 'patterns': [ | ||
| 89 | + { | ||
| 90 | + 'match': '[A-Z]\\w*' | ||
| 91 | + 'name': 'entity.name.type.class.ruby' | ||
| 92 | + } | ||
| 93 | + { | ||
| 94 | + 'include': '#separators' | ||
| 95 | + } | ||
| 96 | + ] | ||
| 97 | + } | ||
| 98 | + ] | ||
| 99 | + } | ||
| 100 | + { | ||
| 101 | + 'begin': '<' | ||
| 102 | + 'captures': | ||
| 103 | + '0': | ||
| 104 | + 'name': 'punctuation.separator.inheritance.ruby' | ||
| 105 | + 'end': '(?=$)|(?![\\s\\w.:])' | ||
| 106 | + 'patterns': [ | ||
| 107 | + { | ||
| 108 | + 'begin': '\\s*' | ||
| 109 | + 'end': '(?=$)|(?![\\s\\w.:])' | ||
| 110 | + 'contentName': 'entity.other.inherited-class.ruby' | ||
| 111 | + 'patterns': [ | ||
| 112 | + { | ||
| 113 | + 'match': '[A-Z]\\w*' | ||
| 114 | + 'name': 'entity.name.type.class.ruby' | ||
| 115 | + } | ||
| 116 | + { | ||
| 117 | + 'include': '#separators' | ||
| 118 | + } | ||
| 119 | + ] | ||
| 120 | + } | ||
| 121 | + ] | ||
| 122 | + } | ||
| 123 | + ] | ||
| 88 | 124 | } | |
| 89 | 125 | { | |
| 126 | + 'begin': '^\\bmodule\\b' | ||
| 90 | 127 | 'captures': | |
| 91 | - '1': | ||
| 128 | + '0': | ||
| 92 | 129 | 'name': 'keyword.control.module.ruby' | |
| 93 | - '2': | ||
| 94 | - 'name': 'entity.name.type.module.ruby' | ||
| 95 | - '3': | ||
| 96 | - 'name': 'entity.other.inherited-class.module.first.ruby' | ||
| 97 | - '4': | ||
| 98 | - 'name': 'punctuation.separator.inheritance.ruby' | ||
| 99 | - '5': | ||
| 100 | - 'name': 'entity.other.inherited-class.module.second.ruby' | ||
| 101 | - '6': | ||
| 102 | - 'name': 'punctuation.separator.inheritance.ruby' | ||
| 103 | - '7': | ||
| 104 | - 'name': 'entity.other.inherited-class.module.third.ruby' | ||
| 105 | - '8': | ||
| 106 | - 'name': 'punctuation.separator.inheritance.ruby' | ||
| 107 | - 'match': '''(?x) | ||
| 108 | - ^\\s*(module)\\s+ | ||
| 109 | - ( | ||
| 110 | - ([A-Z]\\w*(::))? | ||
| 111 | - ([A-Z]\\w*(::))? | ||
| 112 | - ([A-Z]\\w*(::))* | ||
| 113 | - [A-Z]\\w* | ||
| 114 | - ) | ||
| 115 | - ''' | ||
| 130 | + 'end': '\\s*$|(?![\\s\\w.:])' | ||
| 116 | 131 | 'name': 'meta.module.ruby' | |
| 132 | + 'patterns': [ | ||
| 133 | + { | ||
| 134 | + 'match': '[A-Z]\\w*(?=::)' | ||
| 135 | + 'name': 'entity.other.inherited-class.module.ruby' | ||
| 136 | + } | ||
| 137 | + { | ||
| 138 | + 'match': '[A-Z]\\w*' | ||
| 139 | + 'name': 'entity.name.type.module.ruby' | ||
| 140 | + } | ||
| 141 | + { | ||
| 142 | + 'include': '#separators' | ||
| 143 | + } | ||
| 144 | + ] | ||
| 117 | 145 | } | |
| 118 | 146 | { | |
| 119 | 147 | 'comment': 'else if is a common mistake carried over from other languages. it works if you put in a second end, but it’s never what you want.' | |
| Back | FazBrowse Home | New Git URL |
0 commit comments