euphoria3.vim 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. " Vim syntax file
  2. " Language: Euphoria 3.1.1 - supports DOS - (http://www.rapideuphoria.com/)
  3. " Maintainer: Shian Lee
  4. " Last Change: 2014 Feb 24 (for Vim 7.4)
  5. " Remark: Euphoria has two syntax files, euphoria3.vim and euphoria4.vim;
  6. " For details see :help ft-euphoria-syntax
  7. " quit when a syntax file was already loaded
  8. if exists("b:current_syntax")
  9. finish
  10. endif
  11. " Reset compatible-options to Vim default value, just in case:
  12. let s:save_cpo = &cpo
  13. set cpo&vim
  14. " Should suffice for very long expressions:
  15. syn sync lines=40
  16. " Euphoria is a case-sensitive language (with only 4 builtin types):
  17. syntax case match
  18. " Keywords/Builtins for Debug - from $EUDIR/bin/keywords.e:
  19. syn keyword euphoria3Debug with without trace profile
  20. syn keyword euphoria3Debug profile_time warning type_check
  21. " Keywords (Statments) - from $EUDIR/bin/keywords.e:
  22. syn keyword euphoria3Keyword if end then procedure else for return
  23. syn keyword euphoria3Keyword do elsif while type constant to and or
  24. syn keyword euphoria3Keyword exit function global by not include
  25. syn keyword euphoria3Keyword xor
  26. " Builtins (Identifiers) - from $EUDIR/bin/keywords.e:
  27. syn keyword euphoria3Builtin length puts integer sequence position object
  28. syn keyword euphoria3Builtin append prepend print printf
  29. syn keyword euphoria3Builtin clear_screen floor getc gets get_key
  30. syn keyword euphoria3Builtin rand repeat atom compare find match
  31. syn keyword euphoria3Builtin time command_line open close getenv
  32. syn keyword euphoria3Builtin sqrt sin cos tan log system date remainder
  33. syn keyword euphoria3Builtin power machine_func machine_proc abort peek poke
  34. syn keyword euphoria3Builtin call sprintf arctan and_bits or_bits xor_bits
  35. syn keyword euphoria3Builtin not_bits pixel get_pixel mem_copy mem_set
  36. syn keyword euphoria3Builtin c_proc c_func routine_id call_proc call_func
  37. syn keyword euphoria3Builtin poke4 peek4s peek4u equal system_exec
  38. syn keyword euphoria3Builtin platform task_create task_schedule task_yield
  39. syn keyword euphoria3Builtin task_self task_suspend task_list
  40. syn keyword euphoria3Builtin task_status task_clock_stop task_clock_start
  41. syn keyword euphoria3Builtin find_from match_from
  42. " Builtins (Identifiers) shortcuts for length() and print():
  43. syn match euphoria3Builtin "\$"
  44. syn match euphoria3Builtin "?"
  45. " Library Identifiers (Function) - from $EUDIR/doc/library.doc:
  46. syn keyword euphoria3Library reverse sort custom_sort lower upper
  47. syn keyword euphoria3Library wildcard_match wildcard_file arcsin
  48. syn keyword euphoria3Library arccos PI flush lock_file unlock_file
  49. syn keyword euphoria3Library pretty_print sprint get_bytes prompt_string
  50. syn keyword euphoria3Library wait_key get prompt_number value seek where
  51. syn keyword euphoria3Library current_dir chdir dir walk_dir allow_break
  52. syn keyword euphoria3Library check_break get_mouse mouse_events mouse_pointer
  53. syn keyword euphoria3Library tick_rate sleep get_position graphics_mode
  54. syn keyword euphoria3Library video_config scroll wrap text_color bk_color
  55. syn keyword euphoria3Library palette all_palette get_all_palette read_bitmap
  56. syn keyword euphoria3Library save_bitmap get_active_page set_active_page
  57. syn keyword euphoria3Library get_display_page set_display_page sound
  58. syn keyword euphoria3Library cursor text_rows get_screen_char put_screen_char
  59. syn keyword euphoria3Library save_text_image display_text_image draw_line
  60. syn keyword euphoria3Library polygon ellipse save_screen save_image display_image
  61. syn keyword euphoria3Library dos_interrupt allocate free allocate_low free_low
  62. syn keyword euphoria3Library allocate_string register_block unregister_block
  63. syn keyword euphoria3Library get_vector set_vector lock_memory int_to_bytes
  64. syn keyword euphoria3Library bytes_to_int int_to_bits bits_to_int atom_to_float64
  65. syn keyword euphoria3Library atom_to_float32 float64_to_atom float32_to_atom
  66. syn keyword euphoria3Library set_rand use_vesa crash_file crash_message
  67. syn keyword euphoria3Library crash_routine open_dll define_c_proc define_c_func
  68. syn keyword euphoria3Library define_c_var call_back message_box free_console
  69. syn keyword euphoria3Library instance
  70. " Library Identifiers (Function) - from $EUDIR/doc/database.doc:
  71. syn keyword euphoria3Library db_create db_open db_select db_close db_create_table
  72. syn keyword euphoria3Library db_select_table db_rename_table db_delete_table
  73. syn keyword euphoria3Library db_table_list db_table_size db_find_key db_record_key
  74. syn keyword euphoria3Library db_record_data db_insert db_delete_record
  75. syn keyword euphoria3Library db_replace_data db_compress db_dump db_fatal_id
  76. " Linux shell comment (#!...):
  77. syn match euphoria3Comment "\%^#!.*$"
  78. " Comment on one line:
  79. syn region euphoria3Comment start=/--/ end=/$/
  80. " Delimiters and brackets:
  81. syn match euphoria3Delimit "[([\])]"
  82. syn match euphoria3Delimit "\.\."
  83. syn match euphoria3Operator "[{}]"
  84. " Character constant:
  85. syn region euphoria3Char start=/'/ skip=/\\'\|\\\\/ end=/'/ oneline
  86. " String constant:
  87. syn region euphoria3String start=/"/ skip=/\\"\|\\\\/ end=/"/ oneline
  88. " Hexadecimal integer:
  89. syn match euphoria3Number "#[0-9A-F]\+\>"
  90. " Integer/Floating point without a dot:
  91. syn match euphoria3Number "\<\d\+\>"
  92. " Floating point with dot:
  93. syn match euphoria3Number "\<\d\+\.\d*\>"
  94. " Floating point starting with a dot:
  95. syn match euphoria3Number "\.\d\+\>"
  96. " Boolean constants:
  97. syn keyword euphoria3Boolean true TRUE false FALSE
  98. " Define the default highlighting.
  99. " Only used when an item doesn't have highlighting yet:
  100. hi def link euphoria3Comment Comment
  101. hi def link euphoria3String String
  102. hi def link euphoria3Char Character
  103. hi def link euphoria3Number Number
  104. hi def link euphoria3Boolean Boolean
  105. hi def link euphoria3Builtin Identifier
  106. hi def link euphoria3Library Function
  107. hi def link euphoria3Keyword Statement
  108. hi def link euphoria3Operator Statement
  109. hi def link euphoria3Debug Debug
  110. hi def link euphoria3Delimit Delimiter
  111. let b:current_syntax = "euphoria3"
  112. " Restore current compatible-options:
  113. let &cpo = s:save_cpo
  114. unlet s:save_cpo