gyp.xclangspec 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226
  1. /*
  2. Copyright (c) 2011 Google Inc. All rights reserved.
  3. Use of this source code is governed by a BSD-style license that can be
  4. found in the LICENSE file.
  5. gyp.xclangspec
  6. GYP language specification for Xcode 3
  7. There is not much documentation available regarding the format
  8. of .xclangspec files. As a starting point, see for instance the
  9. outdated documentation at:
  10. http://maxao.free.fr/xcode-plugin-interface/specifications.html
  11. and the files in:
  12. /Developer/Library/PrivateFrameworks/XcodeEdit.framework/Versions/A/Resources/
  13. Place this file in directory:
  14. ~/Library/Application Support/Developer/Shared/Xcode/Specifications/
  15. */
  16. (
  17. {
  18. Identifier = "xcode.lang.gyp.keyword";
  19. Syntax = {
  20. Words = (
  21. "and",
  22. "or",
  23. "<!",
  24. "<",
  25. );
  26. Type = "xcode.syntax.keyword";
  27. };
  28. },
  29. {
  30. Identifier = "xcode.lang.gyp.target.declarator";
  31. Syntax = {
  32. Words = (
  33. "'target_name'",
  34. );
  35. Type = "xcode.syntax.identifier.type";
  36. };
  37. },
  38. {
  39. Identifier = "xcode.lang.gyp.string.singlequote";
  40. Syntax = {
  41. IncludeRules = (
  42. "xcode.lang.string",
  43. "xcode.lang.gyp.keyword",
  44. "xcode.lang.number",
  45. );
  46. Start = "'";
  47. End = "'";
  48. };
  49. },
  50. {
  51. Identifier = "xcode.lang.gyp.comma";
  52. Syntax = {
  53. Words = ( ",", );
  54. };
  55. },
  56. {
  57. Identifier = "xcode.lang.gyp";
  58. Description = "GYP Coloring";
  59. BasedOn = "xcode.lang.simpleColoring";
  60. IncludeInMenu = YES;
  61. Name = "GYP";
  62. Syntax = {
  63. Tokenizer = "xcode.lang.gyp.lexer.toplevel";
  64. IncludeRules = (
  65. "xcode.lang.gyp.dictionary",
  66. );
  67. Type = "xcode.syntax.plain";
  68. };
  69. },
  70. // The following rule returns tokens to the other rules
  71. {
  72. Identifier = "xcode.lang.gyp.lexer";
  73. Syntax = {
  74. IncludeRules = (
  75. "xcode.lang.gyp.comment",
  76. "xcode.lang.string",
  77. 'xcode.lang.gyp.targetname.declarator',
  78. "xcode.lang.gyp.string.singlequote",
  79. "xcode.lang.number",
  80. "xcode.lang.gyp.comma",
  81. );
  82. };
  83. },
  84. {
  85. Identifier = "xcode.lang.gyp.lexer.toplevel";
  86. Syntax = {
  87. IncludeRules = (
  88. "xcode.lang.gyp.comment",
  89. );
  90. };
  91. },
  92. {
  93. Identifier = "xcode.lang.gyp.assignment";
  94. Syntax = {
  95. Tokenizer = "xcode.lang.gyp.lexer";
  96. Rules = (
  97. "xcode.lang.gyp.assignment.lhs",
  98. ":",
  99. "xcode.lang.gyp.assignment.rhs",
  100. );
  101. };
  102. },
  103. {
  104. Identifier = "xcode.lang.gyp.target.declaration";
  105. Syntax = {
  106. Tokenizer = "xcode.lang.gyp.lexer";
  107. Rules = (
  108. "xcode.lang.gyp.target.declarator",
  109. ":",
  110. "xcode.lang.gyp.target.name",
  111. );
  112. };
  113. },
  114. {
  115. Identifier = "xcode.lang.gyp.target.name";
  116. Syntax = {
  117. Tokenizer = "xcode.lang.gyp.lexer";
  118. Rules = (
  119. "xcode.lang.gyp.string.singlequote",
  120. );
  121. Type = "xcode.syntax.definition.function";
  122. };
  123. },
  124. {
  125. Identifier = "xcode.lang.gyp.assignment.lhs";
  126. Syntax = {
  127. Tokenizer = "xcode.lang.gyp.lexer";
  128. Rules = (
  129. "xcode.lang.gyp.string.singlequote",
  130. );
  131. Type = "xcode.syntax.identifier.type";
  132. };
  133. },
  134. {
  135. Identifier = "xcode.lang.gyp.assignment.rhs";
  136. Syntax = {
  137. Tokenizer = "xcode.lang.gyp.lexer";
  138. Rules = (
  139. "xcode.lang.gyp.string.singlequote?",
  140. "xcode.lang.gyp.array?",
  141. "xcode.lang.gyp.dictionary?",
  142. "xcode.lang.number?",
  143. );
  144. };
  145. },
  146. {
  147. Identifier = "xcode.lang.gyp.dictionary";
  148. Syntax = {
  149. Tokenizer = "xcode.lang.gyp.lexer";
  150. Start = "{";
  151. End = "}";
  152. Foldable = YES;
  153. Recursive = YES;
  154. IncludeRules = (
  155. "xcode.lang.gyp.target.declaration",
  156. "xcode.lang.gyp.assignment",
  157. );
  158. };
  159. },
  160. {
  161. Identifier = "xcode.lang.gyp.array";
  162. Syntax = {
  163. Tokenizer = "xcode.lang.gyp.lexer";
  164. Start = "[";
  165. End = "]";
  166. Foldable = YES;
  167. Recursive = YES;
  168. IncludeRules = (
  169. "xcode.lang.gyp.array",
  170. "xcode.lang.gyp.dictionary",
  171. "xcode.lang.gyp.string.singlequote",
  172. );
  173. };
  174. },
  175. {
  176. Identifier = "xcode.lang.gyp.todo.mark";
  177. Syntax = {
  178. StartChars = "T";
  179. Match = (
  180. "^\(TODO\(.*\):[ \t]+.*\)$", // include "TODO: " in the markers list
  181. );
  182. // This is the order of captures. All of the match strings above need the same order.
  183. CaptureTypes = (
  184. "xcode.syntax.mark"
  185. );
  186. Type = "xcode.syntax.comment";
  187. };
  188. },
  189. {
  190. Identifier = "xcode.lang.gyp.comment";
  191. BasedOn = "xcode.lang.comment"; // for text macros
  192. Syntax = {
  193. Start = "#";
  194. End = "\n";
  195. IncludeRules = (
  196. "xcode.lang.url",
  197. "xcode.lang.url.mail",
  198. "xcode.lang.comment.mark",
  199. "xcode.lang.gyp.todo.mark",
  200. );
  201. Type = "xcode.syntax.comment";
  202. };
  203. },
  204. )