tokens_rust.json 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. [[
  2. "start",
  3. ["keyword.source.rust","use"],
  4. ["text"," "],
  5. ["support.constant","core::rand::"],
  6. ["text","RngUtil"],
  7. ["keyword.operator",";"]
  8. ],[
  9. "start"
  10. ],[
  11. "start",
  12. ["keyword.source.rust","fn"],
  13. ["meta.function.source.rust"," "],
  14. ["entity.name.function.source.rust","main"],
  15. ["meta.function.source.rust","("],
  16. ["text",") {"]
  17. ],[
  18. "start",
  19. ["text"," "],
  20. ["keyword.source.rust","for"],
  21. ["text"," ["],
  22. ["string.quoted.double.source.rust","\"Alice\""],
  23. ["keyword.operator",","],
  24. ["text"," "],
  25. ["string.quoted.double.source.rust","\"Bob\""],
  26. ["keyword.operator",","],
  27. ["text"," "],
  28. ["string.quoted.double.source.rust","\"Carol\""],
  29. ["text","].each |&name| {"]
  30. ],[
  31. "start",
  32. ["text"," "],
  33. ["keyword.source.rust","do"],
  34. ["text"," spawn {"]
  35. ],[
  36. "start",
  37. ["text"," "],
  38. ["keyword.source.rust","let"],
  39. ["text"," v "],
  40. ["keyword.operator","="],
  41. ["text"," "],
  42. ["support.constant","rand::"],
  43. ["text","Rng().shuffle(["],
  44. ["constant.numeric.integer.source.rust","1"],
  45. ["keyword.operator",","],
  46. ["text"," "],
  47. ["constant.numeric.integer.source.rust","2"],
  48. ["keyword.operator",","],
  49. ["text"," "],
  50. ["constant.numeric.integer.source.rust","3"],
  51. ["text","])"],
  52. ["keyword.operator",";"]
  53. ],[
  54. "start",
  55. ["text"," "],
  56. ["keyword.source.rust","for"],
  57. ["text"," v.each |&num| {"]
  58. ],[
  59. "start",
  60. ["text"," print(fmt"],
  61. ["keyword.operator","!"],
  62. ["text","("],
  63. ["string.quoted.double.source.rust","\"%s says: '%d'"],
  64. ["constant.character.escape.source.rust","\\n"],
  65. ["string.quoted.double.source.rust","\""],
  66. ["keyword.operator",","],
  67. ["text"," name"],
  68. ["keyword.operator",","],
  69. ["text"," num "],
  70. ["keyword.operator","+"],
  71. ["text"," "],
  72. ["constant.numeric.integer.source.rust","1"],
  73. ["text","))"]
  74. ],[
  75. "start",
  76. ["text"," }"]
  77. ],[
  78. "start",
  79. ["text"," }"]
  80. ],[
  81. "start",
  82. ["text"," }"]
  83. ],[
  84. "start",
  85. ["text","}"]
  86. ],[
  87. "start"
  88. ],[
  89. "start",
  90. ["keyword.source.rust","fn"],
  91. ["meta.function.source.rust"," "],
  92. ["entity.name.function.source.rust","map<T, U>"],
  93. ["meta.function.source.rust","("],
  94. ["text","vector: &[T]"],
  95. ["keyword.operator",","],
  96. ["text"," function: &fn(v: &T) "],
  97. ["keyword.operator","->"],
  98. ["text"," U) "],
  99. ["keyword.operator","->"],
  100. ["text"," ~[U] {"]
  101. ],[
  102. "start",
  103. ["text"," "],
  104. ["keyword.source.rust","let"],
  105. ["text"," "],
  106. ["keyword.source.rust","mut"],
  107. ["text"," accumulator "],
  108. ["keyword.operator","="],
  109. ["text"," ~[]"],
  110. ["keyword.operator",";"]
  111. ],[
  112. "start",
  113. ["text"," "],
  114. ["keyword.source.rust","for"],
  115. ["text"," "],
  116. ["support.constant","vec::"],
  117. ["text","each(vector) |element| {"]
  118. ],[
  119. "start",
  120. ["text"," accumulator.push(function(element))"],
  121. ["keyword.operator",";"]
  122. ],[
  123. "start",
  124. ["text"," }"]
  125. ],[
  126. "start",
  127. ["text"," "],
  128. ["keyword.source.rust","return"],
  129. ["text"," accumulator"],
  130. ["keyword.operator",";"]
  131. ],[
  132. "start",
  133. ["text","}"]
  134. ],[
  135. "start"
  136. ]]