tokens_python.json 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. [[
  2. "start",
  3. ["comment","#!/usr/local/bin/python"]
  4. ],[
  5. "start"
  6. ],[
  7. "start",
  8. ["keyword","import"],
  9. ["text"," "],
  10. ["identifier","string"],
  11. ["text",", "],
  12. ["identifier","sys"]
  13. ],[
  14. "start"
  15. ],[
  16. "start",
  17. ["comment","# If no arguments were given, print a helpful message"]
  18. ],[
  19. "start",
  20. ["keyword","if"],
  21. ["text"," "],
  22. ["support.function","len"],
  23. ["paren.lparen","("],
  24. ["identifier","sys"],
  25. ["text","."],
  26. ["identifier","argv"],
  27. ["paren.rparen",")"],
  28. ["keyword.operator","=="],
  29. ["constant.numeric","1"],
  30. ["text",":"]
  31. ],[
  32. "qstring3",
  33. ["text"," "],
  34. ["keyword","print"],
  35. ["text"," "],
  36. ["string","'''Usage:"]
  37. ],[
  38. "start",
  39. ["string","celsius temp1 temp2 ...'''"]
  40. ],[
  41. "start",
  42. ["text"," "],
  43. ["identifier","sys"],
  44. ["text","."],
  45. ["identifier","exit"],
  46. ["paren.lparen","("],
  47. ["constant.numeric","0"],
  48. ["paren.rparen",")"]
  49. ],[
  50. "start"
  51. ],[
  52. "start",
  53. ["comment","# Loop over the arguments"]
  54. ],[
  55. "start",
  56. ["keyword","for"],
  57. ["text"," "],
  58. ["identifier","i"],
  59. ["text"," "],
  60. ["keyword","in"],
  61. ["text"," "],
  62. ["identifier","sys"],
  63. ["text","."],
  64. ["identifier","argv"],
  65. ["paren.lparen","["],
  66. ["constant.numeric","1"],
  67. ["text",":"],
  68. ["paren.rparen","]"],
  69. ["text",":"]
  70. ],[
  71. "start",
  72. ["text"," "],
  73. ["keyword","try"],
  74. ["text",":"]
  75. ],[
  76. "start",
  77. ["text"," "],
  78. ["identifier","fahrenheit"],
  79. ["keyword.operator","="],
  80. ["support.function","float"],
  81. ["paren.lparen","("],
  82. ["identifier","string"],
  83. ["text","."],
  84. ["identifier","atoi"],
  85. ["paren.lparen","("],
  86. ["identifier","i"],
  87. ["paren.rparen","))"]
  88. ],[
  89. "start",
  90. ["text"," "],
  91. ["keyword","except"],
  92. ["text"," "],
  93. ["identifier","string"],
  94. ["text","."],
  95. ["identifier","atoi_error"],
  96. ["text",":"]
  97. ],[
  98. "start",
  99. ["text"," "],
  100. ["keyword","print"],
  101. ["text"," "],
  102. ["support.function","repr"],
  103. ["paren.lparen","("],
  104. ["identifier","i"],
  105. ["paren.rparen",")"],
  106. ["text",", "],
  107. ["string","\"not a numeric value\""]
  108. ],[
  109. "start",
  110. ["text"," "],
  111. ["keyword","else"],
  112. ["text",":"]
  113. ],[
  114. "start",
  115. ["text"," "],
  116. ["identifier","celsius"],
  117. ["keyword.operator","="],
  118. ["paren.lparen","("],
  119. ["identifier","fahrenheit"],
  120. ["keyword.operator","-"],
  121. ["constant.numeric","32"],
  122. ["paren.rparen",")"],
  123. ["keyword.operator","*"],
  124. ["constant.numeric","5.0"],
  125. ["keyword.operator","/"],
  126. ["constant.numeric","9.0"]
  127. ],[
  128. "start",
  129. ["text"," "],
  130. ["keyword","print"],
  131. ["text"," "],
  132. ["string","'%i"],
  133. ["constant.language.escape","\\260"],
  134. ["string","F = %i"],
  135. ["constant.language.escape","\\260"],
  136. ["string","C'"],
  137. ["text"," "],
  138. ["keyword.operator","%"],
  139. ["text"," "],
  140. ["paren.lparen","("],
  141. ["support.function","int"],
  142. ["paren.lparen","("],
  143. ["identifier","fahrenheit"],
  144. ["paren.rparen",")"],
  145. ["text",", "],
  146. ["support.function","int"],
  147. ["paren.lparen","("],
  148. ["identifier","celsius"],
  149. ["keyword.operator","+"],
  150. ["constant.numeric",".5"],
  151. ["paren.rparen","))"]
  152. ]]