endless-sky-mode.el 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395
  1. (defvar endless-sky-constants
  2. '("color"
  3. "conversation"
  4. "effect"
  5. "event"
  6. "fleet"
  7. "galaxy"
  8. "government"
  9. "hazard"
  10. "interface"
  11. "mission"
  12. "news"
  13. "outfit"
  14. "outfitter"
  15. "person"
  16. "phrase"
  17. "planet"
  18. "ship"
  19. "shipyard"
  20. "start"
  21. "substitution"
  22. "system"
  23. "true"
  24. "false"
  25. "trade"))
  26. (defvar endless-sky-builtins
  27. '(
  28. "Drone"
  29. "Fighter"
  30. "Fine"
  31. "Mortgage"
  32. "abort"
  33. "absolute"
  34. "accept"
  35. "accompany"
  36. "account"
  37. "action"
  38. "active"
  39. "addend"
  40. "afterburner"
  41. "ammo"
  42. "angle"
  43. "anti-missile"
  44. "apparent"
  45. "arrival"
  46. "assist"
  47. "assisting"
  48. "asteroid"
  49. "atmosphere"
  50. "atrocities"
  51. "atrocity"
  52. "attitude"
  53. "attributes"
  54. "automaton"
  55. "back"
  56. "bay"
  57. "belt"
  58. "blast"
  59. "blast"
  60. "blocked"
  61. "board"
  62. "boarding"
  63. "branch"
  64. "bribe"
  65. "brightness"
  66. "bunks"
  67. "burn"
  68. "burst"
  69. "capacity"
  70. "capture"
  71. "cargo"
  72. "category"
  73. "chance"
  74. "choice"
  75. "clear"
  76. "clearance"
  77. "cloak"
  78. "cloaking"
  79. "cluster"
  80. "collection"
  81. "commodities"
  82. "complete"
  83. "concealment"
  84. "conditions"
  85. "confusion"
  86. "constant"
  87. "consumption"
  88. "cooling"
  89. "corrosion"
  90. "cost"
  91. "costs"
  92. "count"
  93. "credits"
  94. "crew"
  95. "custom"
  96. "daily"
  97. "damage"
  98. "date"
  99. "deadline"
  100. "death"
  101. "decline"
  102. "defer"
  103. "delay"
  104. "density"
  105. "departure"
  106. "depleted"
  107. "description"
  108. "despawn"
  109. "destination"
  110. "destruct"
  111. "dialog"
  112. "die"
  113. "disable"
  114. "disabled"
  115. "discharge"
  116. "display"
  117. "disruption"
  118. "dissipation"
  119. "distance"
  120. "drag"
  121. "drive"
  122. "dropoff"
  123. "duration"
  124. "efficiency"
  125. "energy"
  126. "enforces"
  127. "engine"
  128. "enter"
  129. "environmental"
  130. "equivalent"
  131. "evade"
  132. "event"
  133. "explode"
  134. "facing"
  135. "fail"
  136. "fence"
  137. "fighters"
  138. "final"
  139. "fine"
  140. "fire"
  141. "firing"
  142. "flare"
  143. "flotsam"
  144. "force"
  145. "foreign"
  146. "frame"
  147. "frequency"
  148. "friendly"
  149. "fuel"
  150. "generation"
  151. "give"
  152. "goto"
  153. "government"
  154. "gravitational"
  155. "gun"
  156. "habitable"
  157. "hail"
  158. "hardpoint"
  159. "hazard"
  160. "haze"
  161. "heat"
  162. "hidden"
  163. "history"
  164. "hit"
  165. "homing"
  166. "hostile"
  167. "hull"
  168. "hyperdrive"
  169. "icon"
  170. "illegal"
  171. "illegals"
  172. "inaccuracy"
  173. "income"
  174. "inefficiency"
  175. "inertia"
  176. "infiltrating"
  177. "infrared"
  178. "inscrutable"
  179. "installable"
  180. "interest"
  181. "interference"
  182. "invisible"
  183. "ion"
  184. "jamming"
  185. "job"
  186. "jump"
  187. "kill"
  188. "label"
  189. "landing"
  190. "landscape"
  191. "language"
  192. "launch"
  193. "leak"
  194. "leakage"
  195. "left"
  196. "licenses"
  197. "lifetime"
  198. "link"
  199. "live"
  200. "location"
  201. "log"
  202. "maintenance"
  203. "map"
  204. "mappable"
  205. "mass"
  206. "message"
  207. "minable"
  208. "minables"
  209. "minor"
  210. "missile"
  211. "modifier"
  212. "mortgage"
  213. "mounts"
  214. "multiplier"
  215. "music"
  216. "name"
  217. "names"
  218. "near"
  219. "neighbor"
  220. "never"
  221. "noun"
  222. "npc"
  223. "object"
  224. "offer"
  225. "offset"
  226. "operating"
  227. "optical"
  228. "outfit"
  229. "outfits"
  230. "outfitter"
  231. "over"
  232. "overheat"
  233. "override"
  234. "parallel"
  235. "passengers"
  236. "payment"
  237. "penalties"
  238. "penalty"
  239. "percentage"
  240. "period"
  241. "personality"
  242. "phasing"
  243. "piercing"
  244. "planet"
  245. "player"
  246. "plural"
  247. "portrait"
  248. "ports"
  249. "pos"
  250. "power"
  251. "principal"
  252. "priority"
  253. "protection"
  254. "provoke"
  255. "provoked"
  256. "radar"
  257. "radius"
  258. "raid"
  259. "ramscoop"
  260. "random"
  261. "range"
  262. "rate"
  263. "relative"
  264. "reload"
  265. "remove"
  266. "repair"
  267. "repeat"
  268. "replace"
  269. "reputation"
  270. "require"
  271. "required"
  272. "resistance"
  273. "reveal"
  274. "reverse"
  275. "rewind"
  276. "right"
  277. "safe"
  278. "salaries"
  279. "save"
  280. "scale"
  281. "scaling"
  282. "scan"
  283. "scene"
  284. "score"
  285. "scram"
  286. "scramble"
  287. "security"
  288. "self"
  289. "sentence"
  290. "set"
  291. "shield"
  292. "shields"
  293. "ships"
  294. "shipyard"
  295. "show"
  296. "slowing"
  297. "solar"
  298. "sound"
  299. "source"
  300. "space"
  301. "spaceport"
  302. "spawn"
  303. "speed"
  304. "spin"
  305. "split"
  306. "sprite"
  307. "star"
  308. "starfield"
  309. "stealth"
  310. "steering"
  311. "stopover"
  312. "stream"
  313. "strength"
  314. "submunition"
  315. "substitutions"
  316. "swizzle"
  317. "system"
  318. "system-wide"
  319. "tactical"
  320. "target"
  321. "term"
  322. "threshold"
  323. "thrust"
  324. "thrusting"
  325. "thumbnail"
  326. "time"
  327. "toward"
  328. "tracking"
  329. "tribute"
  330. "trigger"
  331. "turn"
  332. "turning"
  333. "turret"
  334. "uncapturable"
  335. "under"
  336. "universal"
  337. "unlink"
  338. "unplunderable"
  339. "unvisit"
  340. "variant"
  341. "velocity"
  342. "visit"
  343. "waypoint"
  344. "weapon"
  345. "wind"
  346. "word"
  347. "wormhole"
  348. "zoom"
  349. ))
  350. (defvar endless-sky-keywords
  351. '(
  352. "no"
  353. "on"
  354. "to"
  355. "in"
  356. "out"
  357. "not"
  358. "has"
  359. "for"
  360. "if"
  361. "and"
  362. "or"
  363. "never"
  364. ))
  365. (defvar endless-sky-font-lock-defaults
  366. `((
  367. ;; stuff between double quotes and backticks
  368. ;; ("\"\\.\\*\\?" . font-lock-string-face)
  369. ("\`\\.\\*\\?\`" . font-lock-string-face)
  370. ;; ; : , ; { } => @ $ = are all special elements
  371. (":\\|,\\|;\\|{\\|}\\|=>\\|@\\|$\\|=" . font-lock-keyword-face)
  372. ( ,(regexp-opt endless-sky-keywords 'words) . font-lock-keyword-face)
  373. ( ,(regexp-opt endless-sky-builtins 'words) . font-lock-builtin-face)
  374. ( ,(regexp-opt endless-sky-constants 'words) . font-lock-constant-face)
  375. )))
  376. (define-derived-mode endless-sky-mode fundamental-mode "Endless Sky data"
  377. "A major mode for editing Endless Sky data files"
  378. (setq font-lock-defaults endless-sky-font-lock-defaults)
  379. (setq comment-start "#")
  380. (setq comment-end "")
  381. (modify-syntax-entry ?# "< b" endless-sky-mode-syntax-table)
  382. (modify-syntax-entry ?\n "> b" endless-sky-mode-syntax-table)
  383. (define-key endless-sky-mode-map (kbd "TAB") 'self-insert-command))
  384. (provide 'endless-sky-mode)