Skip to content

Commit

Permalink
Add syntax pattern for union definition
Browse files Browse the repository at this point in the history
  • Loading branch information
qerub committed Jun 19, 2013
1 parent 5d79ef5 commit 04b5687
Showing 1 changed file with 64 additions and 1 deletion.
65 changes: 64 additions & 1 deletion Syntaxes/Thrift.tmLanguage
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@
</dict>
<dict>
<key>begin</key>
<string>(?=(struct|s?enum|service|const|typedef|exception)\b)</string>
<string>(?=(struct|s?enum|union|service|const|typedef|exception)\b)</string>
<key>comment</key>
<string>begin the definition list</string>
<key>end</key>
Expand Down Expand Up @@ -217,6 +217,69 @@
</dict>
</array>
</dict>
<dict>
<key>begin</key>
<string>(?&lt;!\S)(union)(?!\S)(?:\s+([a-zA-Z_][\w.]*)\s*(?![^\s{]))?</string>
<key>beginCaptures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>keyword.other.union.thrift</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>entity.name.type.union.thrift</string>
</dict>
</dict>
<key>end</key>
<string>(?&lt;=\})|$</string>
<key>name</key>
<string>meta.union.thrift</string>
<key>patterns</key>
<array>
<dict>
<key>match</key>
<string>(?&lt;!\S)xsd_all(?!\S)</string>
<key>name</key>
<string>keyword.other.xsd-all.thrift</string>
</dict>
<dict>
<key>begin</key>
<string>\{</string>
<key>beginCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.section.union.begin.thrift</string>
</dict>
</dict>
<key>end</key>
<string>\}</string>
<key>endCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.section.union.end.thrift</string>
</dict>
</dict>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#comments</string>
</dict>
<dict>
<key>include</key>
<string>#field</string>
</dict>
</array>
</dict>
</array>
</dict>
<dict>
<key>begin</key>
<string>(?&lt;!\S)(enum)(?!\S)(?:\s+([a-zA-Z_][\w.]*)\s*(?![^\s{]))?</string>
Expand Down

0 comments on commit 04b5687

Please sign in to comment.