summaryrefslogtreecommitdiff
path: root/mc/syntax/turtle.syntax
blob: 8e08933ba1abcfae3ad85afc9cb3bad842ecf232 (plain)
  1. #
  2. # Turtle syntax highlighting
  3. # for MC Editor/CoolEdit
  4. #
  5. # Copyright 2020, Jonas Smedegaard <dr@jones.dk>
  6. #
  7. # This program is free software:
  8. # you can redistribute it and/or modify it
  9. # under the terms of the GNU General Public License
  10. # as published by the Free Software Foundation,
  11. # either version 3 of the License,
  12. # or (at your option) any later version.
  13. #
  14. # 2020-04-12 Jonas Smedegaard <dr@jones.dk>
  15. # * Initial public release.
  16. #
  17. # Reference:
  18. # https://www.w3.org/TeamSubmission/turtle/
  19. context default lightgray
  20. spellcheck
  21. # declarations
  22. keyword whole @base magenta
  23. keyword whole @prefix magenta
  24. keyword whole a yellow
  25. keyword ^^ brightmagenta
  26. # Collection
  27. keyword ( brightmagenta
  28. keyword ) brightmagenta
  29. # Shorthand prefix
  30. keyword wholeleft \{abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\}\[\abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-\]: cyan
  31. keyword wholeleft : cyan
  32. # Anonymous node
  33. keyword wholeleft _: cyan
  34. keyword [ cyan
  35. keyword ] cyan
  36. # Decimal integers
  37. keyword whole \{0123456789\}\[0123456789\] yellow
  38. keyword whole \{-+\}\{0123456789\}\[0123456789\] yellow
  39. # Decimal floating point arbitrary precision number
  40. keyword whole \{0123456789\}.\[0123456789\] yellow
  41. keyword whole .\{0123456789\}\[0123456789\] yellow
  42. keyword whole \{-+\}\{0123456789\}.\[0123456789\] yellow
  43. keyword whole \{-+\}.\{0123456789\}\[0123456789\] yellow
  44. # Decimal floating point double/fixed precision number
  45. keyword whole \{0123456789\}.\[0123456789\]\{eE\}\{0123456789\}\[0123456789\] yellow
  46. keyword whole \{0123456789\}.\[0123456789\]\{-+\}\{eE\}\{0123456789\}\[0123456789\] yellow
  47. keyword whole .\{0123456789\}\[0123456789\]\{eE\}\{0123456789\}\[0123456789\] yellow
  48. keyword whole .\{0123456789\}\[0123456789\]\{-+\}\{eE\}\{0123456789\}\[0123456789\] yellow
  49. keyword whole \{-+\}\{0123456789\}.\[0123456789\]\{eE\}\{0123456789\}\[0123456789\] yellow
  50. keyword whole \{-+\}\{0123456789\}.\[0123456789\]\{-+\}\{eE\}\{0123456789\}\[0123456789\] yellow
  51. keyword whole \{-+\}.\{0123456789\}\[0123456789\]\{eE\}\{0123456789\}\[0123456789\] yellow
  52. keyword whole \{-+\}.\{0123456789\}\[0123456789\]\{-+\}\{eE\}\{0123456789\}\[0123456789\] yellow
  53. # Boolean
  54. keyword whole true yellow
  55. keyword whole false yellow
  56. # Language
  57. keyword wholeright @\{abcdefghijklmnopqrstuvwxyz\}\[abcdefghijklmnopqrstuvwxyz0123456789-\]\[abcdefghijklmnopqrstuvwxyz0123456789\] brightmagenta
  58. keyword wholeright @\{abcdefghijklmnopqrstuvwxyz\}\[abcdefghijklmnopqrstuvwxyz0123456789\] brightmagenta
  59. # Punctuation
  60. keyword , white
  61. keyword ; white
  62. # keyword . black white
  63. keyword . white brightmagenta
  64. # URL
  65. # keyword whole <*> brightred
  66. context < > brightred
  67. # TODO: enable when context ending at newline doesn't ruin next context
  68. # syntax violation
  69. # keyword +\n black red
  70. # String escape
  71. keyword \\u\{0123456789abcdef\}\{0123456789abcdef\}\{0123456789abcdef\}\{0123456789abcdef\} brightgreen
  72. keyword \\U\{0123456789abcdef\}\{0123456789abcdef\}\{0123456789abcdef\}\{0123456789abcdef\}\{0123456789abcdef\}\{0123456789abcdef\}\{0123456789abcdef\}\{0123456789abcdef\} brightgreen
  73. keyword \\\{tnr>\\} brightgreen
  74. # Single-line literals
  75. context exclusive " " green
  76. spellcheck
  77. # TODO: enable when context ending at newline doesn't ruin next context
  78. # syntax violation
  79. # keyword +\n black red
  80. # String escape
  81. keyword \\u\{0123456789abcdef\}\{0123456789abcdef\}\{0123456789abcdef\}\{0123456789abcdef\} brightgreen
  82. keyword \\U\{0123456789abcdef\}\{0123456789abcdef\}\{0123456789abcdef\}\{0123456789abcdef\}\{0123456789abcdef\}\{0123456789abcdef\}\{0123456789abcdef\}\{0123456789abcdef\} brightgreen
  83. keyword \\\{tnr"\\} brightgreen
  84. # Multi-line literals
  85. context """ """ green
  86. spellcheck
  87. # String escape
  88. keyword \\u\{0123456789abcdef\}\{0123456789abcdef\}\{0123456789abcdef\}\{0123456789abcdef\} brightgreen
  89. keyword \\U\{0123456789abcdef\}\{0123456789abcdef\}\{0123456789abcdef\}\{0123456789abcdef\}\{0123456789abcdef\}\{0123456789abcdef\}\{0123456789abcdef\}\{0123456789abcdef\} brightgreen
  90. keyword \\\{tnr"\\} brightgreen
  91. # Comment
  92. context linestart # \n brown
  93. spellcheck
  94. # Ideally we would have defined comments with "context linestart \[\s\]# ...",
  95. # but contexts can't start with a character class. So we define comments twice.
  96. context linestart \s\[\s\]# \n brown
  97. spellcheck