Simple email application for Android. Original source code: https://framagit.org/dystopia-project/simple-email
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

215 lines
5.0 KiB

  1. var colors = require('ansicolors')
  2. // Change the below definitions in order to tweak the color theme.
  3. module.exports = {
  4. 'Boolean': {
  5. 'true' : undefined
  6. , 'false' : undefined
  7. , _default : colors.yellow
  8. }
  9. , 'Identifier': {
  10. 'undefined' : colors.yellow
  11. , 'self' : colors.yellow
  12. , 'type' : colors.yellow
  13. , 'value' : colors.yellow
  14. , 'console' : undefined
  15. , 'log' : colors.blue
  16. , 'warn' : colors.blue
  17. , 'error' : colors.blue
  18. , 'join' : colors.blue
  19. , _default : function(s, info) {
  20. var prevToken = info.tokens[info.tokenIndex - 1]
  21. var nextToken = info.tokens[info.tokenIndex + 1]
  22. return (nextToken
  23. && nextToken.type === 'Punctuator'
  24. && nextToken.value === '('
  25. && prevToken
  26. && prevToken.type === 'Keyword'
  27. && prevToken.value === 'function'
  28. ) ? colors.blue(s) : colors.white(s)
  29. }
  30. }
  31. , 'Null': {
  32. _default: colors.yellow
  33. }
  34. , 'Numeric': {
  35. _default: colors.yellow
  36. }
  37. , 'String': {
  38. _default: function(s, info) {
  39. var nextToken = info.tokens[info.tokenIndex + 1]
  40. // show keys of object literals and json in different color
  41. return (nextToken && nextToken.type === 'Punctuator' && nextToken.value === ':')
  42. ? colors.green(s)
  43. : colors.brightGreen(s)
  44. }
  45. }
  46. , 'Keyword': {
  47. 'break' : colors.magenta
  48. , 'case' : colors.magenta
  49. , 'catch' : colors.magenta
  50. , 'class' : undefined
  51. , 'const' : undefined
  52. , 'continue' : colors.magenta
  53. , 'debugger' : colors.magenta
  54. , 'default' : colors.magenta
  55. , 'delete' : colors.red
  56. , 'do' : colors.magenta
  57. , 'else' : colors.magenta
  58. , 'enum' : undefined
  59. , 'export' : undefined
  60. , 'extends' : undefined
  61. , 'finally' : colors.magenta
  62. , 'for' : colors.magenta
  63. , 'function' : colors.magenta
  64. , 'if' : colors.magenta
  65. , 'implements' : undefined
  66. , 'import' : undefined
  67. , 'in' : colors.cyan
  68. , 'instanceof' : colors.cyan
  69. , 'let' : undefined
  70. , 'new' : colors.cyan
  71. , 'package' : undefined
  72. , 'private' : undefined
  73. , 'protected' : undefined
  74. , 'public' : undefined
  75. , 'return' : colors.magenta
  76. , 'static' : undefined
  77. , 'super' : undefined
  78. , 'switch' : colors.magenta
  79. , 'this' : colors.red
  80. , 'throw' : colors.magenta
  81. , 'try' : colors.magenta
  82. , 'typeof' : colors.cyan
  83. , 'var' : colors.magenta
  84. , 'void' : colors.magenta
  85. , 'while' : colors.magenta
  86. , 'with' : colors.cyan
  87. , 'yield' : undefined
  88. , _default : colors.white
  89. }
  90. , 'Punctuator': {
  91. ';': colors.white
  92. , '.': colors.white
  93. , ',': colors.white
  94. , '{': colors.white
  95. , '}': colors.white
  96. , '(': colors.white
  97. , ')': colors.white
  98. , '[': colors.white
  99. , ']': colors.white
  100. , '<': undefined
  101. , '>': undefined
  102. , '+': undefined
  103. , '-': undefined
  104. , '*': undefined
  105. , '%': undefined
  106. , '&': undefined
  107. , '|': colors.white
  108. , '^': undefined
  109. , '!': undefined
  110. , '~': undefined
  111. , '?': colors.white
  112. , ':': colors.white
  113. , '=': undefined
  114. , '<=': undefined
  115. , '>=': undefined
  116. , '==': undefined
  117. , '!=': undefined
  118. , '++': undefined
  119. , '--': undefined
  120. , '<<': undefined
  121. , '>>': undefined
  122. , '&&': undefined
  123. , '||': undefined
  124. , '+=': undefined
  125. , '-=': undefined
  126. , '*=': undefined
  127. , '%=': undefined
  128. , '&=': undefined
  129. , '|=': undefined
  130. , '^=': undefined
  131. , '/=': undefined
  132. , '=>': undefined
  133. , '**': undefined
  134. , '===': undefined
  135. , '!==': undefined
  136. , '>>>': undefined
  137. , '<<=': undefined
  138. , '>>=': undefined
  139. , '...': undefined
  140. , '**=': undefined
  141. , '>>>=': undefined
  142. , _default: colors.cyan
  143. }
  144. // line comment
  145. , Line: {
  146. _default: colors.brightBlack
  147. }
  148. /* block comment */
  149. , Block: {
  150. _default: colors.brightBlack
  151. }
  152. // JSX
  153. , JSXAttribute: {
  154. _default: colors.magenta
  155. }
  156. , JSXClosingElement: {
  157. _default: colors.magenta
  158. }
  159. , JSXElement: {
  160. _default: colors.magenta
  161. }
  162. , JSXEmptyExpression: {
  163. _default: colors.magenta
  164. }
  165. , JSXExpressionContainer: {
  166. _default: colors.magenta
  167. }
  168. , JSXIdentifier: {
  169. className: colors.blue
  170. , _default: colors.magenta
  171. }
  172. , JSXMemberExpression: {
  173. _default: colors.magenta
  174. }
  175. , JSXNamespacedName: {
  176. _default: colors.magenta
  177. }
  178. , JSXOpeningElement: {
  179. _default: colors.magenta
  180. }
  181. , JSXSpreadAttribute: {
  182. _default: colors.magenta
  183. }
  184. , JSXText: {
  185. _default: colors.brightGreen
  186. }
  187. , _default: undefined
  188. }